Orbitum Scaterum by TolMera

[raw]
made by TolMera for LD 42 (UNFINISH)

The who/what/why

For LD42 I built, an orbital simulator to highlight the danger of a (https://en.wikipedia.org/wiki/Kessler_syndrome)[Kessler Cascade] in a fun and game-ish way.

Unfortunately my choice of technology means that I have nothing but screenshots to show for my efforts! (sad face)

So for posterity sake, I wanted to record my journey through LD42 and the choices that led to the "unfinished" outcome.

First off, I'm going to say thank you to people who contribute to Wikipedia! I use it all the time and it's an invaluable source of information for 'real world' games.

So my idea was as follows: The Theme "Running out of Space" gave me a really hard time, and for the first time during a LD I didn't have a game idea at the 4 hour mark (my schedule). Instead I found myself going to bed after six hours and several vague game ideas, with the hope that something would click while I slept and hopefully dreamed up some gameplay.

After waking up from my nights sleep (sleep is important even when doing LD) I still didn't have a good game idea, I specifically wanted a game that could be played on a smartphone. So things like "Tower defence where mobs steal area from you" just didn't satisfy my desire for a mobile game. After chatting about some ideas I settled down to continue thinking. I twisted and thought about the theme "running" "space" "out of", maybe a game where you had to "run" to stop yourself getting sucked out into space (infinite runner?), I could have made any of these, but they also didn't feel rewarding to me, I wanted to do something harder. Something that had less art (I didn't have the right setup to be doing art). Finally I settled on the idea of 'A game where you have to clean up space, or "we" risk running out of space in space for new space things' I already knew about the Kessler cascade, and thought I could use that to make my game.

The gameplay was going to be the following:

You're a space-ship trying to get to high orbit around the earth (above all the space junk). That's just an artificial goal for the player, the real fun of the game would come from persistence and getting splattered by existing space junk!

I planned to have a persistent world on one of my servers, you would connect, be given a spaceship in orbit (circular) somewhere in LEO (Low Earth Orbit), and be told to clime to GEO (Geostationary Orbit). You would also be told to avoid the space junk.

The UI would give you a little dot on the edge of your screen when your ship detected an incoming piece of space junk, the colour would change depending on if it was getting closer or moving away and the brightness would change depending on how fast if was moving relative to you. The dot would also flash if it was on a collision course with you. So you would hopefully be able to avoid the space junk. I planned to implement something for the hard core gamer who can think in 2D orbital mechanics, that if you matched the speed of the incoming junk, you could 'pick up' the junk, allowing you to build additional parts onto your ship, so you could be bigger, turn faster, accelerate quicker et al.

Keep in mind that all the space junk would be 'real' and be tracked and moved around by the server, so if you collected some space junk, it would be removed from the server and added to your ship.

If however you were unlucky and got yourself hit by a piece of high speed debris, then it would knock a chunk off or destroy your ship. meaning that not only was the original piece of space junk now on a different orbit, there was also more space junk now floating around the universe. (Potentially a fair bit more space junk if you got yourself smacked hard enough)

Because of the persistent nature of the game, as more players attempted to reach GEO, there was bound to be more failures to reach GEO, and more people in GEO orbit. Getting hit by someone else's ship would have much the same effect as getting hit by some space junk (So PVP was a possible game mechanic).

* Implementation *

So this might sound like a lot to implement, but really it's not that much. I needed a main game server - pretty easy, just use a Digital Ocean (or Amazon) machine, with a simple Node server running on it.

First: Load all the space debris as an array [{mass: M, position:[x,y,z], speed:[x,y,z]},...] Run through the list as often as possible. moving the junk with gravity. This would make everything orbit really nicely.

Next: When someone connected, and every X seconds send them an update of all "junk" within "Radius", and let their phone do the math to see what happened (This is not a good thing to do with games, we generally don't trust the user to perform calculations and tell the server what happened, that's just a bad idea!!! but hey, this is a LD game, and I didn't want to need an expensive server and high quality internet connection in order to do ALL the math on the server.) If the player 'collected' some junk, or was hit by some junk, I use the outcome on the server to either add more junk (using real physics) or remove the piece of junk from the server, have the client add the junks velocity et al to their own (Conservation of momentum).

Client side

On the client side, I needed some basic UI elements, I made some nice Cubes in Onshape.com which I used as the ships body, I got an image of a protractor and modified it (because in the compo you make all your own elements) so that it was 'my own', and used it to give you some user feedback about your position in orbit around the planet. I needed some stars (white dots) that could move around to add to your feeling or 'orbit'. And I needed some space junk (blotches). Overall the art was pretty darn simple.

Code wise, I needed to know your position (x,y,z), velocity (x,y,z), Mass. Which was all pretty simple. I had to get your phone to calculate your orbital properties, this was a little harder, but half a day of learning, and I had a good grasp on orbital mechanics, enough to write an "orbital math" module in JS and attach it to my code.

And I needed a little code to let the user rotate their ship, add thrust as needed, this was also pretty simple.

So hopefully you all have some idea of just how straight forward the game actually was! Yea there's a bunch of code, and some hard math, but really it was not too much to do within the time span of a Game Jam.

So I had a bunch of this done, and was pretty proud of the results so far. I have an IPhone and it was working great on there. I had coded all of it up so far in React Native, being that I wanted a react native game under my belt, and I wanted a game on LD that was made for mobile play (an under-served market here on LD (if comments are to be believed))

So this is where I hit a really annoying issue! I didn't have an android phone! Fortunately my Dad (who lives on the other side of the world) has an Android phone, it was pretty late in the evening their side, but my Dad helped me out a bunch by downloading Expo, and running the game on his phone. "CRASH"....

Yep. Game Crashed, ok that's no big deal, it happens, what's the error message? "something went wrong".... <<< Ok I think it was a little better than "Something went wrong" but it was about as useful as that. Well I managed to track the issue down to image loading. React native has 3 ways of including an image, First, you "require" and image, and everything happens by magic. But that was not working. So I fell to the backup "data:image/png:base64....." which embeds the image directly in the code (I got to say, this loads FAST!!!) but that also crashed the game!?! the last method (bearing in mind that both of the previous methods were working 100% on my IPhone!) you source the image from the internet using a source URI. Well magically.. this "CRASHED"!!! Ahhh!!! All three methods failed? how can this be? You mean my game can't be played on Android because some darn bug is stopping images from loading? ok... not sure what to do but at least Apple people will be able to play, and I might be able to fix the Android code right? Right? (sad face 2)

OH NO! Character limi

Ratings

Given 0🗳️ 0🗨️