Thread: Levellist
View Single Post
  #8  
Old 11-07-2002, 03:19 AM
Com013 Com013 is offline
Registered User
Join Date: Aug 2002
Location: GMT+1
Posts: 381
Com013 is on a distinguished road
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.
__________________
Com013
Former Admin of the LAT on Graal The Adventure

e-mail: [email protected]
Reply With Quote