[Fixed] 3.7.1 and morph actors

Bugs that have been investigated and resolved somehow.

Moderator: Developers

3.7.1 and morph actors

Postby Vostyok » Thu Jan 03, 2019 2:18 pm

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
Vostyok
Zone Trippin'
 
Joined: 17 Jan 2015
Location: The Place of Broken Dreams
Discord: Vostyok#3164

Re: 3.7.1 and morph actors

Postby Graf Zahl » Thu Jan 03, 2019 2:27 pm

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

Re: 3.7.1 and morph actors

Postby Vostyok » Thu Jan 03, 2019 2:34 pm

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
Vostyok
Zone Trippin'
 
Joined: 17 Jan 2015
Location: The Place of Broken Dreams
Discord: Vostyok#3164

Re: 3.7.1 and morph actors

Postby Korell » Thu Jan 03, 2019 2:40 pm

@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
Korell
 
Joined: 28 May 2017

Re: 3.7.1 and morph actors

Postby Nash » Thu Jan 03, 2019 2:50 pm

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
Nash
Nash Muhandes
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia

Re: 3.7.1 and morph actors

Postby Vostyok » Thu Jan 03, 2019 3:06 pm

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/5iup1e81cq68wj5/AshesBugTest.wad/file
User avatar
Vostyok
Zone Trippin'
 
Joined: 17 Jan 2015
Location: The Place of Broken Dreams
Discord: Vostyok#3164

Re: 3.7.1 and morph actors

Postby Korell » Thu Jan 03, 2019 3:37 pm

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.
User avatar
Korell
 
Joined: 28 May 2017

Re: 3.7.1 and morph actors

Postby _mental_ » Fri Jan 04, 2019 10:12 am

I managed to track it to this commit. It's not quite apparent what's the problem with these changes.
_mental_
 
 
 
Joined: 07 Aug 2011

Re: 3.7.1 and morph actors

Postby Graf Zahl » Fri Jan 04, 2019 10:14 am

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

Re: 3.7.1 and morph actors

Postby Major Cooke » Fri Jan 04, 2019 11:35 am

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
Major Cooke
The road to Hell is paved in the carrion she leaves behind.
 
Joined: 28 Jan 2007
Discord: Major Cooke#0846

Re: 3.7.1 and morph actors

Postby Graf Zahl » Fri Jan 04, 2019 11:53 am

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

Re: 3.7.1 and morph actors

Postby Major Cooke » Fri Jan 04, 2019 12:14 pm

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 allExpand view
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
Major Cooke
The road to Hell is paved in the carrion she leaves behind.
 
Joined: 28 Jan 2007
Discord: Major Cooke#0846

Re: 3.7.1 and morph actors

Postby Graf Zahl » Fri Jan 04, 2019 12:28 pm

That should never happen. The item would remove itself from the owner before actually destroying itself.
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: 3.7.1 and morph actors

Postby Major Cooke » Fri Jan 04, 2019 12:43 pm

Hmmm, strange. I must've been doing something weird then.
User avatar
Major Cooke
The road to Hell is paved in the carrion she leaves behind.
 
Joined: 28 Jan 2007
Discord: Major Cooke#0846

Re: 3.7.1 and morph actors

Postby Graf Zahl » Fri Jan 04, 2019 12:57 pm

If that was indeed the cause it should be fixed now. I can't test right now, can someone confirm?
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Next

Return to Closed Bugs

Who is online

Users browsing this forum: No registered users and 0 guests