It was a bit of a slow week for game development for me with having to get some papers polished up for my physics day job, but this weekend Jeff and I have been working on the space game (now tentatively titled ‘One With Everything’). Mostly the focus has been, how do we do ‘stage transitions’ between scales that are smooth?
The game is supposed to cover about 15 orders of magnitude in scale when all is said and done. Thats enough that floating point problems could raise their ugly head. We could just cut things off every 3-4 orders of magnitude and make a new stage, but that feels artificial and abrupt. So instead the idea is to ‘curate’ position and scale every so often, re-centering the game on the player and rescaling everything to keep it in a numerically stable zone. That should take care of things up until about the planetary scale.
The problem at the planetary scale is, we want to have the player start zoomed in among a debris field and then eventually get big enough that they can start noticing their ‘orbit’. Once the player is big enough, they can either reach escape velocity (in which case the game zooms out, everything vanishes, and then it zooms in placing them in orbit around a different randomly generated object appropriate to their size) or absorb the thing they’re orbitting around, in which case they start to orbit around a new object one ‘tier’ higher (absorb a moon, you’re now orbiting a planet; absorb a planet, you’re now orbiting the sun, etc).
That means spawning an object that might be 100-10000 times bigger than the player in order to have it there (so if you go inwards in the orbit far enough you encounter it and get gobbled up). For example, in the current demo when the player is 10 meters in size, we place a planetoid 3km away that is itself maybe 1km in radius. However there’s a noticeable amount of glitching when you’re close to the planetoid – objects tend to graphically jump around on the sub-meter scale during their orbits, like they’re suffering noticeable round-off errors. The actual velocities involved aren’t that large and the orbits appear stable, so I don’t think its the numerical integrator, and it looks like the objects actually do change position when they ‘jump’, so its not just lag bursts from generating new chunks. At this point I’m not really sure what it is.
The game is playable with it though, so I’m going to give it a rest and move on to another element of the game – the progression system. The way One With Everything is set up is that you have a certain amount of time to absorb things and grow before everything disintegrates around you. This time is going to be fairly easy to maintain at the early levels, but it will get very rough at later levels. However, as you do crazy things like bounce off of objects at half the speed of light, do tight gravity assists around heavy objects, etc, you unlock achievements. These aren’t just for show – they’re the ‘currency’ for the game’s upgrade shop. Every (couple) achievements, you can buy an upgrade to your speed, maneuverability, ability to break objects, etc. You can then choose to leave these upgrades on and get their benefits, or turn them off to get a bonus to your score multiplier.
The idea is that as you play the game, yes you have to repeat the early stages, but at the same time there will still be new things you can earn during those early stages so you aren’t just retreading old ground. Hopefully that will make for a fresh and interesting take on this kind of repeated-play/progression game.