Originally Posted By: Scorpion
@fastlane69 When using branching with 'connection', how can I identify the client, who controls the entity - he needs different code than the other clients ofc.

For that, I use the following "branch":
Code:
if (me == player) ...


Just make sure that the player pointer is set, and you know that this client can controll the entity.

There is another problem in your code that can lead to lagging or jittering over the internet:
Code:
send_skill(my.KEYS, SEND_VEC|SEND_UNRELIABLE);


This sends the 3 skills every frame, something you may never do.
use a code like this to send the skill only when it has changed:
Code:
if (my.KEYS != my.OLD_KEYS) {my.OLD_KEY = my.KEYS; send_skill(my.KEYS, SEND_UNRELIABLE);


I also removed the SEND_VEC, cause you don't need to send the SPEED and ASPEED skills in this example.


And there is another thing you should do:
the server now receives the my.KEYS for the players. It should now send it to all clients (SEND_ALL) and they should also c_move the entity for smooth movement. the server will still send the absolute positions of the entitys every x frames (can be controlled with dplay_entrate). In my game survive, i was able to set dplay_entrate to 2 ( 8 updates per second) and it was still working very smooth. Also, set dplay_smooth to 0, because the build in smoothing algorithm doesn't work well in many cases.