c# - Simulate movement of game object as if server handles requests with lag -


question: can give me idea how can write custom algorithm, move object point point b latency?

i using pretty simple algorithm:

  1. while(input held) add point current existing list of points
  2. check if list exceeds maximum offset (a given number of points) -> a.move object on 0 index point. b.delete 0 index point.
  3. loop 1.

but algorithm not give me desired results.i looking maybe kind of math expression lag simulation, not sure can produced math anyway headed first here ask question.

assuming have sort of user input , way process events.

one approach explicitly delay user input events (or other events) later time. i.e. when user clicks send game object new position instead of setting new immediate target can put action list of future events "move point b, starting currenttime + delay".

as result code not aware of request change destination , continue moving object previous target till "delay" time passed.


Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -