Devlog - 17: Unit attacks


Devlog - 17: Unit attacks

I've been refactoring units, their behaviour and their attacks in my spare time as they've not been very optimal or smart so far.

Units behaviour

One thing different in this game is that you do not control your units as you usually do. Instead, you can just give them a target to move to and they'll attack anything they can along the way.

This also ties in to the setting and story. As a machine race not everything you build or have has a lot of capabilities. I aim to expand upon this with different ways to organise and control units. I already have some ideas brewing, but I'll leave that for later.

Refactoring

First thing I did was to make units actually  detect stuff only inside their detection range. If inside the detection range the unit will start moving towards that object and attack it once it's inside the attack range.

Attack subsystem

I also created a base attack subsystem that's then implemented by each specific unit. In this way, all units can reuse the same unit controller and have different ways of attack.

Showcase of a player unit:

The unit uses the specific attack subsystem to create 2 lasers. Each one targets a different section of the enemy building.  There are some precision issues as sometimes it will not be directly on the building, but I just have to make the calculations a bit more precise.

Note: Updates may be a bit slower than usual as I have quite a bit of freelance work lately :)

Leave a comment

Log in with itch.io to leave a comment.