Let´s talk about combat - Part 2


Issue #2 - Starting combat, combat and ending combat

Hey, check this out ↓↓↓

Yeah, its the current state of the combat system. It works™!

A few things happen before the combat actually happens.


A system very similar to the Cinema script is triggered; B2_Script_Combat.

  • All combat actor move toward their selected positions.
  • The B2_CombatManager is initiated, along with the Combat ticker (A timer that controls the combat pacing)
  • The UI´s combat module is initiated, showing some combat related info.
  • Both the player, players weapons and enemies increase theirs action counters. When the counter is at 100%, the combat actor can perform an action.
    • The player and players weapons have different action counters. Weapons can shoot and use skills, while the player can use items, defend, escape and move/roll.
    • Moving and defending can affect how long it takes for Hoopz to reload its weapons
  • When all enemies are defeated, The camera focus on Hoppz and shows the battle results (XP, Money, Level  Ups).
  • UI´s combat module hides itself and the combat related stuff queues itself out.

There are a lot of stuff missing

  • Lose condition
  • Skills
  • Enemy attack
  • Weapon stats being used on bullets (speed, accuracy, damage, sfx, vfx)
  • Enemy AI
  • Status effects

The good thing is that the combat is functional ( as in, you can enter battle, attack and end battle ) but nowhere finished.

AI

What about the enemy AI? Personally, I'm terrible with AI's...
I´ve tried to work with behavior trees in the past, with some success (and a lot of stress) but I don't want to deal with that again.

Barkley 1 had a turn-based AI system, but the code is a bit confusing ( this and this I think ).

For now, random attack decisions will do.

Movement and melee combat

Player movement inside combat is also a concern. Initially, I was thinking that the player could dodge attacks by dodge rolling (using the MOVE command), but what if the player moves too far away? How can I handle this kinds of situations? Maybe creating a bounding box around the combat area?

Melee combat is also an issue. While Hoopz can use guns, he may also use an weak melee attack (when he has no weapons / no ammo ). Enemies may also use melee attacks.

The issue is that all CombatActors are RigidBodies. Initially, melee actions are done by tweening its position to make the attack animation. Tweening a RigidBody position is a bit buggy. Tweening its velocity instead may result in irregular animations.

Other action may affect the way that Hoopz reload guns. Maybe rolling away from an enemy attack can reset the gun´s action points?

Skills and attacks

Hoopz can shoot guns normally and use weapon skills ( like a triple shot using the pistol ). The way I'm thinking, a skill is just a bunch of normal attacks.
I need to find a way to organize attacks based on the gun type and material, along with some skill that can be passed on new guns ( gun breeding is a planned feature ).
On the Combat Prototype I created a bunch of custom resources to manage that. It worked fine there, but I'm worried that it cant scale very well. B2 already has a ton of "custom classes" and I've heard that it has some performance impact.

UI and camera

The UI is a major issue.


Most of it is just dead space... dead space that I can't just remove.
I've dabbled on using an UI similar to B1, but I don't think it looks good.

The enemy health bar also sucks. I made that and it looks terrible. It works for now, but I need to change it later.

With the cramped play-space, a good camera setup is needed. One big issue is how zooming works with my chosen viewport mode.
When enemies are far from each other, the camera may zoom out to cover all enemies. Depending on the viewport mode, it can look bad or terrible.

Canvas item - Mixed sized pixels (Which I hate):

Viewport - Loss of detail:

While these screenshot looks OK, in full screen mode on a large monitor it looks terrible. No idea how to deal with this.

All said and done, I'm pretty happy how this is going. Maybe in a few months I will go back on working on non-combat related stuff.
See ya.

Get Barkley 2 - Godot Port

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.