battlecode / galaxy

MIT License
10 stars 3 forks source link

Map order in tour runner gets broken somewhere #581

Open n8kim1 opened 1 year ago

n8kim1 commented 1 year ago

Apparently, even when the TournamentRound has matches in the right order, the matches get played out of order occasionally. TODO find an example, or even replicate.

Doesn't influence outcome of winner/loser of overall match, but does lessen quality of stream. Maps 1-3 are guaranteed to be played so we try to put our better map ideas for those early slots. Similarly, when maps get reused, they are reused as maps that are later in the set, for more interesting views.

n8kim1 commented 1 year ago

The culprit is likely that for a match object, .maps.all() isn't guaranteed to preserve order. We use it twice, here and here. We'll have to switch it to something else.

It's also possible that Saturn doesn't respect map order when it runs games. Haven't checked. Would need to test.

j-mao commented 1 year ago

I did check. The Match objects were generated with out-of-order maps when compared with the TournamentRound. Saturn order respects the shuffled Match objects.