Speed Zone Bug
by Myrddin Emrys · in General Game Discussion · 01/15/2005 (12:01 am) · 12 replies
I've noticed speed zones tend to catch you on corners if you are not careful... this could be fixed. Instead of having the speed zones give a boost every single server-tick, perhaps they could push you once, when you enter the area (just like equipment is handed out once when you enter the zone). If you hit an obstruction, rather than being stuck, you would just bounce backwards... much less of a hassle.
#2
01/15/2005 (10:20 am)
It is actually a problem for map makers -- but the suggestion would make it a lot easier to make maps with speed zones.
#3
I have seen speed areas used to create one-way corridors. If your proposed were made, then it would be possible to travel the other way on the corridor. Just stay along the wall so that the one-time burst is not effective, then pass through easily.
A better solution is to change the way collissions are handled. The speed-zones are working correctly. The walls are not. I don't know how it is done now, but this sort of collision handling is not so tough.
If you come in contact with an immovable object, use a dot product between your velocity and a normal vector of the immovable object's surface. Now take the absolute value of that quantity, multiply it by 2, and multiply it by the surface normal vector. You now have an impulse vector which should be added to your ship's velocity to get the ship's new momentum.
Oh, and if you are touching a corner, which has two surfaces, then it should be two collision events. If you are touching 2 corners at once, that is 4 consecutive collision events. This is not a realistic way to treat corners, but it is good enough that nothing really bizarre will happen.
For collisions between ships, convert both ship velocities to center of mass reference frame. Place a surface that passes between the two ships, and have both ships bounce off it as described above. Finally, whatever vector you added to ship velocities to get to center of mass reference frame... subtract it off.
01/15/2005 (2:49 pm)
I just saw this happen in one of the custom maps. It wasn't on a corner though. You can get caught on anything that you touch while in speed area, not just on corners. I assumed that you were refering to corners of a map, but maybe you meant corners of your ship?I have seen speed areas used to create one-way corridors. If your proposed were made, then it would be possible to travel the other way on the corridor. Just stay along the wall so that the one-time burst is not effective, then pass through easily.
A better solution is to change the way collissions are handled. The speed-zones are working correctly. The walls are not. I don't know how it is done now, but this sort of collision handling is not so tough.
If you come in contact with an immovable object, use a dot product between your velocity and a normal vector of the immovable object's surface. Now take the absolute value of that quantity, multiply it by 2, and multiply it by the surface normal vector. You now have an impulse vector which should be added to your ship's velocity to get the ship's new momentum.
Oh, and if you are touching a corner, which has two surfaces, then it should be two collision events. If you are touching 2 corners at once, that is 4 consecutive collision events. This is not a realistic way to treat corners, but it is good enough that nothing really bizarre will happen.
For collisions between ships, convert both ship velocities to center of mass reference frame. Place a surface that passes between the two ships, and have both ships bounce off it as described above. Finally, whatever vector you added to ship velocities to get to center of mass reference frame... subtract it off.
#4
01/15/2005 (6:50 pm)
I'm a little unclear on the situation you're describing. Are you saying that if you're in the speed zone and its pushing you into something while you're in it, you just stop?
#5
The ship's bounding box is a circle. If you touch a speed zone, and the bounding circle is in any way obstructed, by even the most oblique corner, you will get completely stuck. On my map, it only happens when a person slides into one of the speed zones from the top edge of the tunnel... they can get 'hooked' on an oblique corner, even though it looks like they should just slide off the corner and go out properly.
Eric is right that my fix would make it possible to exploit the zone and go through it in reverse... though I think that would be quite difficult. A better fix might be to have the speed zone push you every OTHER tick (rather than every tick). This would allow the ship one tick to bounce away, or move, or otherwise change its position enough so that it is no longer stuck. That would mean you would only get stuck if the zone was truly placed poorly by the map maker.
01/15/2005 (8:35 pm)
That's correct. On my server (Tikatt's), I run my maps, and I use speed zones for one-way corridors frequently. I was pretty careful to put the speed zones into the corridor, so you cannot get caught... but in uncommon situations it can still happen.The ship's bounding box is a circle. If you touch a speed zone, and the bounding circle is in any way obstructed, by even the most oblique corner, you will get completely stuck. On my map, it only happens when a person slides into one of the speed zones from the top edge of the tunnel... they can get 'hooked' on an oblique corner, even though it looks like they should just slide off the corner and go out properly.
Eric is right that my fix would make it possible to exploit the zone and go through it in reverse... though I think that would be quite difficult. A better fix might be to have the speed zone push you every OTHER tick (rather than every tick). This would allow the ship one tick to bounce away, or move, or otherwise change its position enough so that it is no longer stuck. That would mean you would only get stuck if the zone was truly placed poorly by the map maker.
#6
01/16/2005 (12:38 am)
Why not just put a ship diameter's worth of space around the speed zone? :)
#7
01/16/2005 (1:16 am)
Because then it would no longer be a one-way passage... the entire point of the construct is to make sure you can only go one way through the corridor.
#8
01/16/2005 (5:00 am)
Hmm. Good point. We'll have to get a fix for that in at some point, esp. if people are really getting permanently stuck, which is lame.
#9
If you haven't seen this problem, try playing on Tikat's server, especially the turret map. There seems to always be someone stuck when that map comes up. There is a white trail coming off a ship at the point of contact which looks like bubbles in fast moving water.
As for the one-way issue, why not a portal? You could even have the portal place you on a speed zone after you pass through it.
01/16/2005 (9:10 am)
Yes, it is permanent. Only way that I've found to free myself is suicide, switch teams, or log off. Since only certain weapons allow suicide, you might be stuck with the second two options.If you haven't seen this problem, try playing on Tikat's server, especially the turret map. There seems to always be someone stuck when that map comes up. There is a white trail coming off a ship at the point of contact which looks like bubbles in fast moving water.
As for the one-way issue, why not a portal? You could even have the portal place you on a speed zone after you pass through it.
#10
Also, Eric, try firing a burst into the wall next to you. I've had that bump me free pretty frequently. Also, there are three weapons that allow suicide... mines, burst, and bouncing bullets... so there is always a weapon that allows suicide.
01/16/2005 (11:02 am)
True, I did consider using a portal... but all the maps use portals, I kinda like the difference of speed zones. Also, speed zones don't delay teammates who are also trying to exit at the same time. And few things are more fun, to me, than charging a base and having two or three enemies knock me flying when they come zipping out of the spawn. The ships themselves become missiles. :-)Also, Eric, try firing a burst into the wall next to you. I've had that bump me free pretty frequently. Also, there are three weapons that allow suicide... mines, burst, and bouncing bullets... so there is always a weapon that allows suicide.
#11
Yes, I do like the idea of speedzones rather than portals. It loses all of its coolness when people get stuck though.
01/16/2005 (2:16 pm)
Burst and bouncing are the ones I use. Mines don't work because they don't become active until the person who layed them moves outside of a certain radius, not possible when stuck. Yes, I do like the idea of speedzones rather than portals. It loses all of its coolness when people get stuck though.
#12
01/18/2005 (2:18 am)
You can plant a mine, then shoot it with a phaser, while it's right next to you, to suicide.
Torque Owner Eric Lavigne