![]() |
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
|
Quote:
|
ok just making sure i don't want to write the tut wrong , thanks
|
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. |
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 |
I think you will lag your NPC server unnecessarily by having a ton of NPCs constantly moving around on the overworld?
|
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)
|
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.