Skip to content

Allow deterministic random output in DialogueManager (for network sync / replay) #1227

Description

@RickyYCheng

Is your feature request related to a problem? Please describe.

Use cases: multiplayer dialogue sync, save/replay, deterministic testing, replay-from-checkpoint.

In multiplayer game, the [[Hi|Hello|Howdy]] syntax will generate different results on different peer side, since the seed and internal state are different.

For the dialogue_line sync, it is ok since we got line_id: String here to sync. I use rpc to implement simple networking dialogue (For example, cutscenes or real-time dialog).

Describe the solution you'd like
Use RandomNumberGenerator is possible, or just use mutations so that we can do whatever we want.

Describe alternatives you've considered
Call seed() for all peers but it is not good, since it pollutes the global state.

Or use custom functions by using inline mutations so that we can use goto-s based on the result of function. And we can handle states or resolving networking stuffs in (mutation) functions.

Additional context
Non.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions