GunGame mode plugin

Questions, comments, and news on the server side plug-ins and it's API
Post Reply
User avatar
Trogdor BurNinat0R
Private First Class
Private First Class
Posts: 10
Joined: Fri Jun 29, 2007 3:33 am
Location: Location Location
Contact:

GunGame mode plugin

Post by Trogdor BurNinat0R » Wed Mar 20, 2013 5:02 pm

I've got an alpha-stage plugin which emulates "GunGame" from CS and GoldenEye Source style of play. It's very simple, but I think it's fun - especially with different skill level players on the same server.

This plugin changes how flags work - players don't pick them up or drop them anymore.

All players start out with Laser flag. On each successive kill, their flag is replaced with a less powerful one, moving on eventually to bad flags. The first player to kill someone with the last flag wins. That's basically it. Suicide results in going back one flag.

One issue I've discovered (trial and error) is that flags need to exist in the world for bz_givePlayerFlag() to work. So you have to allocate 'n' of each flag in the map or when you start bzfs...

It would be nice if I could completely hide these (now useless) flag. Like _hideFlagsOnRadar() but... also on the actual map. It would also be nice if I could disable a player weapon through the API (for example, when they have SR).

It would also be nice if I could just allocate the flags in the plugin rather than create a dependency on the map or bzfs invocation that they all exist...

Thoughts?

User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5119
Joined: Fri Dec 13, 2002 4:11 am
Location: [Redacted]
Contact:

Re: GunGame mode plugin

Post by JeffM » Wed Mar 20, 2013 6:27 pm

Yeah the system doesn't really support that. What we want to eventually do is make the flag effects just be attributes that can be applied to players and the flags would just be one way to apply those attributes, plugins would be others. But this is a ways off, it requires large changes to the network protocol and the client so it would have to wait for the next major release.

What some people do is make a sealed room in the map somewhere and put all the flags in there like a storeroom, then just have the plugin put and pull flags from that location so players can never get them.

User avatar
joevano
General
General
Posts: 1863
Joined: Sat Jun 18, 2005 1:08 pm
Location: South Bend, Indiana, USA

Re: GunGame mode plugin

Post by joevano » Wed Mar 20, 2013 6:37 pm

Often it is way up in the sky, so that the flags are dimmed on radars that show your relative hight to the object.
There is nothing worse than aggressive stupidity. -- Johann Wolfgang von Goethe
"How many legs does a dog have if you call his tail a leg? Four. Calling a tail a leg doesn't make it a leg." -- Abraham Lincoln

User avatar
Trogdor BurNinat0R
Private First Class
Private First Class
Posts: 10
Joined: Fri Jun 29, 2007 3:33 am
Location: Location Location
Contact:

Re: GunGame mode plugin

Post by Trogdor BurNinat0R » Wed Mar 20, 2013 8:16 pm

I was hoping to make this somewhat map agnostic. Is it common practice in these cases to distribute the map as well, or just a snippet to insert in the .bzw file?

I'll also probably distribute the .conf file - it contains the "correct flags" so that they're guaranteed to be available in-game to all players at all times.

User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5119
Joined: Fri Dec 13, 2002 4:11 am
Location: [Redacted]
Contact:

Re: GunGame mode plugin

Post by JeffM » Wed Mar 20, 2013 8:18 pm

Some plugins only work with specific map setups.

You could try to make the plugin look for a specifically named zone to put the flags in. If the map doesn't have the zone don't activate your logic. Then you aren't tied to a specific map, but a class of maps that have the features you need.

It's not perfect but it can't be perfect in the current software.

User avatar
blast
General
General
Posts: 4589
Joined: Fri Mar 21, 2003 3:49 pm
Location: playing.cxx
Contact:

Re: GunGame mode plugin

Post by blast » Wed Mar 20, 2013 9:30 pm

Generally the flag spawning is controlled through zone(s) in the map file, not through a plugin. I don't think there is enough logic exposed in the plugin API to effectively take over flag spawning.
"In addition to knowing the secrets of the Universe, I can assure you that I am also quite potty trained." -Koenma (Yu Yu Hakusho)

Image

User avatar
optic delusion
Special Forces
Special Forces
Posts: 946
Joined: Sat Sep 25, 2004 2:29 pm
Location: Planet MoFo
Contact:

Re: GunGame mode plugin

Post by optic delusion » Thu Mar 21, 2013 4:43 am

Sounds to me like you'll want to use zoneflag zones.
Zoneflag will spawn flags ALWAYS where you want them, even if you don't specify the flags elsewhere in the conf. In fact, for this application DO NOT specify the flags elsewhere in the conf.
Also use -set _maxFlagGrabs 1 (or zero may be better). And don't forget -fb
With this combination of options, flags should always fly back to the zone when dropped.

A few years ago I tried a similar technique with what I called "progressive flags".
We had to take the current flag away from the player before giving (zap) them the new one.
We found that what might appear to work perfectly on a local server did not work on a public server, because of lag, and you are trying to hit a moving target.
A delay of one quarter second between the taking and the giving proved 99.5% effective. Set your lag limit low.
Also, that was BZFlag version 2.0.12. I'm pretty sure that the flag zap has improved since then.
Take a look at my Defender game mode concept.

Thinking is not an automatic process. A man can choose to think or to let his mind stagnate, or he can choose actively to turn against his intelligence, to evade his knowledge, to subvert his reason. If he refuses to think, he courts disaster: he cannot with impunity reject his means of perceiving reality.

User avatar
Trogdor BurNinat0R
Private First Class
Private First Class
Posts: 10
Joined: Fri Jun 29, 2007 3:33 am
Location: Location Location
Contact:

Re: GunGame mode plugin

Post by Trogdor BurNinat0R » Thu Mar 21, 2013 5:35 am

Thanks again!

Progressive flags sounds similar.

I currently catch any drop event and re-give the flag if they're alive. It is possible though for a person to drop/fire/drop/fire/drop/fire really quickly and sometimes squeak a normal shot through before the re-give happens. I'm not sure I can fix that though.

I am currently using a single zoneflag zone with -fb (way up high on a box so you don't see them even on radar). And setting _hideFlagsOnRadar too, because it's there.

I saw mention of this pre-zapping in the forums, so I'm also calling bz_removePlayerFlag (Is this the "zap" call you are referring to?) before bz_givePlayerFlag, and that *usually* works without a delay. I think adding a delay between "zap" and "give" may solve the remaining two problems I've seen. I presume one typically does this with eTickEvents?

Here's what I saw (each happened twice), but I haven't really debugged it yet:

1) "shot type did not match expected shot type" --> kick
2) bz_givePlayerFlag() fails b/c "player was dead"

I'll pull the mofo stuff in the clouds out of the map - that is I think just cosmetic anyway. Should be easy to find as it's all high up.

User avatar
blast
General
General
Posts: 4589
Joined: Fri Mar 21, 2003 3:49 pm
Location: playing.cxx
Contact:

Re: GunGame mode plugin

Post by blast » Thu Mar 21, 2013 11:01 am

Trogdor BurNinat0R wrote:I currently catch any drop event and re-give the flag if they're alive. It is possible though for a person to drop/fire/drop/fire/drop/fire really quickly and sometimes squeak a normal shot through before the re-give happens. I'm not sure I can fix that though.
You actually can solve this. You can alter the shot flag type of bullets, and if you set it to PZ, the bullets will show up for other people as "zoned" bullets, meaning it would only kill tanks that have PZ and have gone through a teleporter. So if you don't intend to use PZ as an actual flag, this can be used to negate the effect of bullets if the shot had no flag type set.
"In addition to knowing the secrets of the Universe, I can assure you that I am also quite potty trained." -Koenma (Yu Yu Hakusho)

Image

User avatar
Trogdor BurNinat0R
Private First Class
Private First Class
Posts: 10
Joined: Fri Jun 29, 2007 3:33 am
Location: Location Location
Contact:

Re: GunGame mode plugin

Post by Trogdor BurNinat0R » Thu Mar 21, 2013 2:15 pm

Oh so THAT'S what PZ is good for!!! :lol-old:

EDIT: I'll also totally use this to make the end flag (SteamRoller) have a "disabled" gun. Closer to "knife" of traditional GunGame end weaponry.

User avatar
Trogdor BurNinat0R
Private First Class
Private First Class
Posts: 10
Joined: Fri Jun 29, 2007 3:33 am
Location: Location Location
Contact:

Re: GunGame mode plugin

Post by Trogdor BurNinat0R » Tue May 14, 2013 12:22 am

Optic Delusion is awesomely hosting this plugin over at planet mofo while any remaining kinks are hopefully ironed out.

It more or less works, and I think it pairs well on the "passion of the FFA" map.

It's online *sometimes*. Search for "mofo" in the servers list (use '/' to search) and if you see something about gungame, that's it. PM me through the forum if you find bugs -- preferably with as much info about what happened right around the time of your problem as you think might be relevant.

And if anyone is interested, the code lives here:
https://github.com/danryder/bzGunGameStyle

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest