cRPG

cRPG => Suggestions Corner => Topic started by: Vanthor on February 20, 2014, 07:49:25 pm

Title: Proposed change to team-balance algorithim
Post by: Vanthor on February 20, 2014, 07:49:25 pm
http://en.wikipedia.org/wiki/Simulated_annealing (http://en.wikipedia.org/wiki/Simulated_annealing) to find a good state of balanced teams.
Why simulated annealing?

Heres is the proposed algorithm in English, as plain as I can make it.
(click to show/hide)


And here's the algorithm as directly lifted from wikipedia, because its probably implemented right.
(click to show/hide)

In order to make the work we need to define a few variables and functions.

(click to show/hide)
s0
  A state where the number of players on each team is roughly equal and all players with the same banner are on the same team.

neighbor(s)
  In order to change states, the balancer should swap a player on one team with a player on the opposite team.

E(s)
This is the hard one. We need to take a few things into account when calculating the energy level, so I propose splitting it into several sub functions to make it easier.

So, our naive energy function looks like :

function e(s)
  energy ← 0
  energy ← energy + teamSizeEnergy(s)
  energy ← energy + teamBannerEnergy(s)
  energy ← energy + teamSkillEnergy(s)
  energy ← energy + teamClassEnergy(s)
  return energy
end


teamSizeEnergy(s)
 This one should be pretty easy. Our worst case is everyone is on the same team, our best case is that the teams are completely balanced.


function teamSizeEnergy(s)
  energy ← 0
  energy ← absoluteValue(s.team1.numPlayers - s.team2.numPlayers)/s.totalPlayers
  return energy
end


teamBannerEnergy(s)
   This is a little trickier. Our best case scenario is that all players are on the same team as players that share their banner. But whats the worst case? Is it half on one team, half on the other? If theres only two people with a banner, that split would suck. But is it just as bad if there are 10 people with the banner? Suggestions would be welcome.

teamSkillEnergy(s)
 This one should be pretty easy. Out worst case is that all the high skill players are on one team and all low skill players are on the other. Our best case is that both team have an equal amount of skill on them. The hard part is determining a players skill. The best system (that I know of) to do this is TrueSkill. It is much better for a battle/siege scenario than ELO. http://research.microsoft.com/en-us/projects/trueskill/ (http://research.microsoft.com/en-us/projects/trueskill/). However, any reasonably useful abstract ranking would be sufficient.


function teamSkillEnergy(s)
  energy ← 0
  energy ← absoluteValue(s.team1.totalSkill - s.team2.totalSkill)/s.totalSkill
  return energy
end


teamClassEnergy(s)
  This one will take some work, and any suggestions would be appreciated. Programmatically determining a players class is not as easy as it looks at first glance. For instance, if someone only has archery skill, its pretty easy to see they are an archer. But what if they have 3 riding skill and use a horse? Are they a horse archer? A normal archer? Ill come back to this one at a later date.

So how do we know this will work?
You don't. But you don't need a full implementation to check if it will work. If enough data is stored from past battles (Player skill, class, banner) you can apply the energy function to historical data. It will, at the very least, predict when the teams are heavily unbalanced. With some tweaking it could probably even tell you which team is more likely to win. If it can accurately predict which rounds are unbalanced (Or better yet,which team will win), then it can probably do a good job
balancing the teams in its own right.

So we tried it against some historical data, and it sucks. What gives?
I said it would require tweaking. Right now each of the energy sub functions returns a value between 0 and 1. So that means that banner balance is just as important as skill balance as far as the algorithm is concerned, and it probably shouldn't be. Some of those function might need to be weighted, or switched from returning a linear curve to an exponential or logarithmic curve. As I said, it will need to be tweaked and run against historical data.

So why do you care so much about class?
Because it sucks when 80% of the archers are on one team and they won't stop defending. It sucks when 80% of the cavalry are on one team and your cav is too dead or scared to chase them off. I believe a good balancer should take this into account.

So whats next?
Well, any input you have would be greatly appreciated (especially if its on determining class & class balance). Better yet, if we can managed to scrounge up some data, I will implement it myself and see how well it does. Hell, I'll write a web app that will let you tweak those values yourself, run it against any data I can scrounge up, and tell you how well it worked. That way anyone car try and and come up with an optimal solution.

So how can I help?

I'll be posting any data I find myself, incase anyone else finds it useful.[/list]
Title: Re: Proposed change to team-balance algorithim
Post by: Vanthor on February 20, 2014, 07:50:28 pm
Class/build
(click to show/hide)
Title: Re: Proposed change to team-balance algorithim
Post by: Sniger on February 20, 2014, 07:53:39 pm
hardcore.

will prep a .zip for ya
Title: Re: Proposed change to team-balance algorithim
Post by: Kafein on February 20, 2014, 08:11:57 pm
Lots of text for something in the end relatively simple (and to be honest quite mainstream in this kind of problem). I mean I know it would work very nicely but you could present it more succinctly. For example you should remove all the physics analogies, they serve no purpose.

I'm also quite sure the dev team has people qualified enough to come up with good optimizers already. The real problem here isn't the algorithm, but it's the definition of what is a set of balanced teams. It's your energy function.
Title: Re: Proposed change to team-balance algorithim
Post by: Vanthor on February 20, 2014, 08:32:27 pm
Thanks for the input Kafein, I'll see what I can do to re-arrange it so the energy function piece more prominent / succinct.
Title: Re: Proposed change to team-balance algorithim
Post by: Sniger on February 20, 2014, 08:33:14 pm
i think it was real awesome post sure i had to read alot but i like details and stuff

everyone is not a programming guru like kaf  :twisted:
Title: Re: Proposed change to team-balance algorithim
Post by: Elindor on February 20, 2014, 08:50:05 pm
Wow, that's very thought out...

Here's what I would say. 
Whether the dev team has the knowhow is one thing, but bottom line is - THE BALANCE SYSTEM SUCKS AND HAS SUCKED AND IS PROBABLY THE BIGGEST DETERENT OF THIS GAME so them having the knowhow is irrelevant really...maybe they do need a good suggestion?

I am not 100% sure that "class balance" is really as important a factor as just plain old BALANCING of a player's score/kdr, whether that is derived from his current performance or a combo of current and overall stats that the server keeps. 

------

BIGGEST ISSUE which should be rather simple to change is the following:
When a clan stack is going strong, the balancer will often STILL give good, well performing players to that side.

Let's consider a scenario that you might see quite often in game:
- A clan stacked team is winning 3-0 and the top half of their team has scores like 11/1, 8/2, 5/1 and many scores in the 100's.
- Meanwhile the other team has lost all the rounds that map, it's top half of the team has kdrs like 5/2, 4/3, 3/3 and scores in the 50's or so. 

In this situation, it has to keep the banner stack together, but shouldn't it give any "free agent or small clan" that is doing well to the OTHER TEAM?  And yet, it does not. 
This seems insane to me and it kills gameplay....

** WHETHER ITS FROM A STACK OR NOT - The end result of a map should be that the top half of the scoreboard should look RELATIVELY similar as far as kdrs/scores **
Doesn't have to be exact, but the current results (similar to the scenario I posted above) are so obviously one sided.  If this were fixed you would see a lot more close matches instead of so many steamrolls.
Title: Re: Proposed change to team-balance algorithim
Post by: Vanthor on February 20, 2014, 08:58:38 pm

BIGGEST ISSUE which should be rather simple to change is the following:
When a clan stack is going strong, the balancer will often STILL give good, well performing players to that side.

Let's consider a scenario that you might see quite often in game:
- A clan stacked team is winning 3-0 and the top half of their team has scores like 11/1, 8/2, 5/1 and many scores in the 100's.
- Meanwhile the other team has lost all the rounds that map, it's top half of the team has kdrs like 5/2, 4/3, 3/3 and scores in the 50's or so. 

In this situation, it has to keep the banner stack together, but shouldn't it give any "free agent or small clan" that is doing well to the OTHER TEAM?  And yet, it does not. 
This seems insane to me and it kills gameplay....
I think everyone's seen that happen. Thats why I included

The Balancer code has access to a useful number that abstracts a players "skill / worth" to the team (I'm at work right now, but I recall seeing a number in the log showing the points each team has after a round)

in the lists of assumptions I was making.  I know that the server calculates some kind of skill/worth value for every player, but I have no idea how its calculated or how useful it is. It doesn't really matter what system your using to balance teams if they rely on a bogus skill value.
Title: Re: Proposed change to team-balance algorithim
Post by: Jona on February 21, 2014, 12:46:44 am
I was playing late-night (read: really early morning) battle last night, with only 5v5 or 6v6ish for a while. The balancer put the two top players on the same team after round 1. They each had more score than every player on the entire enemy team combined. The thing is, they weren't even in the same clan, so there was no reason they should be put together. The total score of the two teams after one round was about 16 points vs 60. Makes sense, right?

The thing is, this isn't a problem limited to low-pop servers. It is just far more noticeable and easier to point out the flaws in the system when you can count up the total scores of each team in a matter of seconds.
Title: Re: Proposed change to team-balance algorithim
Post by: korppis on February 21, 2014, 08:48:42 am
teamBannerEnergy(s)
   This is a little trickier. Our best case scenario is that all players are on the same team as players that share their banner. But whats the worst case? Is it half on one team, half on the other? If theres only two people with a banner, that split would suck. But is it just as bad if there are 10 people with the banner? Suggestions would be welcome.

Splitting would suck unless that banner is too dominant in numbers. Say, 10 with same banner is not a problem if there's 80 players, but it can be a problem if there's only 30. Do we really have to calculate banner energy if they're less than x% of population and there's enough people to balance around? I wouldn't even mind slight class unbalance versus splitting banners.

teamClassEnergy(s)
  This one will take some work, and any suggestions would be appreciated. Programmatically determining a players class is not as easy as it looks at first glance. For instance, if someone only has archery skill, its pretty easy to see they are an archer. But what if they have 3 riding skill and use a horse? Are they a horse archer? A normal archer? Ill come back to this one at a later date.

It doesn't have to be so accurate.

No matter the melee/archery proficiency, if the player has 4 or less in riding, it doesn't really change anything. Those lower tier horses are crap and he'd turn slow, so why even count that? But if he has 6 or so, those heavier horses start to make difference.

Also, is it really worth sorting HA from other cav? Why not just keep balancing mounted as a whole?

Same with weapon wpf, hybrids with less than 100 in some skill hardly make a difference.
Title: Re: Proposed change to team-balance algorithim
Post by: zagibu on February 21, 2014, 10:16:56 am
Here is the current team balance code, feel free to modify it directly:

Someone asked for the team balance code, here it is, prepare to grease your scroll wheels:

Code: [Select]
#script_cf_crpg_autobalance
("cf_crpg_autobalance", [
(multiplayer_is_server),
(store_script_param, ":type", 1),
#(display_message, "@AB called"),
#(assign, reg1, ":type"),
#(server_add_message_to_log, "@new autobalance start, type:{reg1}"),
(store_script_param, ":param", 2),
(assign, ":switch_player_no", -1),
(try_begin),
(eq, ":type", 0), #type0 = shuffle teams
#check if autobalance is set to 2 - sort by banners
(eq, "$g_multiplayer_auto_team_balance_limit", 2),
(assign, ":type", 3),
(else_try),
(eq, ":type", 1), #type1 = balance teams, in favor of :team_favor
(assign, ":team_favor", ":param"),
#team favor:
#-1 = no team favor
#0 = favor team 0
#1 = favor team 1
(else_try),
(eq, ":type", 2), #type2 = switch player :switch_player_no
#(display_message, "@Type: 2"),
(assign, ":switch_player_no", ":param"),
(assign, ":switch_player_score", -1),
(store_script_param, ":param2", 3),
(assign, ":force_switch", ":param2"),
(try_end),
##calculate the current team levels
(try_begin),
#(this_or_next|eq, ":type", 1), #balance
#(eq, ":type", 2), #switch player
(assign, ":level_team_0", 0),
(assign, ":level_team_1", 0),
(assign, ":player_team_0", 0),
(assign, ":player_team_1", 0),
(assign, ":kd_team_0", 0),
(assign, ":kd_team_1", 0),
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 0, ":num_players"), #t_player1
(store_add, ":slot_index", ":player_no", multi_data_player_index_list_begin),
(troop_set_slot, "trp_multiplayer_data", ":slot_index", 0),
(try_begin),
(player_is_active, ":player_no"),
(ge, ":player_no", 0),
(player_get_team_no, ":player_team", ":player_no"),
(is_between, ":player_team", 0, 2), #make sure he is no spec
(troop_set_slot, "trp_multiplayer_data", ":slot_index", 1),
(call_script, "script_cf_crpg_autobalance_get_level", ":player_no"),
(assign, ":player_score_plus_death", reg0),
(try_begin),
(eq, ":switch_player_no", ":player_no"),
(assign, ":switch_player_score", reg0),
(try_end),
(try_begin),
(eq, ":player_team", 0),
(neq, ":switch_player_no", ":player_no"), #do not take the switcher player into calc
(val_add, ":player_team_0", 1),
(val_add, ":level_team_0", ":player_score_plus_death"),
(store_add, ":cur_troop", "trp_player0_multiplayer", ":player_no"),
(ge, ":cur_troop", 0),
(troop_get_slot, ":kd", ":cur_troop", slot_troop_crpg_kd_ratio),
(val_add, ":kd_team_0", ":kd"),
(else_try),
(eq, ":player_team", 1),
(neq, ":switch_player_no", ":player_no"),
(val_add, ":player_team_1", 1),
(val_add, ":level_team_1", ":player_score_plus_death"),
(store_add, ":cur_troop", "trp_player0_multiplayer", ":player_no"),
(ge, ":cur_troop", 0),
(troop_get_slot, ":kd", ":cur_troop", slot_troop_crpg_kd_ratio),
(val_add, ":kd_team_1", ":kd"),
(try_end),
(try_begin),
(neq, ":player_score_plus_death", 0), #dont disable the slot by accident
(neq, ":player_score_plus_death", -1),
(troop_set_slot, "trp_multiplayer_data", ":slot_index", ":player_score_plus_death"),
(try_end),
(try_end),
(try_end), #t_player1_end = this checked for levels and assigned each player his value
(try_end),
(assign, "$ab_score_team_0", ":level_team_0"),
(assign, "$ab_score_team_1", ":level_team_1"),
(assign, reg9, -3),
(neq, "$g_multiplayer_auto_team_balance_limit", 0), #if it's 0, return false, then the player selection is used
(neq, "$g_multiplayer_auto_team_balance_limit", 3), #if it's 3, return false, then the player selection is used
(neq, "$g_multiplayer_game_type", multiplayer_game_type_defend_the_village), #don't do any AB in dtv
(assign, ":do_autobalance", 1), #start with assigned autobalance
(try_begin),
(eq, ":type", 1), #type1 = balance teams, in favor of :team_favor
#one team should be in favor - check if the favored team has less level
(try_begin),
(eq, ":team_favor", 0),
(ge, ":level_team_0", ":level_team_1"), #if level0 > #level1 skip autobalance
(assign, ":do_autobalance", 0),
(else_try),
(eq, ":team_favor", 1),
(ge, ":level_team_1", ":level_team_0"), #if level1 > #level0 skip autobalance
(assign, ":do_autobalance", 0),
(try_end),
(try_end),
(try_begin),
(eq, ":type", 2), #type2 = switch player :switch_player_no
(assign, ":do_autobalance", 0), #stop autobalance here, because it's done inside this
#check if the player in question is on the lower leveled team already
(player_get_team_no, ":player_team", ":switch_player_no"),
#(display_message, "@Type 2 AB"),
(try_begin),
(eq, ":player_team", 0),
(gt, ":level_team_0", ":level_team_1"), #if level0 > #level1 do moving
(assign, reg9, 1),
(try_begin),
(eq, ":force_switch", 1),
(call_script, "script_crpg_switch_player_team", ":switch_player_no", 1),
(try_end),
(val_add, "$ab_score_team_1", ":switch_player_score"),
(else_try),
(eq, ":player_team", 1),
(gt, ":level_team_1", ":level_team_0"), #if level1 > #level0 do moving
(assign, reg9, 0),
(try_begin),
(eq, ":force_switch", 1),
(call_script, "script_crpg_switch_player_team", ":switch_player_no", 0),
(try_end),
(val_add, "$ab_score_team_0", ":switch_player_score"),
(else_try),
#he's a spec
(try_begin), #team-switch disable in siege
(player_get_slot, ":player_previous_team", ":switch_player_no", slot_player_crpg_last_team),
(is_between, ":player_previous_team", 0, 2),
(eq, "$g_multiplayer_game_type", multiplayer_game_type_siege),
#(eq, "$g_multiplayer_game_type", multiplayer_game_type_battle),
#(display_message, "@Previous team is 0 or 1"),
(try_begin),
(eq, ":player_previous_team", 0),
(assign, reg9, 0),
#(call_script, "script_crpg_switch_player_team", ":switch_player_no", 0),
(player_set_team_no, ":switch_player_no", 0),
#(display_message, "@Moving player to team 0"),
(val_add, "$ab_score_team_0", ":switch_player_score"),
(else_try),
(eq, ":player_previous_team", 1),
(assign, reg9, 1),
#(call_script, "script_crpg_switch_player_team", ":switch_player_no", 1),
(player_set_team_no, ":switch_player_no", 1),
#(display_message, "@Moving player to team 1"),
(val_add, "$ab_score_team_1", ":switch_player_score"),
(try_end),
(else_try),
(ge, ":level_team_1", ":level_team_0"), #if level1 > #level0 do moving
(assign, reg9, 0),
(try_begin),
(eq, ":force_switch", 1),
(call_script, "script_crpg_switch_player_team", ":switch_player_no", 0),
(try_end),
(val_add, "$ab_score_team_0", ":switch_player_score"),
(else_try),
(assign, reg9, 1),
(try_begin),
(eq, ":force_switch", 1),
(call_script, "script_crpg_switch_player_team", ":switch_player_no", 1),
(try_end),
(val_add, "$ab_score_team_1", ":switch_player_score"),
(try_end),
(try_end),
(try_end),
(try_begin),
#current situation:
#if type = 0, autobalance = 1
#if type = 1, autobalance = 1 if teams are unfair
#if type = 2, autobalance = 0, player got moved already
(eq, ":do_autobalance", 1),
(assign, ":new_level_0", 0),
(assign, ":new_level_1", 0),
(try_begin),
(eq, ":type", 3), #3(by banners) is very special and checked separately
#a) get all different banners, sort them in b array
(try_for_range, ":array", crpg_banner_number_start, crpg_banner_number_end*2),
(troop_set_slot, "trp_temp_array_a", ":array", 0), #a = if the banner exists or not
(troop_set_slot, "trp_temp_array_b", ":array", 0), #b = the score of the banner
(try_end),
(store_add, ":level_score_halfed", ":level_team_0", ":level_team_1"),
(store_div, ":level_score_halfed_regulars", ":level_score_halfed", 9),
(val_div, ":level_score_halfed", 3),
(try_for_range, ":player_no", 0, ":num_players"), #t_player2
(player_is_active, ":player_no"),
(store_add, ":slot_index", ":player_no", multi_data_player_index_list_begin),
(neg|troop_slot_eq, "trp_multiplayer_data", ":slot_index", 0),
(neg|troop_slot_eq, "trp_multiplayer_data", ":slot_index", -1),
(player_get_banner_id, ":banner", ":player_no"),
(try_begin),
(le, ":banner", -1),
(store_random_in_range, ":banner", crpg_banner_number_start, crpg_banner_number_end),
(try_end),
(troop_get_slot, ":rank", "trp_temp_array_b", ":banner"),
(troop_get_slot, ":player_value", "trp_multiplayer_data", ":slot_index"),
(try_begin),
(is_between, ":banner", crpg_banner_number_start, crpg_banner_number_end),
(assign, ":score", ":level_score_halfed_regulars"),
(else_try),
(assign, ":score", ":level_score_halfed"),
(try_end),
(val_add, ":rank", ":player_value"),
(try_begin),
(ge, ":rank", ":score"),
#security mechanism - if one side has more than 50% power, split them
#(val_add, ":banner", 1), #just take the next banner, doesn't matter
(store_random_in_range, ":banner", crpg_banner_number_start, crpg_banner_number_end), #this is better
(troop_get_slot, ":rank", "trp_temp_array_b", ":banner"),
(val_add, ":rank", ":player_value"),
(try_end),
(troop_set_slot, "trp_temp_array_a", ":banner", 1),
(troop_set_slot, "trp_temp_array_b", ":banner", ":rank"),
(player_set_slot, ":player_no", slot_player_crpg_ab_banner, ":banner"),
(try_end),
(try_for_range, ":banner_id", crpg_banner_number_start, crpg_banner_number_end*2),
(troop_get_slot, ":rank", "trp_temp_array_b", ":banner_id"),
(gt, ":rank", 100),
(assign, ":power", 1),
(set_fixed_point_multiplier, 10000),
(convert_to_fixed_point, ":power"),
(convert_to_fixed_point, ":rank"),
(val_mul, ":power", 11),
(val_div, ":power", 10), #result: 1.1
(store_pow, ":tmp", ":rank", ":power"),
(assign, ":rank", ":tmp"),
(convert_from_fixed_point, ":rank"),
(troop_set_slot, "trp_temp_array_b", ":banner_id", ":rank"),
(try_end),
#(assign, ":assign_players_to_team", 0),
#b) loop through banners, get the one with the highest number
(try_for_range, ":banner_id", crpg_banner_number_start, crpg_banner_number_end*2),
(troop_slot_eq, "trp_temp_array_a", ":banner_id", 1),
(assign, ":selected_banner_id", -1),
(assign, ":selected_banner_score", -1),
(try_for_range, ":ranking_banner_id", crpg_banner_number_start, crpg_banner_number_end*2),
(neg|troop_slot_eq, "trp_temp_array_b", ":ranking_banner_id", 0),
(troop_get_slot, ":rank", "trp_temp_array_b", ":ranking_banner_id"),
(ge, ":rank", ":selected_banner_score"),
(assign, ":selected_banner_score", ":rank"),
(assign, ":selected_banner_id", ":ranking_banner_id"),
(try_end),
(gt, ":selected_banner_id", -1), #it's valid
(troop_set_slot, "trp_temp_array_b", ":selected_banner_id", 0), #removed from the loop pool
#b2) select the proper team:
(try_begin),
(eq, ":new_level_0", 0),
(eq, ":new_level_1", 0),
(store_current_scene, ":cur_scene"), #assign the start team randomly, based on scene nr
(store_mod, ":assign_players_to_team", ":cur_scene", 2),
(else_try),
(gt, ":new_level_1", ":new_level_0"),
(assign, ":assign_players_to_team", 0),
(else_try),
(assign, ":assign_players_to_team", 1),
(try_end),
#c) highest banner selected, switch all players of this banner to team
(try_for_range, ":player_no", 0, ":num_players"), #t_player2
(player_is_active, ":player_no"),
(store_add, ":slot_index", ":player_no", multi_data_player_index_list_begin),
(neg|troop_slot_eq, "trp_multiplayer_data", ":slot_index", 0),
(neg|troop_slot_eq, "trp_multiplayer_data", ":slot_index", -1),
#(player_get_banner_id, ":banner", ":player_no"),
#banner can now be overridden:
(player_get_slot, ":banner", ":player_no", slot_player_crpg_ab_banner),
(eq, ":banner", ":selected_banner_id"),
(troop_get_slot, ":value", "trp_multiplayer_data", ":slot_index"),
(troop_set_slot, "trp_multiplayer_data", ":slot_index", 0), #removed from the loop pool
(try_begin),
(eq, ":assign_players_to_team", 0),
(val_add, ":new_level_0", ":value"),
(else_try),
(eq, ":assign_players_to_team", 1),
(val_add, ":new_level_1", ":value"),
(try_end),
(player_get_team_no, ":curr_team", ":player_no"),
(try_begin),
(neq, ":curr_team", ":assign_players_to_team"),
(call_script, "script_crpg_switch_player_team", ":player_no", ":assign_players_to_team"),
(try_end),
(try_end),
(try_end),
(assign, "$ab_score_team_0", ":new_level_0"),
(assign, "$ab_score_team_1", ":new_level_1"),
(try_end),
(neq, ":type", 3), #3(banners) is very special and checked before, fail if done
(try_for_range, ":unused", 0, ":num_players"), #t_player1
(player_is_active, ":unused"),
(assign, ":max_score_plus_death", -30000030),
(assign, ":max_score_plus_death_player_no", -1),
(try_for_range, ":player_no", 0, ":num_players"), #t_player2
(player_is_active, ":player_no"),
(store_add, ":slot_index", ":player_no", multi_data_player_index_list_begin),
(neg|troop_slot_eq, "trp_multiplayer_data", ":slot_index", 0),
(neg|troop_slot_eq, "trp_multiplayer_data", ":slot_index", -1),
(troop_get_slot, ":value", "trp_multiplayer_data", ":slot_index"),
(try_begin),
(eq, ":type", 0), #check if it's shuffle command
(gt, ":value", ":max_score_plus_death"),
(assign, ":max_score_plus_death", ":value"),
(assign, ":max_score_plus_death_player_no", ":player_no"),
(else_try),
(eq, ":type", 1), #check if it's autobalance command
(neg|troop_slot_eq, "trp_multiplayer_data", ":slot_index", 0), #wasnt moved yet
#calculate the team diff
(store_sub, ":level_diff", ":level_team_0", ":level_team_1"),
#divide by 2
(val_div, ":level_diff", 2),
(try_begin),
(gt, ":level_diff", 0), #team0 has higher level
(assign, ":from_team", 0),
(else_try),
(lt, ":level_diff", 0), #team1 has higher level
(val_abs, ":level_diff"),
(assign, ":from_team", 1),
(else_try),
(assign, ":from_team", -1),
(try_end),
#get team
(player_get_team_no, ":player_team", ":player_no"),
(eq, ":player_team", ":from_team"),
(val_sub, ":level_diff", ":value"),
(ge, ":level_diff", 0),
(this_or_next|eq, ":max_score_plus_death", -30000030),
(lt, ":level_diff", ":max_score_plus_death"),
(assign, ":max_score_plus_death", ":level_diff"),
(assign, ":max_score_plus_death_player_no", ":player_no"),
(try_end),
(try_end), #t_player2
#here we now have the highest player
(try_begin),
(eq, ":type", 0), #check if it's shuffle command
(ge, ":max_score_plus_death_player_no", 0),
(store_add, ":slot_index", ":max_score_plus_death_player_no", multi_data_player_index_list_begin),
(troop_get_slot, ":value", "trp_multiplayer_data", ":slot_index"),
(assign, reg8, ":value"),
(assign, ":value", ":max_score_plus_death"),
(assign, reg12, ":value"),
(troop_set_slot, "trp_multiplayer_data", ":slot_index", 0), #removed from the loop pool
(player_get_team_no, ":curr_team", ":max_score_plus_death_player_no"),
(try_begin),
(gt, ":new_level_0", ":new_level_1"),
(assign, reg9, 1),
(val_add, ":new_level_1", ":value"),
#checking if he is on the right team
(try_begin),
(neq, ":curr_team", 1),
(call_script, "script_crpg_switch_player_team", ":max_score_plus_death_player_no", 1),
(try_end),
(else_try),
(val_add, ":new_level_0", ":value"),
(assign, reg9, 0),
#checking if he is on the right team
(try_begin),
(neq, ":curr_team", 0),
(call_script, "script_crpg_switch_player_team", ":max_score_plus_death_player_no", 0),
(try_end),
(try_end),
#(str_store_player_username, s1, ":max_score_plus_death_player_no"),
#(assign, reg15, ":new_level_0"),
#(assign, reg16, ":new_level_1"),
#(assign, reg17, ":curr_team"),
#(server_add_message_to_log, "@autobalanceshuffle: player:{s1}, value:{reg12}, checkvalue:{reg8},  team:{reg9}[old:{reg17}], {reg15}:{reg16}"),
(try_end),
(try_begin),
(eq, ":type", 1), #check if it's autobalance command
(ge, ":max_score_plus_death_player_no", 0),
(store_add, ":slot_index", ":max_score_plus_death_player_no", multi_data_player_index_list_begin),
(troop_get_slot, ":value", "trp_multiplayer_data", ":slot_index"),
(assign, reg2, ":value"),
(str_store_player_username, s1, ":max_score_plus_death_player_no"),
#(server_add_message_to_log, "@autobalance: player:{s1}, value:{reg2}"),
(troop_set_slot, "trp_multiplayer_data", ":slot_index", 0), #removed from the loop pool
(player_get_team_no, ":player_team", ":max_score_plus_death_player_no"),
(try_begin),
(eq, ":player_team", ":from_team"),
(eq, ":player_team", 0),
(val_add, ":level_team_1", ":value"),
(val_sub, ":level_team_0", ":value"),
(call_script, "script_crpg_switch_player_team", ":max_score_plus_death_player_no", 1),
(else_try),
(eq, ":player_team", ":from_team"),
(eq, ":player_team", 1),
(val_add, ":level_team_0", ":value"),
(val_sub, ":level_team_1", ":value"),
(call_script, "script_crpg_switch_player_team", ":max_score_plus_death_player_no", 0),
(try_end),
(try_end),
(try_end),
(try_begin),
(eq, ":type", 0),
(assign, "$ab_score_team_0", ":new_level_0"),
(assign, "$ab_score_team_1", ":new_level_1"),
(else_try),
(assign, "$ab_score_team_0", ":level_team_0"),
(assign, "$ab_score_team_1", ":level_team_1"),
(try_end),
(try_begin),
(eq, ":type", -1), #make the teams even by number
#disabled
#first, check how many are different
(store_sub, ":team_diff", ":player_team_0", ":player_team_1"),
(val_abs, ":team_diff"),
(ge, ":team_diff", 2),
#let's see who to move now...
(try_begin),
(gt, ":player_team_0", ":player_team_1"),
(assign, ":move_from", 0),
(assign, ":move_to", 1),
(store_div, ":average", ":level_team_0", ":player_team_0"),
(else_try),
(assign, ":move_from", 1),
(assign, ":move_to", 0),
(store_div, ":average", ":level_team_1", ":player_team_1"),
(try_end),
#how many? teamdiff/2
#get average from team with more players - done above
(get_max_players, ":num_players"),
(assign, ":move_total_value", 0),
(try_for_range, ":unused", 0, ":team_diff"), #t_player1
(assign, ":move_player_no", -1),
(assign, ":move_player_value", -1),
(try_for_range, ":player_no", 0, ":num_players"), #t_player2
(player_is_active, ":player_no"),
(player_get_team_no, ":team", ":player_no"),
(eq, ":team", ":move_from"), #he's on the right team - check if his lvl is above average
(call_script, "script_cf_crpg_autobalance_get_level", ":player_no"),
(ge, reg0, ":average"), #he is above average - check if we have someone who is lower already
(this_or_next|eq, ":move_player_no", -1),
(gt, ":move_player_value", reg0), #the guy before has a higher value
(assign, ":move_player_no", ":player_no"),
(assign, ":move_player_value", reg0),
(try_end),
#now we should have one guy slightly above average -move him, and add his value
(val_add, ":move_total_value", ":move_player_value"),
(call_script, "script_crpg_switch_player_team", ":move_player_no", ":move_to"),
(try_end),
(val_div, ":team_diff", 2),
(store_div, ":average", ":move_total_value", ":team_diff"),
(try_for_range, ":unused", 0, ":team_diff"), #t_player1
(assign, ":move_player_no", -1),
(assign, ":move_player_value", -1),
(try_for_range, ":player_no", 0, ":num_players"), #t_player2
(player_is_active, ":player_no"),
(player_get_team_no, ":team", ":player_no"),
(eq, ":team", ":move_to"), #he's on the right team - check if his lvl is above average
(call_script, "script_cf_crpg_autobalance_get_level", ":player_no"),
(ge, reg0, ":average"), #he is above average - check if we have someone who is lower already
(this_or_next|eq, ":move_player_no", -1),
(gt, ":move_player_value", reg0), #the guy before has a higher value
(assign, ":move_player_no", ":player_no"),
(assign, ":move_player_value", reg0),
(try_end),
(try_begin),
(eq, ":move_player_no", -1), #found no suitable match - take the highest player
(try_for_range, ":player_no", 0, ":num_players"), #t_player2
(player_is_active, ":player_no"),
(player_get_team_no, ":team", ":player_no"),
(eq, ":team", ":move_to"), #he's on the right team - check if his lvl is above average
(call_script, "script_cf_crpg_autobalance_get_level", ":player_no"),
(this_or_next|eq, ":move_player_no", -1),
(gt, reg0, ":move_player_value"), #the guy before has a higher value
(assign, ":move_player_no", ":player_no"),
(assign, ":move_player_value", reg0),
(try_end),
(try_end),
#now we should have one guy slightly above average -move him, and add his value
#(val_add, ":move_total_value", ":move_player_value"),
(call_script, "script_crpg_switch_player_team", ":move_player_no", ":move_from"),
(try_end),
(try_end),
#(assign, reg1, ":level_team_0"),
#(assign, reg2, ":level_team_1"),
#(server_add_message_to_log, "@end of autobalance: team1:{reg1}, team2:{reg2}"),
(try_end),
(eq, 0, 1), #break script
]),

#script_cf_crpg_autobalance_get_level
#Input: none
#Output: none
("cf_crpg_autobalance_get_level", [
(store_script_param, ":player_no", 1),
(try_begin),
(store_add, ":troop_no", "trp_player0_multiplayer", ":player_no"),
(troop_get_slot, ":level", ":troop_no", slot_troop_crpg_level),
(gt, ":level", 0),
(val_add, ":level", 5), #add 4 levels to everyone so every player counts higher
(try_begin),
(eq, "$g_multiplayer_game_type", multiplayer_game_type_rabbit),
(val_add, ":level", 25), #in rabbit, people by itself count more
(try_end),
(player_get_score, ":kill_count", ":player_no"),
(player_get_death_count, ":death_count", ":player_no"), #get_death_count
(val_div, ":kill_count", 10),
(val_sub, ":kill_count", ":death_count"),
(val_mul, ":kill_count", 3),
(store_mul, ":player_score_plus_death", ":level", 10),
(val_add, ":player_score_plus_death", ":kill_count"),
#(val_sub, ":player_score_plus_death", ":death_count"),
#(val_mul, ":player_score_plus_death", ":player_score_plus_death"),
(set_fixed_point_multiplier, 10000),
#(val_mul, reg0, 10000),
(troop_get_slot, ":kd", ":troop_no", slot_troop_crpg_kd_ratio),
(val_div, ":kd", 100),
(val_add, ":player_score_plus_death", ":kd"),
(val_max, ":player_score_plus_death", 0),
(assign, ":power", 1),
(convert_to_fixed_point, ":player_score_plus_death"),
(convert_to_fixed_point, ":power"),
(val_mul, ":power", 11),
(val_div, ":power", 10),
(store_pow, ":tmp", ":player_score_plus_death", ":power"),
(assign, ":player_score_plus_death", ":tmp"),
(convert_from_fixed_point, ":player_score_plus_death"),
(assign, reg0, ":player_score_plus_death"),
(try_begin),
(player_get_team_no, ":team", ":player_no"),
(is_between, ":team", 0, 2),
(team_get_score, ":this_team_score", ":team"),
(store_sub, ":enemy_team", ":team", 1),
(val_abs, ":enemy_team"),
(team_get_score, ":enemy_team_score", ":team"),
(val_sub, ":this_team_score", ":enemy_team_score"),
(lt, ":this_team_score", 0),
(val_mul, ":this_team_score", 30),
(val_add, reg0, ":this_team_score"),
(try_end),
(else_try),
(assign, reg0, 1),
(try_end),
]),

#script_crpg_switch_player_team
#Input: none
#Output: none
("crpg_switch_player_team", [
(store_script_param, ":player_no", 1),
(store_script_param, ":team", 2),
#(assign, reg1, ":player_no"),
#(assign, reg2, ":team"),
#(str_store_player_username, s1, reg1),
#(server_add_message_to_log, "@autobalance: moving player:{s1} ({reg1}), team2:{reg2}"),
(try_begin),
#if player is living add +1 to his kill count because he will get -1 because of team change while living.
(player_get_agent_id, ":latest_joined_agent_id", ":player_no"),
(ge, ":latest_joined_agent_id", 0),
(agent_is_alive, ":latest_joined_agent_id"),
(player_get_kill_count, ":player_kill_count", ":player_no"), #adding 1 to his kill count, because he will lose 1 undeserved kill count for dying during team change
(val_add, ":player_kill_count", 1),
(player_set_kill_count, ":player_no", ":player_kill_count"),
(player_get_death_count, ":player_death_count", ":player_no"), #subtracting 1 to his death count, because he will gain 1 undeserved death count for dying during team change
(val_sub, ":player_death_count", 1),
(player_set_death_count, ":player_no", ":player_death_count"),
(player_get_score, ":player_score", ":player_no"), #adding 1 to his score count, because he will lose 1 undeserved score for dying during team change
(val_add, ":player_score", 1),
(player_set_score, ":player_no", ":player_score"),
(get_max_players, ":num_players"),
(try_for_range, ":player_send", 1, ":num_players"), #0 is server so starting from 1
(player_is_active, ":player_send"),
(multiplayer_send_4_int_to_player, ":player_send", multiplayer_event_set_player_score_kill_death, ":player_no", ":player_score", ":player_kill_count", ":player_death_count"),
(try_end),
(try_end),
(player_set_team_no, ":player_no", ":team"),
#(multiplayer_send_message_to_player, ":player_no", multiplayer_event_force_start_team_selection),
]),
Title: Re: Proposed change to team-balance algorithim
Post by: Kafein on February 21, 2014, 11:21:40 am
Here is the current team balance code, feel free to modify it directly:

I'd rather do real time cryptography in Clojure, thanks
Title: Re: Proposed change to team-balance algorithim
Post by: Sniger on February 21, 2014, 02:17:28 pm
24(!) screenshots uploaded
Title: Re: Proposed change to team-balance algorithim
Post by: Elindor on February 21, 2014, 04:28:24 pm
I was playing late-night (read: really early morning) battle last night, with only 5v5 or 6v6ish for a while. The balancer put the two top players on the same team after round 1. They each had more score than every player on the entire enemy team combined. The thing is, they weren't even in the same clan, so there was no reason they should be put together. The total score of the two teams after one round was about 16 points vs 60. Makes sense, right?

The thing is, this isn't a problem limited to low-pop servers. It is just far more noticeable and easier to point out the flaws in the system when you can count up the total scores of each team in a matter of seconds.

This is what I'm talking about Jona 100%.
If the server had just moved one of those players to the other team it would have almost completely balanced itself right there.
And in siege it does the same thing and siege can shift players freely every round!  But it doesn't do it. 

I'm really beginning to think that the balancer has almost no directive to balance overall scores/kdrs of players on each team...

-----

:arrow: I would love for someone (Tydeus, cmp, anyone) who has SOME knowledge of the actual mechanics of the balancer to chime in on one of these many many many topics about how badly the balancer performs and just give us a clue what is going on.  Not a demand, but a request which I'm sure the community would be very happy about.

[EDIT] It appears Zagibu has already posted it....  Any chance someone can summarize it's priorities for us though?  Paul?  Tydeus? :)  There is no way I'm gonna understand much of that 500 lines of script :)

...I've said it before and I'll say it again...
Whats wrong with cRPG?  Its not this weapon vs this weapon, or this build vs this build ...its HOW BAD THE BALANCER IS.
Title: Re: Proposed change to team-balance algorithim
Post by: Vanthor on February 21, 2014, 04:53:39 pm
Here is the current team balance code, feel free to modify it directly:


Thanks! I'll do exactly that.
Title: Re: Proposed change to team-balance algorithim
Post by: Tydeus on February 21, 2014, 05:46:42 pm
Elindor, I haven't taken an in depth look at how it works, I've only skimmed through it. I've seen it enough to know I don't want to have anything to do with it at the moment.  :|
Title: Re: Proposed change to team-balance algorithim
Post by: Utrakil on February 21, 2014, 05:49:53 pm
Thanks! I'll do exactly that.
Her comes a +1 for bravery!
Title: Re: Proposed change to team-balance algorithim
Post by: Sniger on February 21, 2014, 06:02:13 pm
vanthor not brave

vanthor is just like:
visitors can't see pics , please register or login
Title: Re: Proposed change to team-balance algorithim
Post by: Elindor on February 21, 2014, 06:52:43 pm
Elindor, I haven't taken an in depth look at how it works, I've only skimmed through it. I've seen it enough to know I don't want to have anything to do with it at the moment.  :|

Honestly, I cannot blame you.  Let's tie a rope around Vanthor so if he tugs on it we can pull him back out...

God speed Vanthor.
Title: Re: Proposed change to team-balance algorithim
Post by: Sniger on February 21, 2014, 11:48:18 pm
since the screenshots ive provided is a little bit old i figured id hop on eu1 and spec for abit.

this is the very first map i spec'ed:

(click to show/hide)

ill keep spec and screen but will .zip the rest and upload
Title: Re: Proposed change to team-balance algorithim
Post by: Paul on February 22, 2014, 10:40:02 am
Afaik the team balance code is a creation of chadz himself and thus considered to be a holy piece of perfection. In other words noone cba to do get started with working on it.
Title: Re: Proposed change to team-balance algorithim
Post by: Sniger on February 22, 2014, 03:21:34 pm
Afaik the team balance code is a creation of chadz himself and thus considered to be a holy piece of perfection.

everything make sense now.

but well im sure its awesome code and i guess it works great for what it is! BUT........

:)
Title: Re: Proposed change to team-balance algorithim
Post by: Vanthor on February 24, 2014, 10:22:14 pm
So, this may explain why the auto balancer is awful.   This is the power (energy) function it uses. Lets choose two example players Sir_TryHard_CarriesAlot and ArcherWith300Ping.

Its a 30 on 30. Sir_TryHard_CarriesAlot is on blue, and is an old school two-handed hero. He started the match of well, hitting the enemy murderball (massed infantry) like a tidal wave, killing 7 people while taking little damage. ArcherWith300Ping is a strength crutcher with a long bow. He hasn't had a good round so far, hasn't had a clear shot. So he says fuck it, and starts lobbing arrows into the melee at head height from a mile away.

Sir_TryHard_CarriesAlot is on a roll. He going to set a personal record this match. Sir_TryHard turns to fight the next enemy, and suddenly an arrow sprouts from his head. He goes down.

Lets take a look at how our two players did round 1.

P1 Sir_TryHard_CarriesAlot
Level: 30
Overall K/D from all matched: 10:1
Round 1 kills: 7 ( Had a bad round)
Round 1 Deaths: 1
Round 1 Points: 40
On Losing team(Re: Bad round)

P1 ArcherWith300Ping
Level: 31
Overall K/D from all matches: 1:4
Round 1 kills :0
Round 1 Deaths:0
Round 1 Points: 3
On winning team

Some boilerplate:
Code: [Select]

          (store_script_param, ":player_no", 1),
(try_begin),
(store_add, ":troop_no", "trp_player0_multiplayer", ":player_no"),
(troop_get_slot, ":level", ":troop_no", slot_troop_crpg_level),
(gt, ":level", 0),

(val_add, ":level", 5), #add 4 levels to everyone so every player counts higher
(try_begin),
(eq, "$g_multiplayer_game_type", multiplayer_game_type_rabbit),
(val_add, ":level", 25), #in rabbit, people by itself count more
(try_end),
Ok, so we have our new levels. Also, wtf is rabbit?
Sir_TryHard_CarriesAlot Level:  35
ArcherWith300Ping Level:         36

Code: [Select]
(player_get_score, ":kill_count", ":player_no"),
(player_get_death_count, ":death_count", ":player_no"), #get_death_count
So we've got our kill count.... wait... player_get_score?

P1 Sir_TryHard_CarriesAlot
Level: 35
kill_count: 40
deaths: 1

P2 ArcherWith300Ping
Level: 36
kill_count:10
deaths: 0

Code: [Select]
(val_div, ":kill_count", 10),
(val_sub, ":kill_count", ":death_count"),
(val_mul, ":kill_count", 3),
Well, at lease Sir_TryHard is still in the lead. He did such a good job.

P1 Sir_TryHard_CarriesAlot
Level: 35
kill_count: 9
deaths: 1

P2 ArcherWith300Ping
Level: 36
kill_count:3
deaths: 0

Code: [Select]
(store_mul, ":player_score_plus_death", ":level", 10),
(val_add, ":player_score_plus_death", ":kill_count"),
And ArcherWith300Ping takes the lead!

P1 Sir_TryHard_CarriesAlot
Level: 35
player_score_plus_death: 359

P2 ArcherWith300Ping
Level: 36
player_score_plus_death:363

Code: [Select]
(set_fixed_point_multiplier, 10000),
So  I *think* this is going to multiply any number we convert to fixed point by 10000 and divide everything converted by the same. However, I'm going to assume I'm wrong, and was put in to fix a bug with fixed point numbers or something.

Code: [Select]
(troop_get_slot, ":kd", ":troop_no", slot_troop_crpg_kd_ratio),
Yes! Go Sir_TryHard!

P1 Sir_TryHard_CarriesAlot
Level: 35
player_score_plus_death: 359

P2 ArcherWith300Ping
Level: 36
player_score_plus_death:363

Code: [Select]
(val_div, ":kd", 100),
(val_add, ":player_score_plus_death", ":kd"),
(val_max, ":player_score_plus_death", 0),
....
Maybe its stored its stored as 100x? Game doesn't seem to like fixed point numbers. Lets say it is.
Yeah... Go Sir_TryHard!

P1 Sir_TryHard_CarriesAlot
Level: 35
player_score_plus_death: 369

P2 ArcherWith300Ping
Level: 36
player_score_plus_death:363
Code: [Select]
(assign, ":power", 1),
(convert_to_fixed_point, ":player_score_plus_death"),
(convert_to_fixed_point, ":power"),

(val_mul, ":power", 11),
(val_div, ":power", 10),
(store_pow, ":tmp", ":player_score_plus_death", ":power"),
(assign, ":player_score_plus_death", ":tmp"),


(convert_from_fixed_point, ":player_score_plus_death"),
                        (assign, reg0, ":player_score_plus_death"), #What the function will return
Ok... So lets assume what I said earlier about that multiplier is true. So Sir_TryHard increases his lead! Looks like I was wrong. Looks like the balancer will rank Sir_TryHard as he deserves. Although I was expecting him to end up more than 1% better...
P1 Sir_TryHard_CarriesAlot
reg0: 666

P2 ArcherWith300Ping
reg0:654

Code: [Select]
(try_begin),
(player_get_team_no, ":team", ":player_no"),
(is_between, ":team", 0, 2),
(team_get_score, ":this_team_score", ":team"),
Wait, what? Whats going on?

P1 Sir_TryHard_CarriesAlot
reg0: 666
this_team_score:0

P2 ArcherWith300Ping
reg0:654
this_team_score:1
Code: [Select]
(store_sub, ":enemy_team", ":team", 1),
(val_abs, ":enemy_team"),
(team_get_score, ":enemy_team_score", ":team"),
Maybe this will be the boost Sir_TryHard deserves...

P1 Sir_TryHard_CarriesAlot
player_score_plus_death: 666
this_team_score:0
enemy_team_score:1

P2 ArcherWith300Ping
player_score_plus_death:654
this_team_score:1
enemy_team_score:0
Code: [Select]
(val_sub, ":this_team_score", ":enemy_team_score"),
(lt, ":this_team_score", 0),
Or not....
P1 Sir_TryHard_CarriesAlot
player_score_plus_death: 666
this_team_score:-1


P2 ArcherWith300Ping
player_score_plus_death:654
this_team_score:1


Code: [Select]
(val_mul, ":this_team_score", 30),
(val_add, reg0, ":this_team_score"),
And ArcherWith300Ping is now more useful (According to the autobalancer) than Sir_TryHard_CarriesAlot
P1 Sir_TryHard_CarriesAlot
player_score_plus_death: 636
this_team_score:-1


P2 ArcherWith300Ping
player_score_plus_death:654
this_team_score:1

Moral of the story is that the fame weights level too much, and overall K/D far too little.
Title: Re: Proposed change to team-balance algorithim
Post by: San on February 26, 2014, 08:16:47 pm
Bump, like where this is going.

Not sure how well traditional programming methods would work on this kind of script.

I like the idea of prioritizing banners by power and distributing them across teams with an emphasis of avoiding powerhouse players on the stacked team.

Same for these classes:
Horse ranged
Melee cav
foot ranged
infantry

I don't think it needs to be too specific. This can simply look at a person's equipment when spawning or maybe the build that they use (cav can easily become infantry, making using builds somewhat unreliable). I think trying to get too specific with worrying about hybrid builds or people trying to cheat the system may create more problems.

Although I can't help but feel the energy functions working at odds with each other, but as you said before, perhaps some simulations with past data can shed light on how well it would work. I don't fully understand how the values for mean and variance of the Gaussian for TrueSkill would work for warband, but it sounds nice if we could get something working. I think average score per round is a good placeholder before something more complicated is used.

Since this hasn't been mentioned in this thread, a 10 second wait when the map changes and balance on the first round would be great once it's working. With the current broken balance, sometimes the randomly distributed first round ends up better than when "balance" comes into play.
Title: Re: Proposed change to team-balance algorithim
Post by: Elindor on February 26, 2014, 08:41:20 pm
Moral of the story is that the fame weights level too much, and overall K/D far too little.

Please please please (and so on...) let's continue to look at this and bring it to the attention of anyone that will listen (San, Tydeus help us :) )

Vanthor thanks for running through that and explaining what is going on...
If the balancer is not correctly weighting people that may be why it doesn't think its a big deal to put a currently 18 and 2 player on a team that is already winning from a massive clan stack.

------------------------

The balancer imho needs to prioritize in this way:

1) Put together players on same banners.
2) Generally balance # of players on same banners per team (as much as possible).
3) Evaluate "POWER" of each team after Steps 1 and 2 by evaluating individual POWER of players, as well as adding CLAN POWER for # of players on same banners.
3) Adjust to balance by switching "FREE AGENTS" (those not in a stack that the system can more freely move) currently scoring as high "POWER" to the team with lower overall power.


Level of the player should actually have very little to do with the assumed "POWER" rating of the player, it should be much more about current KDR and score...who cares if he's lvl 12 if he's wrecking everyone (means he's a badass but from a balancer perspective level shouldn't mean much, its about what they are doing)
Title: Re: Proposed change to team-balance algorithim
Post by: San on February 26, 2014, 08:48:37 pm
I can try, but my eyes hurt if I look at it too much. Kind of like cthulu.
Title: Re: Proposed change to team-balance algorithim
Post by: Elindor on February 26, 2014, 09:00:41 pm
I can try, but my eyes hurt if I look at it too much. Kind of like cthulu.

yeah Im just saying if we can get a better suggestion we should take it to the devs and see if they will agree to look into it and maybe adjust some things based on our suggestions....

Current balancer is honestly why I sign off most nights....that or I need to poop.
Title: Re: Proposed change to team-balance algorithim
Post by: Jona on February 26, 2014, 10:32:26 pm
This can simply look at a person's equipment when spawning or maybe the build that they use

This would most likely be the best option. If someone spawns with an xbow, I don't care if they have 170 wpf or 1... they are currently a 'ranged player.' Same goes for horseback. If you decide to spawn on donkey-back, you will simply hurt your team (I am guessing) since you will be considered a high-value player while you are (assumingly) not contributing much, or as much as a 'real cav.' Sure it might not seem fair to consider a donkey to be cav, or a no-wpf xbower to be ranged, but the line has to be drawn. Maybe the code could be specific enough to count cav as any horse, not including donkey's. I would assume it would be simplest to say "If player spawns with anything in the horse slot, he is a cav player."
Title: Re: Proposed change to team-balance algorithim
Post by: Elindor on February 26, 2014, 10:34:40 pm
I would assume it would be simplest to say "If player spawns with anything in the horse slot, he is a cav player."

Kinda like "If player spawns with anything in his butt slot, he is gay"
Title: Re: Proposed change to team-balance algorithim
Post by: Tydeus on February 27, 2014, 12:02:47 am
Rabbit is what rageball is called in the module system. I have no idea what the point of player_get_score is, considering the fact that player_get_kill_count exists. Perhaps it's so autobalance doesn't "break" with other gamemodes. I think that's the gist of how the fixed point multiplier shit work. Overall, your analysis seems to be right, but I have a rather limited experience with the ms, so I can't say definitively.

Do you still have intentions of modifying the script yourself, Vanthor?  :wink:
Title: Re: Proposed change to team-balance algorithim
Post by: zagibu on February 27, 2014, 12:09:31 am
Kinda like "If player spawns with anything in his butt slot, he is gay"

What about poop? Poop is a valid un-gay thing to have in your butt slot.
Title: Re: Proposed change to team-balance algorithim
Post by: Macropus on February 27, 2014, 11:03:35 pm
What about poop? Poop is a valid un-gay thing to have in your butt slot.
So is poop better than gays then?
Title: Re: Proposed change to team-balance algorithim
Post by: Elindor on February 27, 2014, 11:38:45 pm
What about poop? Poop is a valid un-gay thing to have in your butt slot.

> "If player spawns with [other player] in his butt slot, he is gay"

Fixed.
Title: Re: Proposed change to team-balance algorithim
Post by: San on February 27, 2014, 11:50:24 pm
Well.. At least the topic is staying bumped.
Title: Re: Proposed change to team-balance algorithim
Post by: Jona on February 28, 2014, 11:43:08 am
Anything that works, right?
Title: Re: Proposed change to team-balance algorithim
Post by: Vanthor on February 28, 2014, 08:31:45 pm
Sorry for the long time between posts, been busy with work and such.


Although I can't help but feel the energy functions working at odds with each other, but as you said before, perhaps some simulations with past data can shed light on how well it would work. I don't fully understand how the values for mean and variance of the Gaussian for TrueSkill would work for warband, but it sounds nice if we could get something working. I think average score per round is a good placeholder before something more complicated is used.


The energy functions are somewhat at odds with each other, but the key is to use them to come up with a best case compromise. As for TrueSkill, its the best algorithm I know of for rating players in games like this (Although it takes it a long time for a game like warband) so I suggested it. I agree that average score per round would be a good placeholder for the time being. A TrueSkill implementation would be way better.

Do you still have intentions of modifying the script yourself, Vanthor?  :wink:

Currently working on it. I've just never worked with anything quite so unique as the "M&B scripting language". I'm thinking of quickly revamping the "cf_crpg_autobalance_get_level" function in the current balancer, as i'm pretty sure its the root cause of the weirdness in the auto-balancing.

It puts way too much stock in a players level (1 level ~= to 33.33 points). This matters quite a bit in the auto-balance after the first round.

What I'm currently doing:


Title: Re: Proposed change to team-balance algorithim
Post by: Jona on February 28, 2014, 11:32:03 pm
(click to show/hide)

If you can pull this off, you may be the greatest hero crpg has ever known. Best of luck!
Title: Re: Proposed change to team-balance algorithim
Post by: Tydeus on March 01, 2014, 12:55:17 am
What I'm currently doing:
  • Reading through the current auto-balancer code - Done
  • Gathering data & getting  (Thanks sniger for all the screenshots of match end scoreboards) - 20%
  • Porting the current auto balancer algorithm to something I can test (I want to make sure the new one isn't worse. Also helps me understand old code)- 10%
  • Write a new auto-balancer in something I can test
  • Port new auto-balancer to M&B scripting language.

If you're looking at scoreboards, and the relation between player score and their k:d ratio, it might help to know exactly how score is calculated. Although I'm still in the middle of reworking it to more accurately reflect a player's contributions to his team's effort, the following should still be useful.

Current system:

- take the final damage dealt as the base score amount
- cap it by what HP the enemy has left
- if the hit kills the enemy player, add 30
- if not a kill but final damage >= 1, add 5
- if it is a horse and has a rider, reduce to 2/3
- if it is a horse without a rider, set to 0
- if the victim agent and attacker agents are on the same team, multiply by -2, if they're the same agent(you damage yourself), multiply by -1
- cap the hit player's offset between 75 and 125
- multiply score * victim's offset
- divide score by 100
- give this score to the one who did the damage
- multiply score by 1/3
- give to everyone within 2.5m that is an enemy of the victim(including those who died up to 5 seconds prior)
- finally, the scoreboard duplicates a player's score divides that number by 15 and rounds down. (So you can deal 9 damage to someone with a 100% offset, not see a change on the scoreboard, yet still get properly rewarded for it).

A player's offset is calculated by...

- finding the average score gained in the previous round for all players that spawned
- finding the average score for the whole map
- get the player's previous round score gained
- get the player's total score
- multiply both by 100
- divide the player's previous round score gained by the average score gained in the previous round
- divide the player's total score by the total score average
- take whichever is higher as the offset

I didn't want things to get out of hand with the offset, so I chose rather restrictive limitations on it. Several people on any given map tend to have 2 to 4 times the average player's score, so rather than having them literally worth 4 times as much score, thereby making them a target for everyone else on the server, I chose a rather low cap. Might change this in the future, but I haven't exactly had any feedback on it.

On a sidenote, we all idle the mount&blade-crpg irc channel on QuakeNet, so if you have any questions, feel free to hop in and ask anytime.

Edot: Also, a player's Score Offset is set to 100 when entering the server and after a map change.
Title: Re: Proposed change to team-balance algorithim
Post by: Vanthor on March 01, 2014, 04:02:04 pm
Thanks Tydeus, that's useful information to have.
Title: Re: Proposed change to team-balance algorithim
Post by: Vanthor on March 01, 2014, 04:15:10 pm
whoops
Title: Re: Proposed change to team-balance algorithim
Post by: Elindor on March 01, 2014, 05:48:25 pm
I officially love Vanthor, Tydeus, San, and Jona (when he's not killing me with hiltslashing polearms) and all the rest of you in this thread.

This is *** HUGE *** (cannot stress enough) for cRPG and I think we're all frequenting this thread because we all realize that.

@Vanthor - For those of us not as code inclined - What can we do to help??
Do you need screenshots?  What are you looking for?  Do you need testers eventually?  Im sure anyone in this thread would love to help this come to fruition if it helps the balancer system even a little bit.

Good work!
Title: Re: Proposed change to team-balance algorithim
Post by: Tydeus on March 01, 2014, 06:19:38 pm
I officially love Vanthor, Tydeus, San, and Jona (when he's not killing me with hiltslashing polearms) and all the rest of you in this thread.

This is *** HUGE *** (cannot stress enough) for cRPG and I think we're all frequenting this thread because we all realize that.

@Vanthor - For those of us not as code inclined - What can we do to help??
Do you need screenshots?  What are you looking for?  Do you need testers eventually?  Im sure anyone in this thread would love to help this come to fruition if it helps the balancer system even a little bit.

Good work!
If he makes the appropriate changes, I can host a cRPG server that would allow us to test the system(you will all lag though, my internet isn't very good and I live in Louisiana).
Title: Re: Proposed change to team-balance algorithim
Post by: Rico on March 01, 2014, 07:49:17 pm
Moral of the story is that the fame weights level too much, and overall K/D far too little.

Seems problematic. Apply this to Arbalest users:

Code: [Select]
Level:           27

Strength:        15
Agility:         24

Skill to attr:   14

Weapon Master:    8

Crossbow:       180
using cRPG NewGen calc (http://alpha-lider19.ru/MB)

This build for level 27 has maximum accuracy on the Arbalest. Damage is fixed anyways, so you could say this is perfect for shooting.

Now the Arbalest user goes highlevel and hits level 35:

Code: [Select]
Level:           35

Strength:        15
Agility:         30

Skill to attr:   10

Power Strike:     5
Shield:           1
Athletics:       10
Weapon Master:   10

Onehanded:      110
Crossbow:       180
using cRPG NewGen calc (http://alpha-lider19.ru/MB)

With this build, the survivability is slightly higher in case something goes wrong: Run away, annoy others with short sword. It's still perfect for shooting, since the core part is the same at level 27. Even with additional speed and power strike, an arbalest user does not behave differently from before. Take cover, come out to shoot, take cover. Since highlevel Arbalest users will still get their kills mostly from shooting, the impact on the scoreboard is overall nearly the same, but the balance system seems to think they play much much better at lvl 35 compared to lvl 27.

My suggestion would be to adjust the balance system in a way that performance counts more than the level does. Even if our arbalest user was level 50 and had 400 wpf in crossbow, the accuracy would be the same as lvl 27. Because crossbow acc is hardcapped, you see more highlevel archers than crossbowers, and that's why people demand archer nerfs more often than crossbow nerfs, by the way.

Don't misunderstand this as a *buff crossbow* post, I just try to explain that there is not much of a difference for arbalest users between level 27 and higher levels, and the balance system should take this into account.
Title: Re: Proposed change to team-balance algorithim
Post by: Rico on March 01, 2014, 07:59:18 pm
Well and the ballistas on Siege make peasants perform better than they would according to the system, and people who go 3 levels higher to go 2h/pole hybrid for instance are also overrated balance-wise.
Title: Re: Proposed change to team-balance algorithim
Post by: Elindor on March 02, 2014, 07:15:35 am
These are good points Panaru, but any change for the better is good - even if it's not perfect.  Of course level matters, but it shouldn't matter more than how someone is performing at the moment.

What I'm hoping we can do away with are the obvious and gratuitous imbalances of teams that result in just absolute steamrolls....and you look at the scoreboard and go "wtf??? is the autobalancer just trolling us?"

(click to show/hide)
Title: Re: Proposed change to team-balance algorithim
Post by: Jona on March 02, 2014, 09:40:35 am
Perfect example of balancer problem just now in battle. My teams top 3 guys all had higher scores/KDRs than the opponents top player on a 15v15 server. I know that the top guys were all relatively high level on my side as well, so maybe the high levels on the other team simply weren't pulling their own weight, or they didn't exist. Can't say for sure, but I can say that obviously being high level doesn't mean shit in this game. It only adds more potential to get a higher score. Same goes for looms. Anyone can have a full set of +3s if they have played enough, or have generous friends, but it doesn't mean that they can put them to use properly. In my opinion there should be three factors to consider when balancing the teams: score and KDR, which arguably are almost the same thing, and then class. The only reason class should matter is so that one team is not all ranged and cav and the other all melee footsoldiers. Not saying that cav or ranged is OP, per se, just that from a fun standpoint it is far better to have the same ratio of classes on each side.
Title: Re: Proposed change to team-balance algorithim
Post by: Elindor on March 03, 2014, 09:34:12 pm
Bump
Title: Re: Proposed change to team-balance algorithim
Post by: San on March 03, 2014, 10:39:13 pm
List of commands if needed

http://pastebin.com/nLBUADRB
Title: Re: Proposed change to team-balance algorithim
Post by: Vanthor on March 05, 2014, 09:43:45 pm
Ok, so I've managed to collect up some data:

From this, I was able to determine that there is a linear relationship between a players score per round and their average k/d.
average_score_per_round = 3.46 * average_kd + 4.40
The average score value should be correct to with +-30%

So if we want to get the auto-balancer to stop being level dependent, I propose we change the script_cf_crpg_autobalance_get_level to be the following.
(click to show/hide)

Breakdown in story form (See Sir_TryHard post):
(click to show/hide)

And for those of you who just want to see the results:
PlayerOriginal ValueNew Value
Sir_TryHard_CarriesAlot636100
ArcherWith300Ping65429.25

And again, I'd like to that Sniger for providing me we the EU screenshots. Ill be posting some comparisons of how those two algorithms perform in a bit.
Title: Re: Proposed change to team-balance algorithim
Post by: Vanthor on March 05, 2014, 09:53:35 pm
And the aggregate data (more to come)
(click to show/hide)
Title: Re: Proposed change to team-balance algorithim
Post by: Elindor on March 06, 2014, 06:20:16 am
Interesting Vanthor, I'm glad that Archerwith300ping is no longer scoring higher than TryHardCarriesALot to the balancer....that is definitely an improvement!

- What's everyone think about this?
- Are there other things you'd like to tweak Vanthor or is this all you think needs done?
- What is the next step from here (San, Tydeus?)

Awesome stuff....
If this can make the balancer better Vanthor deserves a loom...just saying.  :mrgreen:

Title: Re: Proposed change to team-balance algorithim
Post by: Sniger on March 06, 2014, 09:29:32 am
what if this "balance" is suppose to be? if banner balance code is made by tjadz® himself, will he allow anyone to fizzle with it? is he really not aware of the effect his code has? im sure he is!

poor balance wouldnt have so big impact if we gained xp/gold in another way than the way we currently gain.

i think there is alot more work and effort in attempting to alter or change the banner balance holycode than comming up with another xp/gold system.

whats wrong in giving everyone the same amount of xp/gold per tick? why give winners more experience? "experience" is based on time you spend doing something yes? losers spend the same time as winners but gain less experience. doesnt make sense. a gold-multiplier would be natural but i think a fixed xp income would be for the greater good.
Title: Re: Proposed change to team-balance algorithim
Post by: Jona on March 06, 2014, 11:37:02 am
what if this "balance" is suppose to be? if banner balance code is made by tjadz® himself, will he allow anyone to fizzle with it? is he really not aware of the effect his code has? im sure he is!

poor balance wouldnt have so big impact if we gained xp/gold in another way than the way we currently gain.

i think there is alot more work and effort in attempting to alter or change the banner balance holycode than comming up with another xp/gold system.

whats wrong in giving everyone the same amount of xp/gold per tick? why give winners more experience? "experience" is based on time you spend doing something yes? losers spend the same time as winners but gain less experience. doesnt make sense. a gold-multiplier would be natural but i think a fixed xp income would be for the greater good.


It wouldn't require more work to change the 'holy balancer code' if Vanthor is already halfway there or so (Okay, maybe he's not even halfway there, but he seems to at least know how to get to the destination). And if you only rewarded winners with more gold, then that removes a heck of a lot of the incentive to try hard and win. Gold is super easy to get as is. No need to make it super, super easy to get, while making xp much harder. The grind to higher levels is long enough as is, and keeps getting longer. At this stage of the game people want more xp to get to those higher levels since they have so much gold sitting in the bank they can afford any gear and looms they want.

In my opinion if the balancer is tweaked, and then valor is calculated per team (an entire different topic, I know), this game should be in good shape balance-wise and will reward the good players appropriately.
Title: Re: Proposed change to team-balance algorithim
Post by: Sniger on March 06, 2014, 01:43:53 pm
eye of the beholder i guess. ill continue to gather screenshots in any case, its the only thing i can do to help, wish i was a codeshark :p

if there is more who wanna help with the screencapturing it would be cool its limited how much i play, its incredible agrovating :p

i still think xp/gold system should be changed in some way though. the current system is kind of made for banner balance

Title: Re: Proposed change to team-balance algorithim
Post by: Angantyr on March 06, 2014, 04:45:00 pm
Sniger, since our first talk on this topic I have actually collected 211 round end screenshots, but I have been too busy to upload them or their stats. Will do when I find the time, though not very scientific it is at least a perspective.
Title: Re: Proposed change to team-balance algorithim
Post by: Kafein on March 06, 2014, 05:54:00 pm
With that many screenshots, getting them OCRed might be better than reading them
Title: Re: Proposed change to team-balance algorithim
Post by: Angantyr on March 06, 2014, 06:06:39 pm
Yeah. And there's been plenty more since. Would help if I could still drag'n'drop in Photobucket.
Title: Re: Proposed change to team-balance algorithim
Post by: Sniger on March 06, 2014, 06:28:27 pm
.zip and upload to for examble dropbox
Title: Re: Proposed change to team-balance algorithim
Post by: Elindor on March 07, 2014, 04:04:02 am
For me (and probably many) a better balancer is not something we desire because we want more gold/exp, but because we want more balanced combat scenarios.  When you are against overwhelming odds (through clan stacks and skill balance of players on each team) it really can stop being fun at some point for most players.

But yes, the gold/exp reward system also needs tweaked to be based off not just winning/losing rounds (and valor) but to also take into account personal performance, etc.

Also Valor needs to be calculated per team (think it's already like this in battle but not siege, of course, what else is new)
Title: Re: Proposed change to team-balance algorithim
Post by: San on March 07, 2014, 05:12:00 am
Valor for a player per team's average instead of a pooled average is coming for next patch.
Title: Re: Proposed change to team-balance algorithim
Post by: Jarold on March 07, 2014, 05:32:43 am
Team valor sounds awesome, does that mean no more individual Rambo valor? If so, GOOD!

Vanthor you are a saint for doing this and the community appreciates it. From what I read your balance system is looking really good so far, it actually makes sense. I hope you will be able to finish it and that chadz will accept it.

Good luck!
Title: Re: Proposed change to team-balance algorithim
Post by: San on March 07, 2014, 05:56:08 am
Sorry, worded that poorly. Valor is going to be if you have 3x the average score of your team.
Title: Re: Proposed change to team-balance algorithim
Post by: Vanthor on March 07, 2014, 03:05:28 pm
Just realized I could just share the data I've collected.

https://docs.google.com/spreadsheets/d/1e3lIiCPT0i2wxmgdBM2m2GlUsgQ0yH5T9dr6RiTSuzA/pubhtml

Sheet1 is raw data
Sheet8 is all unique player names from the raw data
Sheet9 is play data on each unique player.
Final is sheet 9 filtered on players I have 3+ games for.
Match info contain what team won
Match Displays useful data on each match. If you copy the spreadsheet you can change the cell B1 to see the data on each Game. Ok you can't copy it. Weird.
Title: Re: Proposed change to team-balance algorithim
Post by: Vanthor on March 07, 2014, 04:44:24 pm
With that many screenshots, getting them OCRed might be better than reading them

Tried it. Images are way too noisy.
Title: Re: Proposed change to team-balance algorithim
Post by: Tydeus on March 07, 2014, 05:30:11 pm
I'm trying to get approval to save average score per round, per character, on the website. Still, even if that's not done, it's possible to use the score gained from the previous round(player offset).

Code: [Select]
(multiplayer_is_server),
(agent_get_player_id, ":player_no", ":agent_no"),
(player_get_slot, ":score_offset", ":player_no", slot_player_crpg_player_score_offset),

With score_offset being the the ratio of player's score gained:average score gained * 100. So a player with an offset of 100 will have gained the same as what the average was, for that round. It's also possible to have a negative offset, this will happen only if your total score for the map is negative, though, as offset looks at both previous round score and total map score. +/- 30% reliability doesn't seem that great, tbh.


Alternatively, you can use either of these as well.

Code: [Select]
                    (player_get_slot, ":personal_score", ":cur_player", slot_player_crpg_player_score_round), #previous round score
                    (player_get_slot, ":personal_score_total", ":cur_player", slot_player_crpg_player_score_total), #map score
Title: Re: Proposed change to team-balance algorithim
Post by: Kafein on March 07, 2014, 08:15:42 pm
Tried it. Images are way too noisy.

What happens if you try to filter everything that isn't red or white?
Title: Re: Proposed change to team-balance algorithim
Post by: Elindor on March 07, 2014, 08:39:31 pm
I'm trying to get approval to save average score per round, per character, on the website

I think a lot of people would actually be interested to know their own stats on this...
Can be more representative than KDR anyhow.

I'd go as far as to say we should all be able to see our own:
- Battle KDR/Average Score per round
- Siege KDR/Average Score per round

Off topic, sorry.
Title: Re: Proposed change to team-balance algorithim
Post by: Jarold on March 07, 2014, 09:27:33 pm
Sorry, worded that poorly. Valor is going to be if you have 3x the average score of your team.

Ah, well it still sounds a lot better than what it is now.
Title: Re: Proposed change to team-balance algorithim
Post by: Sniger on March 08, 2014, 05:02:05 pm
4-0 or 4-1

MAP AFTER MAP AFTER MAP AFTER MAP

W T F IS THIS SHIT?! SERIOUSLY?!

id love someone with insight to explain this. chadz for examble. but i guess he is too busy responding to threads about dating
Title: Re: Proposed change to team-balance algorithim
Post by: Rico on March 08, 2014, 06:25:53 pm
4-0 or 4-1

MAP AFTER MAP AFTER MAP AFTER MAP

W T F IS THIS SHIT?! SERIOUSLY?!

id love someone with insight to explain this. chadz for examble. but i guess he is too busy responding to threads about dating

It has its advantages. I only observe one-sided matches on Battle, and either I get x1 over multiple maps, or x5 over multiple maps. Better than juming between x1 and x2 all the time if you ask me... The real balance mechanism in Battle works only after round 1; the rest is fine-tuning.

On Siege, there is a new balancing every round and whole clans get switched etc. There you have less constant x1s or x5s, which makes it more interesting to play in balanced teams, but less effective for experience.

I don't think the balance mechanism is perfect (see my posts above), but as soon as it makes 4-0 or 4-1 outcomes, you have better chances for leveling. That's something positive too, isn't it?
Title: Re: Proposed change to team-balance algorithim
Post by: Sniger on March 08, 2014, 09:31:58 pm
thats why the xp and gold gain also needs to be changed
Title: Re: Proposed change to team-balance algorithim
Post by: SP1N on March 09, 2014, 08:51:47 pm
Class/build
(click to show/hide)

I'm not alone!

visitors can't see pics , please register or login
Title: Re: Proposed change to team-balance algorithim
Post by: Vanthor on March 10, 2014, 03:26:51 pm
On Topic:
Better than juming between x1 and x2 all the time if you ask me... The real balance mechanism in Battle works only after round 1; the rest is fine-tuning.
The teams after round 1 are guaranteed to have roughly the same total level (Team 1 might have 2 level 30s, team 2 4 level 15s) and banner balanced. Every thing it does after that is random flailing caused by:
(click to show/hide)
That piece of code basically gives every person on the losing team -30 value per round. Thats about -5% of the players total value. Per loss. So if they loose twice, its -60, 3 times its -90. The problem with this strategy is that in low pop games, the type of player it will balance is peasants (Lowest value to make the teams even).

Off Topic:
Quote
I'm not alone!

Go agi pikes! I like it much better than my old 24/18 piker. Much easier to get into position.
Title: Re: Proposed change to team-balance algorithim
Post by: Elindor on March 15, 2014, 01:56:29 am
Bump because...

visitors can't see pics , please register or login
Title: Re: Proposed change to team-balance algorithim
Post by: Sniger on March 17, 2014, 01:05:34 am
*cough*
Title: Re: Proposed change to team-balance algorithim
Post by: FRANK_THE_TANK on March 17, 2014, 02:59:15 am
Wow, that's very thought out...

Here's what I would say. 
Whether the dev team has the knowhow is one thing, but bottom line is - THE BALANCE SYSTEM SUCKS AND HAS SUCKED AND IS PROBABLY THE BIGGEST DETERENT OF THIS GAME so them having the knowhow is irrelevant really...maybe they do need a good suggestion?

I am not 100% sure that "class balance" is really as important a factor as just plain old BALANCING of a player's score/kdr, whether that is derived from his current performance or a combo of current and overall stats that the server keeps. 

------

BIGGEST ISSUE which should be rather simple to change is the following:
When a clan stack is going strong, the balancer will often STILL give good, well performing players to that side.

Let's consider a scenario that you might see quite often in game:
- A clan stacked team is winning 3-0 and the top half of their team has scores like 11/1, 8/2, 5/1 and many scores in the 100's.
- Meanwhile the other team has lost all the rounds that map, it's top half of the team has kdrs like 5/2, 4/3, 3/3 and scores in the 50's or so. 

In this situation, it has to keep the banner stack together, but shouldn't it give any "free agent or small clan" that is doing well to the OTHER TEAM?  And yet, it does not. 
This seems insane to me and it kills gameplay....

** WHETHER ITS FROM A STACK OR NOT - The end result of a map should be that the top half of the scoreboard should look RELATIVELY similar as far as kdrs/scores **
Doesn't have to be exact, but the current results (similar to the scenario I posted above) are so obviously one sided.  If this were fixed you would see a lot more close matches instead of so many steamrolls.

I've seen the stupid thing balance the teams in such away that I'm the top of the team with 250 ping and like 5 kills... Some times the thing is just fucking retarded.
Title: Re: Proposed change to team-balance algorithim
Post by: Sniger on March 17, 2014, 11:02:40 pm
id really like to know if the all cav on team A and all range on team B is some black dev-magic or just warband
Title: Re: Proposed change to team-balance algorithim
Post by: Sniger on March 21, 2014, 12:29:39 pm
also http://en.wikipedia.org/wiki/Game

"Key components of games are... challenge, interaction."

losing 5th round 20-0 is not challenging, thats just sheer rape.

balanced fights are the most challenging.



Title: Re: Proposed change to team-balance algorithim
Post by: Elindor on March 31, 2014, 11:20:57 pm
any updates to this?
Title: Re: Proposed change to team-balance algorithim
Post by: Dementia on April 03, 2014, 01:51:53 am
bump
Title: Re: Proposed change to team-balance algorithim
Post by: Thryn on April 11, 2014, 03:39:45 pm
I'd love an update :D
Title: Re: Proposed change to team-balance algorithim
Post by: Sniger on April 18, 2014, 12:50:34 pm
me too
Title: Re: Proposed change to team-balance algorithim
Post by: Jona on April 24, 2014, 10:53:39 am
Bump for justice!
Title: Re: Proposed change to team-balance algorithim
Post by: Baskakov_Dima on April 24, 2014, 01:00:10 pm
I did not read the thread, sorry, I will probably do that now, but I completely dislike the game trying to give me 50% win/loss ratio. Players will not be interested to play as good as possible, because if they do, they will have to play better and better. Everybody will just leech and still have lots of money and XP.
Title: Re: Proposed change to team-balance algorithim
Post by: Jarold on April 28, 2014, 05:29:08 am
Don't give up on us  :cry:
Title: Re: Proposed change to team-balance algorithim
Post by: Joseph Porta on April 30, 2014, 02:21:28 pm
Cant totalarmor value be incorporated in the code? I think that armor value, especially on siege, is a big factor.

Also do battle & siege have seperate balancing system?
Title: Re: Proposed change to team-balance algorithim
Post by: San on April 30, 2014, 08:44:40 pm
At this point, I might try to see if I can do *something* with this sometime this weekend. If I knew of an easier way to test it, that could help.
Title: Re: Proposed change to team-balance algorithim
Post by: Tydeus on May 01, 2014, 04:42:26 pm
Alright, I will be testing a change this weekend. You won't have to download any files, but be warned; you're going to have poor ping. Test will be scheduled for Saturday 12:00 PM(Noon) Central US / 5 PM GMT. You'll want to search for the server "cRPG_Tyd_Testbed" and don't forget to switch from "favorites" to "internet". The more people we have, the better the test will be, that's why I'm making this public, rather than just getting a select few testers as I normally do.

Edit: If you want to check out the new(er) 1h right-to-left anim, use this: https://dl.dropboxusercontent.com/u/24876970/cRPG%20Stuff/anim_tydeus_nudges.rar and replace the modules/crpg/resources/anim_tydeus_nudges.brf with the one inside the .rar.
Title: Re: Proposed change to team-balance algorithim
Post by: Thryn on May 01, 2014, 05:19:52 pm
Alright, I will be testing a change this weekend.

What may that be :?:  :)
Title: Re: Proposed change to team-balance algorithim
Post by: Tydeus on May 01, 2014, 06:34:20 pm
What may that be :?: :)
Just a minor change to the cf_crpg_autobalance_get_level script. I have it pull the character's score_offset, so if we end up having offset saved on the website, it should even be able to function on the first round.
Title: Re: Proposed change to team-balance algorithim
Post by: Angantyr on May 12, 2014, 11:06:24 am
Early morning battles are often imbalanced because of the low server population, but I've just lost six maps in a row utter annihilation on every single one of them, when finally my team won 1 round I was switched, ha ha. This is probably a personal record, was unsure if it was even possible to lose that many consecutive rounds

Here it was mostly due to class balance, sort of sucked out of the fun after map 3.
Title: Re: Proposed change to team-balance algorithim
Post by: Thryn on May 13, 2014, 04:52:09 pm
Bump for Justice.

Vanthor needs to come out of his hidey-hole and show us his new balancer :)
Title: Re: Proposed change to team-balance algorithim
Post by: Jona on May 14, 2014, 03:51:53 am
RIP Vanthor. He was a brave soul, tackling this project all on his own.


(click to show/hide)
Title: Re: Proposed change to team-balance algorithim
Post by: HarunYahya on May 14, 2014, 09:49:01 am
Well, whatever you do just don't forget to add  "/teamswitch:Cicero_end_of_Round_2" line.
Seriously we get into eu1 with 10 clanmates,as soon as we finish the first round together, he gets kicked in to opposing team and leaves us as herdless flock of sheep  :evil:
Title: Re: Proposed change to team-balance algorithim
Post by: Angantyr on May 14, 2014, 01:25:54 pm
Reconsidered.
Title: Re: Proposed change to team-balance algorithim
Post by: Thryn on June 22, 2014, 08:26:09 pm
visitors can't see pics , please register or login
Title: Re: Proposed change to team-balance algorithim
Post by: Vanthor on June 24, 2014, 09:52:27 pm
Tydeus, any update on how that little auto balance test change went?
Title: Re: Proposed change to team-balance algorithim
Post by: Jona on June 24, 2014, 09:57:00 pm
HE LIIIIIIIIIIIIIVES!  :mrgreen:
Title: Re: Proposed change to team-balance algorithim
Post by: San on June 24, 2014, 10:38:31 pm
Tydeus, any update on how that little auto balance test change went?

There was a test on the testbed server, but nothing from the autobalance was working. That has since been fixed, but I don't think anything further was done.
Title: Re: Proposed change to team-balance algorithim
Post by: Tydeus on June 28, 2014, 02:49:51 am
Tydeus, any update on how that little auto balance test change went?
There was a test on the testbed server, but nothing from the autobalance was working. That has since been fixed, but I don't think anything further was done.
I need to organize another test. Perhaps I'll do that next weekend.
Title: Re: Proposed change to team-balance algorithim
Post by: San on June 30, 2014, 07:07:24 am
This is currently the most desperately needed change. If there is a way to split based on build or gear, that would be phenomenal. A quick fix for player worth would already be leagues beyond what we currently have.
Title: Re: Proposed change to team-balance algorithim
Post by: Tydeus on July 13, 2014, 01:34:12 pm
Live test failed horribly due to a major oversight on my part.  :P

Perhaps I can get another test going after a strat battle/Official Event sometime.
Title: Re: Proposed change to team-balance algorithim
Post by: Sniger on July 13, 2014, 03:33:18 pm
yeah or could ask a couple clans to help fill out the rooster for a test battle server, im sure you would get enough players to carry out tests... ill try ask kalmars, the more the merrier i guess :)
Title: Re: Proposed change to team-balance algorithim
Post by: Tydeus on July 14, 2014, 03:22:32 am
yeah or could ask a couple clans to help fill out the rooster for a test battle server, im sure you would get enough players to carry out tests... ill try ask kalmars, the more the merrier i guess :)
Thing is, for a real test I need about 30+ (preferably 40+) players for about 30 minutes of testing. Most people will have 100+ ping, even NA players (due to my location).
Title: Re: Proposed change to team-balance algorithim
Post by: Noodlenrice on July 14, 2014, 04:15:42 am
Dafuq you live in the middle of Atlantic?
Title: Re: Proposed change to team-balance algorithim
Post by: Tydeus on July 14, 2014, 06:59:32 am
Dafuq you live in the middle of Atlantic?
Poor US routing. Living in the swamps of Louisiana doesn't help either, though.
Title: Re: Proposed change to team-balance algorithim
Post by: Sniger on July 18, 2014, 03:26:48 pm
visitors can't see pics , please register or login
Title: Re: Proposed change to team-balance algorithim
Post by: Tydeus on July 18, 2014, 03:47:24 pm
Where EST is Eastern Time. My bad.

Also, it's 4 PM East, not 2.
Title: Re: Proposed change to team-balance algorithim
Post by: Tydeus on July 19, 2014, 10:33:52 pm
Doesn't work without changing cf_crpg_autobalance, significantly. Thanks for at least looking at AB, Vanthor.