@Raynos You said you'd only use RequireJS for packages, however if you want to separate each object into its own file, you need to use it for objects too
@Tom An object containing strings, each string matches a regex. If the regex fails shoot the client. if it passes then your serverside validation just passed
writing an input / output handler shouldnt be so hard
@Tom ClientInput -> server, GameState -> client. You shouldnt need anymore information then that
client connect is seperate and so is client disconnect. But apart from that you only need to wrap keyboard & mouse events in a clientinput and periodically send over the gamestate to the client
@Raynos for the player, all clients do that - server distributes calculations and verifies them. You can emulate the game state if you need high precision
There are a lot of sophisticated and complex algorithms available
I'd look into it
If its a small or slow game you can calculate movement server-side
Anyway you cannot just import the clients GameState and trust it
You need to verify it, and some of these states will have to be set by the server and then send to client
@Raynos depends on your structure. I actually made a system where the server only records movement types: eg. movingForward, turningRight, turningLeft etc.
So all clients calculated position themselves with this data and every second or so adjustments were made smoothly
@Tom you mean clientA says "I pressed jump" server -> clientB "clientA jumped" instead of server -> clientA jumps -> clientB "clientA moved up 20 pixels"
I mean passing on actions rather then physics
I still dont know what calculations the client is allowed to do and how to deal with the differences between client state and server state