Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-12-2005, 03:50 PM
ZeroTrack ZeroTrack is offline
G2K1 Developer
ZeroTrack's Avatar
Join Date: Apr 2004
Location: LongIsland, NY
Posts: 402
ZeroTrack is on a distinguished road
Send a message via AIM to ZeroTrack
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
__________________

Reply With Quote
  #2  
Old 01-12-2005, 06:20 PM
TB3 TB3 is offline
Registered User
TB3's Avatar
Join Date: May 2001
Location: US of A State of VA
Posts: 658
TB3 is on a distinguished road
Send a message via Yahoo to TB3
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.
__________________

To the sun of your age, I arise
Reply With Quote
  #3  
Old 01-12-2005, 06:45 PM
ZeroTrack ZeroTrack is offline
G2K1 Developer
ZeroTrack's Avatar
Join Date: Apr 2004
Location: LongIsland, NY
Posts: 402
ZeroTrack is on a distinguished road
Send a message via AIM to ZeroTrack
ok just making sure i don't want to write the tut wrong , thanks
__________________

Reply With Quote
  #4  
Old 01-12-2005, 11:36 PM
TB3 TB3 is offline
Registered User
TB3's Avatar
Join Date: May 2001
Location: US of A State of VA
Posts: 658
TB3 is on a distinguished road
Send a message via Yahoo to TB3
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.
__________________

To the sun of your age, I arise
Reply With Quote
  #5  
Old 01-13-2005, 09:02 AM
oinknessx oinknessx is offline
Banned
oinknessx's Avatar
Join Date: Apr 2004
Location: United States
Posts: 646
oinknessx is on a distinguished road
Send a message via AIM to oinknessx
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.
Reply With Quote
  #6  
Old 01-13-2005, 09:18 AM
Evil_Trunks Evil_Trunks is offline
Evil
Evil_Trunks's Avatar
Join Date: Dec 2004
Posts: 391
Evil_Trunks is on a distinguished road
I think you will lag your NPC server unnecessarily by having a ton of NPCs constantly moving around on the overworld?
__________________

Reply With Quote
  #7  
Old 01-13-2005, 03:43 PM
osrs osrs is offline
Graalian since 1998
osrs's Avatar
Join Date: Mar 2002
Location: Brazil
Posts: 2,724
osrs is on a distinguished road
Send a message via ICQ to osrs Send a message via AIM to osrs Send a message via MSN to osrs Send a message via Yahoo to osrs
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)
Attached Files
File Type: txt docu_optimization.txt (8.6 KB, 192 views)
__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /
Reply With Quote
  #8  
Old 01-14-2005, 06:14 PM
TB3 TB3 is offline
Registered User
TB3's Avatar
Join Date: May 2001
Location: US of A State of VA
Posts: 658
TB3 is on a distinguished road
Send a message via Yahoo to TB3
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.
__________________

To the sun of your age, I arise
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 08:20 AM.


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