Jump to content
  • Advertisement
Sign in to follow this  
ghost0

Verifying Movement Packets

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
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 this post


Link to post
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 this post


Link to post
Share on other sites
Quote:
Original post by ghost0
like 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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!