/
dieoska
/
ddnet
Обзор
Документация
Войти
/
dieoska
/
ddnet
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
src/engine/docs/prediction.txt
19 строк
773 B
yangfl
Fix typo
10 июл 2018, 12:29
10 июл 2018, 12:29
81a39c2
Код
Авторство
О чём код?
Title: Prediction The engine calls <modc_predict> when reprediction is required. This happens usually when new data has arrived from the server. <modc_predict> should to prediction from the current snapshot and current snapshot tick (<client_tick> + 1) up to and including the tick returned by <client_predtick>. Predicted input sent to the server can be retrieved by calling <client_get_input> with the corresponding tick that you want the input for. Here is a simple example of how it might look. > void modc_predict() > { > int tick; > prediction_reset(); > > for(tick = client_tick()+1; tick <= client_predtick(); tick++) > { > MY_INPUT *input = (MY_INPUT *)client_get_input(); > if(input) > prediction_apply_input(input); > prediction_tick(); > } > }