Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache random seed with dungeon info (feature req) #334

Open
sshipway opened this issue Mar 19, 2016 · 4 comments
Open

Cache random seed with dungeon info (feature req) #334

sshipway opened this issue Mar 19, 2016 · 4 comments

Comments

@sshipway
Copy link
Contributor

The random seed used for a particular dungeon should be cached with the rest of the information; this will allow it to be recreated identically, rather than replaced with a new random dungeon.

This could also allow the dungeon cache to be exported and then used to recreate the same dungeons in a new world generated from the same seed.

Also, the dungeon seed could be defaulted to ((world seed)xor(x)xor(z<<16)) so that each spot always uses the same seed unless explicitly specified, which would make the caching not so necessary

@sshipway sshipway changed the title Cache random see with dungeon info (feature req) Cache random seed with dungeon info (feature req) Mar 21, 2016
@orphu
Copy link
Owner

orphu commented Mar 22, 2016

Deterministic seeds would mean you can't regenerate in place and get something entirely new, which breaks the current (mostly desired I think) functionality.

I can see saving the seed I guess, but it's maybe not as useful as it first seems. This is a little tricky though because slight changes will still create a totally different dungeon. If your config differs even a tiny bit, or you use a different version of MCDungeon you'll still get entirely different dungeons with the same seed. Also you'll likely get different dungeons when rendering on another OS or computer.

The seed option is mostly for debug purposes. For example I'll use it to recreate the same layout when trying to repro something.

@sshipway
Copy link
Contributor Author

I think there are multiple use cases here; some people would want to regenerate with a completely new dungeon, whereas others might want to just 'repair' the existing dungeon to look the same for the next batch of players. Having the seed saved makes the second case possible, even if you don't want it to be the default.

Of course the change of computer and MCD Version caveat remains; but I think there is still a value in saving the seed and giving the option to use original seeds on regen.

@orphu
Copy link
Owner

orphu commented Mar 22, 2016

Yeah, it's an easy addition, so why not.

The only caveat is that folks will be able to regenerate the exact same dungeon only under an extremely narrow set of conditions, even if they have the same seed. The config, machine, MCD version, and OS need to be exactly the same or they will get different results. Not sure people will expect that.

Fixing that problem would take a major reworking of how the random seed is used.

@sshipway
Copy link
Contributor Author

Once you document it sufficiently, it just becomes a 'feature' :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants