I got stuck trying to make the asteroid field have density waves that would correspond to rings like what Saturn has. Spent 8 hours noobing around last weekend trying to figure out an algorithm. I managed to make a wave, but only while going in one direction. Basically the box that puts down the asteroids outside the screen would check for the Y coordinate and oscillate the density of asteroids between 2 values as Y increased. So as the ship was going up it would travel through denser and less dense regions.
I was stuck because I wanted to generate a whole ring system based on some equations. I hoped I would be able to figure something out eventually. Luckily I realized today that I only need a map with regions that would correspond to the rings and even interesting artifacts caused by gravitational interactions between moonlets and the particles of the ring. Then just need my "asteroid generator" to pop stuff into the game based on where it is on that map. So it could vary the density of asteroids based on location and create the illusion of traveling through a detailed ring system. :)
I do want to have gravity and basic orbital mechanics but I will have to cheat because no computer today would be able to handle a ring system actually made of billions of objects and realistically interacting with the planet they orbit.
The plan is to have a planet and gravity, and have the player in orbit. Then have the ring marked out as regions, and as the player orbits it generates and destroys the asteroids based on what region it is in. The asteroids are spawned with correct orbital velocity so when they enter the simulation and while they are in, they interact with the planet and it's gravity properly. Once they are offscreen they are popped out. I will use pooling so I won't have to constantly create and destroy objects, and I bought an asset that seems to be a way better gravity implementation than what I cooked up. Faster, and seems to be able to handle a lot more objects.
I want to make the ring system BIG. The dream is to have the same scale as Saturn's actual rings which would mean that with the relative velocities achievable within the game it would probably take months to traverse it to either get to the planet, or to get to the edge and try reach some larger moons. Being a 2D game it is a bit hard to avoid the rocks. :)
still need to tweak the engine and the health of other objects and I want to make the asteroids breakable. I will continue to work on the "environment" a bit longer. Now that I have figured out a way to make it less boring and more structured I am quite excited. :) I might even add a moonlet with weak gravity so we can have some landing action happening. :) I love lander type games. :)
Plans change. Instead of maps, I am going with creating a class for ringlets that store various characteristics of ringlets like width or asteroid density or distance from planet etc. Then I just put the ringlets I generate in a list. This means from the starting position as the player moves towards the planet or it moves outwards it can generate new ringlets and save them and if it backtracks it will just use the ringlets already generated to change how the asteroid placer puts down the asteroids.ReplyDelete
I am working on a new "asteroid placer". The current one is just a box placed ahead of the ship based on the ship's velocity. It is manually set to be outside the screen. The new script will have asteroid placer boxes all around the screen offset by some distance, and then have a "asteroid remover" boxes outside the placer ones. Then will have a pool set up, and hopefully the frame rate will increase so I can do other expensive calculations like adding gravity etc...
Probably this will change again as I hit some roadblocks.
And now with the ringlet class and some constructors that use random input I think I could do a whole ring system generated in runtime as the player moves around and also save the position and characteristics of the ringlets by just using seeds for the random number generators.
Long weekend coming up. I will try and get out of social stuff and work on this, it feels like I am actually getting somewhere.
Single-stage reusable launch vehicle to unitary fuel 1
BetVictor Casino Site | Lucky ClubReplyDelete
BetVictor casino luckyclub site is operated by Microgaming and has 1,000 slots games, 1,000 table games, and a lot more at their own app, all powered by Microgaming.