Quote:
Originally posted by Kaimetsu
Sure, if you wanna tackle the problem in a stupid way. Instead of repeatedly sampling a random number, why not use the Poisson distribution to predict the average time to next spawn and then apply a standard deviation to that? Then simply set timeout to that new quasi-random time and spawn the fish when the period has elapsed.
|
Of course I did
not intend something like this:
NPC Code:
if (created) {
timeout = 0.1;
}
if (timeout) {
if (random(0,1000)<0.5) // put fish
timeout = 0.1;
}
I was thinking of something like this:
NPC Code:
if (created) {
timeout = 120;
}
if (timeout) {
if (level.fishrate < level.maxfishrate) {
level.fishrate = level.fishrate*1.2+0.05;
if (level.fishrate > level.maxfishrate) level.fishrate = level.maxfishrate;
}
timeout = 120;
}
But still...the NPC Server would have to keep record of timeouts in
2000 levels or so.
And I'd have to add this NPC to all of this levels.