Graal Forums  

Go Back   Graal Forums > Development Forums > Future Improvements
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 11-02-2002, 10:38 PM
Com013 Com013 is offline
Registered User
Join Date: Aug 2002
Location: GMT+1
Posts: 381
Com013 is on a distinguished road
Levellist

It would help me if there was a list of levels I can access serverside. I'd need the variables levelscount and #L(...) to randomly place NPCs in certain levels (or to refill the fishrate).
#L(...) should be sorted alphabetically and #L(0) should not be the same as #L, but the first level in the order.
Then I could do something like this:
NPC Code:

if (created) {
timeout = 5;
}
if (timeout) {
if (level.fishrate < level.maxfishrate) level.fishrate+=0.1;
this.nextlevel= (this.nextlevel+1)%levelscount;
warpto #L(this.nextlevel),0,0;
}

__________________
Com013
Former Admin of the LAT on Graal The Adventure

e-mail: [email protected]
Reply With Quote
  #2  
Old 11-03-2002, 01:46 AM
Falcor Falcor is offline
Darth Cucumber
Falcor's Avatar
Join Date: Mar 2001
Location: At School
Posts: 2,874
Falcor is on a distinguished road
Send a message via ICQ to Falcor Send a message via AIM to Falcor Send a message via MSN to Falcor Send a message via Yahoo to Falcor
If the NPCs server level list was optomised it could be useful, but right now every level you ever put on the server, even if you took it off, is on the level list... so eventually you'd get a level that doesn't exsists. *shrugs*... I don't see why you'd really need it though, I'm sure there are other ways, maybe even more efficient ways of doing what you want.
__________________

subliminal message: 1+1=3
Reply With Quote
  #3  
Old 11-03-2002, 03:50 AM
Dach Dach is offline
call me Chad, it's cooler
Dach's Avatar
Join Date: Aug 2002
Posts: 1,899
Dach is on a distinguished road
Thats a pretty good idea, aslong as the levellist is up to date and all that. Are there any other ways to do this, other than using a string list of all the levels you'd need? Considering that there would be atleast a couple hundred indecies just for levels w/ fish, that wouldn't be very efficient at all...
__________________
Scripting Documents:Old Script Documentation-Movement Tutorial
Reply With Quote
  #4  
Old 11-03-2002, 04:24 PM
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 Falcor
If the NPCs server level list was optomised it could be useful, but right now every level you ever put on the server, even if you took it off, is on the level list... so eventually you'd get a level that doesn't exsists.
Yes, that mustn't happen.
Quote:
*shrugs*... I don't see why you'd really need it though, I'm sure there are other ways, maybe even more efficient ways of doing what you want.
No. At least not more efficient ways. Currently on Classic the normal fish (fishrate) are refilled every time you enter the level. But only local (since we have no level. vars without an NPC Server). This is not good...fish should refill slowly and not depending on when a player entered the level.
And then there are the pets of Classic: fighting fish. Currently they are placed randomly when the player entered the level. Again, I don't like that it depends on when a player entered. Currently it is possible to cheat by standing at the border of two levels and pressing two keys at once, so you warp between the two levels very often. Before I wrote a fix for it you got 20 fighting fish in each level, now I did it so you can only get one fish in a certain amount of time. But one cheated fish is one cheated fish too much.

Of course I could solve it using a string list, but imagine a stringlist containing 6000 levelnames....
__________________
Com013
Former Admin of the LAT on Graal The Adventure

e-mail: [email protected]
Reply With Quote
  #5  
Old 11-03-2002, 04:33 PM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally posted by Com013

Yes, that mustn't happen.

No. At least not more efficient ways. Currently on Classic the normal fish (fishrate) are refilled every time you enter the level. But only local (since we have no level. vars without an NPC Server). This is not good...fish should refill slowly and not depending on when a player entered the level.
You could have an NPC in every level that contains fish, which monitors the amount of fish in the level and places new ones when necessary.
__________________
Reply With Quote
  #6  
Old 11-06-2002, 12:52 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


You could have an NPC in every level that contains fish, which monitors the amount of fish in the level and places new ones when necessary.
Sure. And then I'll run to Stefan complaining that the NPC Server is too laggy. In each level with water a fighting fish could apear. That means in each level I need an NPC having constantly timeouts. Ok, I am thinking of 30 seconds or more for the timeout, but still, the NPC server would have to control the timeouts of 3000 NPCs.

And do you think I want to add the NPCs to all those levels? Of course, I could try to make the script converter place them, but the poor program has enough work to do. (Or more to the fact: the poor programmer).
__________________
Com013
Former Admin of the LAT on Graal The Adventure

e-mail: [email protected]
Reply With Quote
  #7  
Old 11-06-2002, 12:43 PM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally posted by Com013

Sure. And then I'll run to Stefan complaining that the NPC Server is too laggy. In each level with water a fighting fish could apear. That means in each level I need an NPC having constantly timeouts.
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.
__________________
Reply With Quote
  #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
  #9  
Old 11-07-2002, 04:10 AM
Tyhm Tyhm is offline
Psionic Youth
Tyhm's Avatar
Join Date: Mar 2001
Location: Babord, West Graal Deaths:1009 Kills:1
Posts: 5,635
Tyhm has a spectacular aura about
I think Kai meant have one NPC that sends a fish to each level listed...or something, somehow.

Terrible how all the NPCServ people look down on Classic people for not having a year or so experience
__________________
"Whatever," said Bean, "I was just glad to get out of the toilet."

"Power does not corrupt. Fear corrupts, perhaps the fear of a loss of power."- John Steinbeck
"I'm only acting retarded, what's your excuse?" queried the Gord.
- My pet, the Levelup Gnome

http://forums.graalonline.com/forums...&postcount=233
Reply With Quote
  #10  
Old 11-07-2002, 04:14 AM
Spark910 Spark910 is offline
Ex-Graal Global
Spark910's Avatar
Join Date: Oct 2001
Location: England
Posts: 10,892
Spark910 has a spectacular aura about
Who care, you will leanr new stuff. And you will probably end up being better than everyone else, maybe!
__________________
--Spark911
Reply With Quote
  #11  
Old 11-07-2002, 09:16 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally posted by Com013

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.
Okay, here: Every time a fish dies, it sends a trigger to the server. The server then replaces it, possibly with a delay for realism. Then the only problem is the actual placing of the fish in the first place, and easy ways could be concocted to handle that. For example, something in the CNPC could trigger the server every time it enters a suitable level. If the server agrees that the level is fine for fish then it places some there. Then the workload is spread according to the activities of the players, and perhaps levels that don't get many visitors could empty out their fish after a while to reduce server load.

Question, though: What do these fish do? If you're worried about timeouts then how are you going to make them do anything other than float on the water's surface and do nothing?

Quote:
Originally posted by Tyhm
Terrible how all the NPCServ people look down on Classic people for not having a year or so experience
Not at all, my suggestion had nothing to do with exclusively-serverside stuff. It was just maths, y'know?
__________________
Reply With Quote
  #12  
Old 11-07-2002, 11:44 PM
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
Question, though: What do these fish do? If you're worried about timeouts then how are you going to make them do anything other than float on the water's surface and do nothing?
There are two types of fish on The Adv.:
  • the normal fish which are just represented by the variable "level.fishrate". This variable controls how fast you can get a normal fish using your fishing rod.
  • the Fighting Fish which are actually NPCs which are moving around and fight against each other. They are very rare and sometimes apearing the water.


Quote:
Originally posted by Falcor
I'm sure there are other ways, maybe even more efficient ways of doing what you want.
Ok, I think I've found the optimal way now:
I'll save how much time has past since the last time the level was refilled. This time will be used for calculating the current increase/chance. Something like this: (the used numbers are just examples. I have to calculate better values)
NPC Code:

if (actionserverside)
{
if (level.lastrefill == 0) level.lastrefill = timevar;
passedtime = timevar - level.lastrefill;
if (level.fishrate < level.maxfishrate)
{
if (level.fishrate <= 0) level.fishrate = 0.05;
level.fishrate = level.fishrate * (1.1^passedtime);
if (level.fishrate > level.maxfishrate) level.fishrate = level.maxfishrate;
}
chance = 1-(0.99^passedtime);
if (chance > random(0,1))
{
// put fighting fish
}

level.lastrefill = timevar;
}
//#CLIENTSIDE
if (playerenters)
{
triggeraction 0,0,serverside,-FishRefill;
}

__________________
Com013
Former Admin of the LAT on Graal The Adventure

e-mail: [email protected]
Reply With Quote
  #13  
Old 11-08-2002, 01:03 AM
Jeff Jeff is offline
Registered User
Join Date: Oct 2002
Location: Nebraska, USA
Posts: 707
Jeff is on a distinguished road
Note to Com:

Fish system on Classic Dev NPC server, working at this very moment on the client interface to the probability system.


EDIT: Serverside part of pole in NPC weapon "Unhackable Fish System" and controller NPC in DBNPC "Fish-Control"
__________________
Jeff, the Archduke of Dustari
Member of the LAT on Graal The Adventure
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GO d+ s++:+ !a C++ UL+(UL+++)@ P+ L+(++)>+++ E---- W++@ N- !o ?K w(w--) !O !M@ !V PS- PE+ Y PGP t+ 5 X R tv(tv+) b++(b+)>b++++ DI(DI+) D-- G e->e++++ h! !r y
------END GEEK CODE BLOCK------
Reply With Quote
  #14  
Old 11-08-2002, 03:53 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 Jeff
Note to Com:

Fish system on Classic Dev NPC server, working at this very moment on the client interface to the probability system.


EDIT: Serverside part of pole in NPC weapon "Unhackable Fish System" and controller NPC in DBNPC "Fish-Control"
Argh...I looked at your NPC and...better use my version. (And my version is already working fine with the fishing rod and so on...I don't want to rescript that again).
Using a stringlist of all the levels with fish inside them? Er...I guess we'd nuke the limit of the string size sooner or later.
__________________
Com013
Former Admin of the LAT on Graal The Adventure

e-mail: [email protected]
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 12:55 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.