3.7.1 and morph actors

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
User avatar
Vostyok
Posts: 1666
Joined: Sat Jan 17, 2015 8:54 am
Preferred Pronouns: No Preference
Location: Discord: Vostyok#3164
Contact:

3.7.1 and morph actors

Post by Vostyok »

I have been informed by a forum member (AL-97), that the newest version of Gzdoom breaks some of the scripts in Ashes: 2063. Specifically, the script where the player is transformed into a motorcycle (don't worry. all will be explained) and then back into a regular player. A summary of how this script works is detailed below:
Spoiler:
The problem is, is that the player, after returning to normal, is left unable to switch weapons, and their inventory, including cash, is reduced to zero. Is this a problem within my scripts? Is this something I can fix myself? This is irritating but would not be a problem otherwise.

My greater concern is that this will break other morph actor playerclasses in other games, such as heretic and hexen, or mods that use this function. Hence why I am bringing this up as a bug until I can further investigate this problem.

Have any changes been made to the morph actor function? Any help in this matter would be greatly appreciated.

Thank you :D
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: 3.7.1 and morph actors

Post by Graf Zahl »

Yes, some of the morph code was rewritten for 3.7. But without anything to test I cannot help you beyond that bit of information.
User avatar
Vostyok
Posts: 1666
Joined: Sat Jan 17, 2015 8:54 am
Preferred Pronouns: No Preference
Location: Discord: Vostyok#3164
Contact:

Re: 3.7.1 and morph actors

Post by Vostyok »

I have tested it in hexen and heretic, and it doesn't seem to be a problem. It seems to be a problem exclusive to Ashes, or at least custom morph actors. I will write up a small test map and see if I can replicate it. I will post it if necessary here, but it sounds like this is my problem. :(
User avatar
Korell
Posts: 439
Joined: Sun May 28, 2017 1:01 pm

Re: 3.7.1 and morph actors

Post by Korell »

@Vostyok, there's a forum post on the Brutal Doom Moddb page (in the thread for BD v21 RC5 testing) that details a very similar issue, too, where after the demon rune ends and the player returns to normal that their inventory is reset, including removing any keys that they were holding.
User avatar
Nash
 
 
Posts: 17433
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: 3.7.1 and morph actors

Post by Nash »

If it worked differently before in a previous, official version, and now it doesn't work the same anymore, it's definitely an engine bug and will/should be fixed, provided you prepare a runnable example file that the devs can conveniently load up for testing
User avatar
Vostyok
Posts: 1666
Joined: Sat Jan 17, 2015 8:54 am
Preferred Pronouns: No Preference
Location: Discord: Vostyok#3164
Contact:

Re: 3.7.1 and morph actors

Post by Vostyok »

I am posting a small, cut-down version of the original beta file. It doesn't require any other files apart from Gzdoom to run.
Simply get on the bike behind you with "use", and get off again with "jump". You'll notice that you are now unable to switch weapons. The example cash items are also removed from your inventory, although you'd need a custom hud to see this change, this is definately the case.

The uncompiled scripts that run the motorcycle are included in the wad, under the 'scripts" file, for reference. I hope this helps.

http://www.mediafire.com/file/5iup1e81c ... t.wad/file
User avatar
Korell
Posts: 439
Joined: Sun May 28, 2017 1:01 pm

Re: 3.7.1 and morph actors

Post by Korell »

Vostyok wrote:The example cash items are also removed from your inventory, although you'd need a custom hud to see this change, this is definately the case.
I just tried that test wad with gzdoom-x64-g3.8pre-62 and used the give all command before getting on the bike so that all keys, weapons and ammo were given to the player as these do show up on the classic Doom statusbar. When getting off the bike all of these are removed from the player leaving just the pistol and a small amount of pistol ammo, just as if it had reset to the pistol start.
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: 3.7.1 and morph actors

Post by _mental_ »

I managed to track it to this commit. It's not quite apparent what's the problem with these changes.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: 3.7.1 and morph actors

Post by Graf Zahl »

I'd guess its something with the GC's read barriers again. Unmorphing is a horrible mess because it happens in the completely wrong place and may just result in something getting nulled that is still needed.
User avatar
Major Cooke
Posts: 8170
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: 3.7.1 and morph actors

Post by Major Cooke »

Correct me if I'm wrong but this code does not seem to line up with this piece.

On the C++ side, it accessed the owner's inventory. On the script side, it's accessing its own inventory instead of the owners, it would appear.

Same for here. Shouldn't the start be using owner?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: 3.7.1 and morph actors

Post by Graf Zahl »

It accessed the address of the owner's first inventory pointer. I hate this linked list crap, especially if written like here. In my experience, linked lists just do not work in any conceivable situation and I would have redone the inventory storage as an array if it hadn't been exposed to ZScript already.
User avatar
Major Cooke
Posts: 8170
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: 3.7.1 and morph actors

Post by Major Cooke »

Couldn't agree more. I could see inventory being much easier to maintain inside of a dynamic array, simply because one can delete nulls from the inventory and move on until it hits the size. Huh. Guess I might look into that for my own mods.

Whereas when using probes...

Code: Select all

for (let probe = owner.mo.Inv; probe != null; probe = probe.Inv)
The moment that item is null, the probe quits. And it goes null quite quickly when Destroy() is called, or so it would seem.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: 3.7.1 and morph actors

Post by Graf Zahl »

That should never happen. The item would remove itself from the owner before actually destroying itself.
User avatar
Major Cooke
Posts: 8170
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: 3.7.1 and morph actors

Post by Major Cooke »

Hmmm, strange. I must've been doing something weird then.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: 3.7.1 and morph actors

Post by Graf Zahl »

If that was indeed the cause it should be fixed now. I can't test right now, can someone confirm?
Post Reply

Return to “Closed Bugs [GZDoom]”