🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Entities interaction

Started by
11 comments, last by hplus0603 8 years, 10 months ago

For movement in my game, I allow for some rewind by the server, but actions only happen when they arrive at the server and when the server says it's okay. This prevents the scenario you described in your OP. It gets a little bit tricky with actions that affect movement, but that's manageable.


Wouldn't this create collision detection issues potentially? The player will shoot at the place where he sees the monster (up to 100ms back in time) and then will get the action executed when the monster is probably at a different location.

Yes, but you have to give in somewhere, everything is a trade-off. You need to design your game around these trade-offs. Is shooting in your ARPG really that precise? How often will that scenario present itself / do monsters move about erratically?

Advertisement


You need to design your game around these trade-offs. Is shooting in your ARPG really that precise? How often will that scenario present itself / do monsters move about erratically?

I think you are right. I don't need shooting to be super precise, so I might solve the issue by having hitboxes big enough to compensate for the fact that the event is being executed later. I might even enlarge these hitboxes only when an entity is moving, thus still having fairly precise collision detection when an entity is standing.


How often will that scenario present itself / do monsters move about erratically?

I think it is another fair point: enemies at the moment tend to not move too much, as long as most of them have ranged attacks, and the ones who don't usually come straight to the player and stop when close enough.

PvP will still be an issue with the approach above, but I think that I could design the PvP-related networking system in a slightly different way, so that it is more precise and compensates for lag.

how do games that show instant death deal with this kind of situation?


The thing died in either case. You can show the death right away. Crediting the death (as in, giving XP, looting rights, or whatever) can happen a little bit later, after the server knows the "who" is fully determined.

If you want to support armor spells or such, that would change the outcome of the death blow, then some player will end up seeing a thing start its death animation, but then the armor spell kicks in and the thing has hitpoints again -- a "lag induced glitch," which is the draw-back of showing actions right away. If you can wait for the server round-trip for each action (such as RTS-es do, and some RPG-s) then you totally avoid that problem; instead you have control lag.
enum Bool { True, False, FileNotFound };

This topic is closed to new replies.

Advertisement