Sim-eth-es player movement control


#1

I’m kinda concerned… I mean

private double turnSpeed = 2.5;
...
private double speed = 3.0;

and finally

session.move(rot, thrust);

are all determined by client. While thrust container can be effectively checked and limited on server, this barely can be done with rotation (at least without some non-human math to calculate delta), thus to prevent cheating I have to transfer controls themselves to server side, no other options, right?


#2

You’ve misunderstood what we are sending the server.

Think of a ship with controls. We are sending what the user is pressing, turning, etc… It’s up to the ship decide what to do with that information. What does speed “3” mean? It’s 3x more than speed 1.

How that turns into thrust is completely up to the server. The pilot can press that button as hard as he wants, it doesn’t necessarily mean that the ship will fly any faster.

Similarly for turn speed (which I think is not sent at all as we send raw rotation, yes?). We send to the server the direction the player is looking at that time because we decouple looking from the actual ship to avoid making them sick. It’s still up to the server code to decide how to make the ship orient to that look vector. The simple case, we just force them to be the same but that need not be what happens.

I’ve directly coupled these things together for simplicity but in a real game you certainly wouldn’t. The values in the player input messages would just be recommendations to the ship driver object.

Edit: and note if you ever did decouple the speed/strafe values from thrust then you could rescale them back to 0 to 1… where 1 is the “fast mode/boost” and some fraction of 1 is normal speed. Else if you wish to modify boost as a limited resource then speed and boost would be two separate parameters sent… and both could be 0…1. Continuous values are nice for joystick control where a little stick gets a little movement.


#3

So, you say, this is a “desired” output. And this “boost” is something sort of “turbo button” on user’s panel, it’s up to server to check if a real booster was ever installed on that ship.
Well[quote=“pspeed, post:2, topic:38709”]
then you could rescale them back to 0 to 1…
[/quote]
that was exactly what I was thinking of - to split it at some level (InputMapper maybe) - but yep, I have to reconsider, maybe there’s no need to go that deep. Probably “turbo button” is something that I can expose to client from the start… thanks!