StateLabel variables change their value sometimes.

Is there something that doesn't work right in the latest GZDoom? Post about it here.

Moderator: GZDoom Developers

Forum rules
Please construct and post a simple demo whenever possible for all bug reports. Please provide links to everything.

If you can include a wad demonstrating the problem, please do so. Bug reports that include fully-constructed demos have a much better chance of being investigated in a timely manner than those that don't.

Please make a new topic for every bug. Don't combine multiple bugs into a single topic. Thanks!

StateLabel variables change their value sometimes.

Postby Accensus » Thu Oct 08, 2020 7:26 am

Tested and reproduced on g4.5pre-205-gda4e791a3, but it doesn't seem to be unique to that version. No idea when exactly it got "broken".
This is one of those bugs that I cannot easily reproduce and it only happens after reloading a save game. It happens with the companion mod for Hideous Destructor (yeah, I know, the chances of this getting fixed just dropped down to practically none, but I'm reporting it anyway).

More details:
- The variables are assigned only once, here, so accidental assignment is completely out of the question.
- FollowerWeapon.Create() is called here and only once when the follower is created for the very first time when you start a new game, here.
- The last and only time this happened (to me), FireState somehow managed to get the value of ReloadState. I don't know how, I don't know why.
- Other people have reported the follower straight up disappearing, which I assume is because FireState's value is a non-existent state label in the actor. This is where it happens.

Sadly I am unable to give more information at the time, much less make a contained example. I'm still trying to reproduce this. I suspect it's because I changed the code a little between save games (in a completely unrelated part of the follower, mind you), but never before have I had something like this happen with any other variables. I don't know if the people who originally reported this to me have added/removed mods or changed the code between saving and loading their games.
User avatar
Accensus
Vector, locked in.
 
Joined: 11 Feb 2016
Location: Somalia
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: StateLabel variables change their value sometimes.

Postby Accensus » Sat Oct 10, 2020 5:37 am

It seems like this happens on saving and stays broken permanently. I still haven't found a way to reliably reproduce it, but it would appear that it's not necessarily affected by code changes. I suspect some sort of serialization issue.
User avatar
Accensus
Vector, locked in.
 
Joined: 11 Feb 2016
Location: Somalia
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: StateLabel variables change their value sometimes.

Postby Graf Zahl » Sat Oct 17, 2020 2:17 am

At the moment StateLabels are not safely serializable, they are meant for transiently pass around a state name, so that some target actor can retrieve a real state from it (which can be stored persistently), but not for actually keeping it around.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: StateLabel variables change their value sometimes.

Postby Accensus » Sat Oct 17, 2020 2:50 am

Figured as much. Well I rewrote most of the code to avoid this issue so it's no longer a problem.
User avatar
Accensus
Vector, locked in.
 
Joined: 11 Feb 2016
Location: Somalia
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support


Return to Bugs

Who is online

Users browsing this forum: No registered users and 1 guest