Mission format
Posted: 29 May 2014, 09:54
Added etherpad issue: http://etherpad.springrts.com/p/mission_format.
Original proposal:
I'd like to propose a mission format that can be implemented in the engine and used in unitsync and the lobbies. I would also like to point out that this format does not specify an actual "mission runner" implementation. That is left to the mission creator, and from what I understand, we have about 4 mission runner implementations already.
So why do we need this?
Well, missions depend on a specific map and mod and usually don't allow all team combinations, so I don't think it's correct to continue treating them as a regular game.
Firstly, missions should be defined by a new modtype in the modinfo.lua.
[code]
modtype=2,
[/code]
Now regarding maps, there are two ways of dealing with that I guess.
We can either specify them using a separate field, called map:
[code]
map="Delta Siege Dry",
[/code]
or we can specify that in the depend table, along side the game:
[code]
depend = {
"Original Game v2",
"Delta Siege Dry",
}
[/code]
The second option sounds nice since we can reuse the existing mechanism, but I'm not sure if you can have maps in the depend table, and there might be an issue with ordering in the depend table affecting behavior.
Next, regarding teams, we need to specify the following at least for each team
- Name: if unspecified: lobby decides
- AllyTeam: if unspecified: lobby decides
- IsMandatory: defines whether this slot must be filled or not, if unspecified: 0
- IsPlayer: defines if this slot must be used by a Player: if unspecified: 0
- IsAI: defines if this slot must be used by AI: if unspecified: 0
- AI: defines the AI which will play this team, requires IsAI=1: if unspecified: lobby decides (meaning we could potentially allow custom AIs to be used in the mission)
- CanCoop (better name?): defines if multiple players/AIs can play on the same slot (they still must obey the isPlayer or isAI if set), if unspecified: lobby decides
- Side: defines the team's side name, if unspecified: lobby decides
Looking at a map (as they also define team positions), we can reuse the existing format resulting is something like this:
[code]
[TEAM0]
{
Name=Player;
IsPlayer=1;
IsMandatory=1;
AllyTeam=1;
}
[TEAM1]
{
Name=Enemy;
IsAI=1;
AI=NullAI;
IsMandatory=1;
AllyTeam=2;
}
[TEAM2]
{
Name=FriendlyAI;
IsAI=1;
AI=NullAI;
AllyTeam=1;
}
[/code]
I guess this could be placed in a file separate from modinfo.lua, in the case of maps we have those .smd files, so probably something like that.
Obviously we could implement all this in modinfo.lua, let's say we add a table called teams:
[code]
teams = {
{
Name="Player",
IsPlayer=1,
IsMandatory=1,
AllyTeam=1,
}, {
Name="Enemy",
IsAI=1,
AI="NullAI",
IsMandatory=1,
AllyTeam=2,
}, {
Name="FriendlyAI",
IsAI=1,
AI="NullAI",
AllyTeam=2,
}
}
[/code]
Thoughts?
Original proposal:
I'd like to propose a mission format that can be implemented in the engine and used in unitsync and the lobbies. I would also like to point out that this format does not specify an actual "mission runner" implementation. That is left to the mission creator, and from what I understand, we have about 4 mission runner implementations already.
So why do we need this?
Well, missions depend on a specific map and mod and usually don't allow all team combinations, so I don't think it's correct to continue treating them as a regular game.
Firstly, missions should be defined by a new modtype in the modinfo.lua.
[code]
modtype=2,
[/code]
Now regarding maps, there are two ways of dealing with that I guess.
We can either specify them using a separate field, called map:
[code]
map="Delta Siege Dry",
[/code]
or we can specify that in the depend table, along side the game:
[code]
depend = {
"Original Game v2",
"Delta Siege Dry",
}
[/code]
The second option sounds nice since we can reuse the existing mechanism, but I'm not sure if you can have maps in the depend table, and there might be an issue with ordering in the depend table affecting behavior.
Next, regarding teams, we need to specify the following at least for each team
- Name: if unspecified: lobby decides
- AllyTeam: if unspecified: lobby decides
- IsMandatory: defines whether this slot must be filled or not, if unspecified: 0
- IsPlayer: defines if this slot must be used by a Player: if unspecified: 0
- IsAI: defines if this slot must be used by AI: if unspecified: 0
- AI: defines the AI which will play this team, requires IsAI=1: if unspecified: lobby decides (meaning we could potentially allow custom AIs to be used in the mission)
- CanCoop (better name?): defines if multiple players/AIs can play on the same slot (they still must obey the isPlayer or isAI if set), if unspecified: lobby decides
- Side: defines the team's side name, if unspecified: lobby decides
Looking at a map (as they also define team positions), we can reuse the existing format resulting is something like this:
[code]
[TEAM0]
{
Name=Player;
IsPlayer=1;
IsMandatory=1;
AllyTeam=1;
}
[TEAM1]
{
Name=Enemy;
IsAI=1;
AI=NullAI;
IsMandatory=1;
AllyTeam=2;
}
[TEAM2]
{
Name=FriendlyAI;
IsAI=1;
AI=NullAI;
AllyTeam=1;
}
[/code]
I guess this could be placed in a file separate from modinfo.lua, in the case of maps we have those .smd files, so probably something like that.
Obviously we could implement all this in modinfo.lua, let's say we add a table called teams:
[code]
teams = {
{
Name="Player",
IsPlayer=1,
IsMandatory=1,
AllyTeam=1,
}, {
Name="Enemy",
IsAI=1,
AI="NullAI",
IsMandatory=1,
AllyTeam=2,
}, {
Name="FriendlyAI",
IsAI=1,
AI="NullAI",
AllyTeam=2,
}
}
[/code]
Thoughts?