Procedural Resource Generation

  • Post author:
  • Post published:November 23, 2021
  • Post comments:0 Comments

It’s rather hard to find a proper way to generate resources inside an infinite map and being able to use a seed to generate them in the same way. You need two seeds: one is used as the general seed, while another seed is used for each kind of procedural data you want to generate so that you can combine the two and obtain a different start point in the PNRG sequence.

This is rather useful when you want to scatter around a start point resources randomly but at the same time lazily. Using seeds allows to avoid precomputing all the data, you will be always able to figure out if at coordinate (x,y) there is a specific resource or not with a constant (more or less) time complexity.

You add some bias and mapping function to the results and you are also able to decide how far from the center and how often compared to distance it should spawn.

Leave a Reply