Skip to content

Server and scripting

vonstormvonstorm Member Posts: 66
edited January 2019 in Builders - Scripting
Not sure if this is the right place but here goes -
Has anyone else noticed that server performance slows over time?
at the beginning my areas are fast, spawns are good etc, but after a couple of hours zone transitions take longer, spawns are delayed etc. Is this bad scripting or does everyone have this problem over time. I have zero heartbeat scripts, have cleanup scripts on area exit - merchant clean scripts etc.
any insight would be helpful. If I can make the server run decent for 6 hours Im golden (12 would be nice).
Post edited by vonstorm on

Comments

  • SherincallSherincall Member Posts: 387
    It is something specific to the server for sure. My guess would be a few NPCs get stuck between some placeables and are using up a lot of cycles trying (and failing) to pathfind their way out. Even one NPC stuck like that could cause the perf to drop 50%.

    Ideally, you'd hook your server up on nwnx with the profiler plugin, and it'd give you a perfect breakdown of what is eating the perf and why. Linux only, though.
  • vonstormvonstorm Member Posts: 66
    Sadly running on windows, waiting for NWNX release. Thanks for the insight Ill take a look. May be mobs in designated "pool" areas (areas spawn points pull from) as they get thrown in. However I thought that only assets in player occupied (live) areas were active.
  • Knight_ShieldKnight_Shield Member Posts: 51
    I had a map builder at one time use a place able that constantly fired a script. And they used this place able
    a bunch of different places. That messed with alot in my module.
  • claiminglightclaiminglight Member Posts: 3
    I've never played on a server that could run continuously. They've all need a restart eventually, which in a perfectly coded environment, shouldn't technically happen.

    Some of that, I believe, is an imperfect garbage disposal system in NWN that gets stressed in larger modules with large numbers of players. You probably won't be able to make a module/server that can run continuously. 

    So, to meet your goal of 6ish hours, it's obviously gonna take some trial and error. Some places I'd start trying things:
    https://nwnlexicon.com/index.php?title=Lag_Busting
    * Create more aggressive onDeath scripts for dead monsters (apply DestroyObject on death, for instance).
    * Try DestoryArea and CreateArea to really shake the dirt off zones that aren't in use, but might be remembering more crap than you'd like.

    ... Basically, just nuke stuff that nobodies using and reform it. A policy that's worked great for me and, coincidentally, seems to be a go-to for many of our governments.
  • TressetTresset Member, Moderator Posts: 8,264
    @claiminglight your comment here was caught by the forum's automated spam filter. I have restored it and verified you so that this should not happen again.
  • vonstormvonstorm Member Posts: 66
    Well its getting better. Thanks Claiminglight and others for the tips. Ive made my cleanup scripts act more aggressively (at one point a little too much :smile:). Changed a pseudo heartbeat value on a random spawner and it seems to have helped. One thing I did notice, one time I had to exit the client and go do something, when I came back the area load times were faster without a server restart, so Im guessing its a little of both.
    Its running ok now for a 6 hour session, so Ill up my game and go for 12 :smile:

    Thanks again for the insight.
  • claiminglightclaiminglight Member Posts: 3
    edited January 2019
    Glad you managed to find something that worked so well! And thanks, Tresset!
Sign In or Register to comment.