Cliffski (though I suppose others too if you have any insights?),
I have a few questions about using random.
The first is about the using random multiple times. If you use random multiple times as influences, does it take a new value each time, or will it use the same value for each one? If I explain why I’m asking, it may become a little clearer. I am thinking about the following case:
[influences]
0 = "_random_,0.0,0.2"
1 = "_random_,0.0,0.2"
2 = "_random_,0.0,0.2"
3 = "_random_,0.0,0.2"
4 = "_random_,0.0,0.2"
If each random value is the same here, this will work the same as just using:
0 = "_random_,0.0,1.0"
But if it takes on a different value each time it’s called, it will give you an approximate Gaussian distribution. It seems to be the latter, but it’s not very easy for me to test directly. So I figured I’d just ask.
It also appears I can use random in other places, like inputs to simulation values. Is there any technical, game engine reason this is a horrible idea?
Finally, random always seems to be seeded from the same seed when you start a new game. This means that ‘random’ events happen the same way each game. This can clearly be seen if you have a simulation value that uses its only input as “random,0,1”, as it gives you exactly the same pattern each time. Is there a way to avoid this somehow?
The reason I’m asking is that I’m trying to create a variable with a smoothed random walk. I am doing this by creating a simulation value that has it’s value set using five instances of “random,0,0.2” which appears at least to give me a Gaussian distribution. Then I have a second simulation variable which is seeded off of itself with a one turn lag (so uses the same value as last turn) plus the value of the Gaussian simulation value averaged over the last four turns using 1, 2, 3 and 4 turn lag adjusted so it’s between -0.2 and +0.2. This seems to work. However, every time I run the game I get the exactly the same random walk out of it, which is a little frustrating. It also makes it harder to tell if the whole Gaussian thing is working.
Thanks for any help you can offer!
-El