Author Topic: Team Switch a.k.a Team Balance.  (Read 1499 times)

0 Members and 2 Guests are viewing this topic.

Offline Cicero

  • Duke
  • *******
  • Renown: 515
  • Infamy: 418
  • cRPG Player Sir Black Pawn
  • scourge of god
    • View Profile
  • Faction: BashiBazouks
  • Game nicks: BashiBazouks_Cicero
  • IRC nick: Cicero
Team Switch a.k.a Team Balance.
« on: May 20, 2014, 01:23:38 pm »
+8
I was just curious about whats the fuckin formula for getting teamswitch ?

I have been playing this mode for 4 years or more cant even calculate it and i can only command my retard turks 1 round next round i am getting switched always.

Although its still better to not fight near Harunyahya and Velandor who got a teamspeak record on a hotkey says " sorry unbalanced shit" , i am really bored of this.

We need a new balance system.

Offline IR_Kuoin

  • King
  • **********
  • Renown: 1761
  • Infamy: 331
  • cRPG Player
  • What too write here?
    • View Profile
  • Faction: Fallen Brigåde
  • Game nicks: KuoiN, Ziath
  • IRC nick: Simply Kuoin
Re: Team Switch a.k.a Team Balance.
« Reply #1 on: May 20, 2014, 01:26:10 pm »
+3
1. Take on peasant gear
2. Leech
3. Make money
4. Get automatically switched to winning team
5. ???
6. Make sick amout of gold, get loomz
visitors can't see pics , please register or login

Offline Radament

  • King
  • **********
  • Renown: 1071
  • Infamy: 64
  • cRPG Player Sir Black Bishop
  • ☑Yes ☒No
    • View Profile
  • Faction: Faction
  • Game nicks: «Radament» «Miasma»
Re: Team Switch a.k.a Team Balance.
« Reply #2 on: May 20, 2014, 01:26:27 pm »
+2
i agree , sometimes it swithces me for no reason , i did not scored the max of my team , was not the higher lvl and server switch only me. i want to see the formula too.
visitors can't see pics , please register or login

Offline Moncho

  • King
  • **********
  • Renown: 1127
  • Infamy: 221
  • cRPG Player Sir Black Bishop A Gentleman and a Scholar
    • View Profile
  • Game nicks: Moncho, Some_Random_STF, Some_Random_Troll
Re: Team Switch a.k.a Team Balance.
« Reply #3 on: May 20, 2014, 02:02:08 pm »
+2
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),
]),

There may have been some changes to it, though, from http://forum.melee.org/suggestions-corner/proposed-change-to-team-balance-algorithim/75/

Offline Strudog

  • Marshall
  • ********
  • Renown: 922
  • Infamy: 361
  • cRPG Player A Gentleman and a Scholar
  • A Dog
    • View Profile
  • Faction: Britfag
  • Game nicks: Strudog
Re: Team Switch a.k.a Team Balance.
« Reply #4 on: May 20, 2014, 02:03:55 pm »
+2
it always seems to be the person second in the winning team,
This is the internet.
Men are men
Women are men
Little girls are FBI agents.
Those are the rules no?

Offline Cicero

  • Duke
  • *******
  • Renown: 515
  • Infamy: 418
  • cRPG Player Sir Black Pawn
  • scourge of god
    • View Profile
  • Faction: BashiBazouks
  • Game nicks: BashiBazouks_Cicero
  • IRC nick: Cicero
Re: Team Switch a.k.a Team Balance.
« Reply #5 on: May 20, 2014, 02:08:44 pm »
+1
There may have been some changes to it, though, from http://forum.melee.org/suggestions-corner/proposed-change-to-team-balance-algorithim/75/
My russian is pretty better than computer language ; so even boobs means more than those things.

Offline Teeth

  • King
  • **********
  • Renown: 2550
  • Infamy: 1057
  • cRPG Player Sir Black Bishop A Gentleman and a Scholar
    • View Profile
Re: Team Switch a.k.a Team Balance.
« Reply #6 on: May 20, 2014, 02:22:16 pm »
0
In my experience it has a lot to do with k/d. I always felt that as soon as I pass 3.0 it's continous switching time. It does sometimes really suck when you are playing with your clan, especially if there are some ranged players from your clan on. Unlike some clans Byzantium doesn't avoid killing their clanmates, usually we focus eachother hard. If there are a few ranged cunts on my team, like Chase or Hate More that will incessantly focus me, getting switched is my cue to leave. Nevertheless, switching the players with high k/d's usually has the intended effect of evening up the teams rather efficiently.

Yeah, thanks Moncho, posting that is really helpful. That code looks like such a convoluted mess, someone should probably discard it entirely and write a new one from the ground up. Would do the game a lot of good, but finding that someone who has the ability and will to do that, that's the problem. I believe San and Tydeus might have been trying to do some work on it though.

Offline Switchtense

  • King
  • **********
  • Renown: 1137
  • Infamy: 137
  • cRPG Player Sir White Bishop
  • poking you where the sun dont shine!
    • View Profile
  • Faction: Unicorns, BIRD CLAN BEST CLAN!
  • Game nicks: All sorts of Switch's
  • IRC nick: Switchtense
Re: Team Switch a.k.a Team Balance.
« Reply #7 on: May 20, 2014, 02:28:48 pm »
0
In my experience it has a lot to do with k/d. I always felt that as soon as I pass 3.0 it's continous switching time. It does sometimes really suck when you are playing with your clan, especially if there are some ranged players from your clan on. Unlike some clans Byzantium doesn't avoid killing their clanmates, usually we focus eachother hard. If there are a few ranged cunts on my team, like Chase or Hate More that will incessantly focus me, getting switched is my cue to leave. Nevertheless, switching the players with high k/d's usually has the intended effect of evening up the teams rather efficiently.

Well, I find myself being switched every now and then as well, and I am usually quite far from having a 3:1 k/d.
For all the non-believers, look no further than this thread for proof that while strat battles are won/lost in NA3/EU3, strat wars are won and lost on the forums.
visitors can't see pics , please register or login

Offline Cicero

  • Duke
  • *******
  • Renown: 515
  • Infamy: 418
  • cRPG Player Sir Black Pawn
  • scourge of god
    • View Profile
  • Faction: BashiBazouks
  • Game nicks: BashiBazouks_Cicero
  • IRC nick: Cicero
Re: Team Switch a.k.a Team Balance.
« Reply #8 on: May 20, 2014, 02:30:38 pm »
0
Well actually people can re-write it but the problem ; what shall it be ?

I mean banner balance for sure otherwise no need to have a clan but this limits some of the balance since we dont have enormous player base nowadays.

I always wanted to have a class balance but how can it work if someone gonna make a archer clan and join server with 10 archers with same banner ?


Offline NJ_Legion_Icedtea

  • Count
  • *****
  • Renown: 259
  • Infamy: 35
  • cRPG Player Sir White Knight
    • View Profile
  • Faction: Norsemen
  • Game nicks: Norse_Icedtea
  • IRC nick: Icedtea
Re: Team Switch a.k.a Team Balance.
« Reply #9 on: May 20, 2014, 02:37:40 pm »
+1
I saw this and thought it was a Switch appreciation post  :lol:

but all I know is if you are the last person to TH on your team you are also switched, if I am correct?
(click to show/hide)

Offline Switchtense

  • King
  • **********
  • Renown: 1137
  • Infamy: 137
  • cRPG Player Sir White Bishop
  • poking you where the sun dont shine!
    • View Profile
  • Faction: Unicorns, BIRD CLAN BEST CLAN!
  • Game nicks: All sorts of Switch's
  • IRC nick: Switchtense
Re: Team Switch a.k.a Team Balance.
« Reply #10 on: May 20, 2014, 02:46:59 pm »
0
I saw this and thought it was a Switch appreciation post  :lol:

That's what I thought at first as well :D But then I realised, who the hell would ever do this, and especially: WHY? :D
For all the non-believers, look no further than this thread for proof that while strat battles are won/lost in NA3/EU3, strat wars are won and lost on the forums.
visitors can't see pics , please register or login

Offline Cicero

  • Duke
  • *******
  • Renown: 515
  • Infamy: 418
  • cRPG Player Sir Black Pawn
  • scourge of god
    • View Profile
  • Faction: BashiBazouks
  • Game nicks: BashiBazouks_Cicero
  • IRC nick: Cicero
Re: Team Switch a.k.a Team Balance.
« Reply #11 on: May 20, 2014, 04:54:53 pm »
0
I saw this and thought it was a Switch appreciation post  :lol:

but all I know is if you are the last person to TH on your team you are also switched, if I am correct?
(click to show/hide)
I thought its a fuckin myth :)

Offline tisjester

  • Baron
  • ****
  • Renown: 102
  • Infamy: 6
  • cRPG Player
    • View Profile
  • Faction: KUTT
  • Game nicks: TitsJester
Re: Team Switch a.k.a Team Balance.
« Reply #12 on: May 20, 2014, 06:21:05 pm »
0
"team balancer" or inverse stacker as I like to call it.
If it was truly even Team A would win as much as Team B, and there would be no multi.
visitors can't see pics , please register or login

Offline HarunYahya

  • Marshall
  • ********
  • Renown: 965
  • Infamy: 309
  • cRPG Player
  • Proud Abdulla wielder
    • View Profile
  • Faction: BashiBazouks
  • Game nicks: HarunYahya,HarunShootya,Inan
  • IRC nick: HarunYahya
Re: Team Switch a.k.a Team Balance.
« Reply #13 on: May 20, 2014, 06:35:15 pm »
+1
I was just curious about whats the fuckin formula for getting teamswitch ?

I have been playing this mode for 4 years or more cant even calculate it and i can only command my retarted turks 1 round next round i am getting switched always.

Although its still better to not fight near Harunyahya and Velandor who got a teamspeak record on a hotkey says " sorry unbalanced shit" , i am really bored of this.

We need a new balance system.
Why the hatin?
I hit you so you can face a real challenge, knowing you would die in 1 hit makes you a better player. Trust me you are nothing without my psychological help through team hits.
And u know, the shit is unbalanced and your footwork is bad so as your blocks y u no block my hits ? Spammer nublet.

Offline Donkey_Thrower

  • Baron
  • ****
  • Renown: 80
  • Infamy: 8
  • cRPG Player
  • Official Master of Donkey Throwing
    • View Profile
    • Donkey Facts!
  • Faction: Donkey Trap All Stars/Federal Burro of Information
  • Game nicks: Donkey_Thrower, Donker, DonkStar_Donkey_Thrower
  • IRC nick: Donkey_Thrower
Re: Team Switch a.k.a Team Balance.
« Reply #14 on: May 20, 2014, 07:16:46 pm »
0
There may have been some changes to it, though, from http://forum.melee.org/suggestions-corner/proposed-change-to-team-balance-algorithim/75/

Jesus christ what programming language is that? God have mercy on whatever poor soul had to code that.
visitors can't see pics , please register or login

Donkey thrower official Master of Donkey Throwing.
Support Donkey Armor!!! http://forum.melee.org/suggestions-corner/plated-donkey/