Designing Co-Op

Finished the sixth level this week, awwwright. Just one more to go! Although, this is the one level where I don’t have as much work pre-done – it wasn’t at an “alpha” state like the others. So, it’ll probably take a bit longer to put together, but hopefully not too long. Most bosses and environments are roughed in, at least.

This week I thought I’d detail some things to consider when implementing co-op!

Enemies

In Bleed 2 there are two versions of every enemy: purple (reflectable) and yellow (unreflectable.) I think it’s important the sprites indicate their colour before they attack — it just seems fair. On easier settings enemies are mostly purple, with the ratio of yellow increasing with the difficulty. In co-op, there’s a purple and a yellow player, so it has to be an even mix regardless of difficulty.

Maybe hard to tell, but the second enemy is yellow in co-op.

Bosses

Similarly: on lower difficulties bosses have a high chance of using purple attacks, and the chance goes down as the difficulty goes up. In addition to that, the bosses have increased health to compensate for the potentially doubled player damage – boss health isn’t doubled though, right now it’s only increased by 25%. I don’t want it to be a slog, but I don’t want it to be a cakewalk.

Player Targeting

Enemies and bosses also need tweaks to their AI to accomodate the extra player. All baddies have a “player target” and will focus on attacking that character. Watching people play co-op so far, it seems really frustrating when enemies target a player that can’t reflect their shots. So, enemies generally target the player matching their colour, but they can change focus if the target runs away or the other player does more damage, that kind of thing.

Bosses also have a player target, but most boss attacks cover a wide range and are a threat to both players. More focused attacks are modified slightly to target both players, and in the case of a really focused attack, the bosses randomly swtich up targets to keep both players on their toes.

…come to think of it, maybe taunting could be a way of focusing enemy attention on a specific player! It seems obvious now that I’ve typed it out, but it also might be hugely exploitable. I’ll have to try that out once the last level is done!

Player Damage

This is something I have yet to code – players need to be able to damage enemies at the same time. Right now enemies can only be damaged once per frame (with few exceptions – reflected bullets and attacks always hurt enemies, for example.) The limitation exists because most bosses have multiple hitboxes — some weapons can strike multiple hitboxes at once, causing bosses to take, say, 500% damage from a single hit, which obviously isn’t cool. Instead of bosses taking one hit per frame, they’ll have to take one hit per player per frame.

Cutscenes, Event Triggers and More

The second player must be added to cutscenes. I also have to handle scenarios where the first player triggers a boss fight or other event, and the second player is off-screen. Boss fights, for example, limit the action to a certain area and I can’t leave the second player trapped outside.

Alright that’s quite enough of that! I’m sure you can see there’s a lot of tweaking and added features that go into adding local co-op. I think it’ll be worth the effort!