Posted April 05, 2025 by Sanlo
#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.
There are a lot of stuff missing
The good thing is that the combat is functional ( as in, you can enter battle, attack and end battle ) but nowhere finished.
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.
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?
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.
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.