This week was focused on getting lag compensation in place, and I focused on two specific events which should be to appear as responsive as possible, namely picking loot and landing on enemies’ head.

So remember that the player is seeing the world 100ms behind, but his avatar is updated immediately thanks to Input Prediction which was done last week. When picking up loot, it needs to be verified by the server. When avatar touches a loot, it sends a request to the server with the current render tick (~100ms behind). The server will go back in time to verify that he can take the loot, and reply with a yes/no answer.

The landing on an enemy head (and killing him) is slightly more complicated, namely because it we create a dead body instance that flies off from the position of the killing. So if it is accepted by the server, we need to simulate back in time to the current time for both the server and the client, since they are both rendering 100ms behind.

Since a lot of data structures are involved in making this possible, it was inevitable that I would do some typo or other stupid mistake. And this is where I miss Unity and it’s strong typed C#. In GameMaker you can do anything and it will not check for you. So for example you can delete a buffer instead of a list and it will not complain but will obviously corrupt the memory and then you start having all kind of weird crashes. I would accept this in a compiled released version where all checks are removed, but I was surprised no checks at all are being done in the debug VM version. Because of this, I think this will be my first and last project on GameMaker.