This was so much fun! Getting a very quick :bulb: moment for the theme helped me get going. I came up with Space LTD, a generic space services company simulator, which is the theme reversed sort of. Here's the timelapse, with lots of notes below: https://youtu.be/Sky141NOvDk
On the lapse, you'll notice sometimes the left screen goes black. This is when I have that monitor switched over to the xbox. You'll also notice alot of flashbangs from old visual studio. This was kind of unavoidable as I had to use a windows xp virtual machine to code for the original xbox.
So going into this I knew there would be a few timing challenges so I opted for the 3 week mode. There was the overwatch league grand finals, motoGP and an emulated everquest server I had been looking forward to for a long time launched the same weekend.
Stuff I didn't anticipate was a big family gathering 300 miles away, and a death in the family + funeral and such. Then the weather had a bit of a cold snap and I had to abandon my office (and my xbox) for a few days. If you've played Rimworld you know what I mean :)
Codewise I started mostly with nothing, but referred back to my github stuff in both C and C# format. I have some basic collada tools, bsp map compile stuff, a shader library and such. None of which were compiled for xbox. So I spent quite a lot of time just getting text drawing on the screen.
Some of the code challenges I ran into were my usual yaw/pitch/roll camera not working at all in space. Fixing that was just changing any pitch/yaw/roll change to be relative to current orientation. There is no "up" or "forward" just where-am-I-now? Quaternions are great for this, but the old xbox math libs were missing alot of quaternion stuff so I had to go hunting for a few functions to steal.
Physics were the next big one. I was going to just fake some simple velocity and thrust and such but the numbers would quickly go haywire and it was hard to show onscreen data like G forces. I ended up porting over an implementation I had done in C# of Gaffer on games's great physics articles: https://gafferongames.com/post/integration_basics/
That got me thinking (and googling) about power requirements and heat and fuel and so on. We are a long way off from decent space travel, and it mostly comes down to getting rid of heat. I had to assume superconductors had been invented to even get close at decent amounts of thrust.
Then there was the extreme scales of space. A shuttle being a few dozen meters and gas giants being 50 thousand kilometers across. I ended up going with "sectors" that were 64 thousand floating point units across + and -, and then INT_MAX of those, so around 2000 astronomical units of space for a star system. Not enough for the furthest out bits of the Oort cloud but plenty for a game.
I ended up using a megameter scale for huge stuff like planets and major asteroids like ceres. These draw first as I couldn't image anything big enough to draw "behind" them. Then I change projection matrix, clear the depth buffer, and draw the close stuff. This worked pretty well.
I did one realtime journey, but I cheated and gave myself an enormously powerful engine that would accelerate at 30 thousand G. Even with that it took a few hours to do a 7 AU journey. Space is big!
Here's the Git: https://github.com/Kharzette/GrogTestXBOX
There's not much art assets really. Just a font and a couple dozen AI generated gas giant cubemaps. Oh and a terrible shuttle I made in blender in 5 minutes.