Closed Nefertumm closed 2 years ago
Reading the code I don't see where you handled the case when:
player X is lvl 19
player Y is lvl 10
Y and X join BG
Y click on "enter battle", he will be in the weak or strong team?
X click on "enter battle" after Y
who will be in the weak team? and why? the teams are balanced?
If Y will be in the strong team and X in the weak one, consider this other case:
player Z is 10
player K is 15
K click on enter battle
Z click on enter battle after K
I expect that K goes to the weak team and Z in the strong one, but consider that Z and K decrease the current avgLevel of both factions, how your algorithm will behave in this scenario?
In your algorithm you are considering the avg level of the team, but you are not predicting who is joining, you are only consider the "current player" that is joining but not the next-one that is in queue
Regarding your first question: The players are the first to enter or after the hypothetical situation on the issue? In the hypothetical situation, the lvl 19 would go on the weak team and the teams would be balanced, because the algorithm tries to balance to the weaker team instead of the stronger team.
On the second part, this is how the algorithm would be behave, which is wrong because I don't check for people in queue also.
In order to fix this current issue, I will need to check the queue too, you're right :)
I'll update this after monday hopefully, I have finals coming.
While I was resting I was thinking about this problem, I tested the results with what you pointed and it worked. The logic can be improved so it wouldn't be so nested. Feel free to do it if you want, if not I'll do it after Monday.
I'll review the code and make some tests in these days, thanks!
Sorry, I could not test this :(. Did you test the scenario that I wrote?
Whats the status on this?
Only in-game testing needed for different scenarios like Helias pointed. I'll come back tomorrow from my holidays. I ran before a couple tests but it's a pretty big change to test alone due you'd have to test with a lot of chars simultaneously while having certain conditions.
hmm whats the worst that can happen?
Well, the worst that can happen can be unbalance :P
Use an algorithm based on averages. Closes #78