Quite repulsing and pretty flowers

by Paul on

So, I noticed we have not actually written a lot about that new ship we added to Roche Fusion recently, so I figured I will talk about something completely different!

Among other things, including some balancing improvements I added a new upgrade to the game today.

The idea was simple: Make an upgrade that pushes enemies away so that the player has an easier time flying close to them.
Setting up the base stuff was pretty trivial, and I quickly had the power to push enemies around. The way I did it, I simply pushed all enemies that were closed than a certain radius to the player away from it, with a force that grew stronger the closed the enemy was to the player.

In principle that worked great, however, while playing around with it, I noticed that there was one thing this did not allow the player to do, which felt like quite an intuitive thing to me. The idea I had was that being able to push enemies around, I should be able to wedge and fly through cracks in enemy formations that would usually too small for me. However, when I tried that, the enemies did not actually get pushed out of the way but just in front of me, which ended up with a collision after all, unless I set the repulsion force to be extremely high.

I tried a few more and less complicated things to solve that problem, but then it struck me, that I really should do exactly what my intuition was telling me: If I fly towards a group of enemies, they should not be pushed away from me, but they should be pushed away from the path I was flying on, to get out of my way.


So that is exactly what I did, and it worked great!
If the player is not moving, or if an enemy is behind them, they will still be pushed away the regular way, but otherwise, they will do their best to clear a path for the player, allowing them to fly through most loose formations if careful.

Lastly, I of course also had to give the upgrade a nice graphical effect. I went with something fairly subtle: periodic circular waves filling the radius of influence. Those waves both have a colour (the same colour as the flowing highlight on the ship that is using the upgrade) and apply a slight distortion effect to make it look more three-dimensional. The effect starts out very transparent but quickly becomes clearly visible anytime the upgrade is actively pushing enemies away.

All in all I am very happy with how things turned out, and as a reward for scrolling down, here are some screenshots of how it looks in game. The first is me setting in a swarm of green and red enemies, not doing anything, and yet being perfectly safe. None of the enemies that usually deal damage via collisions can hurt you unless you actually fly into them.


And for a bit more fun, here is me in god-mode after being surrounded by a swarm of small red enemies. Is it not pretty?