PassTheFlag 1.0.6 released

Expand and mod your server.
User avatar
FiringSquad
Sergeant
Sergeant
Posts: 849
Joined: Thu Jan 26, 2006 5:53 pm
Location: Ireland

Re: PassTheFlag 1.0.3 released (bugfix)

Post by FiringSquad »

Version 1.0.3 released to fix bug mention in previous post.
Available for download from initial post on first page.
User avatar
FiringSquad
Sergeant
Sergeant
Posts: 849
Joined: Thu Jan 26, 2006 5:53 pm
Location: Ireland

Re: PassTheFlag 1.0.4 released (bugfix)

Post by FiringSquad »

Version 1.0.4 released. BugFix version, although some debugging enhancements have been added to facilitate remote debugging.
User avatar
FiringSquad
Sergeant
Sergeant
Posts: 849
Joined: Thu Jan 26, 2006 5:53 pm
Location: Ireland

Re: PassTheFlag 1.0.5 released (Please Test)

Post by FiringSquad »

This version fixes the bug where things got confused when you dropped one flag while sitting on another. The server thought you had the flag, but no clients were informed.
For those interested in the technical details:
This problem was due to corruption of the flag-grab message caused by sending a flag-update before the flag-grab event was complete.
I fixed it by sending a flag-update message using a local message buffer, thus leaving the main message buffer undamaged.

I also added more flexibility in choosing which flags are passable.

Finally, I set the default maxwait value to 0.1
If this is too small, then you should see the flag being passed when some other effect was expected.
If you see this happening on your map, then you will need to increase this value in the loadplugin parameters.
User avatar
FiringSquad
Sergeant
Sergeant
Posts: 849
Joined: Thu Jan 26, 2006 5:53 pm
Location: Ireland

Re: PassTheFlag 1.0.5 released (Please Test)

Post by FiringSquad »

Updated Readme.txt for Version 1.0.5 to include info about debugaccess.
User avatar
FiringSquad
Sergeant
Sergeant
Posts: 849
Joined: Thu Jan 26, 2006 5:53 pm
Location: Ireland

Re: PassTheFlag 1.0.6 released (Please Test)

Post by FiringSquad »

I fixed a bug in the "customflags" command of the "-loadplugin" command-line.

Note: The flags must now be enclosed in square brackets for the command line. bzfs had problems dealing with multiple flags within braces as a plugin parameter due to Brace-Expansion. A silly oversight on my part.

Example command-line:

Code: Select all

./bzfs/bzfs -loadplugin ../plugins/passtheflag/.libs/PassTheFlag.so,customflags=[T,sw,G*],pass2anykiller,dist=9 etc.
The in-game commands "customflags" and "toggleflags" still use braces, i.e. "/fpass toggleflags={t,sw}" so as to avoid confusion with the BNF-like notation of the in-game help.
User avatar
blast
General
General
Posts: 4931
Joined: Fri Mar 21, 2003 3:49 pm
Location: playing.cxx
Contact:

Re: PassTheFlag 1.0.6 released (Please Test)

Post by blast »

FiringSquad, you might also consider having a configuration file instead of lots of custom parameters like that. As an example, the serverControl plugin does this (it has some parser for reading the config file). Just something to think about.
"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
FiringSquad
Sergeant
Sergeant
Posts: 849
Joined: Thu Jan 26, 2006 5:53 pm
Location: Ireland

Re: PassTheFlag 1.0.6 released (Please Test)

Post by FiringSquad »

Good idea. The configuration options just keep growing[sup]1[/sup]. :-)
I just had a look at the code and it looks pretty simple to implement[sup]2[/sup].
Thanks for the heads-up.

I won't implement it just yet, but the next version should have it.

[hr]
[/hr]
1. Whodathunk I'd be producing bloatware for my first plug-in. Jeez!
2. Of course I thought this plug-in would be a lot simpler to implement before I actually started typing.


What's with the "sup" and "hr" tags?
Ahh! That's right, superscript & Horizontal-line is not implemented here yet. One can but hope. :-)
Yrogirg
Private First Class
Private First Class
Posts: 154
Joined: Sat Oct 27, 2007 7:24 pm

Re: PassTheFlag 1.0.6 released (Please Test)

Post by Yrogirg »

Dirty hint: If FairCTF is enabled you still can pass the flag to your base. If teams are unbalanced just grab the flag while moving towards your base.

Maybe in this case FairCTF plugin only encourages abuse of weaker team.
User avatar
FiringSquad
Sergeant
Sergeant
Posts: 849
Joined: Thu Jan 26, 2006 5:53 pm
Location: Ireland

Re: PassTheFlag 1.0.6 released (Please Test)

Post by FiringSquad »

Thank you for the suggestion, but I don't think I will implement this feature in this plugin, as there are other ways to achieve this effect and it probably belongs in the in the fairCFT plug-in anyway, rather than here.
Perhaps you can make the suggestion in the fairCTF thread, here.
My code is available for download and I would certainly offer any support I could to that plugin's developer, L4m3r, though I doubt he needs it.

I have tried to give this plugin as invisible a footprint as I can. It should be able to be bolted on to any map with any plugins installed and should still work.
If I start to introduce code that interacts with anything other than the server, then I would need to modify the code (or at least verify it) every time those plug-ins are modified.
And that would be a recipe for disaster. :-)
User avatar
FiringSquad
Sergeant
Sergeant
Posts: 849
Joined: Thu Jan 26, 2006 5:53 pm
Location: Ireland

Re: PassTheFlag 1.0.6 released (Please Test)

Post by FiringSquad »

I may need to modify the plug-in to be compatible with the fairCTF plug-in (or vice versa).
When the flag is dropped by the fairCTF plugin, it passes. It should stay in the same place.
Not sure when I'll have time to check this, but I'll keep you posted.

Hmmm... After a quick inspection, it looks like the only way to solve this, would be to create a version of the fairCTF plugin that drops the flag without calling bz_removePlayerFlag().
I don't want to do this as it would mean creating a version that would not be universally compilable.
If this becomes a problem for anyone and they are running a non-Windows server, then I can produce a version of the fairCTF plugin that will work for you.

Note: If the PassTheFlag plug-in is configured with "dist=0.0" then this problem will not occur.
User avatar
FiringSquad
Sergeant
Sergeant
Posts: 849
Joined: Thu Jan 26, 2006 5:53 pm
Location: Ireland

Re: PassTheFlag 1.0.6 released (Please Test)

Post by FiringSquad »

:doh:
Forgot to change the version number in the source file.
New version of Source uploaded.
An SQUERRILz
Private First Class
Private First Class
Posts: 91
Joined: Wed Apr 25, 2007 2:08 am

Re: PassTheFlag 1.0.6 released

Post by An SQUERRILz »

Code: Select all

bool getPlayerPosition(int playerID, float PlayerPos[3])
{
	bz_PlayerRecord* player = bz_getPlayerByIndex(playerID);
	if (!player) {
		return false;
	}
	memcpy(PlayerPos, player->pos, sizeof(float[3]));
	return true;
}
I was under the impression if you didn't bz_freePlayerRecord(player) something bad would happen (SCADOOSH).
JeffM wrote:The server does not track player positions over time in 2.0.x.In 3.0 it does a simple linear interpolation. There is no accurate way to get a player's position at any time. All you can do is get the last updated position.
Since 3.0 can do a simple linear interpolation serverside (and it is done in 2.0 clientside), there is no reason why we can't do it pluginside. Call it hacky but it works well. I think the biggest source of inaccuracy is the rounding of the playerUpdateEventData floats to (the lowest) 0.02.

In some plugins it doesn't matter, but in FlagThrow or PassTheFlag your intended direction can be off by up to 45 degrees (for that one update per second without changing speed/angular). And I used to think it was something to do with spinning the ball :book:
Pedantics are more important in league play when inconsistency can damage one's ego :gross:

PM me if you want the code for it.
User avatar
FiringSquad
Sergeant
Sergeant
Posts: 849
Joined: Thu Jan 26, 2006 5:53 pm
Location: Ireland

Re: PassTheFlag 1.0.6 released

Post by FiringSquad »

I'm happy for others to make amendments to the code and release newer versions.
I do not wish to own the code or claim any rights to it.
If you already have code that works then feel free to release a new version.
The plug-in (code included) belongs to everybody. :-)

The suggestion is a good one. I actually thought of it, but the anomaly was predictable for me, so I just considered it a quirk that the user would need to learn.
Be careful that you are predicting angle and not just position.

re bz_freePlayerRecord()
I should be taken out and shot.
Thanks for the heads-up. I was under the impression from other sample code (e.g. CustomFlagSample.cpp) that it was returning a reference to a pre-existing instance, but upon closer inspection, it does indeed return a reference to a newly created instance.
If you intend to modify the code for better location & rotation prediction, I would be grateful if you could fix this too.
If you want me to make the change then it will probably have to wait until next week at the earliest.
User avatar
zaphod
Sergeant
Sergeant
Posts: 352
Joined: Sun Jan 23, 2005 3:20 pm
Location: beteigeuze-system
Contact:

Re: PassTheFlag 1.0.6 released

Post by zaphod »

can't wait to see it getting even better then it is already!!!
.
.
.
Image
An SQUERRILz
Private First Class
Private First Class
Posts: 91
Joined: Wed Apr 25, 2007 2:08 am

Re: PassTheFlag 1.0.7 release for BZFlag 2.4

Post by An SQUERRILz »

Upgraded plugin to compile for bzflag 2.4
Tested :mrgreen:
Attachments
PassTheFlag_1_0_7.zip
(27.9 KiB) Downloaded 179 times
Post Reply