Challenge .ini documentation

For challenge discussions and reports
Post Reply
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Challenge .ini documentation

Post by aubergine »

I've made a brief start on trying to document the process for creating challenges, but have a gazillion questions:

https://warzone.atlassian.net/wiki/disp ... enge+Games

My questions are denoted with a blue (?) icon. If anyone knows any of the answers I'd much appreciate the info :)
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: Challenge .ini documentation

Post by Per »

maxPlayers has to be equal to map's number of players. This is a workaround for a game internal limitation, since that information is not readily available when challenges are loaded.

Name and map are mandatory.

For [player_N] sections, only team is mandatory. If it is not present, or no such section is present for a player, then that player slot is disabled. The default position for human player is position zero. Allow position change can override these positions. If the ai field is 'null' then no AI is loaded for that player (it has nothing to do with the 'extra' field below).

The [scripts] section allows you to load an extra script through the 'extra' field. This is useful eg if you want to have an extra script that does things without being loaded for each player. The 'rules' field allows you to load a different 'rules.js' for this challenge (ie the default 'rules.js' will not be loaded) -- it can be named something else than 'rules.js', though.
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: Challenge .ini documentation

Post by aubergine »

Thanks Per, that's filled in quite a few gaps in the docu :)

Some remaining questions through (I tried looking at the C++ code but struggled to understand it, sorry)...

[challenges] section:

* If "Difficulty" is not mandatory, what does it default to?
* What does "Bases" default to? -- if not defined, player can select
* What does "Power" default to? -- if not defined, player can select

[player_N] sections:

* What does "name" default to if not specified? I initially guessed the name property of an .ai file, however a) the "ai" property references the .js file and not an .ai file, and b) the "ai" property is optional.
* What happens if "position" not specified on an AI player? Does the player just take the next available start position on the map?
* Are positions 0- or 1-referenced? Most things in the ini seem to be 1-referenced, which is at odds with everything else in the game that seems to be 0-referenced.

[scripts] section:

* What player id does the 'extra' script run against? For example, what would the value of 'me' be in that script?
* Can you provide any examples of what an 'extra' script would be used for (I can't think of any but assume there must be a compelling reason for them)?
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: Challenge .ini documentation

Post by Per »

Difficulty in challenges section is actually mandatory. It is only used for informing the player how difficult the challenge is, though.

The name defaults to whatever the name the game usually gives to AIs. The challenge part of the code does not change it, nor should it be assumed to be any particular value by default.

I don't recall what happens if a position is not filled. Only one way to find out...

Positions are 1-referenced, for some reason.

Extra script, like campaign scripts, run as player zero, for no particular reason other than that is what wzscript campaign scripts did. Maybe it would make more sense to set 'me' to null or undefined, though? You'd typically use an extra script if you want to use the default rules.js, have standard AI scripts running on all players, and in addition have some events scripted specially for the challenge.
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: Challenge .ini documentation

Post by aubergine »

The JS API docs state that the "ai" property in challenge ini files should point to the .js file. How does the challenge know what the name of the AI is, if the "name" is not specified in the .ini file, if the AI is specified via it's .js file and not it's .ai file (the .ai file contains the name, not the .js)?

As for the "extra" script, that's a really cool feature now I understand it. You could define missions and all sorts of other things in there, effectively turning a challenge map in to something akin to a campaign level. In WZ 3.2 if there's that way of persisting data between games, it would mean that the challenge mode of WZ could be used to create custom campaigns (albeit with some rough edges). For that reason, I'd keep the "extra" script tied to player 0, I think it will open up lots of possibilities in WZ 3.2...
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: Challenge .ini documentation

Post by Per »

Good question. If you don't give them names, their names become "Nexus". No matter what AI is used. So I guess the name field should just be mandatory to reduce confusion.
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: Challenge .ini documentation

Post by aubergine »

Or make the "ai" field point to an .ai file (which provides the AI name) instead of a .js file? That way older vlo/slo AIs could be used as well by pointing to their .ai file.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: Challenge .ini documentation

Post by Per »

These player-specific scripts are not necessarily AIs in that sense. Pointing to the .ai file would be somewhat complicated for somewhat technical reasons.
Post Reply