Gaming Zone > [MiA] Servers

VCTF - working on balancer

(1/5) > >>

Piglet:
As you may have seen as you joined the server recently, there's an alpha version of some code that isn't yet actually doing anything unless it's manually triggered.

The_cowboy's base code is here: https://github.com/ravimohan1991/Equalizer/tree/c1665627b7dcc682ee3d4a203fd83c0cafb4d78d

I've taken that and shoved in a load of debug and a few changes: Download from here

In summary what the code currently on the server does is:


* Track player achievements
* Save away those achievements to an external database - communication is server-server over http to a php backend
* On joining the server, for achievements are requested and sourced from the external database
I'm not 100% sure step 3 is working fully. I've seen times when data hasn't been requested/not received.

There is the beginning of ordering and preparation for team balancing at the start. The code sorts the players, currently by points scores per time period into what it thinks is a fair split.

There is code which is triggered from the map start which saves away what those teams would look like.


--- Code: ---2022-01-27 22:00:28 0 I would have balanced to team 0 Snoop (UA) : 283.00
2022-01-27 22:00:28 1 I would have balanced to team 1 ^Darkside- (CL) : 260.00
2022-01-27 22:00:28 2 I would have balanced to team 1 Yes (UK) : 238.00
2022-01-27 22:00:28 3 I would have balanced to team 0 notthc (HU) : 233.00
2022-01-27 22:00:28 4 I would have balanced to team 1 Rounin_Napoli (IT) : 231.00
2022-01-27 22:00:28 5 I would have balanced to team 0 Lòón (AR) : 182.00
2022-01-27 22:00:28 6 I would have balanced to team 1 Steve (UK) : 168.00
2022-01-27 22:00:28 7 I would have balanced to team 0 Meganoob (TR) : 163.00
2022-01-27 22:00:28 8 I would have balanced to team 1 maelman (CA) : 123.00
2022-01-27 22:00:28 9 I would have balanced to team 0 Teammate (BE) : 120.00
2022-01-27 22:00:28 10 I would have balanced to team 1 Risel (RU) : 119.00
2022-01-27 22:00:28 11 I would have balanced to team 0 cronix (HR) : 94.00
2022-01-27 22:00:28 12 I would have balanced to team 1 UR18 (DE) : 85.00
2022-01-27 22:00:28 13 I would have balanced to team 0 javiar (US) : 82.00
2022-01-27 22:00:28 14 I would have balanced to team 1 TRAINING_DAY (US) : 77.00
2022-01-27 22:00:28 15 I would have balanced to team 0 chris (US) : 35.00
2022-01-27 22:00:28 16 I would have balanced to team 1 Bluecat77 (US) : 29.00
--- End code ---

Next steps are:

1. Identify how to know a point just before map start, before players are spawned at which we can insert the logic to balance the teams. I've not yet looked for that place in the code. It's rather easier in Freon as that's its own gametype and you can add in anything you like right into the core of the game code.

2. Actually move the players between teams. The code in there looks right to me, but I think the test I ran yesterday ran foul of the "keep teams same size" mutator code which I've now removed from vctf. I also ran it after players spawned....which mean that some people got switched teams after spawning in what became the enemy base. One person was swapped whilst standing on what became an enemy manta!





Caracal:
Great! Thank you!

Is it possible to add to the balancer so that e.g. me and Hellfire are most probably in the same team? I mean, there are few players who use discord, and when we do, we always try to change to the same team.

Piglet:
Nah! The point of all of this is to balance out the teams. Not to load one team with the players that can work most efficiently together to win a game. If you want that then set up a clan and do clan wars. :D

The_Cowboy:
Thanks Piglet. My entire energy is engaged in this now.
I have created an issue https://github.com/ravimohan1991/Equalizer/issues/4. Feel absolutely free to unload yourself there or here.

Piglet:
Right. Another step forward.

I found a way to hook in to the point just before the players spawn at the start of the map by firing up a timer and watching the DeathMatch(level.game).startupStage variable. That's the one the game uses to track the start of game status changes - waiting, 3..., 2..., 1..., & over time. When it counts down....that's the time to do the balance; right before the spawn.

I'd hoped there would be an even there to hook on to. - but I couldn't see one.

The server should now be doing "start of game better than random" team allocation.

Time to remove lots of the debug and tidy.

Then to add in something to deal with uneven player count.

Navigation

[0] Message Index

[#] Next page

Go to full version