Closed jauggy closed 3 months ago
Fixes #218
@badosu this pull request has less changes than the previous pull request but should give the same results.
Thank you! I'll check out when I'm able to
Tested with previous branch and it lgtm https://github.com/jauggy/teiserver/tree/add-balancemode-split-one-chevs default balance
$balancemode split_one_chevs
Same visual result with the branch of this PR
@badosu Given that fireball has tested, I think code review alone would be fine if you don't have a dev environment to test this.
However if you want to setup dev environment let me know if you have any issues with teiserver/spads setup. There's some docs here for SPADS.
Also there is not any documentation currently for launching multiple chobbies so let me know if you need that and I will create it.
@jauggy Just to be clear, I'm not the stakeholder for this project, and don't know who that would be.
That said, I want to have a more active role, unfortunately haven't had time to familiarize with the repo myself yet. As soon as I do I'll get back to here. (There are no blockers from me until I can confidently review a PR here)
As requested by Lexon, I'll be adding some unit tests to this PR in the next couple of days.
@L-e-x-o-n Tests have been added. I updated the documentation documents/guides/testing.md
which will give instructions on how to test just the balance tests.
I think the most important change here is the introduction of DB calls inside the create_balance
function. Seeing there is a timer System.system_time(:microsecond)
as well, that makes me think this function is somewhat time sensitive and I'm wary of making it not pure by introducing DB calls inside.
Thanks for the review @geekingfrog . Yeah you caught something that I also wasn't too happy about but at the time I wanted to write minimal code. Now that I have more spare time, I'll see if I can pull the db call outside.
@geekingfrog As requested, I've added the new changes to this PR
@geekingfrog if you do end up getting multi chobby working, I have some sample instructions for testing in the issue as well as a crude way of adding sample users.
After some unrelated struggles, I finally tested this branch as of 6422ac12d9b95597d9c59b6d1e30b61a208521df and it looks good.
Using the default balance algorithm:
#
And then, switching using $balancemode split_one_chevs
I get:
I think it's probably good to be shipped.
Problem
Games like this are unfair and it feels like the match is decided by the balancer. If one side has multiple new players and the other side has none, then if you're a semi-experienced player on the side of the new players you will feel the game is unwinnable.
This PR aims to provide an OPTIONAL balance mode that will make a better distribution of one chevs.
Test Steps and Full Details
To test this please see instructions in #218