Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If you wanted to generate the same terrain, then you could save a particular seed for the random function which could be appended to the url.

That wouldn't include all the player made modifications to the terrain but it would give people the same world.



How would you generate which seed to use?


The seed could be generated using the default random function of your platform without specifying the seed (the default seed is likely based on some timestamp component).

You would then take the value the default random function gives you and feed it into the overloaded constructor which allows you to specify the seed.

That way you could still record the seed's value which was used to generate your terrain.


But the terrain wasn't generated using an rng, it was generated by the user placing and deleting blocks.


If you read my first comment in this thread, I stated that by recording the seed it would allow you to save the terrain generated by the game not any modifications or alterations a user added to it with their own block placement.

This is used frequently in Minecraft for players to share interesting maps which have randomly generated.


Sorry, I misunderstood.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: