endel / LD35

Entry for Ludum Dare 35 Game Jam. Theme: Shapeshift (Colyseus 0.3.x)
http://ludumdare.com/compo/ludum-dare-35/?action=preview&uid=50958
13 stars 4 forks source link

Client prediction #1

Open Ulydev opened 7 years ago

Ulydev commented 7 years ago

Right now, movement looks a bit choppy due to server lag. I would like to implement client-side prediction, but I'm struggling to fully understand the structure of this project. Do you have any advice on how to get started with this feature?

Ulydev commented 7 years ago

Also, this means the server and the client would need to have common files (e.g. collision manager). How would one implement that? Thanks in advance!

endel commented 7 years ago

Hi @Ulydev, thanks for your interested.

You'll basically need to have a look at these files:

As server and client are written in JavaScript, you can have a separated folder for shared code in the root, for example, and require it on both sides as necessary.

I'm curious the approach you want to pursue. I actually wanted to do the same using "Timelines", but it doesn't seem to be performant nor reliable. (didn't spent much time on it though)

Cheers!