fairCTF

Questions, comments, and news on the server side plug-ins and it's API
Post Reply
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 »

This plugin has been released. Please see the release thread for the latest plugin version and up-to-date info.

...a beta. My first plugin. :D

In CTF games, it always sucks when half your team leaves at once, and some <insert colorful word here> continues to capture your flag, even though you're outnumbered 2:1, and no one is willing to switch teams.

fairCTF is my solution to this problem. It checks whether or not the teams are even, numerically. If the teams are uneven, any team flags will be dropped in place almost instantaneously if they are grabbed (or if they're being carried). This includes friendly team flags, effectively freezing the CTF aspect of the game until the teams even up. Players are notified whenever CTF is enabled or disabled.

A team is uneven if:
-The difference in size between the two teams is greater than or equal to 25% of the size of the smaller team when the gap is greater than 1
-The difference in size is four players or more.
-when the smallest team is two players or fewer and the teams are not exactly even.

That last one might sound akward, but it's special to prevent the percentage filter from catching 3v4 or 4v5.

Here are some numbers that the plugin should consider fair:
1v1
2v2
3v4
4v5
5v6
11v9
13v16

these should not be seen as fair by the plugin:
1v2
2v3
2v4
3v5
8v10
17v21

Rogues and teams with zero players are ignored.

This is designed for two-team CTF (any two teams), but it can be used with three or four teams if desired. I do not recommend this, though, because you will have to get a lot of players on the server before it will allow CTF. If there are more than two active teams, the plugin will determine fairness by comparing the smallest and largest teams.

If only one team is present, CTF is allowed (not that it matters).

If any mac and/or linux users would be so kind as to make sure this will build and run properly, I'd really appreciate it. I can't compile plugins under linux, sadly.

Please excuse my crappy coding skills, as I have only had one quarter of formal C++ instruction.

I love the idea of being able to contribute working implementations of my own ideas in the form of plug-ins... :)

in the attatched zip, there is the source code and a Windows DLL, all I can build. Hope it works, and if it does, enjoy.
Attachments
fairCTF.zip
fairCTF plugin
(72.6 KiB) Downloaded 373 times
Last edited by L4m3r on Mon Mar 20, 2006 10:03 am, edited 3 times in total.
Optimism is just a milder alternative to denial.
User avatar
I_Died_Once
Special Forces
Special Forces
Posts: 635
Joined: Sun Nov 28, 2004 5:27 pm
Location: The Dark Side
Contact:

Post by I_Died_Once »

ALright L4m3r, I'm gonna start an age old debate on ya.

What constitutes unfair? I'm of the school that thinks that once you get over 5 people a differance of 1 player between the teams should be acceptable. (but NOT two) Once you get over 10 players, a differance of two should be accepted. At fifteen, a three player differance should be OK. (OK to cap the flag, that is) Increase the differance allowed by one for every five players on the server. (now, I'm talking about 2 team CTF. More than that will need a revision?)

But I will also say that if you are in a CTF game, if you would concentrate on defending your flag, capping their flag, and the game itself, instead of counting how many people are on what team - you might play a little better and not even noticew the absence of a team mate.

I've held off three players all by myself on a couple of occasions, AND landed myself a cap. I swear that some of you people worry about the most retarded things. I know the folks at Viper's are frothing at the mouth for this plugin.

L4m3r, you're the man.
...This has been a recording.
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 »

Read my whole post, Darth. It allows a difference of one player, unless there are 2 or fewer on the smaller team. :p

Likewise, it's roughly the same as your limits, except that the ones you specify are the upper limit of what's not considered fair by the plugin- e.g. 10 vs. 8 is not ok, but 9 vs 11 is. Up until a gap of four players occurs, the plugin goes by a percentage difference.

I don't like to whine about it that much when there's a difference of one player, but 5v3 is a noticeable disadvantage. I don't normally check for missing teammates at random; I usually check when I notice that I can hardly spawn...
Optimism is just a milder alternative to denial.
1veedo
Private First Class
Private First Class
Posts: 184
Joined: Sat Feb 05, 2005 1:26 am
Location: usa

Post by 1veedo »

I dont think the difference should be so small. You said
these should not be seen as fair by the plugin:
1v2
2v3
2v4
3v5
8v10
17v21
8 v 10 really isn't that unfair. 7 v 10 I would say is. But I guess if people disagree they can just modify it themselves.

Great job, though!
1veedo (libcurl.so.2) I have version 3!
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 »

1veedo wrote:I dont think the difference should be so small. You said
these should not be seen as fair by the plugin:
1v2
2v3
2v4
3v5
8v10
17v21
8 v 10 really isn't that unfair. 7 v 10 I would say is. But I guess if people disagree they can just modify it themselves.

Great job, though!
Thanks.

And like I said, 8v10 is the upper limit for a difference of two; the plugin will accept 9v11 as even enough... it's close, at least :P
Optimism is just a milder alternative to denial.
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 »

I've managed to compile it in linux thanks to some help from Tropican8. The zip file now includes a linux .so and a windows .dll.

EDIT: also updated to CVS API.
Optimism is just a milder alternative to denial.
User avatar
Hannibal
Private First Class
Private First Class
Posts: 1073
Joined: Mon May 02, 2005 10:27 pm
Contact:

Post by Hannibal »

I believe that the silvercat folks have something like this relatively in place. it sends the person private messages to drop the flag in 15(?) seconds or be kicked. but I like this.
Games don't make people violent, lag does.
ImageImage
User avatar
Sir Kay of Camelot
Private First Class
Private First Class
Posts: 51
Joined: Sat Jan 21, 2006 7:52 pm
Location: You'll Never Know!
Contact:

.

Post by Sir Kay of Camelot »

Hey I think you should make new topics about new plugins your doing great but also I don't think 8v10 isn't that unfair either....7v10 is but not excactily 8v10....I think you should change that.....Gnurdux is making a theme plugin maybe you could help him :twisted:
Owner@Cruel's
Admin@(Dvn)'s
Cop@Theme's
Cop@Alex135's
God@-Shadow-'s
Owner@YOUR DEAD's
Owner@Gnurdux's
Maker of Servers
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 »

Whoops. forgot about this thread.

The plugin has been released. see this thread. A few new features have been added, including cusomizeability.
Optimism is just a milder alternative to denial.
User avatar
SilverFox
Private First Class
Private First Class
Posts: 163
Joined: Wed Oct 06, 2004 6:51 pm
Contact:

Permissions Problems

Post by SilverFox »

I have both the FAIRCTF permission and the +ALL permission, yet I do not have the permission to run the /ctf command. I'd tell you the revision, but I can't find the version in the README file or anywhere else.

When I do a "/showperms" it doesn't list fairCTF.

Any ideas?
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 »

Interesting.

I take it you're using the release version, since the readme is the only place that contains info about the FAIRCTF perm.

First off, what version of BZFS are you using, and what OS?

my groups have the perm and we've never had any problems, from 2.0.4 to CVS from a couple nights ago. the server pass does not cause it to stop working either. However, /showperms does not show fairCTF, probably because it's a custom perm.

If you're sure the plugin is loading right, and for some mysterious reason your particular bzfs doesn't like the perm, you could always use a normal perm unique to whomever you want running the plugin, e.g. BAN, by making a small tweak to the source in the ctfCommand::handle function (the last one IIRC). I could compile a special binary for you if need be. ;)
Optimism is just a milder alternative to denial.
User avatar
SilverFox
Private First Class
Private First Class
Posts: 163
Joined: Wed Oct 06, 2004 6:51 pm
Contact:

version

Post by SilverFox »

Code: Select all

BZFlag server 2.0.5.20051221-DEVEL-linux-gnu (protocol 0026) http://BZFlag.org/

Linux silvercat 2.4.27-2-386 #1 Mon May 16 16:47:51 JST 2005 i686 GNU/Linux
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 »

I just played at silvercat for a few minutes, and P Death Spiral was able to use the command while UL_Approved was not. Are you sure the perms are correct?

Still, though, using BAN instead of FAIRCTF is probably the easiest solution.
Optimism is just a milder alternative to denial.
User avatar
SilverFox
Private First Class
Private First Class
Posts: 163
Joined: Wed Oct 06, 2004 6:51 pm
Contact:

heh... interesting...

Post by SilverFox »

The way our groupfiles are set up, owner "include" admins, and admin "include" cop priveledges.

According to http://silvercat.bzflag.org/page3.html PDS is a cop. UL Approved is an admin.

I can only imagine that the problem is the FAIRCTF perm doesn't get "included" via the * operator. Anyhow, I'll add it manually to the other groups and see what happens.

Thanks for the help.
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 »

Perhaps the group perm inheritance only takes "standard" perms?

If a dev could shed some light on this I'd appreciate it. :?

Hope everything works afterward, SilverFox.
Optimism is just a milder alternative to denial.
User avatar
SilverFox
Private First Class
Private First Class
Posts: 163
Joined: Wed Oct 06, 2004 6:51 pm
Contact:

Post by SilverFox »

Well, adding it into each group rather than inheriting the previous groups perms made the difference. This is good to know. I'll know to look for this for any future plugins that have custom perms.
User avatar
cosmos
Private First Class
Private First Class
Posts: 83
Joined: Thu Dec 23, 2004 7:18 pm
Location: Los Angeles
Contact:

FreeBSD 4.x version

Post by cosmos »

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
(795.24 KiB) Downloaded 310 times
Post Reply