Verifying Movement Packets

This topic is 3668 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

Is there a good way to verify a movement packet without pathfinding?

Share on other sites
You're going to need to elaborate... like, a lot.

Share on other sites
like to stop hacking, lets say speed hacking or going through walls. Is there an efficient way of checking it or do game servers not check that? Specifically mmo servers. My clients check boundaries before it sends the packet but since it sends between "ticks", I can't just see if the previous location can goto the current location in a straight line(lets say if someone cuts a corner or lags).

Share on other sites
the client should not have any authority - so it does not matter.

The client should send keyboard input related info and the server should then TELL the client (making him the authority) where he is and where he's heading.

The hard part is then tweaking the balance of security, user responsiveness, and maintaining accurate simulation

Share on other sites
How often are you sending packets? I'd think a simple collision check should suffice unless you let it go too long.

Share on other sites
Quote:
 Original post by ghost0like to stop hacking, lets say speed hacking or going through walls.

Does it even matter? Or is it enough you ensure someone can't enter a room with locked doors?

Quote:
 Is there an efficient way of checking it or do game servers not check that?

Some do, some don't. Some check intra-entity collisions, others just static geometry. Some approximate, some enforce. Depends.

Quote:
 My clients check boundaries before it sends the packet but since it sends between "ticks", I can't just see if the previous location can goto the current location in a straight line(lets say if someone cuts a corner or lags).

That depends on your map, update rate, desired accuracy, complexity of geometry.

About speed hacking movement: if client is at P0 at T0, and moves around ending at P1 at T1, then no matter how it moved, |P0-P1| <= v*(T1-T0). Or, since you know the maximum velocity at which someone can move, you can check if distance between two points is less or equal to distance that could be covered if traveling in straight line. If you average that over a few updates or seconds, you get a cheap enough check. It should eliminate warping all over the place.

When it comes to maps and warping through walls, the problem is likely only relevant for in-doors, or in limited parts of maps. One way is to perform "topological" pathfinding. Rather than worrying about every single step, check if client could have gotten from A to B. For example:
  X  A  /   \   /----P-1     \|   C B    Q------2\------- D      O

A,B,C and D are zones, polygons.
O is starting location, X is ending location.
1 and 2 are corner locations.

When you notice that movement vector crosses zone boundaries, calculate the intersections, and try to hug the geometry. In above, instead of moving from O-X, you'd modify movement to O-1-X.

This data can obviously be pre-calculated and stored as part of static geometry if needed. If multiple paths exist, pick shortest.

It may seem like huge approximation, but consider that typically characters will walk or run. If you send updates at 1-10 times a second, they'll cover less than 3 or so meters each second, or 0.5m per update.

You might not want to even bother correcting the paths. If you encounter collision, simply extrapolate from O-Q and then P-X. Player will snap, but it shouldn't matter much. And on client, you can still run more expensive algorithm to mask that.

But as always, it depends on many factors, and your desired goals.

1. 1
2. 2
3. 3
Rutin
13
4. 4
5. 5

• 26
• 10
• 9
• 9
• 11
• Forum Statistics

• Total Topics
633696
• Total Posts
3013390
×