Page MenuHomeWildfire Games

Gamesetup support to select team placement pattern
ClosedPublic

Authored by elexis on Jan 31 2020, 2:50 PM.

Details

Summary

The maps Ambush and Frontier support different kinds of player placement (radial, line, stronghold, random).
In #4110 it was proposed that the placement could be selected in the gamesetup.
This patch implements that.
The available player placement options are specified in the json file, so that it can be used for arbitrary values specified for the map.

Test Plan

Notice that there still is the bug where a CC is placed on the starting resources of a neighboring ally.
This should be fixed by placing all CCs first, and then the starting resources. (Ticket somewhere if Im not mistaken.)
Notice that the conditions for the patterns (teamCount, playerCount, mapSize) have been removed.
This is because I could not identify any reason for them being there except this described bug (which even occurs if those conditions are met).
Confirm that this patch implements the feature correctly and in a scalable way.
Notice that it doesn't break in Atlas by picking a random placement pattern, but doesn't provide the map specific dropdown.
Notice that Atlas copies all JSON properties from the map to the current object and persists them when selecting a different map,
which is broken for every setting that is optionally specified (for example DisabledTemplates, Garrison) already and can't be fixed or circumvented in this diff.

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

elexis created this revision.Jan 31 2020, 2:50 PM

Successful build - Chance fights ever on the side of the prudent.

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1686/display/redirect

This revision was not accepted when it landed; it landed in state Needs Review.Jan 31 2020, 10:26 PM
This revision was automatically updated to reflect the committed changes.
Owners added subscribers: Restricted Owners Package, Restricted Owners Package.Jan 31 2020, 10:26 PM
nani awarded a token.Feb 1 2020, 12:00 AM