Something I've always stated emphatically from day one is that if a feature or system ever causes performance or stability issues, then I will work on nothing but that problem until it's resolved. To that end, this latest Dev Diary has been delayed a week because the ship's real-time electrical system was starting to cause performance issues on older generation CPUs.
After taking a good look at what was happening, it was clear that the system I'd originally built just wasn't sophisticated enough, so I went back to the drawing board and re-wrote the entire thing from scratch. Rather than relying on what was largely just a brute-force approach, the new system is far more self-aware and focuses on using as few system resources as possible. In fact, during normal operation the new electrical system has practically zero CPU load, so with all things considered the past couple of weeks of hard graft were well worth it!
One of the many lessons I've learned during the past 5 or so years in game development, is to not be all precious about any code I've written. Rarely is anything perfect on the first attempt, and sometimes you just have to recognise that it sucks and needs doing better. I'm actually a big fan of the SpaceX "failing upwards" approach, where you just keep blowing things up until it's perfect!
These past couple of weeks haven't all been about rebuilding systems though, I've also been making some practical additions too. Firstly, the Reactor now has a Main Distribution Bus that will serve as the primary connection point for every electrical system on the ship. This will also host the loopback connection for the Reactor, feeding electrical energy back into the Reactor to maintain the fusion reaction.
Secondly, I've also added some status lighting to two of the distributor box types, which will flash either red or yellow to alert the crew that an interface has an error or warning condition. This helps see at a glance that something isn't working as intended, and I'll add the same functionality to the other boxes as I get around to updating them.
So what's the plan for next week? Well, I still have a few loose bits of electrical code to tidy up, but I'd actually like to get some more modelling done. Hopefully, I'll be able to start fleshing out more of the reactor hardware, as well as the fuel and coolant tanks. I really want to get this part of the ship finished off now so I can get back to the Bridge
0 comments