Here’s the (sort of) weekly devlog regarding Unending Galaxy. On the menu: warpgates, war, performances and bug-fixes.
Enjoy !
I took the weekend to implement the warpgate system I explained in a previous design post. Factions can build those gates in what I call “core sectors”. It’s where they can also build shipyards and that can be used as a faction spawn point when loading a new game. A warpgate allows ship to jump to any other warpgate in the galaxy. However, factions can forbid travel through their gates to enemies, preventing some silly situations during wars. This also improved trading efficiency tenfold, especially on big maps. The result is good enough for me to start making the pricing dynamic and linking the ship/station production to the economy (yay!)
On the faction AI front, I made the defensive deployment of military assets much more efficient, instead of reacting to the enemies inside their sectors, they react to the enemy fleets at their borders. It makes invasions and skirmishes much less one sided. Speaking of invasions, factions have now additional settings, some will raze enemy factories in conquered sectors, while others will convert or simply ignore them. The AI Core will self-destruct its own factories when it loose a sector.
Performance wise, I reviewed the display engine and heavily optimized the code. While it’s not perfect, it gives much higher FPS is heavily populated sectors even with nebulas and planets. There’s still a very small stutter in ship movements, but I think it has more to do with the physic engine (I have not reviewed it in months) than with anything else. I’ll check that soon.
I also improved the weapon / bullet collision detection code, large battle happening in the sector the player is in should tax the CPU a bit less. It’s not yet perfect, though. Finally, I created a new thread to remove some weight out of the ship AI one. It’s also used to do the stuff that must happen at a regular interval (changing animation frame, counting the time to live of loot drops, and so on).
I fixed a couple of bugs introduced in the last demo: The building of an unlimited amount of factories (ore mines) until there’s no space left causing a nasty game crash; and the loot drops never disappearing, here again clogging memory and general game speed. It was an easy fix. I also fixed a relatively hard to catch issue (but easy to fix) that was causing factions to sometimes believe they still had an attack fleet after a defeat during an invasion leading to a sort of paralysis during war.
I think that’s all for this week. There’s still a hell lot to do, but the progress is more or less on tracks and I hope to release an alpha with missions, actual pirates and real trading during this summer.