Ryan6578 / Codewords

A LUA script for Codewords on Tabletop Simulator for Steam.
https://ryan6578.com
GNU General Public License v3.0
29 stars 16 forks source link

Minimal movement player shuffle with frame waits #93

Closed Canonelis closed 3 years ago

Canonelis commented 3 years ago

Conditions that haven't changed: -Players are seated from the bottom positioned colours to the top. -Teams are distributed evenly. -The two codemasters are assigned randomly to the red or blue teams -If there is only 1 or 0 players in the codemaster queue, it picks the other codemaster(s) at random. -It creates even teams. -Still waits 1 frame after changing a person's colour.

Changes: -Red team will always get the larger team if it is uneven.(other randomness makes this fair, but this can be changed) -It does not move people already in the correct seat. -It only has at most 1 person out of their seat at any given time. -With 10 players, averages 11 moves, best case is 0 moves(happens 1 in 10!), worst case is 15 moves(happens 1 in 4000).

Tested with 0, 1, 2 and 10 players seated. With 0, 1, 2 and more players in the codemaster queue. Tested with people in the codemaster queue who have since left. Tested stay and join for 0, 1, 2 and more people in the codemaster queue. Tested with codemaster queue disabled.