Multiplayer Campaigns HOWTO
Moderator: Forum Moderators
Multiplayer Campaigns HOWTO
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:
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.
The second scenario looks like this:
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!!!
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
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]
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]
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.
Try some Multiplayer Scenarios / Campaigns
Wow.
E-cookie to Rhuvaen
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.
E-cookie to Rhuvaen
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.
First read, then think. Read again, think again. And then post!
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.toms wrote:Does it also work to have another next_scenario= in the next scenario? It does not show.
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.
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.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.
Try some Multiplayer Scenarios / Campaigns
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 !
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 .
WIth two player sides, both came across to scenario 2 without problems and could recall their units independently. Seems to work !
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 .
- Attachments
-
- MP_Camp.zip
- Test case for MP campaigns - two player cooperative test
- (1.23 KiB) Downloaded 735 times
Try some Multiplayer Scenarios / Campaigns
- Viliam
- Translator
- Posts: 1341
- Joined: January 30th, 2004, 11:07 am
- Location: Bratislava, Slovakia
- Contact:
Re: Multiplayer Campaigns HOWTO
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 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.
Re: Multiplayer Campaigns HOWTO
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.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.
Try some Multiplayer Scenarios / Campaigns
Thanks! I haven't even ported that one yet to this MP campaigns format...jb wrote:Nice work Rhuvaen. Eagerly awaiting the sequel to Unnatural Winter.
I'll work on it in parallel with a new randomly generated quest-style campaign.
Try some Multiplayer Scenarios / Campaigns
Custom units?
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.
I'm not looking forward to that prestart event either. It's been a loooooooong time since I've played with WML.
Re: Custom units?
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.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?
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 ). 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.
Try some Multiplayer Scenarios / Campaigns
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.
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...
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 ).
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.
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 ).
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.
Try some Multiplayer Scenarios / Campaigns
Re: Custom units?
Kelmi and Rewny (the two controllable leaders) are both custom, and there's a dragon later on.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.
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.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...
Re: Custom units?
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.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.
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.