Multiplayer Campaigns HOWTO

Discussion of all aspects of multiplayer development: unit balancing, map development, server development, and so forth.

Moderator: Forum Moderators

Rhuvaen
Inactive Developer
Posts: 1272
Joined: August 27th, 2004, 8:05 am
Location: Berlin, Germany

Multiplayer Campaigns HOWTO

Post by Rhuvaen »

Important Notice: Multiplayer Campaigns are functioning again as of version 1.3.5+.

Known Bugs:
1.3.8:
- linger mode introduces a bug. You can completely circumvent this problem as a host if you tell your players to leave linger mode (by clicking "end turn") before you do so. Only if the host leaves linger mode last will the game progress with all players. The download of the next scenario will not start before the host ends linger mode (but it will be at 0% downloaded), so an impatient player may be inclined to abort the game beforehand. Inform your players.

- OOS on recalls. All observers will get OOS on the second and following scenarios. Giving an observer control of a player side will not allow that player to recall. You need to save and reload if you need to hand control to an observer.

- [story] is unavailable over the net. All your carefully crafted [story] information is not available to players who haven't downloaded your content. It's thus not a reliable way to share the story with all players.

- allow_new_game=no. Still doesn't work properly. I recommend not using this right now.

There is also a wiki page on Multiplayer Campaigns.

Here's the basic scheme for making multiplayer campaigns (found out after a lot of experimentation).

MP Campaigns are simply a series of [multiplayer] scenarios, unlike [campaign]s. I recommend having a separate directory for the scenarios and a cfg file pointing to the scenarios in the campaigns folder, like thus:

Code: Select all

# this loads my MP scenarios
#ifdef MULTIPLAYER
{@campaigns/My_MP_Campaign_Folder/}
#endif
It means all your scenarios are available in the Multiplayer creation dialogue - and there's no way around that because the game needs to be able to find them all. So name them properly (i.e. MY_MP_CAMPAIGN_START, MY_MP_CAMPAIGN_2 etc.) so that people know where to start.

The first scenario is rather special in that the choices the players make when they join your game supersede the settings in the config file. EDIT: if you want specific factions and leaders you need to replace them in a prestart event in the first scenario only.

Code: Select all

[multiplayer]
   id=MY_MP_CAMPAIGN_START
   description="the starting scenario of MY MP CAMPAIGN!"
   name="This is what I want the scenario to be called in the game setup menu"
   map_data="<insert cool map here>"
   turns=50
   next_scenario="MY_MP_CAMPAIGN_2"

   {DEFAULT_SCHEDULE}

   [side] # this is a player side definition
   side=1
   canrecruit=1
   save_id="Player1"
   team_name="human"
   controller="human"
   [/side]

   [side] # this is an AI side definition
   side=2
   canrecruit=1
   type="Orcish Warrior"
   recruit="Orcish Grunt,Orcish Archer,Wolf Rider,Orcish Assassin"
   allow_player="no"
   controller="ai"
   [/side]

[/multiplayer]
The second scenario looks like this:

Code: Select all

[multiplayer]
   id=MY_MP_CAMPAIGN_2
   description="the second scenario - DON'T PLAY THIS!"
   name="..."
   map_data="<insert cool map here>"
   turns=50
   allow_new_game="no"

   {DEFAULT_SCHEDULE}

   [side] # this is a player side definition for subsequent scenarios
   side=1
   canrecruit=1
   save_id="Player1"
   controller="human"
   type="Lieutenant"
   [/side]

   [side] # this is an AI definition
   side=2
   canrecruit=1
   type="Dark Sorcerer"
   recruit="Dark Adept, Ghoul, Skeleton, Skeleton Archer, Walking Corpse"
   controller="ai"
   [/side]

[/multiplayer]
You need to declare the same save_id as the previous scenarios, otherwise the side doesn't get allocated to the player correctly.

See the "type=Lieutenant" definition? Currently, in order for the game not to barf while loading the leader unit from the recall list, it needs a default type. This is ignored if the game finds an actual leader in the recall list, though!

EDIT: the new allow_new_game=no setting will prevent your subsequent scenarios from showing up in the map/scenario list when starting new MP games.

So, here are the bare bones. Good luck and go, go, go make some MP Campaigns!!!
Last edited by Rhuvaen on September 27th, 2007, 10:49 pm, edited 8 times in total.
toms
Posts: 1717
Joined: November 6th, 2005, 2:15 pm

Post by toms »

Wow.

E-cookie to Rhuvaen :D

Does it also work to have another next_scenario= in the next scenario? It does not show.

And to ensure that the scenarios after the first cannot be played:

I strongly believe it works to initialize a variable in the first scenario and end all other levels of the campaign in the prestart event if the variable does not evaluate to true. :twisted:
First read, then think. Read again, think again. And then post!
Rhuvaen
Inactive Developer
Posts: 1272
Joined: August 27th, 2004, 8:05 am
Location: Berlin, Germany

Post by Rhuvaen »

toms wrote:Does it also work to have another next_scenario= in the next scenario? It does not show.
It's just an outline of the principle, and that's all I tried yet. But my guess is if it works for scenarios 1->2, there's no reason it wouldn't work for 2->3 etc.

Note that the above isn't even really true "multiplayer" either, because I only defined one "human" side ;). It's really just an example giving the declarations that work.
toms wrote:And to ensure that the scenarios after the first cannot be played:

I strongly believe it works to initialize a variable in the first scenario and end all other levels of the campaign in the prestart event if the variable does not evaluate to true. :twisted:
Ah, good idea! I will collect ideas like that in this thread. The other scenarios will still show in the game creation menu, though, and just making them duds is only a partial solution.
Yogin2
Posts: 24
Joined: April 21st, 2006, 6:56 am

Post by Yogin2 »

wow. awesome.
nuff said.
<sapientx> [The heavy fighter]'s like a cross between an HI and a mage
<sapientx> I couldn't decide whether to guard him or put him on the front line
Rhuvaen
Inactive Developer
Posts: 1272
Joined: August 27th, 2004, 8:05 am
Location: Berlin, Germany

Post by Rhuvaen »

I tested this today over the server, and it's absolutely necessary to include the controller keys in the side definitions. If you don't do that, the game will still work in hotseat, but won't be able to start via the server (it won't even display for others to join!). Post above edited.

WIth two player sides, both came across to scenario 2 without problems and could recall their units independently. Seems to work :D!

I've attached the bare-bones test cfg's if people want to have something as an example to start from. It's not even remotely interesting, playwise :wink:.
Attachments
MP_Camp.zip
Test case for MP campaigns - two player cooperative test
(1.23 KiB) Downloaded 734 times
User avatar
Viliam
Translator
Posts: 1341
Joined: January 30th, 2004, 11:07 am
Location: Bratislava, Slovakia
Contact:

Re: Multiplayer Campaigns HOWTO

Post by Viliam »

Rhuvaen wrote:all your scenarios are available in the Multiplayer creation dialogue - and there's no way around that because the game needs to be able to find them all.
Is this still true? If yes, I recommend a new WML attribute for "multiplayer" tag: "show_in_menu=no". Scenarios with this tag will not be displayed in a multiplayer menu. This should be used for all multiplayer campaign scenarios except the first one.
Rhuvaen
Inactive Developer
Posts: 1272
Joined: August 27th, 2004, 8:05 am
Location: Berlin, Germany

Re: Multiplayer Campaigns HOWTO

Post by Rhuvaen »

Viliam wrote:I recommend a new WML attribute for "multiplayer" tag: "show_in_menu=no". Scenarios with this tag will not be displayed in a multiplayer menu.
Exactly what I had in mind as a feature request. I'll file one today :)! I'd call it "start_new_game" because I think it's more descriptive. I also think it should be in 1.2, because that stable version would be great for developing content such as this.
User avatar
jb
Multiplayer Contributor
Posts: 505
Joined: February 17th, 2006, 6:26 pm
Location: Chicago

Post by jb »

Nice work Rhuvaen. Eagerly awaiting the sequel to Unnatural Winter.
My MP campaigns
Gobowars
The Altaz Mariners - with Bob the Mighty
Rhuvaen
Inactive Developer
Posts: 1272
Joined: August 27th, 2004, 8:05 am
Location: Berlin, Germany

Post by Rhuvaen »

jb wrote:Nice work Rhuvaen. Eagerly awaiting the sequel to Unnatural Winter.
Thanks! I haven't even ported that one yet to this MP campaigns format... :(

I'll work on it in parallel with a new randomly generated quest-style campaign.
NeoPhile
Posts: 155
Joined: July 22nd, 2004, 4:33 am
Location: Halifax, NS, Canada
Contact:

Custom units?

Post by NeoPhile »

Just as an experiment, I figured I'd try porting Elf War to multiplayer. It's a little harder than I thought it would be. Anyway, I'm currently wondering if there's a way to use [+units] in a multiplayer scenario/campaign. Or do I have to make an Elf War era?

I'm not looking forward to that prestart event either. It's been a loooooooong time since I've played with WML.
Rhuvaen
Inactive Developer
Posts: 1272
Joined: August 27th, 2004, 8:05 am
Location: Berlin, Germany

Re: Custom units?

Post by Rhuvaen »

NeoPhile wrote:Just as an experiment, I figured I'd try porting Elf War to multiplayer. It's a little harder than I thought it would be. Anyway, I'm currently wondering if there's a way to use [+units] in a multiplayer scenario/campaign. Or do I have to make an Elf War era?
Ah, good! No, [+units] doesn't work in multiplayer (where are custom units used in Elf War?). You could make an era, but then both player would need to have it.

Please, if you do this, start a new thread and I'll surely lend you a hand (such as writing the prestart events and such :D). Maybe you could PM me a copy of Elf War since I don't have it...

I was thinking about doing this because Elf War always keeps getting mentioned. But I just don't think that campaigns such as these really gain very much from MP other than taking much longer to finish and players not being able to continue when they have time but their partner doesn't. I'm still very interested to get it going for MP, just to have something playable soon.
MrGrendel
Posts: 45
Joined: July 1st, 2006, 2:16 pm

Post by MrGrendel »

Hmm, interesting... would it be possible to make a "looping" campaign, something that might simulate a single multi-part map you can move back and forth on?

For example, let's say you have an elf vs dwarf battle on the main map. If the elves win, they have to fight the dwarves again, but on the second map with a lot of mountainous terrain. They win the campaign if they can beat the dwarves there. However, if they lose that battle, the campaign loops back to the central map.
Look at me, you will see what the moon has done to me / I'm a child of the brightest of nights...
Rhuvaen
Inactive Developer
Posts: 1272
Joined: August 27th, 2004, 8:05 am
Location: Berlin, Germany

Post by Rhuvaen »

Exactly! I think this is one example of a good use of the campaign principle in multiplayer! I posted an outline of this idea here previously, which actually avoided any map being played twice. In this idea, the whole thing also ends with a winner after 3 scenarios. (there's also this threadwith similar proposals)

Another is for a 2v2 to swap teams for a second run according to how well people performed - the winning team is split up between the teams in the second scenario, in order to make the challenge more even. Players who performed badly might get some gold bonus as well (early finish :lol:).

Then there might be something like a 4 player tournament: 2 maps of blitz or whatever next to each other. In the second scenario, the two winners battle for the first place while the losers decide who wins third. This would be a chance to watch other people's strategies and comment the games, especially for observers who would watch 2 games at a time.

Erm, this thread is about the technical aspects of MP campaigns, so we better leave these ideas to another thread.
NeoPhile
Posts: 155
Joined: July 22nd, 2004, 4:33 am
Location: Halifax, NS, Canada
Contact:

Re: Custom units?

Post by NeoPhile »

Rhuvaen wrote: Ah, good! No, [+units] doesn't work in multiplayer (where are custom units used in Elf War?). You could make an era, but then both player would need to have it.
Kelmi and Rewny (the two controllable leaders) are both custom, and there's a dragon later on.
Rhuvaen wrote: Please, if you do this, start a new thread and I'll surely lend you a hand (such as writing the prestart events and such :D). Maybe you could PM me a copy of Elf War since I don't have it...
I'll start a new thread soonish, once I get the first level or two working. The prestart actually turned out to be pretty straightforward, with the exception of choosing a difficulty, which I'm going to ignore for now. Elf War is on the campaign server, that should be easier for both of us.
Quitch
Posts: 69
Joined: January 10th, 2006, 2:32 pm

Re: Custom units?

Post by Quitch »

Rhuvaen wrote: I was thinking about doing this because Elf War always keeps getting mentioned. But I just don't think that campaigns such as these really gain very much from MP other than taking much longer to finish and players not being able to continue when they have time but their partner doesn't. I'm still very interested to get it going for MP, just to have something playable soon.
As an interested party, allow me to disagree. I would be interested in tru multiplayer campaign because it would add a new element to the experience, trying to win in co-ordination with an ally, rather than having full control over the forces on the battlefield.

A different experience. Perhaps not to everyones taste, but not a big problem timewise if you're playing with a regular teammate, or in my case my brother.
Post Reply