Replication
Overview
This is only relevant to multiplayer games.
None of Stoch's classes handle replication on their own. However, this is not necessary and replicating distributions, loot tables, etc. is discouraged.
All stoch objects generate things which require sensitive data; it's highly recommended to store these objects (loot tables, distributions, etc.) on the server and replicate the results of generation back to clients.
Example
Let's look at a simple example using a loot table. Suppose you are generating a random item type from the following table:
Data Table Fruits | |
---|---|
Row Name | Display Name |
Apple | Apple |
Banana | Banana |
We have this loot table:
Compiled Loot Table A (Unlimited) | ||
---|---|---|
Ref Table | Ref Row Name | Weight |
Fruits | Apple | 100 |
Fruits | Banana | 400 |
The data table would be the item 'registry', which contains item data. The loot table would contain the drop chances of each item. Both of these are sensitive information that you likely don't want players to find out. Thus, we recommend enabling Strip From Client Builds on them so they're not available client-side.
Next, suppose we sample Table: DT_Fruits, Row: Apple. We can invoke Get Data Table Row on this row to obtain the data for it on the server. Then we can replicate this row's data back to the client(s). For our example that's just a Display Name, but for your items that would include all item data which is available client-side.