[PSA]Modders: things that worked in Zandronum 1.3 may break in 2.0, please check here

Discuss all aspects related to modding Zandronum here.
Post Reply
User avatar
Hypnotoad
Retired Staff / Community Team Member
Posts: 528
Joined: Tue May 29, 2012 8:50 pm
Location: Britland

[PSA]Modders: things that worked in Zandronum 1.3 may break in 2.0, please check here

#1

Post by Hypnotoad » Mon Feb 23, 2015 11:25 pm

Since Zandronum 2.0 will feature a major upgrade to its Zdoom codebase, certain things modders do that relied on undefined yet consistent behavior in 1.3 may no longer work in 2.0. Modders must check if their projects are relying on this undefined behavior, and update their projects by using the correct methods instead. I will detail what has changed below and I will update this OP if I hear about any more:

Using the == operator with strings

This should be avoided. While in 1.3, doing something like ' if ( stringvariable == "this" ) ' often worked for static strings, it is undefined and not correct to use the == operator this way with strings in Zandronum. In 2.0 as has been recently found out, you cannot rely on this to always work now, even with static strings. Authors should update their wads if they are relying on this behavior.

Authors should store important data as integers for comparison, not as strings. However, if it is absolutely necessary, it may be possible to construct a string compare function, I'll update this thread with one if I find a good one or someone submits one.

Update: these functions should work in 2.0

http://zdoom.org/wiki/StrCmp
http://zdoom.org/wiki/StrIcmp

Using or hosting wads with multiple actors that might share the same actor name, spawn id or doomed number.

Obviously, you shouldn't be doing this anyway, nonetheless you may be in charge of a project that has considerable community involvement that all submit their own addons with their own decorate actors such that you may have missed these conflicts. Before, in 1.3 and older versions, Zandronum would overwrite or load actors with conflicting spawn ids, actor names or doomed numbers in a certain consistent way and order, so you may not have experienced any problems. Now in 2.0, the way Zandronum handles this undefined behavior has changed, which means the aforementioned project authors might experience the wrong actors spawning unexpectedly. Therefore, project authors should carefully examine all actor definitions in their projects and addons to ensure there are no unintentionally conflicting spawn ids, actor names or doomed numbers. Addon authors should check the zdoom wiki to learn how to correctly replace actors if they rely on this undefined behavior.

The fog rendering has changed in Zandronum 2.0 for OpenGL

The main change is how it handles fog for high or maximum brightness sectors. Before in openGL, fog would still render in very bright sectors. Some authors utilized this in order to have fog show in OpenGL but not in software (since fog generally looks like garbage in software). Unfortunately, GL fog rendering in 2.0 has changed and is now more similar to software in terms of its intensity at certain brightness levels, and wont render at all for very bright sectors. We've found many maps have been affected, authors should check their maps in 2.0 beta if they have made extensive use of fog, and may need to lower sector brightness if fog is not being rendered when it should be in openGL.

update: a good rule of thumb according to blzut3: "If OpenGL renders a software supported feature differently from Software it's probably a bug."

A notable exception here is for 3d floor lighting, as the 3d floor implementation in software is known to be a little buggy.

(Hexen format) Using line specials (e.g. Teleport_Line) with line id 0.

This is something we've found to cause major issues in certain maps; if you use for instance Teleport_Line on a pair of lines in Hexen format, be sure to make the 'thisid' parameter greater than 0 for each line, as in 2.0 this can interfere with lines using Plane_Align which might also use line id 0, and cause serious issues with malfunctioning slopes as we have seen in various maps.

In general, for line actions that require you to set a lineid parameter, use a value greater than 0, or your map may run into serious problems in Zandronum 2.0.

Be wary of using Consolecommand()

I'm unsure if this is being removed in 2.0 (update: it hasn't). Still, this would be a good time for authors to phase out their usage of this function. Some of the same useful behavior of consolecommand can now be replicated with functions like requestScriptPuke, SetCVAR and CVARINFO.


Update: Actor Hits Floor now activates when teleporting to the sector

This has caused major problems, for instance with megaman, actor hits floor specials are now triggered simply by teleporting to that sector. This can break two way teleports that use actor hits floor triggers on both sides, by causing an infinite recursion error. You must make sure to update any maps that rely on actor hits floor specials not being triggered on teleporting to the sector.


Update 2: Using script numbers higher than 999

This was already a bad idea in 1.3 and could result in fatal errors, but if you were lucky your mod may have been using them without causing too many problems. No longer however, it appears all scripts higher than 999 will now produce an error.
Last edited by Hypnotoad on Wed Apr 01, 2015 8:55 pm, edited 1 time in total.

ZzZombo
Forum Regular
Posts: 323
Joined: Mon Jun 11, 2012 12:11 pm
Location: Ravenholm

RE: [PSA]Modders: things that worked in Zandronum 1.3 may break in 2.0, please check here

#2

Post by ZzZombo » Mon Feb 23, 2015 11:46 pm

Last edited by ZzZombo on Mon Feb 23, 2015 11:48 pm, edited 1 time in total.
QZRcon - Qt-based tool for Zandronum/Skulltag servers!
#grandvoid funny stats

Cruduxy
Zandrone
Posts: 1059
Joined: Fri Jun 08, 2012 4:24 pm

RE: [PSA]Modders: things that worked in Zandronum 1.3 may break in 2.0, please check here

#3

Post by Cruduxy » Mon Feb 23, 2015 11:54 pm

Knowing a lot of the modders don't be surprised when they start complaining when their wads break regardless of how many PSA's are done :P.

Especially the second point. Bet it breaks a hilarious number of wads!
[][][][][][][][][][][][][][][]
Nothing to see here
[][][][][][][][][][][][][][][]

User avatar
Hypnotoad
Retired Staff / Community Team Member
Posts: 528
Joined: Tue May 29, 2012 8:50 pm
Location: Britland

RE: [PSA]Modders: things that worked in Zandronum 1.3 may break in 2.0, please check here

#4

Post by Hypnotoad » Tue Feb 24, 2015 12:00 am

Unfortunately those aren't in Zandronum yet (unless they were backported?).

ZzZombo
Forum Regular
Posts: 323
Joined: Mon Jun 11, 2012 12:11 pm
Location: Ravenholm

RE: [PSA]Modders: things that worked in Zandronum 1.3 may break in 2.0, please check here

#5

Post by ZzZombo » Tue Feb 24, 2015 12:22 am

The accounts branch has that.
QZRcon - Qt-based tool for Zandronum/Skulltag servers!
#grandvoid funny stats

User avatar
NachtIntellect
Forum Regular
Posts: 480
Joined: Mon Jun 11, 2012 9:20 am
Location: Bienenstock, Germany

RE: [PSA]Modders: things that worked in Zandronum 1.3 may break in 2.0, please check here

#6

Post by NachtIntellect » Tue Feb 24, 2015 4:06 am

Looks like I'll have to rewrite alot of the code for NZ:DE then, thanks for the heads up.
Did you just bite me? Come here, I will bite you back bastard.

User avatar
Vincent(PDP)
Forum Regular
Posts: 527
Joined: Thu Mar 14, 2013 7:35 pm
Location: Sweden
Clan: My DOOM site
Clan Tag: <MDS>
Contact:

RE: [PSA]Modders: things that worked in Zandronum 1.3 may break in 2.0, please check here

#7

Post by Vincent(PDP) » Wed Feb 25, 2015 1:21 pm

Hypnotoad wrote:However, if it is absolutely necessary, it may be possible to construct a string compare function, I'll update this thread with one if I find a good one or someone submits one.

Update: these functions should work in 2.0

http://zdoom.org/wiki/StrCmp
http://zdoom.org/wiki/StrIcmp
Otherwise I have made one in my ACS.NET library: http://zandronum.com/forum/showthread.php?tid=5666

Note that it is case sensitive though...
Last edited by Vincent(PDP) on Wed Feb 25, 2015 1:22 pm, edited 1 time in total.
//Visual Vincent ( Vincent (PDP) )
- My DOOM site Team

My projects:
Spoiler: (Open)
Doom Writer
Escape From The Laboratory - Done
Escape From The Laboratory Part 2
Parkskolan Zombie Horde Map (ZM10) - Done
In game Admin Commands for Zandronum.
Achievement Mod for Zandronum
Stats mod

Thomas
 
Posts: 51
Joined: Fri Jun 22, 2012 9:41 am

RE: [PSA]Modders: things that worked in Zandronum 1.3 may break in 2.0, please check here

#8

Post by Thomas » Wed Apr 01, 2015 1:33 am

I have another point to add. Since 2.0 ACS scripts that have numbers higher than 999 will crash the game with an error. I see in the changelog that this was changed, because it is not supported. So if people are using script numbers over 999 the map won't work and you have to change it. Can anyone maybe enlighten me why it is restricted now? Because it worked just fine in 1.3 and also in the latest release of GZDoom.

TerminusEst13
Retired Staff / Community Team Member
Posts: 865
Joined: Tue Jun 05, 2012 11:06 pm

RE: [PSA]Modders: things that worked in Zandronum 1.3 may break in 2.0, please check here

#9

Post by TerminusEst13 » Wed Apr 01, 2015 4:06 am

Thomas wrote:Because it worked just fine in 1.3
It didn't. It caused crashes.
The Ranger - New class for HeXen.
ZDoom Wars - I drew some pictures.
Samsara - Some class-based mod I guess?
Metroid: Dreadnought - I am a dumb fanboy.
DemonSteele - ~come with me to anime world~

Thomas
 
Posts: 51
Joined: Fri Jun 22, 2012 9:41 am

RE: [PSA]Modders: things that worked in Zandronum 1.3 may break in 2.0, please check here

#10

Post by Thomas » Wed Apr 01, 2015 8:38 am

TerminusEst13 wrote:
Thomas wrote:Because it worked just fine in 1.3
It didn't. It caused crashes.
Weird, I have several maps with script numbers over 999, never had any problem and they executed just fine. I guess it's just undefined behaviour then and I was (un)lucky?

User avatar
ZZYZX
Posts a lot
Posts: 742
Joined: Thu Jun 07, 2012 5:56 pm
Location: Ukraine
Clan: A3
Clan Tag: [A3]

RE: [PSA]Modders: things that worked in Zandronum 1.3 may break in 2.0, please check here

#11

Post by ZZYZX » Wed Apr 01, 2015 11:53 am

Hypnotoad wrote:Using or hosting wads with multiple actors that might share the same actor name, spawn id or doomed number.
So this is going to break?
(if anything, the point below is distinguishing things that are placed on the map statically from things that were spawned in any other way)
#zamapping wrote:<Siferah> look
<Siferah> There are two ways to replace an actor
<Siferah> One way works almost always, the other works only for things placed on the map (and the second way generates a warning, too, but nevertheless works as intended)
<Siferah> Now, for example, you take class Shotgun
<Siferah> and do this
<Siferah> actor ShotgunThatWontDisappear : Shotgun 2001 {} // 2001 = doomednum for shotgun
<Siferah> actor ShotgunThatWillDisappear : Shotgun replaces Shotgun { /* code here */ }
<Siferah> The point here is that 2001 replacement will most likely be processed first, AND the actor that will be in place of Shotgun will NOT be a Shotgun already, so it won't get replaced by the replaces thing
<Siferah> So that things that are put on the map by the map creator, will be replaced with ShotgunThatWontDisappear actor (not replaced, in fact, ZDoom will just find the new actor instead of previous one by doomednum)
<Siferah> And everything else will be replaced with ShotgunThatWillDisappear actor
Thomas wrote:
TerminusEst13 wrote:
Thomas wrote:Because it worked just fine in 1.3
It didn't. It caused crashes.
Weird, I have several maps with script numbers over 999, never had any problem and they executed just fine. I guess it's just undefined behaviour then and I was (un)lucky?
yeah yeah script numbers over 999 work just fine except they sometimes cause the very fatal error: http://zandronum.com/tracker/view.php?id=1714
Last edited by ZZYZX on Wed Apr 01, 2015 12:45 pm, edited 1 time in total.

Untitled
Forum Regular
Posts: 519
Joined: Sat Dec 29, 2012 4:41 pm
Location: it is a mystery

RE: [PSA]Modders: things that worked in Zandronum 1.3 may break in 2.0, please check here

#12

Post by Untitled » Wed Apr 01, 2015 12:57 pm

I've found the "multiple monsters with the same name" between files hasn't caused problems - at least in single player samsarahold, which uses modified versions of every single monster in the stronghold beastiary, seems to spawn the right ones, despite the fact it's coded via replacement.
"I'm in despair! The fact someone would give me the title 'Forum Regular' has left me in despair!"
Spoiler: Me in a nutshell (Open)
<Untitled> this is a terrible idea
<Untitled> lets do it anyway

<Untitled> Depends
<Untitled> What kind of wad error is "Address not Mapped to Object (Signal 11)"?

<Untitled> So today I found out that stupidity is nested fractally
<Untitled> There is no lower bound
Projects:
SamsaraHold http://zandronum.com/forum/showthread.php?tid=3053

User avatar
Hypnotoad
Retired Staff / Community Team Member
Posts: 528
Joined: Tue May 29, 2012 8:50 pm
Location: Britland

RE: [PSA]Modders: things that worked in Zandronum 1.3 may break in 2.0, please check here

#13

Post by Hypnotoad » Wed Apr 01, 2015 6:58 pm

Updated to include a new important issue.

User avatar
Torr Samaho
Lead Developer
Posts: 1543
Joined: Fri May 25, 2012 6:03 pm
Location: Germany

RE: [PSA]Modders: things that worked in Zandronum 1.3 may break in 2.0, please check here

#14

Post by Torr Samaho » Wed Apr 01, 2015 8:01 pm

Thomas wrote: Weird, I have several maps with script numbers over 999, never had any problem and they executed just fine. I guess it's just undefined behaviour then and I was (un)lucky?
If script numbers bigger than 999 worked for you in 1.3, you were just lucky.

Post Reply