Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Server Baddie Time (https://forums.graalonline.com/forums/showthread.php?t=57028)

ZeroTrack 01-12-2005 03:50 PM

Server Baddie Time
 
I made a really compact code for a serverside baddie its about a page long the entire baddie is serverside , movement hurting , health , but its returning a very high cpu time, 2. 0.026142 secs npcs[0] (in level snowman.nw at pos (30.3, 27.6)) its a class npc . I was wondering if anyone else has see times this high and its just because its a serverside baddie , i want to make sure its the best code before i write a tut for making serverside baddies

TB3 01-12-2005 06:20 PM

Quote:

Originally Posted by ZeroTrack
I made a really compact code for a serverside baddie its about a page long the entire baddie is serverside , movement hurting , health , but its returning a very high cpu time, 2. 0.026142 secs npcs[0] (in level snowman.nw at pos (30.3, 27.6)) its a class npc . I was wondering if anyone else has see times this high and its just because its a serverside baddie , i want to make sure its the best code before i write a tut for making serverside baddies

Yes it being a server side baddy it will pull a bit higher times, ours sometimes run about .04 in their peak proccesing "IE being spawned and imediatly dying or pwnt / similiar" I'll give you an exact number of one later i cant get on rc now.

ZeroTrack 01-12-2005 06:45 PM

ok just making sure i don't want to write the tut wrong , thanks

TB3 01-12-2005 11:36 PM

7. 0.103714 secs localnpc_tbt_gremlin1_24902227_7 (in level tbt_gremlin1.nw at pos (30, 18))
This is a boss type baddy and ...
Thats as high a lag as our baddies get thats at its peak time right as it dies
and does the calculations for xp / removes itself from database / peforms an equipment drop calculation / item drop calculation / and a gold drop calculation and places npcs accordingly. Does other misc stuff but that is the majority of it.
Usualy its never this high so im guessing he was ganged to death meaning several players must have pelted the crap out of him to kill him quickly as he was being spawned.

oinknessx 01-13-2005 09:02 AM

This might be off topic, but what can you fellas tell me about making overworld baddies? Like little ones about 16x16 or 32x32/64x64 that would be able to do things such as heal themselves, attack others with physical attacks and poison, but also be free to roam the whole land mass they're on on the overworld?

I know it's a pretty vague question.... But what, shortly, would I have to do to create something like that? I can't really script that well, but I'm up fer learnin. :p

Evil_Trunks 01-13-2005 09:18 AM

I think you will lag your NPC server unnecessarily by having a ton of NPCs constantly moving around on the overworld?

osrs 01-13-2005 03:43 PM

1 Attachment(s)
This document explains quite well how to optimize possible lags and such, it is really helpful when scripting baddies, try reading it. (If you haven't already)

TB3 01-14-2005 06:14 PM

Yeah our baddies have been fixed to idle , and stop timeouts when no players are in level or near them. You could go realy advanced and calculate time / distance and on playerenters you could move the npc the distance it could have traveled in the ammount of time it could have been moving when no one was around thats what im working on.


All times are GMT +2. The time now is 08:54 PM.

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