Raised This Month: $12 Target: $400
 3% 

Simple Team Balancer for TFC


Post New Thread Reply   
 
Thread Tools Display Modes
pizzahut
Senior Member
Join Date: Oct 2004
Old 11-01-2010 , 07:36   Re: Simple Team Balancer for TFC
Reply With Quote #11

This plugin is in constant use on two TFC servers.
v2.1 running on 81.171.82.124:27015 Games-Inside.nl TFC PlayGrounds - FF ON!
v2.15 running on 81.171.82.125:27025 Royston Vasey
The GI head admin hasn't updated because he didn't have any issues with the old version. I don't think the RV head admin has any issues with the more recent version either. (I'm maintaining the HLDS on the latter one, but I'm not head admin.)
__________________
My AMXX plugins (content date 2007-03-29, link check 2017-04-26)

Plugins for the Royston Vasey TFC server - These are UNSUPPORTED, except those which have been published at AMX Mod X.
pizzahut is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-01-2010 , 07:40   Re: Simple Team Balancer for TFC
Reply With Quote #12

I guess it's fine.

Approved.
__________________
Arkshine is offline
pizzahut
Senior Member
Join Date: Oct 2004
Old 04-04-2013 , 09:09   Re: Simple Team Balancer for TFC
Reply With Quote #13

The beta has been updated. The parsed keys (spawns, team size, deathmatch info) are now actually put to use, and an option has been added that allows disabling auto assign instead of putting players into the appropriate team. Thanks urban360 for the hint regarding keys.

Things that still need improving:
  • I should be using engclient_cmd instead of client_cmd.
  • Keys are evaluated each time a player joins. This should only be done once, e.g. by using a flag.
  • There are warnings because I'm using an "if" condition for the debug code. I could use a compiler directive instead, or a cvar to toggle debug mode.

Edit: Fixed in beta 4.

Last edited by pizzahut; 06-03-2013 at 14:07.
pizzahut is offline
pizzahut
Senior Member
Join Date: Oct 2004
Old 03-26-2015 , 16:30   Re: Simple Team Balancer for TFC
Reply With Quote #14

I noticed two bugs in beta 4 (v2.4) regarding the detection of HLDM entities (info_player_deathmatch).
  • If the key name is "classname" then the entity hasn't been created yet and is thus invalid. I removed the check inside pfn_keyvalue() whether the entity number is valid since it's not needed anyway.
  • In above case, the class name (1st parameter) isn't touched at all. I'm now initialising it with a default value, an empty string.
The version number has been bumped to "2.4.1".
pizzahut is offline
pizzahut
Senior Member
Join Date: Oct 2004
Old 04-18-2015 , 12:35   Re: Simple Team Balancer for TFC
Reply With Quote #15

Found another bug in the deathmatch detection of the beta. Some maps have both deathmatch and team spawns, and the deathmatch detection was done by checking for deathmatch spawns, which is wrong in this case. Changed it so that if an info_tfdetect entity is NOT found, the plugin will assume it's deathmatch (4 teams).

Last edited by pizzahut; 04-18-2015 at 12:35.
pizzahut is offline
pizzahut
Senior Member
Join Date: Oct 2004
Old 08-21-2015 , 16:51   Re: Simple Team Balancer for TFC
Reply With Quote #16

Added Forced Team Switching (fts.sma). This component is an alternative to Uneven Teams Warning. Instead of warning about teams being uneven, it randomly switches one player.

Edit: Changed it so that it doesn't check teams with a repeating timer, but instead checks teams when someone leaves or joins spectators.

Last edited by pizzahut; 08-21-2015 at 18:25.
pizzahut is offline
pizzahut
Senior Member
Join Date: Oct 2004
Old 09-14-2015 , 15:01   Re: Simple Team Balancer for TFC
Reply With Quote #17

Updated "Force Team Switch" plugin. I made the most recent changes 11 days ago, but wanted to leave it running for a while before releasing.

Changes:
- There will be a delay of up to 60s (configurable) before switching to avoid this happening too frequently. It uses the same cvar as UTW for this (stb_time).
- If the trigger word "teams" is mentioned in global chat, teams will be evened immediately.
- Some info on what the plugin is doing is printed to the client console.

Last edited by pizzahut; 09-14-2015 at 15:02.
pizzahut is offline
pizzahut
Senior Member
Join Date: Oct 2004
Old 09-20-2015 , 15:21   Re: Simple Team Balancer for TFC
Reply With Quote #18

Updated FTS again (v6.3).

- Added warnings so people have a chance to switch themselves and are informed ahead of time of what will happen.

- Added debug log again (messages appear in client console), and I found that a problem is that other plugins might switch around players using "engclient_cmd", which isn't noticed by FTS. I don't know how to catch this apart from going back to checking teams at a regular interval instead of event based (player disconnects or switches to spectators). So this is a known bug in FTS right now, which I only can work around, but not fix. Another work-around would be to patch other plugins (e.g. plmenu, afk kicker) to use client_cmd instead of engclient_cmd. This won't work for bots though.

- Added subsequent checks in case teams were extremely uneven. E.g. several disconnects in a row. I could also even the teams completely at once, but I want to give players time to switch voluntarily before being forced.

Last edited by pizzahut; 09-21-2015 at 15:33.
pizzahut is offline
pizzahut
Senior Member
Join Date: Oct 2004
Old 06-04-2016 , 14:42   Re: Simple Team Balancer for TFC
Reply With Quote #19

Added team scrambling (shuffle_teams.sma) - still needs some work though.

Hint: It may be better to use TFC's built-in damage balancing (tfc_balance_scores, tfc_balance_teams) instead of using a "Scramble teams?" vote.
pizzahut is offline
pizzahut
Senior Member
Join Date: Oct 2004
Old 01-08-2019 , 16:13   Re: Simple Team Balancer for TFC
Reply With Quote #20

Uploaded a new beta version (5).

- Bishop added cvar stb_immunity. If disabled, even admins with immunity have to keep teams even. Default is enabled, i.e. admins with immunity can switch to any team.
- Added cvar stb_debug which shows debug infos in console (client side). Default is disabled.
- Fixed a bug preventing players from joining any team. (Cause: There are maps which have references to teams which have no spawns, and the plugin didn't take this possibility into consideration. E.g. "maya" has a goal for team 4, but there's no spawn for it.)

Last edited by pizzahut; 01-08-2019 at 18:25.
pizzahut is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:46.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode