This is a big one – technically it came in multiple parts over the last few weeks and I forgot to write an update about it. Here are the major changes:

  1. There’s an actual galaxy now
  2. UI update
  3. Backend stuff

A living galaxy

Project 4 now has a procedural generated galaxy with a decent bit of depth for the generation code being written in a day. Systems spawn with random size and composition, then are populated by different space stations, the makeup of which is influenced by different factions and economies (though these don’t affect anything else at the moment). Planets have orbits simulated around their star.

Systems can be traversed using jump gates. Every system can jump to any other system within 50 light years. It can be kind of confusing to navigate this way since there is no galaxy map yet, and I haven’t done extensive testing to make sure that systems cannot get orphaned so to say.

Certain systems are guaranteed to spawn, for instance Sol will always spawn with the planet’s you’d expect. However, it’s economy and station are still procedural. I’ve also included two other special systems. Io may or may not become a story location down the line, but for now it’s not that interesting. I’ve also included Barnard’s star, with a little reference to Starset :).

UI Improvements

The focus panel has been completely re-designed. It now has much better scrolling, and has multiple tabs. In the future, this is where you will access your inventory from, and probably station services too.

The whole UI’s colour scheme has been re-done to be more consistent. You can even create custom themes. I’m not totally happy with the new colours, but at least they’re easy to change now.

The layout has been changed too. The system information panel has moved to the bottom left. The action bar remains in the top left for now. The point defense button is now greyed out until you install a PDC.

The log has moved to the top right. It can now handle multiple colours as well and is animated! Though the animations are rather poor in quality. The log is also much more dynamic now, cause it’s now hooked directly into the message bus (see below), and will update you frequently. The master caution that was previously the WARN indicator in the action bar has been merged into the log.

Boring code stuff

The entire data model for saves has been re-done. Saving and loading is somewhat more reliable now. I would have had to re-work it anyway at some point, so the systems thing coming together is pretty cool cause it gave me a reason to re-design it.

Internally, Bonetree uses a message bus pattern to allow different ‘thinkers’ as I call them to talk to each other without needing each other’s identities. I got the idea from this article a while ago and adapted it to my needs, and using C# features. Now, there’s lots of data just sitting in the message bus at any given time, so I decided to make the log a message bus node and just see how much information it can pass on that’s relevant to the player. While the log is a LOT more dynamic now as a result there is still a high quantity of messages being hidden from you.

Code quality seems to have improved as well. A couple of weeks ago I texted my friend this:

But thankfully, I’m now down to 258 warnings in 69 files. I’m still hesitant to heavily incorporate AI into my workflow as many people have been telling me to do both online and off recently. I could probably get the game done faster, but the only reason I started this was as a learning project, and I feel like that’s more important.