Forged Alliance Forever Forged Alliance Forever Forums 2017-11-04T21:41:44+02:00 /feed.php?f=42&t=15280 2017-11-04T21:41:44+02:00 2017-11-04T21:41:44+02:00 /viewtopic.php?t=15280&p=155960#p155960 <![CDATA[Re: prevent multiple ladder matches on the same map]]>
Code:
(map_id, map_name, map_path) = random.choice(self.game_service.ladder_maps)

game = LadderGame(self.game_service.createUuid(), self.game_service, self.game_stats_service)
self.game_service.games[game.id] = game

player1.game = game
player2.game = game

game.map_file_path = map_path



Almost all module functions depend on the basic function random(), which generates a random float uniformly in the semi-open range [0.0, 1.0). Python uses the Mersenne Twister as the core generator. It produces 53-bit precision floats and has a period of 2**19937-1. The underlying implementation in C is both fast and threadsafe. The Mersenne Twister is one of the most extensively tested random number generators in existence. However, being completely deterministic, it is not suitable for all purposes, and is completely unsuitable for cryptographic purposes.


You can see that it is in fact random. It is just as reasonable that you will get the same 2 maps over and over as it is for any other sequence of maps. There was talk about changing the system in the last dev conference, so that it will not select the map that each player played last. But of course then you could still get loki->badlands->loki->badlands->loki->badlands.....

It is just that one line of code in https://github.com/FAForever/server/blo ... service.py that chooses the maps. So anyone here could watch a couple python tutorials and change the algorithm. A simple solution would be to check the map that you played last and then pick the next one in the list, and if that happens to be the map your opponent played last, then pick the next one. Then you will never play the same map twice in a row and the games will be almost perfectly distributed among all the maps in the pool. The hard part is figuring out what map each player played last, but I imagine someone on Slack can tell you how to do it. Probably by just getting the last ladder reply for each player and checking what map it was on.

Statistics: Posted by ThomasHiatt — 04 Nov 2017, 21:41


]]>
2017-11-04T20:46:27+02:00 2017-11-04T20:46:27+02:00 /viewtopic.php?t=15280&p=155959#p155959 <![CDATA[Re: prevent multiple ladder matches on the same map]]>
Image

Statistics: Posted by Morax — 04 Nov 2017, 20:46


]]>
2017-10-13T07:42:00+02:00 2017-10-13T07:42:00+02:00 /viewtopic.php?t=15280&p=155172#p155172 <![CDATA[Re: prevent multiple ladder matches on the same map]]>
Erich von Manstein wrote:
I already wrote an algorithm about a year ago or so that selects a 12 map pool and selections are completely random. We all know what happened next...

You made a pull request on github so someone can review the code and then merge it?
You convinced the player councilor that a 12 map pool is the way to go?
Also 12 maps in the pool don't prevent you from getting the same map several times in a row. It just makes it less likely to occur.

Statistics: Posted by PhilipJFry — 13 Oct 2017, 07:42


]]>
2017-10-13T04:14:04+02:00 2017-10-13T04:14:04+02:00 /viewtopic.php?t=15280&p=155170#p155170 <![CDATA[Re: prevent multiple ladder matches on the same map]]> Statistics: Posted by Lieutenant Lich — 13 Oct 2017, 04:14


]]>
2017-10-13T00:26:47+02:00 2017-10-13T00:26:47+02:00 /viewtopic.php?t=15280&p=155167#p155167 <![CDATA[Re: prevent multiple ladder matches on the same map]]> Statistics: Posted by partymarty81 — 13 Oct 2017, 00:26


]]>
2017-10-06T17:32:04+02:00 2017-10-06T17:32:04+02:00 /viewtopic.php?t=15280&p=154945#p154945 <![CDATA[Re: prevent multiple ladder matches on the same map]]>

Statistics: Posted by Mephi — 06 Oct 2017, 17:32


]]>
2017-10-06T17:17:48+02:00 2017-10-06T17:17:48+02:00 /viewtopic.php?t=15280&p=154944#p154944 <![CDATA[prevent multiple ladder matches on the same map]]>
could a change be made to the map picking algorithm to prevent choosing the ladder maps that you or your opponent last played on?

Statistics: Posted by Evan_ — 06 Oct 2017, 17:17


]]>