Devlog : Pirates !

Snap100Here again I am a bit late posting an update, it has been a busy week with the installation of the website and forum on the new server. But, I still had the time to get some work done, quite a lot actually.

The most important part being the numerous changes I made to the pirate faction, the addition of pirate bases and of a bounty system that I will explain in details further down in the article. Also, with the help of some debugging tools I managed to spot and fix a few bottlenecks in the code. And finally, as usual, there’s a list of not always intentional bug fixes and miscellaneous changes.

Enjoy ! 🙂

Pirates

That is the most interesting change so far. At a faction level, pirates won’t work at all like the other factions. They do not have a military fleet anymore and they can’t takeover sectors by military means. Pirate patrol ships don’t care at all if you blow up 3rd party stuff in their sectors, and they don’t even care that much if you blow up their own ships. Their faction AI layer has been stripped down to the essential (station building and limited diplomacy).

However, each Pirate Base (PB from now on) has a fairly complicated AI which allow it to manage its funds and ships and to plan various actions. For example, when relatively low on cash, a PB will send a raiding party against a cargo ship transporting valuables. When it has a lot of money, it may buy a cruiser or a capital ship to protect itself from enemies. Larger PB will send large raiding parties to attack or ransom (that i still have to implement) 3rd party sectors and stations. The list goes on.

Last night, while testing these features, a pirate base sent a wing to attack a cargo ship transporting large quantities of raw materials in a newly colonized human sector. The raiding ships managed to intercept it before it reached its destination. The cargo ship sent a call for help to the local police, which already was on its way (contrary to Siraks, Humans hunt down pirate raiders on sight), and a small skirmish ensued between the raiders and the local forces who ultimately managed to win the fight. The cargo ship wasn’t so lucky, though. Once the mission system gets done, it will perfectly be possible for the player to join the fight for either side and get a monetary reward and/or relation boost. Alternatively he could also wait for the fight to die down and scavenge the loot.

Also, once the economy gets linked to actual ship building, you can imagine the ramifications: pirate raids may have quite a negative impact on the welfare of other empires. And, as it’s possible for me force attacks on specific races if I want to, empires may be allowed to bribe the pirates to weaken their foes.

And all of this lead to the other major feature the game can now handle (to some extend, more work still need to be done):

Bounty System

It’s a simple system, when a ship from faction X gets destroyed by another one from faction Y, a bounty is put on its head. Same goes for other illegal actions (like smuggling when it gets implemented). Police / Patrol type ships will attack ships that have a bounty on their head if they have nothing more urgent to do and if they are the same or friend with the faction who set the bounty. It will also allow PB to target ship(s) who destroyed many of their assets as some kind of revenge.

Later on, I am going include NPC bounty hunter parties that will hunt down people for money so they can buy better ships and gear. Such missions will, of course, be offered to the player as well.

This feature has also some more “peaceful” consequences. Right now, attacking a poor transport in a faction’ sector, without even killing it, can lead to the whole army and police forces hunting you down forever (something I purposefully disabled in the demo by preventing enemy fleets from chasing you across sectors). Once it’s fully implemented, what’s going to chase you will be proportional to the bounty on your head, and more to the point, you’ll be allowed to pay the fine to make the problem go away.

That was the fun part, now it’s time for the boring stuff I will summarize quickly.

Improved Performances and bug fixes

While testing a very large map and let the game run the whole day, I had the unpleasant surprise to notice that my economic system where factories post “i need this, i sell that” missions to a virtual board wasn’t as efficient as I thought it would be. It would take about 20 minutes to run the whole list of factory AI modules. Given that each factory AI should be called every 5 minutes or so, it wouldn’t do. I managed to get the number down back the 3 minutes or so, but  it still using on of my cores at 100% all the time once the galaxy is big enough (40×40) with several hundreds of stations. It mostly has to do with the pathfinder being called way too often. But I am confident i can optimize that much further, i just hadn’t the time to do so.

I also made the game much, much, more responsive in CPU heavy situations (large battles breaking out simultaneously everywhere). Beforehand, ships and bullets would simply stop moving, this behavior should be fixed completely. Decision mechanisms and actual movement were handled by the same code, they are now running separately and in different threads.

I also optimized the display engine, frame-rate should be much more consistent due to better culling of objects that aren’t visible to the user. There’s still some work to be done, and parallax scrolling to be added.

Finally, there’s a bunch of random bugs, weird ship behaviors, and user interface issues that have been fixed, but that’s not very interesting or relevant at the moment.

That’s all for now, I will continue my work on the pirate related stuff and economics this week and probably tackle a few other stuff as well 🙂

One thought on “Devlog : Pirates !”

Comments are closed.