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.
GameplayActors that need to shoot things are given a
TargetingAbilitycomponent that can interface with the physics system to find potential targets. It is fairly inefficient and uses a
SphereCastto find available targets and then chooses the closest.
- Amended the
GameplayActorinterface to indicate if it is targetable or not. A
GameplayActorthat is not targetable can not be located by the
Weaponactor has been added that is wieldable by a new
Unitclass. It can fire
Projectileactors. It has a fire rate and state about it's cooldown.
- A generic
Projectileactor 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.
- Teams. You can't shoot your own dudes (yet), so
TargetingAbilitycomponents need to know which team they are on and which they hate.
- UI to show the cooldowns and can observe certain properties of that cooldown.
- A metric ton of Controllers/Factories/Providers that deal with building a
GameplayActorinstance 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...