Author Topic: Reworked Team Prefs / Selection  (Read 4836 times)

Offline VoiDeD

  • Full Admin
  • *****
  • Posts: 2,451
Reworked Team Prefs / Selection
« on: November 06, 2014, 05:29:49 pm »
So after reviewing the original ZF code for team selection, I've decided to completely rework how team prefs and team selection works in ZF. It used to be considerably busted and would leave players on the same team round after round in certain cases. So I've redesigned that entire bit of code.

Team selection works a little like this now:

1. All players will get placed into one of three buckets based on their team pref (if any): survivor, zombie, and none. Players without a pref are assigned the "none" bucket.

2. Team selection will alternate between picking one survivor and one zombie at a time. It will continue picking survivors and zombies until the survivor ratio is met, and the rest of the picks will be dedicated to zombies.

When selecting a survivor, there is first a random roll done to decide if a player should be chosen from the survivor bucket. The odds here are approximately 3 to 4 that someone with the survivor pref will get picked for the survivor team. This means that preferences aren't guaranteed, but instead just highly likely.

If the roll passes, a player from the survivor bucket is randomly chosen to be a survivor. If it doesn't pass, a player from the "none" bucket is chosen instead. If there are no players available from the survivor or none buckets (if all players have pref set to zombie, for example) then a random player must be chosen from the zombie bucket.

The same logic is then repeated for a single zombie selection (choosing from the zombie bucket instead of survivor, however).

Then the logic will repeat the survivor and zombie selection until enough survivors have been selected to fill the survivor ratio (currently 60%).

These changes should hopefully prevent players from getting stuck on the same team every round as it's considerably more random than what the ZF plugin had before.

If you still seem to find yourself getting stuck on the same team over and over, let me know as I may have introduced a bug in this implementation, and I'll be able to check against the team stats collection I introduced as well.
« Last Edit: November 06, 2014, 09:21:23 pm by VoiDeD »

Offline Lunacy

  • Member
  • *
  • Posts: 527
  • DAT RANGE
Re: Reworked Team Prefs / Selection
« Reply #1 on: November 06, 2014, 06:07:15 pm »
This should help.
Days would be just donators taking literally all the survivor slots and everyone else was just zombie the entire time.  It was very unlikely that a donator would end up starting zombie with survivor pref, but this will at least makes it a better preference than a garentee.
On Hiatus




Primarily running around Zombie Fortress, Freak Fortress, and occasionally Randomizer.


http://youtu.be/C90h1pbF1yY

Offline Reshy

  • Member
  • *
  • Posts: 9
Re: Reworked Team Prefs / Selection
« Reply #2 on: September 26, 2015, 07:49:03 pm »
If possible can the mod be setup to auto-assign your team preference based on what team you choose to join?  Eg.  If you just start a game and you choose survivors (even during a current round) your preference is set to survivors.  If are a survivor and you switch to zombie you are set to auto-pref to zombie.

There has been issues with players setting preference to Survivors and then switching to zombie during the setup phase or other times, skewing team balance.  I would recommend (if possible) that if you attempt to change team off survivor as a survivor that it doesn't let you, instead setting your preference to zombies.