If it isn't clear by now the genera I aim aiming for is a simple RTS-like. It comes from a desire to play an RTS without committing 20 minutes to a game of Starcraft. So now that the game can save and load stages and actors and set them into motion it was time to add combat.

look how cool and frantic this feels

While the gameplay here is far more hectic than I planned, it is starting to seem exciting. The splitting and joining of squads is especially intriguing.

what part of combat am I looking at here?

There are lots of parts involved in adding combat to the game.

  1. GameplayActors that need to shoot things are given a TargetingAbility component that can interface with the physics system to find potential targets. It is fairly inefficient and uses a SphereCast to find available targets and then chooses the closest.
  2. Amended the GameplayActor interface to indicate if it is targetable or not. A GameplayActor that is not targetable can not be located by the TargetingAbility.
  3. A Weapon actor has been added that is wieldable by a new Unit class. It can fire Projectile actors. It has a fire rate and state about it's cooldown.
  4. A generic Projectile actor has been added. A specific instance of that is shown in the image above. It has a collider and some particle effects to show what is going on.
  5. Teams. You can't shoot your own dudes (yet), so TargetingAbility components need to know which team they are on and which they hate.
  6. Cooldowns!
  7. UI to show the cooldowns and can observe certain properties of that cooldown.
  8. A metric ton of Controllers/Factories/Providers that deal with building a GameplayActor instance from a unit definition, hooking it up to the UI system and keeping track of it's memory life cycle.

so what's missing?

Basically everything. Right now you can locate, fire and de-spawn a projectile on impact but there are no consequences for being hit. If I were implementing a simple HP based combat system this would be trivial. But of course I'm not...