I'm working on a text adventure game written in Python and I am at the point where I need to implement procedural generation for the map. As the user moves around, spots are generated, so the entire map is not generated at once but rather it's generated as the user gets closer. For example, the user begins at the position (0, 0) and so the spots generated in the beginning of the game are the eight spots/squares surrounding (0, 0) and of course (0, 0) itself.

I'm have trouble finding a simple way to decide if a "spot" or square is plains, forest, beach, ocean, mountains, etc. I don't want it to be totally random, I want there to be some cogency.

Any help would be appreciated. Thank you.

  • \$\begingroup\$ You can start off with a simple set of adjacency rules - e.g. oceans have high chance of being next to beaches and 0 chance next to mountains. Check all surrounding and choose random new square type based on that. \$\endgroup\$
    – Kromster
    Jan 24, 2020 at 6:49
  • \$\begingroup\$ With any procedural generation question, the first step is on you to define what you want the outputs of that generator to be like. We could suggest a hundred different generation rules with "some cogency" that could work in some game, and ninety-nine of them might be completely wrong for your game. So, to help focus answers on what your game needs, explain to us what qualities we would use to judge the output. Do you have examples of what a "good" generated biome map or player journey through that map might look like, compared to "bad" examples we should avoid? How do we rate answers? \$\endgroup\$
    – DMGregory
    Jan 24, 2020 at 12:43


Browse other questions tagged .