Page 1 of 1

FFA Start Points - Info for map devs

Posted: 29 Mar 2014, 12:23
by Silentwings
BA contains a special mode for placing FFA start points.
This mode is triggered when both
(1) the "FFA Mode" modoption is set (it is set on all our FFA hosts)
(2) the map contains a /luarules/configs/ffa_startpoints.lua file
When triggered it overrides the usual options (i.e. random, choose in game, etc).

The effect of this is that maps can choose a different set of startpoints, dependent on the number of allyTeams spawned in the game.
Each allyTeam has a single startpoint. The commanders spawned in that allyTeam will be clustered around its startpoint.
The startpoints are randomly assigned to allyTeams by BAs spawning gadget.

The ffa_startpoints.lua file should contain a lua table of format:

Code: Select all

ffaStartPoints[numAllyTeamIDs][startPointNum] = {x,z}
ffaStartPoints[numAllyTeamIDs] should be a table with integer keys ranging from 1,...,numAllyTeamIDs.
The i-th value {x,z} of this table should be the x and z co-ordinates of the i-th startpoint to be used when there are numAllyTeamIDs allyteams in the game.

An example ffa_startpoints.lua file (containing only the cases for 1, 2 allyteams) is attached. Typically a FFA game in BA contains up to 16 allyTeams. For more examples, and a widget that autogenerates a matching lua-table/image for the startpoints, see http://imolarpg.dyndns.org/trac/balates ... %20example.

The table doesn't have to be hardcoded - it can be auto-generated and even have randomness. The ffa_startpoints file is included and executed as normal lua.

If there are i allyTeams in the game and the ffaStartPoints table is missing entry , or does not contain i elements, or if it is not present at all (including if the ffa_startpoints.lua file does not exist), then BA will just revert to normal spawning.

I am happy for other games to plunder the code and use the same system.

Re: FFA Start Points - Info for map devs

Posted: 29 Mar 2014, 12:33
by Beherith
Very nice, thanks. Ill have to update my FFA maps then.
Throne is due for a graphical overhaul anyway.

Edit: now that I think of it, Throne cant really be changed much (at least not wrt to the start point distributions). If you think otherwise, let me know!

Re: FFA Start Points - Info for map devs

Posted: 29 Mar 2014, 12:36
by Silentwings
Yeah, I think Throne is already pretty good in this respect - it is well designed to handle the restrictions of the old system. Dworld & others could benefit and I think this makes designing new well balanced ffa maps much easier. Maps could even use lua based metal spots that were differently placed to match the allyteam startpoints.

Another effect is that, if the map has ffa_startpoints.lua, in a Team FFA game each allyTeams coms will start clustered together on the startpoint of that allyTeam.

Re: FFA Start Points - Info for map devs

Posted: 07 Apr 2014, 14:18
by Silentwings
I have made the FFA map Emereld http://springfiles.com/spring/spring-maps/emereld as an example of how to use this system: http://springrts.com/phpbb/viewtopic.php?f=44&t=31913. The config can be easily extracted and modified for other maps.

It uses random startpoints as described above and also changes the metal map to match the startpoints used.

(It is probably not great as a ffa map!)

Re: FFA Start Points - Info for map devs

Posted: 06 Oct 2014, 11:17
by Silentwings
The next BA version (V8.01) will contain startpoint configs as described above for the four main FFA maps - Throne, Dworld, Mearth, and Blindside. These (along with any others added in the future) are used as a fallback if the map does not provide it's own.

If any FFA players or mapdevs would like config files to be made/included by us for other maps, please make a separate post in the BA forum requesting it. If any players find it produces a wtf startpoint configuration, please screenshot (since if it happens it is likely a typo in the config) and make a separate post in the BA forum.