"The end of DECORATE?" or "My fear of ZScript"

Discuss anything ZDoom-related that doesn't fall into one of the other categories.
User avatar
Ravick
Posts: 2002
Joined: Sun Aug 22, 2010 10:59 pm
Location: Tubarão, Brasil
Contact:

Re: "The end of DECORATE?" or "My fear of ZScript"

Post by Ravick »

Look, my two fears (and of a few other modders I've talked to) with this new ZScrit thing was/are that we who have DECORATE based mods could get the same problem of RTC-3057's pistol, simply destroyed when the "old DECORATE format" got deprecated, and the possibility of need to update hundreds (literally, for me and a few others) of actors to this new code format.

It took me some time to believe that this was the reason for RTC-3057 to got so unbalanced without a pistol. I mean, "omg, it can rly happens, our mods can get broken by the Zdoom's evolution!"

And after seeing me and others got mods broken with the new parser (that I've seem some calling "Nazi Parser"), I was rly afraid seeing this ZScript thing emerging. It was one more thing to broken our mods that, before it, were working just fine.

But, if, as said in this thread, DECORATE will remain there, and our inheritance based actors can actually remain even with the stock actors being in ZScript, I welcome it. Modding power is always good. And, even I still not knowing how to use it, ZScrit seems to be an ultimate power for that to me.
User avatar
Rachael
Posts: 13527
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: "The end of DECORATE?" or "My fear of ZScript"

Post by Rachael »

The mods that break should not be too hard to update with the "nazi parser" - the real problem is when authors release stuff with a restrictive copyright that prevents second-hand modification and then completely disappear from the community forever.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49053
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: "The end of DECORATE?" or "My fear of ZScript"

Post by Graf Zahl »

RTC-3057 didn't get broken by the deprecation of old DECORATE but by making actor names case insensitive. The makers were so smart to name their Pistol replacement 'pistol'. A lot of good it did to them. In retrospect I should have addressed the issue back then like I did now - by synthesizing a new name for such actors, not by allowing the duplicate to pass.
User avatar
ZZYZX
 
 
Posts: 1384
Joined: Sun Oct 14, 2012 1:43 am
Location: Ukraine
Contact:

Re: "The end of DECORATE?" or "My fear of ZScript"

Post by ZZYZX »

https://mantis.zdoom.org/view.php?id=325#c730
Why do we destroy DECORATE duplicates now?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49053
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: "The end of DECORATE?" or "My fear of ZScript"

Post by Graf Zahl »

This was a mistake from approx, 8-9 years ago I always regretted doing back then because I didn't see the serious problem it caused (i.e. it has become impossible to retrieve the states of the shadowed class from a savegame, even if other classes inherited from it) So essentially there were 3 options:

1. outright prohibit duplicates (bad)
2. keep the broken behavior in (also bad)
3. try to synthesize a new name for the duplicate (only bad in some special cases)

It's the classic case of a problem with no good solution, I had to pick one the keeps future damage to the minimum.
User avatar
Agentbromsnor
Posts: 265
Joined: Wed Mar 28, 2012 2:27 am

Re: "The end of DECORATE?" or "My fear of ZScript"

Post by Agentbromsnor »

I just wanted to say that I completely relate to this post. As a fellow script-kiddie, I too got quite nervous when I saw all those really complex looking ZScript examples popping up.

However, I do think that at this stage it's still very daunting because of how little "real" documentation there is of ZScript (though this is expanded all the time, of course). I'd say give it another year or so, and there should be a lot more documentation about all the different ZScript functions and how to properly put your scripts together. I think that at the end of the day ZScript is very promising, and I can't think of any other Doom port that allows for this level of scripting without just outright rewriting the source.
User avatar
Rachael
Posts: 13527
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: "The end of DECORATE?" or "My fear of ZScript"

Post by Rachael »

I think what will help ZScript more than anything else in the world at all right now is if project HOERS kicks off, but there's still several things that need to happen before that goes into full swing. Inevitably as people make submissions, some will try and document it, and others will also benefit from being able to make use of the code inside DECORATE.
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Contact:

Re: "The end of DECORATE?" or "My fear of ZScript"

Post by Matt »

Just a passing thought: the fact that the VM overhead is so big compared to relying on a native equivalent should help ~even the playing field~ a bit. There isn't really any reason to type up a bunch of trig and have a thorough breakdown of every piece of what you're doing when most of the assumptions in A_SpawnItemEx/ChangeVelocity/SpawnProjectile already handle what you need.

Most of the more efficiently written code by people who really know what they're doing may well look like DECORATE+anon functions but with more parentheses and semicolons, which (except for the occasional really complex thing here and there that you know that modder would've had an even crazier-looking hack version of in DECORATE anyway) looks more or less like what newer users will be producing, with a small shifting population of those in the learning curve trying out the obviously weird stuff.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49053
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: "The end of DECORATE?" or "My fear of ZScript"

Post by Graf Zahl »

You are thinking too much about VM overhead. Surely it's a lot more than native code, but it's still in the realm of microseconds, not milliseconds what we are talking about.

I had to use D4D (one of the most extreme mods when it comes to script use) on one of the most extreme maps I know (the final map of Neodoom) to get the whole system to the point where the VM use per frame reached one millisecond - and even then it got outclassed 10:1 by the native part of the AI code.
User avatar
DeathIncarnate
Posts: 60
Joined: Thu Oct 16, 2014 1:57 am
Location: South Africa

Re: "The end of DECORATE?" or "My fear of ZScript"

Post by DeathIncarnate »

Would ZScript make certain functions "easier" (less messy)?
E.g: Simply looking at DECORATE functions such as reloading, zooming, kicking and other custom weapon states - let alone actually implementing it - is rather painful.
Looking at the amount of "TNT1 AAAAAAAAAAAAAA 0" and unbelievable amount of Jump functions in DECORATE on certain mods is enough to make one dizzy.
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Contact:

Re: "The end of DECORATE?" or "My fear of ZScript"

Post by Matt »

The "TNT1 AAAAAAAAAAAAAA 0" stuff I still find myself using sometimes, but there's nothing preventing you from using a proper C++ style "for" loop instead.

Where ZScript really shines is when you have to work with the relationship between multiple thinkers (actors, linedefs, sectors, etc.). For instance, if you wanted an AI decision tree that factored in all of the following at once (as a bit of an extreme example):

- an imp
- the nearest fellow imp
- the player
- the wall nearest to the player
- the first shootable actor between the imp and the player
- the fellow imp's own target
- the first solid line, if any, between the imp and either the player or the fellow imp
- the player's current weapon
- whether the player is facing either imp
- whether each of the above actors is standing on lava
- whether the nearest imp fireball would hit the player, if one were to assume that both continued on their current respective trajectories until collision

that can all be obtained in ZS fairly cleanly but could require an unmaintainable megabyte-long glob of spaghetti in Decorate (and even then it would be a very rough approximation of the relevant data).
User avatar
Arctangent
Posts: 1235
Joined: Thu Nov 06, 2014 1:53 pm
Contact:

Re: "The end of DECORATE?" or "My fear of ZScript"

Post by Arctangent »

Let's not forget the sheer amount of potential provided by overriding various internal functions on a per-actor basis. Stuff like ripping projectiles that only damage individual enemies once, spinning blade actors that damage whatever they touch, and custom power up effects are all various things that are either really difficult in DECORATE, or outright impossible in it, but aren't all that complex to do in ZScript.

There's a lot that ZScript has opened up. It's no exaggeration that it's outright revolutionary.
User avatar
R4L
Global Moderator
Posts: 400
Joined: Fri Mar 03, 2017 9:53 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11 Pro
Graphics Processor: nVidia (Modern GZDoom)
Contact:

Re: "The end of DECORATE?" or "My fear of ZScript"

Post by R4L »

I'm itching to jump onto the ZScript bandwagon myself, but I believe I need more practice in programming first. Even with DECORATE and ACS, I rely heavily on the wiki, and ZScript just isn't documented well enough yet. All in due time of course. :)
User avatar
Mikk-
Posts: 2274
Joined: Tue Jun 30, 2009 1:31 pm
Location: Somewhere off Kanagawa

Re: "The end of DECORATE?" or "My fear of ZScript"

Post by Mikk- »

I've found that waiting for proper documentation to be rather fruitless - reading up on how things are done either on the gzdoom github / .pk3 or other mods is a good way to learn and get the general feel of things. There's also the ZDoom discord where people are always willing to help, and as well as the forums.
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Contact:

Re: "The end of DECORATE?" or "My fear of ZScript"

Post by Matt »

One more thing that you can do in ZScript with relative ease that would have you weeping blood in Decorate: Button combos in weapons.

ZScript: write a function that checks your input, then goes to the appropriate state, sets a variable, shoots something, etc. depending on any arbitrary combination you want (altfire but not fire, altfire and reload but nothing else, zoom and altfire but only if fire is not being pressed and the player is on the ground, etc.).

Decorate: mess with an exponentially increasing number of separate state labels and A_WeaponReady calls that have to be matched up to appropriate A_(Clear)Refire calls each going to a unique state, all while trying to keep the branching binary tree of possibilities straight in your head.
Post Reply

Return to “General”