FAForever / FAForever/server

Improve anti-repetition to prefer repeating maps played longer ago

Open
#1,036 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
72
Forks
84
Avg merge
5h 11m
Merged PRs (30d)
1

Description

Sometimes there is no choice but to repeat a map. Currently the way that the repetition system works, how far back a map was played in the history is not taken into account. So it is possible to end up in a situation where the system can choose between a map that was played 1 game ago or a map that was played 2 games ago and will randomly pick with a 50/50 chance. In this situation it would be better to always pick the map that was played 2 games ago.

Probably the way to do this would be something like changing the Counter in `MapPool.choose_map` to count some arbitrary 'tokens' instead of counting occurrences. Then we can give more tokens to recently played maps than to maps played longer ago. Maybe some sort of exponential scale would work well for this. It goes a little crazy for large histories, but in practice our history is always length 2, and it is unlikely to be higher than that.

```
Maps played in chronological order:
----------------
A B C D

1 2 4 8
----------------
Tokens to count (2 ^ i)
```

I think it also does represent a player's desire to not be playing those maps pretty well, if you just played 10 games, you really don't want to repeat the last map, but you don't care at all about the map you played 10 games ago. The exponential scale captures that pretty well.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.