OPEN SOURCING THE PIGSPN & BALANCER  (Read 25659 times)

zeus

  • Full MemberĀ 
  • *
  • Posts: 86
  • Country: um
OPEN SOURCING THE PIGSPN & BALANCER
« on: February 06, 2021, 19:45 »

There has been a discussion about fixing some problems potentially in both the balancer & pigSPN, however for that maybe open sourcing the source code could be useful

Thoughts? Github links?

Piglet

  • 1337
  • *
  • Posts: 3248
  • Country: gb
Re: OPEN SOURCING THE PIGSPN & BALANCER
« Reply #1 on: February 07, 2021, 13:28 »
The source for Freon is in the package you download. Feel free to let me know of any issues you see, and code to fix them.


Piano

  • Full MemberĀ 
  • *
  • Posts: 53
  • Country: hr
  • c'est faisant n'importe quoi qu'on devient n'impor
    • pianoserenity
Re: OPEN SOURCING THE PIGSPN & BALANCER
« Reply #2 on: February 07, 2021, 23:00 »
What is pigSPN?

Piglet

  • 1337
  • *
  • Posts: 3248
  • Country: gb
Re: OPEN SOURCING THE PIGSPN & BALANCER
« Reply #3 on: February 07, 2021, 23:37 »
I think he means 3SPNv3225PIG.u

hagis

  • 1337
  • *
  • Posts: 404
  • Country: gb
Re: OPEN SOURCING THE PIGSPN & BALANCER
« Reply #4 on: February 07, 2021, 23:38 »
3223 is on github https://github.com/mGm-Lizard/3SPNv3223

balancer is same really between that and mia vers

Piglet

  • 1337
  • *
  • Posts: 3248
  • Country: gb
Re: OPEN SOURCING THE PIGSPN & BALANCER
« Reply #5 on: February 08, 2021, 08:08 »
There are some changes that take into account how well each player is currently playing.


 I tried removing the bug which was stopping the logic intended to prevent the same player from being swapped team several times in the same match. It worked but it meant that each swap that would have picked them picked the next best player.... which completely messed up the teams.

When player numbers are low the balancer doesn't work well.

At higher player numbers it sometimes does not appear to always get the team ppr as close as it could do. That may be because it only swaps two players

hagis

  • 1337
  • *
  • Posts: 404
  • Country: gb
Re: OPEN SOURCING THE PIGSPN & BALANCER
« Reply #6 on: February 08, 2021, 18:51 »
the balancer does a good job on match start,. where things sometimes get confused is mid-match joins and leaves,. like you say perhaps it's to do with needing more than one swap to really sort it

I would say in general it works fine,. occasionally it doesn't but knowing the 'best' thing to do is sort of hard to do perfect programmatically

on SoL+HoC people (mostly admins) can move players between teams to help balance which is ok but I think actually the balancer generally gets close enough

Piglet

  • 1337
  • *
  • Posts: 3248
  • Country: gb
Re: OPEN SOURCING THE PIGSPN & BALANCER
« Reply #7 on: February 09, 2021, 10:39 »
The code has the option of forcing a recalculation whenever any player joins or leaves. We don't use that option as it could result in players getting moved every round.

However A CERTAIN UNNAMMED PLAYER WITH HIGH PPR regularly spectated at match start and then joined once the teams had been balanced. That meant that the game went from two balanced teams to one team having a VERY HIGH PPR PLAYER on it in addition - completely wiping out the balance in one move.

As a consequence I changed the code to do a recalculation of balance whenever a player with PPR over a certain threshold leaves or joins.

That works - however what we now see is the opposite impact when a very low PPR player joins the server. No balance action is triggered so now one team has a significant disadvantage.

We could change it it force a balance where a low PPR player joins or leaves - and only not balance when PPRs in a middle range join or leave - however it's really difficult to know how impactful that would be.

As things stand there's nearly always someone with admin rights on the server. They can trigger an attempt at re-balancing if they think it's needed. I don't know why sometimes that mid-game request seems to result in worse PPR averages than before the request. That shouldn't happen. Feel free to look at the code in the package to find out why.

Annihilator

  • Junior Member
  • *
  • Posts: 48
  • Country: hr
  • Kus on su raamat?
    • annihilatorsc
Re: OPEN SOURCING THE PIGSPN & BALANCER
« Reply #8 on: February 09, 2021, 14:12 »
The source for Freon is in the package you download. Feel free to let me know of any issues you see, and code to fix them.
True, and very much appreciated, but a GitHub repo would be highly beneficial regardless, IMHO.

Piglet

  • 1337
  • *
  • Posts: 3248
  • Country: gb
Re: OPEN SOURCING THE PIGSPN & BALANCER
« Reply #9 on: February 09, 2021, 14:14 »
I'm sure you're right. I just don't use it myself.

Annihilator

  • Junior Member
  • *
  • Posts: 48
  • Country: hr
  • Kus on su raamat?
    • annihilatorsc
Re: OPEN SOURCING THE PIGSPN & BALANCER
« Reply #10 on: February 09, 2021, 14:22 »
I'm sure you're right. I just don't use it myself.
VSCode + UScript Addon + GitHub Integration - a g00d and lightweight combination, simple to set up + use. Recommended.

Piglet

  • 1337
  • *
  • Posts: 3248
  • Country: gb
Re: OPEN SOURCING THE PIGSPN & BALANCER
« Reply #11 on: February 09, 2021, 15:45 »
Notepad++

Blub

  • Sr. Member
  • *
  • Posts: 105
  • Country: de
Re: OPEN SOURCING THE PIGSPN & BALANCER
« Reply #12 on: February 09, 2021, 20:10 »

However A CERTAIN UNNAMMED PLAYER WITH HIGH PPR regularly spectated at match start and then joined once the teams had been balanced. That meant that the game went from two balanced teams to one team having a VERY HIGH PPR PLAYER on it in addition - completely wiping out the balance in one move.


I WONDER WHO THAT UNNAMED PLAYER WAS  ;D

Stealer

  • 1337
  • *
  • Posts: 296
  • Country: gb
    • 76561197992159424
    • StealerNinja
Re: OPEN SOURCING THE PIGSPN & BALANCER
« Reply #13 on: February 09, 2021, 21:05 »

However A CERTAIN UNNAMMED PLAYER WITH HIGH PPR regularly spectated at match start and then joined once the teams had been balanced. That meant that the game went from two balanced teams to one team having a VERY HIGH PPR PLAYER on it in addition - completely wiping out the balance in one move.


I WONDER WHO THAT UNNAMED PLAYER WAS  ;D

Thought it might be me, till I read the high PPR bit  :'(
Stealer.T32

Veica

  • 1337
  • *
  • Posts: 724
  • Country: ca
  • \m/
    • xS0NARx
    • VeicaNoriceia
Re: OPEN SOURCING THE PIGSPN & BALANCER
« Reply #14 on: February 10, 2021, 23:35 »
That works - however what we now see is the opposite impact when a very low PPR player joins the server. No balance action is triggered so now one team has a significant disadvantage.

Hey c'mon man, you can use my name y'know!
Previously known as: xS0NARx, Njordr, Latte, or whatever the "name of the week" was.