Devlog: Pirate bosses, pilot traits and nebulae

Snap1324Hi and happy new year !

This is going to be a difficult article to write as I am watching the Awesome Games Done Quick event (a week long speed running live feed against cancer) too, and I am much worst at multitasking than the programs I write. Anyway, there’s quite a lot of ground to cover despite having taken a week off.

Let’s start with what the screenshots are showing : the new nebulae (and background). As I quickly explained in the previous quick post, I am using a procedural generation algorithm commonly known as Perlin Noise to produce the clouds. Basically, you enter a few numbers, and it produces an unique cloud and that can be tiled easily. It has other uses that I will explain further down.

However, building such images in least 512×512 (so the tiling isn’t too obvious) takes its sweet time, well, if you’re dedicating only one core to the task. Here I managed to make the generation nearly fully multi-threaded, downing the required amount of time from 500ms to 140ms or so. There’s still a barely noticeable delay when moving from a nebulae heavy sector to another, but nothing that really break the flow. There’s faster implementations of this algorithm, but that’s way above my mathematical abilities (at least not without taking more time that I can allow on the subject).

Note that it really looks much better when moving around thanks to the parallax scrolling. There’s a background cloud moving exactly the same speed as the stars, the sun/planet with its own scrolling speed, and an upper cloud layer, with, here again its own speed.

We still have the ‘old’ sprites, except I can colorize them in real time now according to the sector’s settings, making it possible to mix them. However, I may remove them altogether from the large multiple sectors nebulae as they tend to be barely visible in these conditions. I’ll keep them to populate lone nebulae sectors where having the fog would look weird when moving it / out of the location.

Last, but not least, and incidentally not used at all (yet) in-game, Perlin noise can be used to blend two different (but similar) images together. A few screenshots will be much better at describing what I could be used for that any wall of text:

Yes, it’s possible to mix planets to get new ones, It’s especially useful to add something that look like a cloud layer. And here again, with 2 images you can make an infinite amount of slight variations. Of course, there’s limits, if I mix a ice planet and a volcano one, it will look bad, however rocky ones and gas giants tend to mix quite well. It works as well with game objects as long as they look the same, coloring aside.

I could go on for pages about this change, but let’s summarize by saying that I am pretty happy with it. I added a nebulae editor to the game editing tools, and I still have to update all maps (except Galaxia) to work properly with the new system, which takes quite a lot of time, but it’s kinda fun to tweak the various settings and see what happens.

Anyway, let’s get to some more Pirate oriented stuff, that’s the goal of this update after all. I am mostly done with the Pirate Boss AI. Each pirate base, granted it manages to gather enough funds to do so can build a cruiser or battleship (depending on its rating) that will run on a custom AI module.

Snap1339Pirates bosses will hang out in a 3 sector radius of their home and will attack targets of opportunity (juicy trading / mining ships mostly) that cross their paths. Each kill will grant money to the base in addition to the cargo pods they may gather. They’ll also slowly grow a fleet of escort ships around them (here again bought from the pirate base). Compared to the raider AI who make a list of cargo ships in the area and then try to catch up with them, it’s surprisingly more efficient and (logically) less cpu intensive. They are also much better at asserting threats and fleeing when needed. Their lifespan is still a bit too short, due to multiple factors (mostly weapon balancing and time for the jumpdrive to act) but it’s so much an improvement that I began the process of implementing those changes into other relevant AI modules.

I am also going to add the ability for pirate bases to recall the boss when attacked and use them during raids.

Snap1340And last major change. I added traits to pilots. Those traits are selected semi randomly and will change how pilots act in combat, and during dialogs with the player. It’s not a game changer, but it adds a bit of variety and gives an incentive to communicate with a ship before attacking it. While the final list is not set in stone, and that it may be possible, later on, that pilots gain/loose traits according to their actions, here’s a summary of the currently implemented traits:

  • Coward : Drop cargo more easily, more likely to jump away from combat
  • Hothead : Much less likely to flee
  • Helpful : more likely to answer questions / requests from the player
  • Leader : can recruit more escort ships
  • Weapons expert : +10% weapon damage¬† (stacks with faction trait)
  • Shield expert : 10% damage reduction on shield (stacks with faction trait)
  • Cruel : never accept surrendering from other ship / player

Once the ability for AI ship to evade projectiles and lead target when firing will be implemented, it’s likely that relevant traits will be added.

And of course there’s the usual minor changes, bug fixes that I won’t detail here. Just note that I added several new weapons and shield systems. Some of them with fairly unique effects.


One thought on “Devlog: Pirate bosses, pilot traits and nebulae”

Comments are closed.