[MOD] Defined Roles mod

Some of you may be familiar with the Defined Roles mode in a few of my HW2 (and now HWRM) mods. The idea is that control over ships is divided among a team’s players. One player controls capital ships and production; another player controls resource collectors, frigates and platforms; and a third player controls fighters and corvettes. (I haven’t been able to think of a fourth role yet now that HWRM supports eight players.)

This is relatively simple to implement for human players. But for CPU players this requires many changes, either to the AI or to some other game structures.

Getting all three CPU players to cooperate with each other by modifying the AI scripts is a PITA and will probably never work. However, I have made some attempts in the past, and there is still some (currently disabled) experimental AI code in my mod files from this time that you can take a look at.

Another solution would be to rely instead on a single CPU opponent with the power of three players. The easiest (for me) would be if GearBox implemented per-player starting fleets and per-player unitcaps, which could then be tweaked/increased to make the CPU opponent stronger. But they (or at least BitVenom) have expressed trepidation about this and are unlikely to do so.

A third way would also rely on a single super-strong CPU player, but would instead simulate per-player starting fleets and unitcaps using current methods. To simulate per-player starting fleets, I could simply spawn all three CPU players’ ships, and then transfer them to the ‘lead’ player while leaving the other CPU players in stasis. However, the only way I can think of to simulate per-player unitcaps, would be to create four new CPU-only races, each with their own versions of common ships, and then alter the unitcaps for these races to give them more ships. It would work, but would be a lot of effort to set up, and a PITA to manage over time if GearBox decided to do additional balancing of ships and races at some point in the future.

Is there another option I am missing? Creating four new races is just too much effort for little gain, and could even be abused by unscrupulous players. What are your thoughts?

@bitvenom would tags work for this? Filtering a different set of AI files per role?

So it seems to me that so long as the CPU can build all ships and the players are restricted to only one set of ships, no messing with unit caps would be needed. You could do this by modifying available researches for the humans, and scripts can do that pretty nicely. You could also grant the CPU some normally inaccessible researches to supercharge it’s resourcing options, or give it extra money for free.

I don’t quite understand. In my mod, the first person on each team does ALL of the production for the whole team. A script then transfers frigates to player 2, fighters to player 3, etc… Players 2 and 3 never do any production or researching of any kind. In exchange, Player 2 and Player 3 then are given unitcaps that are 3x as large.

I don’t quite follow how researches can help here.

Also, I want the game to be fair for both sides, so no supercharges for the CPU! Unless the CPU really sucks and needs to be given an advantage.

CPU Player 2 and CPU Player 3 don’t really need an AI. They just need to know how to shoot stuff. But CPU Player 1 needs to plan on behalf of the whole team, which I just don’t think is possible.

That’s why it might be best to freeze/kill CPU Players 2 & 3, and give all ships and RUs to CPU Player 1. But CPU Player 1 will then need 3x unitcaps.

So player 1, 2, and 3 split one player’s production worth of ships. Since each has their own unit caps I would presume the script does something to prevent the first player from building past the caps of their partners? If that’s the case, it seems like you’d have three players with the total power of one, so facing one CPU player with normal unit caps and normal AI would be a fair fight, unless I’m missing something.

1 Like

Unfortunately, I have not figured out how to do that yet. Right now, you can fill Player 2 and Player 3’s fleets indefinitely with ships (which is a lot of fun!) but what you said is what I want.

You seem to understand the idea. But the unitcaps are 3x higher than normal.

IIRC when you manually transfer your ships to a teammate in a normal multiplayer match, the game checks first whether the teammate can accept that many ships according to his unitcaps.

Is there a way to do this using scripting? The regular script will just transfer the ships regardless of unitcaps.

I’m not here to be useful in any way, since I don’t know anything that doesn’t concern modelling. So sorry for spamming in advance.
I’m just here to state that I absolutely loved the Defined Roles mod in Classic. It was a really cool idea. And I really hope you’ll find a way to recreate it.

Thanks! I did re-create it. I just wish I could change some of its features to make more sense…

But it works just like it used to.

1 Like

Awesome. So it’s MP ready, brilliant.

It’s incorporated as part of this mod now:

http://steamcommunity.com/sharedfiles/filedetails/?id=707870413

1 Like