OndrejNepozitek / Edgar-Unity

Unity Procedural Level Generator
https://ondrejnepozitek.github.io/Edgar-Unity/docs/introduction
MIT License
820 stars 70 forks source link

Is generator deterministic? #123

Closed nodoxi closed 1 year ago

nodoxi commented 1 year ago

I am making cooperative game and want to generate same map on all machines. How to set seed to be sure that all maps will be indentical

OndrejNepozitek commented 1 year ago

Hey, just use the same seed on all the clients and you should get identical results. There's an example in the docs regarding how to configure the seed via a script: https://ondrejnepozitek.github.io/Edgar-Unity/docs/generators/dungeon-generator/#change-the-configuration-from-a-script

Also make sure that whatever you do randomly after the level is generated, you use the same seeded instance on all clients. If you have some logic in a post-processing script, you can access the ".Random" property of that script and use it for seeded randomness. Or you can use any other approach.

Let me know if you have any other question.

nodoxi commented 1 year ago

Thank you. that's exactly what I needed