+2 votes

i want the terrain in my world to generate the same every time (i.e trees are in the same place) given the same seed,
but loot chests/enemy AI/enemy drops/etc to be non-predictably random.

Godot version 3.4.4
in Engine by (25 points)

Why can't You use two seeds ?
One calculated using stable ID and another one calculated using randomly generated number ?

Yes, what Inces said. The point being that the same seed will always generate the same sequence. So, for the stable number set, always use the same seed. For the unstable set, use a random seed.

You could use a uniform distribution RNG for the non-predictable random (the larger the minimum and maximum value, the least likely every number in the bounds will be generated) and for the predictable RNG you could use some other distribution (maybe a normal distribution) so that most of your RNG values lie within close distance to each other.

You could also go with another approach where you manually define the probabily of each event you are workign with. So if you want trees to be common in certain areas, then when you are in a forest area, the probability of a tree spawning in a cell should be increased vs. the probability a tree occurs in a cell of a desert. For enemies you could similarily define the probability of enemy encounters, and you could fine tune the probability based on things like sneaking vs. not sneaking, in an enemy base, etc.

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.