OCESS/orbitx

Network commands are only reflected in the next networked get_state

Opened this issue · 0 comments

Currently, sending a network request with a command like TOGGLE_COOLANT_LOOP only shows an effect on the next request. This is the relevant timeline:

simtime = n: client sends a get_state command, with attached TOGGLE_COOLANT_LOOP command
simtime = n + 0.00001: request TOGGLE_COOLANT_LOOP occurs in the simulation

The physics engine will then send the state of the simulation at time n, before the request has been applied. This is okay for eventual consistency of the simulation, but it means we're delaying input feedback to the user by exactly 1 second more than we have to.

I should fix this.