Monday, January 16, 2017

Markeen - Single-thread for seeded generation

When I implemented the multithreaded generation for Markeen, I inadvertently broke the feature that lets the user specify a seed to get a predictable level set. When there are multiple generations going on at once, the random number generator is used from multiple threads in unpredictable orders, completely destroying the whole "same output for same seed" thing.

To fix that, I reshuffled the outermost generation loop to fall back to the old behavior (one level at a time, sequentially) if a seed was specified. Now, most people will enjoy the fast multithreaded generation, but a predictable set can be created if necessary.

No comments:

Post a Comment