Let´s talk about combat - Part 1


Backstory

If you really think about it, Barkley 2 is a very weird game.

What I mean by that is; its so much different from Barkley 1 and, due to being a commercial product, that it had to stop using so many characters that it barely fits in the same "franchise". Many people compares it to "The Lara-Su Chronicles" because of that.

To me, many changes were very interesting. The art style is great, the music is awesome, the writing is so-so and the combat is terrible.

"The combat is terrible"... This is the my current issue. Since the beginning, I was dreading the time where I needed to work on the combat mostly because working on something that I didn't like seems like such a drag.

Check this high quality, 10 years old, early gameplay:

While its "early" in its development, the combat itself is very similar to the Janky demo´s gameplay. From what I can see, it has many issues:

  • The characters are too big for a 384x240 resolution
  • The concept of guns with multiple effects is very fun until you get 2 useless guns and 1 good gun with low ammo.
  • Dodging and dodge rolling with such a big character doesn't feel nice.
  • The UI eats up about 10% of the screen, making things even more cramped.

I also feel that today, we have so many great twinstick/topdown shooters (ex.: CrossCode) that this kind of gameplay pales in comparison.

Porting a subpar gameplay element that I don't particularly find fun doesn't give me the incentive that I need to actually work on this. 


So... what now?

So far, I was able to half-ass a solution during the tutorial gameplay, but now I have to deal with item and weapon data and player stat. This is really forcing my to actually address this issue. What I decided was this:


Yep, lets make a turn based combat system from scratch, trying to recycle as much as possible from the old system.

Because I had no Idea how to make a system like that, I made simple proof-of-concept for that system: https://sanlor.itch.io/rpg-combat-prototype

The prototype was very useful for me to brainstorm ideas. It ended up being an active turn-based combat (Similar to FF6 or Chrono Trigger), with guns/weapons being the "party members".
After finishing the prototype I realized that Barkley 1 already used a similar system.

Just for fun, I even tried to de-compile the original game to see how it worked ( check it out ) but the code was very messy and hard to understand.

"Great, now I just need to backport some code from the prototype to B2, add some flair, some stuff related to guns and we are done" I said... Oh boy...

Issue #1 - Gun Types and Materials

If you ever played the game, you know that all weapons behave differently, there are A LOT unique gun sprites. each gun can have 2 affixes and 1 suffix, granting further modifiers and different behaviors. There are 81 gun materials and 26 gun types.
This is what I was talking about. Can you try to imagine the amount of work that was poured on this system and spritesheet? How can I just scrap it... I need to reuse it.


Normally, you would have some JSON file with all modifiers and traits and one script that decodes it and applies it to the gun, bullet and bullet casings. That is not how the GMS Barkley 2 does it...

This script sets up a new weapon. Its an array / list / dictionary with a bunch of keys. That's not a lot of keys, right?
This script resets all (or some? dunno) keys on that array. That a lot of keys and I don't know how they are used.
This one selects the weapon type and this one selects the weapon material. Please note that its just a fuckton of case statements, conditions, exceptions and weird edge cases (like adding a delay before firing a musket).
This script details each firing behaviour. Its a huge script with a lot of conditions.

What I mean with this? How the FUCK should I do with this? Its a bunch of code that I cant use, but I don't want to waste it.
I also don't want code the weapons from scratch, I really want to use everything I can from the old code.

The solution for this is...

Dunno. Is there a good solution for this? The solution I came up for it was a simple one.

We have a class called "B2_WeaponMaterial" and "B2_WeaponType". Most data from the scr_combat_weapons_applyType.gml was ported to resources using the "B2_WeaponType" class and scr_combat_weapons_applyMaterial.gml was ported to resources using the "B2_WeaponMaterial".

With these classes, we can create the actual weapon using the class "B2_Weapon" along with a ton of others proprieties.

After a few weeks doing that, I finally realized that it was not going to work on the long run... I have a class with hundreds of proprieties that I don't know how to use it. Its a mess and I don't like it, but it works for now.

Issue #2 - Gun placement

Hoopz can face 16 different directions, as well as the weapons. Hoopz is also right-handed, so assault rifles and heavy weapons are held on the right. Try to imagine how can we place the weapon exactly on Hoopz hands when looking at 16 different positions.

The original game had a bunch of different scripts with a bunch of offsets. This was solved by basically copying these offsets and trying to "translate" Gamemaker's functions to Godot.

After 2 weeks of brute-force coding, I was able to make it work.


Each weapon type has a set of offset for distance from the center, h_offsets and v_offsets. Each propriety needs to be rotated based where the weapon is aimed.
The muzzle position (The pink part) is still a bit off and needs to be tweaked. Some weapons like miniguns still look a bit off, and they have a special draw order. No Idea how to deal with this.

On the next part, I will talk about the combat itself.

Get Barkley 2 - Godot Port

Download NowName your own price

Comments

Log in with itch.io to leave a comment.

And yes, I totally agree. The combat in the demo wasn't really good at all...
For some time I've been thinking that it might be best to do Earthbound style combat:

Any enemy you touch, shoot or get damaged by in the overworld, means you're instantly transported to a temporary battle area, where you and nearby enemies get to battle. 

It would have way more space, and could just be made to look similar to wherever you're currently at, be it City, Swamp, etc.

(1 edit)

This is amazing! And your solutions are very ingenious.
Whichever route you choose for developing the game (Turn based RPG or Shooter or in between) I very much look forward to reading your posts and updates.
And remember, the game was not previously finished, so what matters now is how you feel the game works best. It's your vision and you're practical, which this game needs.