Author |
Message |
Initrd.gz Seasoned Helper
Joined: Sep 18 2008 Posts: 134 Location: Over there ---> Offline
|
Posted: Wed Feb 11, 2009 1:04 pm Post subject: Detecting Mines |
 |
|
|
|
How do I detect laid mines? (preferably in python)
Also, is there a way to detect if a mine has gone off? |
|
Back to top |
|
 |
D1st0rt Miss Directed Wannabe

Age:37 Gender: Joined: Aug 31 2003 Posts: 2247 Location: Blacksburg, VA Offline
|
Posted: Wed Feb 11, 2009 3:46 pm Post subject: |
 |
|
|
|
Mines are sent with the weapon fired information of a position packet. You'll want to have a callback for C2S_POSITION using net->AddPacket. Then you would need to check the pkt->weapon->type for being W_BOMB or W_PROXBOMB and pkt->weapon->alternate for being 1.
The only way I know for sure to detect if a mine has gone off would be to turn on watchdamage for everyone, which is in general not a good idea. A less reliable method would be to keep track of where all mines have been laid and see if any player comes close to them. You would obviously then have to monitor for players going into safes, changing ships, etc for that as well. _________________
 |
|
Back to top |
|
 |
Samapico No, these DO NOT look like penises, ok?

Joined: May 08 2003 Posts: 1252 Offline
|
Posted: Wed Feb 11, 2009 9:46 pm Post subject: |
 |
|
|
|
Mine alive time expiring too
Could it be possible to turn on watchdamage temporarily for people who come within X pixels of the mine, and turning it off again if they go away?
That could give you the "accuracy" of the watchdamage, without the massive server lag for watching everyone.
The only thing you need to keep track of is changing ship, going in safety and mine alive time.
Oh, and enemy repels
Also, if you have wormholes and if they affect bombs, a mine will instantly turn into a bomb if laid close to it, so you'd have to check for that too. _________________ (Insert a bunch of dead links here) |
|
Back to top |
|
 |
Dr Brain Flip-flopping like a wind surfer

Age:39 Gender: Joined: Dec 01 2002 Posts: 3502 Location: Hyperspace Offline
|
Posted: Thu Feb 12, 2009 9:18 am Post subject: |
 |
|
|
|
watchdamage isn't quite enough to detect a unique mine hit anyway. For example, if someone laid a bunch of prox mines close together, and a player hit just one... which one did he hit? You'd still need to do some position and prox checking. _________________ Hyperspace Owner
Smong> so long as 99% deaths feel lame it will always be hyperspace to me |
|
Back to top |
|
 |
JoWie Server Help Squatter
Gender: Joined: Feb 25 2004 Posts: 215 Offline
|
Posted: Thu Feb 12, 2009 11:51 am Post subject: |
 |
|
|
|
You would also need to factor in lag. A player could have hit the mine on one one screen, but not on another. |
|
Back to top |
|
 |
Samapico No, these DO NOT look like penises, ok?

Joined: May 08 2003 Posts: 1252 Offline
|
Posted: Thu Feb 12, 2009 12:36 pm Post subject: |
 |
|
|
|
Dr Brain wrote: | watchdamage isn't quite enough to detect a unique mine hit anyway. For example, if someone laid a bunch of prox mines close together, and a player hit just one... which one did he hit? You'd still need to do some position and prox checking. | Well, you could do the prox checking 'after' the hit though. Player gets hit by a mine, check where he is, scroll through the list of known mines and check which one is more likely to have blown up
But yeah, because of lag, everything gets tricky, because the same mine could hit/kill more than one player at different times, as JoWiE said.
So you'd still have to keep mines that you consider as 'blown up' in the list until they expire (safety, alive time, ship change) and conclude they were blown up a second time if someone in the area blows up because of a mine by the same person and there were not any other mines laid near...
Yeah it gets pretty tricky :S |
|
Back to top |
|
 |
D1st0rt Miss Directed Wannabe

Age:37 Gender: Joined: Aug 31 2003 Posts: 2247 Location: Blacksburg, VA Offline
|
Posted: Thu Feb 12, 2009 3:59 pm Post subject: |
 |
|
|
|
What you might want to do, if mines are a 1 hit-kill is have a command (or if you wanted to get really fancy, use brick drops) to lay a "mine" which would be a region with an lvz image on the map. Then if a player entered that region you could use a fake player, say <mine>, that you use to kill that person off and then give +1 on the kill stat to whoever laid the mine. You could even get into things like, if they have above a certain energy level you just prize them an energy depleted, otherwise you go on with the killing bit. |
|
Back to top |
|
 |
Dr Brain Flip-flopping like a wind surfer

Age:39 Gender: Joined: Dec 01 2002 Posts: 3502 Location: Hyperspace Offline
|
Posted: Thu Feb 12, 2009 6:49 pm Post subject: |
 |
|
|
|
D1st0rt wrote: | What you might want to do, if mines are a 1 hit-kill is have a command (or if you wanted to get really fancy, use brick drops) to lay a "mine" which would be a region with an lvz image on the map. Then if a player entered that region you could use a fake player, say <mine>, that you use to kill that person off and then give +1 on the kill stat to whoever laid the mine. You could even get into things like, if they have above a certain energy level you just prize them an energy depleted, otherwise you go on with the killing bit. |
Even simpler, you can hijack the player that laid the mine for the kill, rather than dealing with a fake.
But yes, a server side solution will be much easier to implement, though it can be a bit limiting. |
|
Back to top |
|
 |
D1st0rt Miss Directed Wannabe

Age:37 Gender: Joined: Aug 31 2003 Posts: 2247 Location: Blacksburg, VA Offline
|
Posted: Thu Feb 12, 2009 8:26 pm Post subject: |
 |
|
|
|
That was my first impulse but I didn't want that player to potentially jump around from the spoofed position. I suppose if that player is the only one you're sending it to and he's dying anyway it doesn't much matter though. |
|
Back to top |
|
 |
Initrd.gz Seasoned Helper
Joined: Sep 18 2008 Posts: 134 Location: Over there ---> Offline
|
Posted: Sun Feb 15, 2009 1:13 pm Post subject: |
 |
|
|
|
I dont really _need_ to detect mines going off. I just wanted to prevent abuse (making the fake absorb some bullets/bombs).
Thanks for your help. Now read my other post on fake turrets please  |
|
Back to top |
|
 |
|