Script Dump

Moderator: GZDoom Developers

Post Reply
Drake Raider
Posts: 474
Joined: Fri Jul 18, 2008 12:27 pm

Script Dump

Post by Drake Raider »

I apologize if this has been asked before.
I'm curious, is there a way to dump the functions that are being used to a text file? So say, if I accidentally looped a script too much, and it hangs the engine, I could see which one was getting called too many times?

Also, Admins, if this is not in existence, could you move this to Feature Requests? I'm acting under the assumption that I just don't know what I'm doing currently. But if there is no such feature, it would be good for those circumstances where the game doesn't actually crash, just lags halfway to heck.
User avatar
Rachael
Posts: 13557
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Script Dump

Post by Rachael »

Drake Raider wrote:Also, Admins, if this is not in existence, could you move this to Feature Requests? I'm acting under the assumption that I just don't know what I'm doing currently. But if there is no such feature, it would be good for those circumstances where the game doesn't actually crash, just lags halfway to heck.
In the future, you can just make it here. It's better to have a dupe than nothing at all. And it is a useful feature, but if it gets implemented I doubt that will happen quickly.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Script Dump

Post by Graf Zahl »

ACS or ZScript?
While this could certainly be done, don't forget that it comes with a performance penalty even if the feature won't be used! In addition, I doubt it would give you any help. There' so much scripted code already that the little bit you are interested in would get drowned in the noise from all the internal things that are running.
User avatar
Rachael
Posts: 13557
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Script Dump

Post by Rachael »

Graf Zahl wrote: While this could certainly be done, don't forget that it comes with a performance penalty even if the feature won't be used!
Couldn't this be alleviated by the use of function templates? Or are the VM's too complicated for that?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Script Dump

Post by Graf Zahl »

The main problem here is not the VM but how the JIT compiler deals with it. On the plain VM this could be easily added but I'm not sure it makes sense to do it in the JIT compiled code, so anyone using such tracing features would have to disable it.
Drake Raider
Posts: 474
Joined: Fri Jul 18, 2008 12:27 pm

Re: Script Dump

Post by Drake Raider »

I don't know ZScript, so ACS or Decorate would be my target area. It would be really helpful, for instance, in a script I'm fighting with right now where I'm trying to adjust a global string variable but I can't tell what the value is upfront.
However, it would be particularly useful when transitioning to ZScript as well, to help buffer the learning curve.

Perhaps a filter could be used in the dump, that holds all builtin actors in decorate, say, and automatically deletes any functions from the dump log that are created by builtin classes?
In case that made no sense, instead of trying to filter which things get reported by the engine, have the printout itself filter things afterwards. Like, say, format the output this way:
ACTOR <NAME> TNT1A A_FunctionDemonstration(x,y,b,c) when an action function is called, or
ACTOR <NAME> <StateLabel> <Pointer> when a pointer is called.

Then have the dump check for any actors in the dump that share classes with builtin ones, like ACTOR DoomImp, and delete those entries.
This doesn't fix the performance of course, but would fix the readability problem. (As long as people aren't hacking GZDoom.pk3 itself, but that's really on them.)
For the performance you could have a toggle where it only checks the information if a CVar is active perhaps?
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”