logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Profiler plugin?

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Development
View previous topic :: View next topic  
Author Message
evilgrin



Joined: 11 Feb 2007
Posts: 2

PostPosted: Sun Feb 11, 2007 1:23    Post subject: Profiler plugin? Reply with quote

Hi, I am the developer for a persistent world, and I am using NWNX extensively.

As the module has grown more complex and the subsystems have become more fleshed out and mature, we have begun running into performance issues.

Does anyone have any idea when the profiler plugin will be available so I can get some good statistics on what may be causing the mod to lag?

It seems like it's NPC spellcasters that cause the worst lag, but when I disable spellhooking it still happens, so it doesn't seem like a script issue for them.

We also get nice lumps of lag at other seemingly random times as well, but I haven't identified any efficient way through code to figure out if it is a rogue script, hence my interest in the profiler for nwn2.

BTW, thanks for the excellent work on nwnx4, it's a life saver.

Evilgrin
Back to top
View user's profile Send private message
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Mon Feb 12, 2007 1:44    Post subject: Reply with quote

I can post the RunScript function address & signature if it's needed.
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Mon Feb 12, 2007 23:24    Post subject: Reply with quote

Ah yes, please do so. You do not happen to know the signatures for intra- and cross-area pathfinding, do you Smile ?

The profiler is something I absolutely want to have for NWN2, but it might be a couple of weeks before it sees the light.
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Thu Feb 15, 2007 19:43    Post subject: Reply with quote

From NWNX4 Chat:
Code:
DWORD FindRunScript()
{ //83 EC 0C 8B 54 24 18 33 C0 56
   char* ptr = (char*) 0x400000;
   while (ptr < (char*) 0x700000)
   {
      if ((ptr[0] == (char) 0x83) &&
         (ptr[1] == (char) 0xEC) &&
         (ptr[2] == (char) 0x0C) &&
         (ptr[3] == (char) 0x8B) &&
         (ptr[4] == (char) 0x54) &&
         (ptr[5] == (char) 0x24) &&
         (ptr[6] == (char) 0x18) &&
         (ptr[7] == (char) 0x33) &&
         (ptr[8] == (char) 0xC0) &&
         (ptr[9] == (char) 0x56)
         )
         return (DWORD) ptr;
      else
         ptr++;
   }
   return NULL;
}

Code:
void RunScript(char * sname, int ObjID)
{
  int sptr[4];
  sptr[1] = strlen(sname);
  _asm {
    lea  edx, sptr
    mov  eax, sname
    mov  [edx], eax
    push 0
    push 1
    push ObjID
    push edx
    mov ecx, pScriptThis
    mov ecx, [ecx]
  }
  scriptRun = 1;
  _asm { call pRunScript }
  scriptRun = 0;
}


Papillon wrote:
You do not happen to know the signatures for intra- and cross-area pathfinding, do you Smile ?
You're absolutely right. Smile I don't, but I think I can find them..
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Gryphyn



Joined: 20 Jan 2005
Posts: 431

PostPosted: Thu Feb 15, 2007 22:45    Post subject: Reply with quote

Great hunting Virusman.

Does this include the option to see any 'parameters' that may have been set. (I'm a bit ignorant here) or is that something for the plugin to determine?

We might want an extra level of logging to trace not only the Script activity, but also parameters being passed - a rouge parameter might be causing a crash, rather than the script itself.

Hey, but first things first 8^)

Cheers
Gryphyn
Back to top
View user's profile Send private message
evilgrin



Joined: 11 Feb 2007
Posts: 2

PostPosted: Mon Feb 26, 2007 23:42    Post subject: Reply with quote

Just checking to see if any progress has been made, any news?
Back to top
View user's profile Send private message
Via Con Diablos



Joined: 23 Nov 2005
Posts: 55

PostPosted: Thu Mar 01, 2007 11:30    Post subject: Reply with quote

Gryphyn wrote:
Great hunting Virusman.

Does this include the option to see any 'parameters' that may have been set. (I'm a bit ignorant here) or is that something for the plugin to determine?

We might want an extra level of logging to trace not only the Script activity, but also parameters being passed - a rogue parameter might be causing a crash, rather than the script itself.

Hey, but first things first 8^)

Cheers
Gryphyn


TFTFY Wink
Back to top
View user's profile Send private message
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Thu Mar 01, 2007 22:16    Post subject: Reply with quote

evilgrin wrote:
Just checking to see if any progress has been made, any news?


I wouldn't hold my breath waiting for it, currently... it's really just something that is on the list of things I want to do, but there are no immediate plans to work on it right now.
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Thu Apr 26, 2007 13:40    Post subject: Reply with quote

Papillon, how did you manage to find pathfinding functions in NWN1?
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Thu Apr 26, 2007 15:12    Post subject: Reply with quote

I had an Avlis module that was lagging very badly. I knew that something was totally wrong and that the profiler did not capture that specific problem. By trial and error, I was also able to isolate the problem to a single creature in one single area. Next, I am not sure exactly how, I discovered that it was a pathfindig issue.

So I poked around the main game loop and eventually found a function that took unusually long to come back into the debugger (with step-over), when I ran the server with my mini-module.

Mind you, that took like... 3 days ?
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Development All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group