fairCTF

Expand and mod your server.
User avatar
L4m3r
Hater of Everything
Hater of Everything
Posts: 724
Joined: Tue Feb 08, 2005 5:15 am
Location: Los Angeles

fairCTF

Post by L4m3r » Fri Jan 27, 2006 4:10 am

From the readme:
During a CTF game, don't you hate it when someone keeps capturing the flag after teams have become very uneven? No more.

fairCTF is a plugin that continually checks team sizes to ensure that they are fair. If the plugin decides that the teams aren't even enough, CTF is disabled and players are notified; team flags will be dropped instantly when picked up. Once the teams even up again, CTF is re-enabled and the game can continue.
Note that the boundaries of what the plugin considers "fair" are changeable without recomplilation. See the readme for details and instructions.

I don't know if the .so will work under mac or not. If it doesn't, I'd greatly appreciate it if someone posted a mac build.

Have fun. :)

----

UPDATE: Version 1.1

I realized today that it would be very convenient to have commands to override the plugin. I went ahead and implemented them, since it was cake.

Thus, the plugin will now add a /ctf command to the game. More specifically, /ctf on, /ctf off, and /ctf auto. Read the updated readme for details.

----

UPDATE: Version 1.2

At the recommendation of A Temporal Distraction, I've altered the plugin command to give a little usage blurb when the command is issued incorrectly.

The switch delay has also been increased to five seconds.

----

UPDATE: Version 2.0

fairCTF has been added to the BZFlag source tree at the request of Bullet Catcher. Get the plugin there from now on. :)

I've also taken the opportunity to rewrite most of it to use more logical events. Flag drop delay is now configureable; see readme.
Attachments
fairCTF_linux.zip
fairCTF for Linux (OLD)
(9.51 KiB) Downloaded 795 times
fairCTF_win32.zip
fairCTF for Windows (OLD)
(6.45 KiB) Downloaded 760 times
fairCTF_source.zip
fairCTF source (OLD)
(12.34 KiB) Downloaded 886 times
Last edited by L4m3r on Tue Feb 07, 2006 6:12 am, edited 4 times in total.
Optimism is just a milder alternative to denial.

User avatar
Teppic
Private First Class
Private First Class
Posts: 575
Joined: Mon Mar 07, 2005 10:00 pm
Location: The North Block
Contact:

Post by Teppic » Fri Jan 27, 2006 12:17 pm

Dose it disable ctf for both teams, or just the team with more members?

temporal distraction
Sergeant
Sergeant
Posts: 250
Joined: Wed Jan 05, 2005 3:12 pm

Post by temporal distraction » Fri Jan 27, 2006 1:41 pm

When the teams are uneven and CTF is disabled, all team flags are immediately dropped where they are. It works quite nicely.

loophole
Private First Class
Private First Class
Posts: 56
Joined: Fri Oct 14, 2005 11:43 pm

Post by loophole » Fri Jan 27, 2006 5:11 pm

Sounds good, I am going to try this plugin out!
Teppic wrote:Dose it disable ctf for both teams, or just the team with more members?
I used to play quake3 and it would only prevent the larger team from handling the flag in an uneven-team situation. I think this is a good idea because it gives the underdog team an advantage, encouraging people to switch teams. Of course switching teams was much easier in q3 than in bz :D

User avatar
L4m3r
Hater of Everything
Hater of Everything
Posts: 724
Joined: Tue Feb 08, 2005 5:15 am
Location: Los Angeles

Post by L4m3r » Fri Jan 27, 2006 5:56 pm

Teppic wrote:Dose it disable ctf for both teams, or just the team with more members?
CTF is disabled for all teams. It wouldn't be fair otherwise. Teams can't even carry their own flags; the plugin effectively freezes the CTF game until the teams even out.
Optimism is just a milder alternative to denial.

loophole
Private First Class
Private First Class
Posts: 56
Joined: Fri Oct 14, 2005 11:43 pm

Post by loophole » Fri Jan 27, 2006 6:17 pm

L4m3r wrote: CTF is disabled for all teams. It wouldn't be fair otherwise.
Uneven teams are intrinsically unfair. Even if you take the flags out of the picture.

So denying caps for both teams really doesn't make it fair, rather it just prevents some very unfair activity(big team capping). But its not really "unfair" when the short handed team caps so it doesn't make sense to prevent that activity too IMHO.

If you were to only penalize the large team you would help to even the balance of power.

I think that CTF should always be encouraged, (only prevented in extreme circumstances) otherwise the game could just degenerate into an FFA with uneven teams, which is "not fair".

User avatar
L4m3r
Hater of Everything
Hater of Everything
Posts: 724
Joined: Tue Feb 08, 2005 5:15 am
Location: Los Angeles

Post by L4m3r » Fri Jan 27, 2006 6:35 pm

Cosmol wrote:
L4m3r wrote: CTF is disabled for all teams. It wouldn't be fair otherwise.
Uneven teams are intrinsically unfair. Even if you take the flags out of the picture.

So denying caps for both teams really doesn't make it fair, rather it just prevents some very unfair activity(big team capping). But its not really "unfair" when the short handed team caps so it doesn't make sense to prevent that activity too IMHO.

If you were to only penalize the large team you would help to even the balance of power.

I think that CTF should always be encouraged, (only prevented in extreme circumstances) otherwise the game could just degenerate into an FFA with uneven teams, which is "not fair".
In my opinion, making it impossible for one team to cap and only making it difficult for the other is a lot more unfair than letting it degenerate into FFA for a few minutes. Usually, only one player needs to switch. If they all refuse, then it's their own fault. :p

Not to mention, the plugin has no concept of which team is which; it ony judges the evenness between them. This is why it works for any number of teams. Making it selectively stop captures would require that it pretty much be reworked, and it opens up a ton of holes and special cases that would have to be dealt with, and special rules that players would have to learn. Too complicated.
Optimism is just a milder alternative to denial.

loophole
Private First Class
Private First Class
Posts: 56
Joined: Fri Oct 14, 2005 11:43 pm

Post by loophole » Fri Jan 27, 2006 7:21 pm

I disagree that it opens up a ton of holes and special cases.There are only 12 cases to consider if we want to just restrict people carrying flags of teams which they outnumber.

Anyway, you will end up with 16 cases to consider if you want to make behavior predictable for 4 teams, instead of just comparing the largest and smallest teams as it does now.

I think I will see If I can whip up something with the source if you don't want to work on this feature.

Thanks for all your efforts, bz has needed this plugin for a long time!

User avatar
L4m3r
Hater of Everything
Hater of Everything
Posts: 724
Joined: Tue Feb 08, 2005 5:15 am
Location: Los Angeles

Post by L4m3r » Fri Jan 27, 2006 8:50 pm

Cosmol wrote:I disagree that it opens up a ton of holes and special cases.There are only 12 cases to consider if we want to just restrict people carrying flags of teams which they outnumber.

Anyway, you will end up with 16 cases to consider if you want to make behavior predictable for 4 teams, instead of just comparing the largest and smallest teams as it does now.

I think I will see If I can whip up something with the source if you don't want to work on this feature.

Thanks for all your efforts, bz has needed this plugin for a long time!
If you're going to do it that way, you'd pretty much be making a new plugin. :p The only part I think you'd be able to use is the fairness "algorithm".
Optimism is just a milder alternative to denial.

User avatar
im fine u?
Private First Class
Private First Class
Posts: 99
Joined: Thu Dec 22, 2005 4:05 am
Location: in computer
Contact:

Post by im fine u? » Fri Jan 27, 2006 8:53 pm

THANK YOU!!!!!!

after mofo, I've been waiting forever for this!!!!!!!!!!
Image

Owner at: Gnurdux's servers

Admin at: (DVN)'s server
tankzilla's server
A Heart Attack's server

User avatar
The Knights Who Say Ni
Private First Class
Private First Class
Posts: 556
Joined: Mon Sep 26, 2005 7:21 pm
Location: Uplyme, England
Contact:

Post by The Knights Who Say Ni » Fri Jan 27, 2006 11:23 pm

Yes i Also will be using this if i can get a permnant server (hopefuly soon)
and also for my non-permnant server ive being needing this for a while.
Image
Sig Made By AlliedArmour

TGPH

User avatar
L4m3r
Hater of Everything
Hater of Everything
Posts: 724
Joined: Tue Feb 08, 2005 5:15 am
Location: Los Angeles

Post by L4m3r » Sat Jan 28, 2006 8:24 am

Plugin updated to 1.1 (see first post)
Optimism is just a milder alternative to denial.

User avatar
Matt?
Private First Class
Private First Class
Posts: 281
Joined: Sun Jan 09, 2005 10:15 pm
Location: st. john wa
Contact:

wait a minute

Post by Matt? » Tue Feb 07, 2006 4:31 am

am i the only one that has tried this? i get an error in apopup window behind bzflag. it says it is missing a file and re-installing it will help fix it
Image

User avatar
L4m3r
Hater of Everything
Hater of Everything
Posts: 724
Joined: Tue Feb 08, 2005 5:15 am
Location: Los Angeles

Post by L4m3r » Tue Feb 07, 2006 4:43 am

Which file? And which version of BZFlag?
Optimism is just a milder alternative to denial.

User avatar
Matt?
Private First Class
Private First Class
Posts: 281
Joined: Sun Jan 09, 2005 10:15 pm
Location: st. john wa
Contact:

Post by Matt? » Tue Feb 07, 2006 4:50 am

ok it is bzflag 2.0.5b5 and the file it need's is MSVCP71D.dll
Image

User avatar
L4m3r
Hater of Everything
Hater of Everything
Posts: 724
Joined: Tue Feb 08, 2005 5:15 am
Location: Los Angeles

Post by L4m3r » Tue Feb 07, 2006 6:12 am

The plugin has been updated. Try it now, Matt.
Optimism is just a milder alternative to denial.

User avatar
Matt?
Private First Class
Private First Class
Posts: 281
Joined: Sun Jan 09, 2005 10:15 pm
Location: st. john wa
Contact:

Post by Matt? » Tue Feb 07, 2006 3:39 pm

excellent, it loads to bzflag, nice work l4. btw what is the -whatever to run a ctf game? thanks
Image

temporal distraction
Sergeant
Sergeant
Posts: 250
Joined: Wed Jan 05, 2005 3:12 pm

Post by temporal distraction » Tue Feb 07, 2006 4:33 pm

Matt? wrote:what is the -whatever to run a ctf game? thanks
Take a look at the conf file in our "Official Files" sticky thread. That conf file is commented very well and you'll be able to find it there.

User avatar
netochka nezvanova
Private First Class
Private First Class
Posts: 120
Joined: Wed Jan 19, 2005 4:58 pm
Location: NL

Post by netochka nezvanova » Thu Feb 09, 2006 10:41 am

how about using the scores in the calculation of fair.
a team with one red and three blue is unfair
but what is the red has a score of say +25 and the blue all below zero

or take also the number of kills and deaths

a player has killed 34 tanks and got shot 33 times (score 1)
anotherplayer has killed 3 tanks but is shot 1 time. (score 2)

the first one can survive for a longer time is he better while having a lower score?
Image

Longhair
Private First Class
Private First Class
Posts: 330
Joined: Tue Feb 08, 2005 6:06 pm
Location: Lancaster, PA
Contact:

Post by Longhair » Thu Feb 09, 2006 1:52 pm

I'd be curious to know how your plugin compares to the script that silvercat is using on its servers. It calculates "fairness" based on a percentage (they have a big crowd, so being off by 1 isn't exactly unfair) and it sends a warning message to the player who is carrying the flag to drop it. It also sends a message about it to the admin channel. I think I like the idea of just having the flag drop, rather than us admins having to jump down somebody's throat when they're too obtuse to read a message from the server.

Personally, I'd weigh in on the side of allowing the minority team still being allowed to capture the flag. I realize that I'm saying this without being able to offer some code help, so whatever the outcome, it's a good idea!

User avatar
L4m3r
Hater of Everything
Hater of Everything
Posts: 724
Joined: Tue Feb 08, 2005 5:15 am
Location: Los Angeles

Post by L4m3r » Thu Feb 09, 2006 9:19 pm

netochka nezvanova wrote:how about using the scores in the calculation of fair.
a team with one red and three blue is unfair
but what is the red has a score of say +25 and the blue all below zero

or take also the number of kills and deaths

a player has killed 34 tanks and got shot 33 times (score 1)
anotherplayer has killed 3 tanks but is shot 1 time. (score 2)

the first one can survive for a longer time is he better while having a lower score?
Two issues with that. One, it would be horribly complicated. As of now, this is a very simple plugin. Adding score features would be quite an undertaking.

Second, we all know that combat scores tend to mean little in CTF. Sure, it can indicate player skill to an extent, but it doesn't say much about whether or not they're a team player.

Also, a discrepancy in numbers can make up for a huge skill difference. I once played a LAN CTF game alone against two complete newbies, but they whipped me because every time they managed to kill me, they'd make off with my flag and theirs. Unless I spawned right there at their base, it was over.
Longhair wrote:I'd be curious to know how your plugin compares to the script that silvercat is using on its servers. It calculates "fairness" based on a percentage (they have a big crowd, so being off by 1 isn't exactly unfair) and it sends a warning message to the player who is carrying the flag to drop it. It also sends a message about it to the admin channel. I think I like the idea of just having the flag drop, rather than us admins having to jump down somebody's throat when they're too obtuse to read a message from the server.
I'd like to know more about this script... I've even tried to see it in action, but no luck. Does it require admin intervention, or can it kick players by itself?

the plugin does use a percentage as its primary reckoning method, but you can also set an absolute maximum gap. there's also a setting to change the cutoff where a one player difference is considred unfair, in case you want it to be different than what the percentage would dictate in that case.
Longhair wrote:Personally, I'd weigh in on the side of allowing the minority team still being allowed to capture the flag. I realize that I'm saying this without being able to offer some code help, so whatever the outcome, it's a good idea!
Yeah, again, that would require a massive restructuring of the plugin. I'll admit that the algorithm cosmol suggested would probably work better in 3 or 4 team CTF games, but personally I'd hate to have the game "rigged" so only one team could win, even if they were at a disadvantage.
Optimism is just a milder alternative to denial.

temporal distraction
Sergeant
Sergeant
Posts: 250
Joined: Wed Jan 05, 2005 3:12 pm

Re: fairCTF

Post by temporal distraction » Fri Feb 24, 2006 1:43 am

L4m3r wrote:I don't know if the .so will work under mac or not. If it doesn't, I'd greatly appreciate it if someone posted a mac build.
Here is that mac build. OSX 10.4.5 so YMMV if you try this with other systems.

Have fun!
Attachments
fairCTF.zip
(50.63 KiB) Downloaded 657 times

User avatar
cosmos
Private First Class
Private First Class
Posts: 76
Joined: Thu Dec 23, 2004 7:18 pm
Location: Los Angeles
Contact:

freebsd 4.x version

Post by cosmos » Mon May 15, 2006 5:48 am

the hepcat hosting runs on freebsd 4.x and after some fiddling tonight i have successfully built a version of fairCTF for that platform. since others have posted their successful versions i am posting mine to hopefully help anyone else who may need it.
Attachments
fairCTF_freebsd.tar.gz
fairCTF FreeBSD 4.x Version
(795.24 KiB) Downloaded 661 times

User avatar
macsforme
General
General
Posts: 2024
Joined: Wed Mar 01, 2006 5:43 am

Post by macsforme » Mon Jul 03, 2006 10:31 am

I've created a simple patchfile that changes the plugin's behaviour somewhat. This file should patch against the current 1.2 version of the fairCTF plugin source code. This patch implements the following features:
1. Teams are now free to carry their own team flags at any time.
2. The weaker team (the one with fewer players) can now carry the stronger team's flag at any time. In a map with more than two teams, this is true of any one team's number of players relative to any other team's number of players.

Thought you all might enjoy this, since it has been requested multiple times. Have fun!
Attachments
fairCTF_patched.cpp.txt
(8.69 KiB) Downloaded 705 times
const_fairctf.diff.txt
(3.21 KiB) Downloaded 665 times
Last edited by macsforme on Wed Jul 12, 2006 6:11 am, edited 1 time in total.

meeba
Master Sergeant
Master Sergeant
Posts: 507
Joined: Sun Mar 12, 2006 10:49 pm
Location: N. Sanity Beach
Contact:

Post by meeba » Fri Jul 07, 2006 9:32 pm

hey Constitution, I'm having problems with your modification of this plugin.

bzfs is crashing and all I see in output is this:

bad argument "ELF"

Post Reply