Page MenuHomeWildfire Games

[maps] don't sort playerIDs unnecessary
AbandonedPublicDraft

Authored by marder on Feb 19 2023, 9:59 AM.

Details

Reviewers
lyv
Summary

Often times sortAllPlayers() is used when the sorting isn't necessary at all and the intention is rather to just get the player IDs.
Especially true in playerPlacementRandom() where they are automatically sorted again.

therefore split the two functionalities.

Note that this only changes the playerPlacementRandom(sortAllPlayers()) combination, but there are probably other places as well, where sortAllPlayers() could be replaced by getPlayerIDs() but I don't want to check in each map if the sorting is actually intended or not. That may be done in the future.

Test Plan

confirm that nothing changes. Agree that the split makes sense.

Event Timeline

marder created this revision.Feb 19 2023, 9:59 AM
marder abandoned this revision.Mar 22 2023, 8:24 PM

meh - at the end the sorting ads no real overhead and it's kind of nice to know that the IDs are always sorted

meh - at the end the sorting ads no real overhead and it's kind of nice to know that the IDs are always sorted

imo I think it would be better to not sort when doing team placements, at least for the circle placements. It is common in multiplayer to use the game setup window to influence player positions. I think this approach is better than defining separate placement functions for grouped vs alternating Circle. For instance, since alternating circle is much less popular than grouped circle, it would produce some annoyance when using the 'random' team placement option. (referring to team placement options patches).