Suppose I should write a follow up to http://www.freemmorpgmaker.com/thread-85435-post-942385.html#pid942385
So, since then, I’ve worked out generally better (and easier) ways to handle things, but https://developer.valvesoftware.com/wiki/Source_Multiplayer_Networking will remain probably the most accurate well documented theoretical implementation available.
- The server stores a remote position and the velocity. The remote position sent out to all clients.
- The client stores a remote position and a local position. Upon receiving the remote position, the client interpolates movement between the current local position to the remote position provided. When moving, the client sends this indication to the server, and likewise for when it’s stopped, forcing the server to update its remote position.
That’s it for fluid movement. It won’t be pixel-perfect exact (and most definitely will not follow the exact path in high latency situations), but it will not be jumpy at all provided you interpolate between the remote and local position.
**I’d argue that fluid movement is more important than getting whether somebody else is walking in strange arc motions is more important. **
As for combat, most people will disagree with this, and rightly so as there are better ways, but I find it works for the movement technique described above. For the best experience, hit detection should be done client-side, with the server to confirm that this is the case (here’s where the stored velocity comes into play, you can extrapolate where the player will be and where they were in a previous state). This means that the clients will hit what they see. In reality, they were probably a few pixels off, but there’s only so much that can be done.
I won’t say that it’s extremely hard to code, frankly, it’s basic 16-year-old level maths and fairly decent logic to follow. It’s just a hassle to get working properly.
Alternatively, you could just set your tile sizes really small (say, 8x8) and work with that to simulate better detail.
As for providing code, I have no intentions of touching VB6. I’d be glad to explain any concept in further detail if you ask.