Author |
Message |
SamHughes Server Help Squatter

Joined: Jun 30 2004 Posts: 251 Location: Greenwich Offline
|
Posted: Mon Jan 31, 2005 1:58 am Post subject: Counting turf flags possessed by frequency |
 |
|
|
|
I am making a MERVbot plugin to use in place of the base wars plugin. How should I detect if a team possesses all of the turf flags?
I have considered three options:
1. Every time there's an EVENT_Tick, iterate through the flag list, comparing each flag's team with the team of list's first flag. Once we find one that doesn't match, we stop. If all have the same team, then that team possesses all the turf flags.
2. The same, but on EVENT_FlagGrab, instead.
3. Store a map of frequencies and how many flags each possesses, and update the map every EVENT_FlagGrab.
I have abandoned the third option, since it requires storing which team _used_ to own each flag.
So that leaves the first two options. I will now ask my real question: Is EVENT_FlagGrab reliable? Is there any chance of missing a touching of a flag, due to lost packets or phases of the sun, moon, and/or space station? For if the bot missed the touching of the team's final flag, it would not notice that team's victory, should I choose option two.
Which do you recommend? |
|
Back to top |
|
 |
Smong Server Help Squatter

Joined: 1043048991 Posts: 0x91E Offline
|
Posted: Mon Jan 31, 2005 4:37 am Post subject: |
 |
|
|
|
There is a packet just for turf flags. I don't know how merv handles it.
If you've noticed EVENT_FlagGrab getting signalled lots of times in a short space of time then merv may be turning the turf packet into individual flag grab events. This is unlikely though.
What is more likely is merv already stores the flag states and calls the flag grab event if a owner changes after a flag pickup or turf packet.
If it doesn't do either of those I would make it count the flags every 5 seconds. |
|
Back to top |
|
 |
Guest
Offline
|
|
Back to top |
|
 |
SamHughes Server Help Squatter

Joined: Jun 30 2004 Posts: 251 Location: Greenwich Offline
|
Posted: Mon Jan 31, 2005 12:22 pm Post subject: |
 |
|
|
|
Thank you for your answers. |
|
Back to top |
|
 |
|