Skip to content

Commit d24bed8

Browse files
Add GIFs to prediction guide
1 parent 2bb3409 commit d24bed8

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/en/ss14-by-example/prediction-guide.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ public sealed class PredictionExampleSystem : EntitySystem
161161
162162
If we look at this in-game we notice the verb and examination text have are showing up with a visual delay and that the popup and sound are happenening with a delay to your actual mouse click.
163163
164-
TODO: Upload gif
164+
![prediction-guide-unpredicted.gif](../assets/images/ss14-by-example/prediction-guide-unpredicted.gif)
165165
166166
Now let's move the code to shared and network and predict it.
167167
@@ -267,7 +267,7 @@ public sealed class PredictionExampleSystem : EntitySystem
267267
```
268268
The result is much more responsive without the delay for the popup, audio or UI elements.
269269

270-
TODO: Upload gif
270+
![prediction-guide-predicted.gif](../assets/images/ss14-by-example/prediction-guide-predicted.gif)
271271

272272
## Dependencies
273273

@@ -511,7 +511,7 @@ To reduce the networking load on the server it will only network any entities wi
511511

512512
If you want to see this in action you can fly around as an aghost while having the view zoomed out.
513513

514-
TODO: Upload gif
514+
![prediction-guide-pvs.gif](../assets/images/ss14-by-example/prediction-guide-pvs.gif)
515515

516516
Since the server holds the authoritative game state it always has full knowledge about all entities, but the client will be restricted on what information it has available, which has implications for prediction. The client won't be able to predict anything happening outside PVS range, and some code like atmos or power cannot be predicted as a result.
517517

@@ -541,7 +541,8 @@ An example for this is [`SharedRevolutionarySystem`](https://github.com/space-wi
541541
If you use `RobustRandom` in shared code the server and client will roll different random results, causing mispredicts. Even worse, the client will also generate a different result for each prediction tick. This often happens for random spawning, randomized sprite colors, random locations or similar.
542542

543543
Here is an example of a mispredict happening when gibbing someone, so that you know what to look out for. Note the organs jumping around wildly due to each prediction tick moving them to another random location.
544-
![mispredict_gibbing](https://hackmd.io/_uploads/rJwzSOBVWx.gif)
544+
545+
![prediction-guide-mispredict.gif](../assets/images/ss14-by-example/prediction-guide-mispredict.gif)
545546

546547
In the future Robust Toolbox will have methods for predicted randomness, but at the time of writing the [PR for RandomPredicted](https://github.com/space-wizards/RobustToolbox/pull/5849) was not merged yet.
547548
As a workaround you can use a new `System.Random` instance and set the seed to something the server and client agree on, for example a combination of an entity's `NetEntity` id and the current game tick (if you would only the game tick here then all randomness within the same game tick would yield the same result, so we need both).

0 commit comments

Comments
 (0)