Skip to content
This repository has been archived by the owner on Sep 29, 2021. It is now read-only.

Client-side prediction #16

Closed
chris-gong opened this issue May 21, 2019 · 2 comments
Closed

Client-side prediction #16

chris-gong opened this issue May 21, 2019 · 2 comments
Assignees
Labels
enhancement New feature or request in-progress Work is currently being done on this

Comments

@chris-gong
Copy link
Owner

Specifically for mechanics like building and shooting. To compensate for server lag aka the delay between when the clients presses a button and the server processing the request to spawn an actor, I will eventually try to spawn the actor on the client first and remove it later in hopes that the actor has spawned on the server by then.

@chris-gong chris-gong added the enhancement New feature or request label May 21, 2019
@chris-gong chris-gong self-assigned this May 21, 2019
@chris-gong chris-gong changed the title Client-side projection Client-side prediction May 25, 2019
@chris-gong
Copy link
Owner Author

Client side prediction for building was implemented by first building on the client, assigning that structure an id ,adding this structure with the assigned id to an array, then calling a server rpc to spawn that exact same structure. From that rpc, a client rpc would be called to destroy that structure with that specific id by searching through an array that is only on the client side. This was implemented in 0af9b39.

Not the most efficient. A better solution, albeit it would require more space, would be to spawn all the structures ahead of time, but make them invisible.

@Moshiach770
Copy link

Chris, you're not only a genius, but a kind soul sharing this awesome knowledge with the rest of us.

@chris-gong chris-gong added the in-progress Work is currently being done on this label Sep 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request in-progress Work is currently being done on this
Projects
None yet
Development

No branches or pull requests

2 participants