pond3r / ggpo

Good Game, Peace Out Rollback Network SDK
MIT License
3.11k stars 360 forks source link

GGPO_ERRORCODE_PREDICTION_THRESHOLD after every ggpo_add_local_input #60

Closed AndreaJens closed 3 years ago

AndreaJens commented 3 years ago

I apologize if this might be a stupid question, but I am having troubles in implementing this library in a sample project of mine. While running the vectorwar demo, everything seems to work fine, without issues. I can compile and execute the game without troubles and the synchronization via GGPO works flawlessly. However, when I try to implement GGPO in my own project, after the connection between the players has been established (GGPO_EVENTCODE_RUNNING has been issued), whenever I call a _ggpo_add_localinput command, it always fails with the above return value (GGPO_ERRORCODE_PREDICTION_THRESHOLD). Is there any step I have to perform between the first time I receive a GGPO_EVENTCODE_RUNNING and the first _ggpo_add_localinput / _ggpo_synchronizeinput that I am missing? If not, what could be the cause of this error?

To summarize:

The above issue happens even when running two instances of the game on the same machine, on different ports.

AndreaJens commented 3 years ago

Found the issue, it was due to me calling _ggpo_advanceframe right after the input update even if the _ggpo_add_localinput was unsuccessful.