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

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: "The end of DECORATE?" or "My fear of ZScript"

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

by Matt » Sat Sep 29, 2018 1:27 pm

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.

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

by Mikk- » Fri Sep 28, 2018 8:50 am

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.

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

by R4L » Fri Sep 28, 2018 8:06 am

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. :)

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

by Arctangent » Mon Sep 24, 2018 11:15 pm

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.

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

by Matt » Mon Sep 24, 2018 4:50 pm

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).

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

by DeathIncarnate » Mon Sep 24, 2018 2:39 pm

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.

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

by Graf Zahl » Tue Mar 14, 2017 7:04 pm

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.

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

by Matt » Tue Mar 14, 2017 3:41 pm

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.

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

by Rachael » Tue Feb 28, 2017 8:28 am

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.

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

by Agentbromsnor » Tue Feb 28, 2017 8:11 am

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.

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

by Graf Zahl » Mon Feb 27, 2017 4:39 am

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.

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

by ZZYZX » Mon Feb 27, 2017 3:52 am

https://mantis.zdoom.org/view.php?id=325#c730
Why do we destroy DECORATE duplicates now?

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

by Graf Zahl » Sun Feb 26, 2017 6:46 pm

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.

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

by Rachael » Sun Feb 26, 2017 3:28 pm

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.

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

by Ravick » Sun Feb 26, 2017 3:19 pm

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.

Top