Script Dump

Remember, just because you request it, that doesn't mean you'll get it.

Moderator: GZDoom Developers

Script Dump

Postby Drake Raider » Tue Dec 25, 2018 3:32 pm

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
Drake Raider
Currently working on Blanket Doom
 
Joined: 18 Jul 2008
Location: Plane of thought.

Re: Script Dump

Postby Rachael » Tue Dec 25, 2018 11:24 pm

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
Rachael
Webmaster
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle

Re: Script Dump

Postby Graf Zahl » Wed Dec 26, 2018 2:09 am

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
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Script Dump

Postby Rachael » Wed Dec 26, 2018 2:24 am

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
Rachael
Webmaster
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle

Re: Script Dump

Postby Graf Zahl » Wed Dec 26, 2018 2:40 am

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.
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Script Dump

Postby Drake Raider » Wed Dec 26, 2018 9:47 pm

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?
User avatar
Drake Raider
Currently working on Blanket Doom
 
Joined: 18 Jul 2008
Location: Plane of thought.


Return to Feature Suggestions

Who is online

Users browsing this forum: No registered users and 2 guests