Beginning multiplayer and open world RPG template

Hello,



I’m in the beginning of writing a multiplayer RPG and thought that this is a nice chance to contribute to the engine via the planned templates for some genres. It should contain lag-compensated multiplayer abitlities and a potentially huge world (so including a workaround for potential precision loss).

I have to admit that I’ll need your help to really do “best practice”. I’m quite experienced in Java and 2D Games but I’m not that much experienced in JME (yet).



I would like to start with some questions:

1)Concerning AppStates:

Of course I would have one AppState that loads the terrain. Would it make sense/be possible to add one terrain loading state for every connected player on serverside? Or in general one AppState for every player? (Maybe the terrain part is to specialized for a template but in my interest anyway^^)

2)Concerning precision loss:

I read a lot about using double for the logical state of objects and of course that sounds good but I’m not quite sure how that works in combination with bullet? (I don’t want to make my own Bullet-double-version like Empire did). Would I have to subdivide the world into different sectors with different Physic Spaces?

3)About Lag Prevention:

I read the Valve Articles about lag prevention and they read:

Then the server moves all other players - only players - back to where they were at the command execution time. The user command is executed and the hit is detected correctly. After the user command has been processed, the players revert to their original positions.

http
s://developer.valvesoftware.com/w/images/c/ca/Lag_compensation.jpg
https://developer.valvesoftware.com/wiki/Source_Multiplayer_Networking
To be honest I have no clue how to do that when Animation and Physics have to be set to an earlier state... (Would it make sense to copy the last two or three physic states which were calculated by the server and go from them to the time when the user fired/hit/or whatever else?)

After finishing my last exam for the next month I would like to come back to this.



I have already layed the ground for starting or joining a server, main menu state, starting/splash state (with nothing visual) and a system that provides an easy way to enable the user to configure the input mappings.



On top of that I learned that question 2 is not concerning me at all cause from some forum posts I noticed that I do not need bullet’s physic on the server^^ (And I learned that one AppState can just attached once)



The only problem is still with the animation. I guess copying the animation states for some points in time is the only way to be able to check if the player really shot at another entity on his local mashine?



If this work of mine is appreciated I would upload it so that someone experienced could take a look over it after I did some further polishing. If you have other plans concerning the templates that’s no problem. I improved my style a lot to match quality and thats already a good gain :wink: