Ok, so the dev has started and I have stumbled upon several problems already As I’ve never coded fast paced network multiplayer before I got much to learn. Also not using UDP but TCP instead makes it harder and I need to be smarter in the way I predict actions and compensate for latency.
So. Here is what I try to accomplish:
Having a player running in a grid-based dungeon. I want the player to walk until he snaps on the center of the grid. Otherwise it would be superhard to change direction as the passage is just as narrow as the player.
Now meanwhile having that snapping I want the player to be able at any time move to opposite direction (so we dont have to wait for it to snap).
After some struggle I manage to get this and it felt like intuitive controls.
Now trying to simulate this over network seems harder.
I figured that if I created one local player and one that listened to what my local player did I would be able to see exactly how big difference the gameplay would be.
This is what it looks like right now. The normal soldier is the local player I control and the purple “ghost” is what it is interpreted as when sending data to the server in london and back to stockholm.
Problems as you can see is of course the changes of direction.
I guess some of that teleporting I have to live with as it is tcp and I guess I will get rid of that grid-snapping thing and instead try some “cut corner” style of control like the classic bomberman.