View previous topic :: View next topic |
Author |
Message |
evilgrin
Joined: 11 Feb 2007 Posts: 2
|
Posted: Sun Feb 11, 2007 1:23 Post subject: Profiler plugin? |
|
|
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 |
|
|
virusman
Joined: 30 Jan 2005 Posts: 1020 Location: Russia
|
Posted: Mon Feb 12, 2007 1:44 Post subject: |
|
|
I can post the RunScript function address & signature if it's needed. |
|
Back to top |
|
|
Papillon x-man
Joined: 28 Dec 2004 Posts: 1060 Location: Germany
|
Posted: Mon Feb 12, 2007 23:24 Post subject: |
|
|
Ah yes, please do so. You do not happen to know the signatures for intra- and cross-area pathfinding, do you ?
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 |
|
|
virusman
Joined: 30 Jan 2005 Posts: 1020 Location: Russia
|
Posted: Thu Feb 15, 2007 19:43 Post subject: |
|
|
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 ? | You're absolutely right. I don't, but I think I can find them.. |
|
Back to top |
|
|
Gryphyn
Joined: 20 Jan 2005 Posts: 431
|
Posted: Thu Feb 15, 2007 22:45 Post subject: |
|
|
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 |
|
|
evilgrin
Joined: 11 Feb 2007 Posts: 2
|
Posted: Mon Feb 26, 2007 23:42 Post subject: |
|
|
Just checking to see if any progress has been made, any news? |
|
Back to top |
|
|
Via Con Diablos
Joined: 23 Nov 2005 Posts: 55
|
Posted: Thu Mar 01, 2007 11:30 Post subject: |
|
|
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 |
|
Back to top |
|
|
Papillon x-man
Joined: 28 Dec 2004 Posts: 1060 Location: Germany
|
Posted: Thu Mar 01, 2007 22:16 Post subject: |
|
|
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 |
|
|
virusman
Joined: 30 Jan 2005 Posts: 1020 Location: Russia
|
Posted: Thu Apr 26, 2007 13:40 Post subject: |
|
|
Papillon, how did you manage to find pathfinding functions in NWN1? |
|
Back to top |
|
|
Papillon x-man
Joined: 28 Dec 2004 Posts: 1060 Location: Germany
|
Posted: Thu Apr 26, 2007 15:12 Post subject: |
|
|
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 |
|
|
|