PassTheFlag 1.0.6 released
- FiringSquad
- Sergeant
- Posts: 849
- Joined: Thu Jan 26, 2006 5:53 pm
- Location: Ireland
Re: PassTheFlag 1.0.3 released (bugfix)
Version 1.0.3 released to fix bug mention in previous post.
Available for download from initial post on first page.
Available for download from initial post on first page.
- FiringSquad
- Sergeant
- Posts: 849
- Joined: Thu Jan 26, 2006 5:53 pm
- Location: Ireland
Re: PassTheFlag 1.0.4 released (bugfix)
Version 1.0.4 released. BugFix version, although some debugging enhancements have been added to facilitate remote debugging.
- FiringSquad
- Sergeant
- Posts: 849
- Joined: Thu Jan 26, 2006 5:53 pm
- Location: Ireland
Re: PassTheFlag 1.0.5 released (Please Test)
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.
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.
- FiringSquad
- Sergeant
- Posts: 849
- Joined: Thu Jan 26, 2006 5:53 pm
- Location: Ireland
Re: PassTheFlag 1.0.5 released (Please Test)
Updated Readme.txt for Version 1.0.5 to include info about debugaccess.
- FiringSquad
- Sergeant
- Posts: 849
- Joined: Thu Jan 26, 2006 5:53 pm
- Location: Ireland
Re: PassTheFlag 1.0.6 released (Please Test)
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:
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.
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.
Re: PassTheFlag 1.0.6 released (Please Test)
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.
- FiringSquad
- Sergeant
- Posts: 849
- Joined: Thu Jan 26, 2006 5:53 pm
- Location: Ireland
Re: PassTheFlag 1.0.6 released (Please Test)
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.
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.
Re: PassTheFlag 1.0.6 released (Please Test)
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.
Maybe in this case FairCTF plugin only encourages abuse of weaker team.
- FiringSquad
- Sergeant
- Posts: 849
- Joined: Thu Jan 26, 2006 5:53 pm
- Location: Ireland
Re: PassTheFlag 1.0.6 released (Please Test)
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.
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.
- FiringSquad
- Sergeant
- Posts: 849
- Joined: Thu Jan 26, 2006 5:53 pm
- Location: Ireland
Re: PassTheFlag 1.0.6 released (Please Test)
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.
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.
- FiringSquad
- Sergeant
- Posts: 849
- Joined: Thu Jan 26, 2006 5:53 pm
- Location: Ireland
Re: PassTheFlag 1.0.6 released (Please Test)
Forgot to change the version number in the source file.
New version of Source uploaded.
-
- Private First Class
- Posts: 91
- Joined: Wed Apr 25, 2007 2:08 am
Re: PassTheFlag 1.0.6 released
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;
}
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.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.
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
Pedantics are more important in league play when inconsistency can damage one's ego
PM me if you want the code for it.
- FiringSquad
- Sergeant
- Posts: 849
- Joined: Thu Jan 26, 2006 5:53 pm
- Location: Ireland
Re: PassTheFlag 1.0.6 released
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.
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.
-
- Private First Class
- Posts: 91
- Joined: Wed Apr 25, 2007 2:08 am
Re: PassTheFlag 1.0.7 release for BZFlag 2.4
Upgraded plugin to compile for bzflag 2.4
Tested
Tested
- Attachments
-
- PassTheFlag_1_0_7.zip
- (27.9 KiB) Downloaded 193 times