1 registered members (TipmyPip),
18,449
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Manipulating the function scheduler?
[Re: jcl]
#387948
11/26/11 04:21
11/26/11 04:21
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
So, Mr Developer...
Are you saying there is no way to do it WITHOUT a plugin?
Or have I missed something TechMuc (or someone else) said?
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Manipulating the function scheduler?
[Re: FBL]
#388016
11/27/11 01:38
11/27/11 01:38
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
OK... After MORE wastage of time, re-reading EVERYONES posts in this thread, I finally got the bastich working! But, by the gods, is it UGLY... Here it is. IMPORTANT:: The bulk of the code MUST come straight after acknex.h and before any other #include's you do. Otherwise they will just be processing 'un-redirected' wait functions... I THINK ...
#include <acknex.h>
//
void _wait(var);
void _wait_initialize() { _wait = wait; }
#define wait(i) do{ diag(waiting\n"); _wait(i); } while(0)
//
#include "everything else"
//
//
void main()
{
_wait_initialize(); //this MUST come before any wait's in main!
...
Point of interest for Germanunkol: Be aware that the "engine_gettaskinfo" function is currently bugged! Check the Bugs forum under Benni003's "engine_getscriptinfo" posting. This bug also affects the engine_gettaskinfo function too...
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Manipulating the function scheduler?
[Re: EvilSOB]
#388457
12/03/11 08:55
12/03/11 08:55
|
Joined: Jun 2006
Posts: 2,640 Earth
Germanunkol
OP
Expert
|
OP
Expert
Joined: Jun 2006
Posts: 2,640
Earth
|
Well thank you very much EvilSOB. I now sorta got the macro working. Sorta, because after the first few wait calls, it always seems to be returning a certain function name - no longer the one which the wait is actually called in. I suspect this has to do with the wrong behavior of gettaskinfo.
This entirely defeats the purpose of the whole thing, because what I need to do is find out where my text object is overwritten, so I log the name of the current function and the text object's value on every wait call. But if the function name isn't correct, I might as well just not do it.
The only Idea I've had so far is to set a string to a different value after every wait() call (and then log that string), but I'd have to do that manually. Which totally sucks.
Or I'll write a c++ script which does it for me... which might be less horrible, cause I probably have around a thousand functions.
~"I never let school interfere with my education"~ -Mark Twain
|
|
|
Re: Manipulating the function scheduler?
[Re: Germanunkol]
#388458
12/03/11 09:42
12/03/11 09:42
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
In order to bypass the gettaskinfo bug, I did it by completely removing the default.c include. Works fine then.
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Manipulating the function scheduler?
[Re: EvilSOB]
#388480
12/03/11 17:08
12/03/11 17:08
|
Joined: Jun 2006
Posts: 2,640 Earth
Germanunkol
OP
Expert
|
OP
Expert
Joined: Jun 2006
Posts: 2,640
Earth
|
I FIXED IT! I've been working on this for 6 months and just could not find the bug. It was - as I've been expecting for quite some time now - an array that was being addressed with a wrong index (resulting in it setting some other part of the memory). By writing a script that added a line before all wait calls, I found out which function it was in. There was some troubles with proc_mode, as those calls changed my results, but I finally found it.
Thanks a lot for all your help!
~"I never let school interfere with my education"~ -Mark Twain
|
|
|
Re: Manipulating the function scheduler?
[Re: Germanunkol]
#388500
12/03/11 21:43
12/03/11 21:43
|
Joined: Dec 2008
Posts: 1,218 Germany
Rackscha
Serious User
|
Serious User
Joined: Dec 2008
Posts: 1,218
Germany
|
@Germanunkol: Oh yea, i know those bugs. Once i wrote into the wrong index and destroey something in the background. Resulting in crashes whenever i called a string function >.<
MY Website with news of my projects: (for example my current Muliplayer Bomberman, GenesisPrecompiler for LiteC and TileMaster, an easy to use Tile editor) Sparetime-Development
|
|
|
Re: Manipulating the function scheduler?
[Re: Germanunkol]
#388503
12/03/11 21:51
12/03/11 21:51
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Good to hear.
Its been useful for me too.
Ive been able to write a debug function that can tell me how long each function is taking to process.
This debug function is also able to filter which functions get reported on, as well as dumping various global variables dependant on which function was running during that time.
Its helping to optimise maultiple parallel functions.
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Manipulating the function scheduler?
[Re: EvilSOB]
#388593
12/04/11 20:27
12/04/11 20:27
|
Joined: Jun 2006
Posts: 2,640 Earth
Germanunkol
OP
Expert
|
OP
Expert
Joined: Jun 2006
Posts: 2,640
Earth
|
But I assume you're using gettaskinfo, right? I was thinking about writing a similar function, to try and get a higher fps..
~"I never let school interfere with my education"~ -Mark Twain
|
|
|
|