[0.4.2] [Blood] Enemy state is reset on savegame load

Moderator: Raze 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.
Gammli
Posts: 47
Joined: Sat Mar 02, 2019 12:46 am

[0.4.2] [Blood] Enemy state is reset on savegame load

Post by Gammli »

This is a problem inherited from DOS Blood. I assume it wasn't fixed in NBlood for accuracy reasons, but in any case it might be desirable for Raze to include a fix.

By resetting state, I specifically mean properties such as current HP, current AI action and current target.
For example, a zombie that was shot and downed when the game is saved will be standing upright once the save is loaded. Furthermore, all its HP will be restored, and it will have lost sight of the player.
This appears to apply to every enemy in Blood.

BloodGDX fixes this problem, as a sidenote.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49141
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [0.4.2] [Blood] Enemy state is reset on savegame load

Post by Graf Zahl »

Holy shit, that's gross. Yes, that absolutely needs to be fixed - if I just had an idea how. With such crippling bugs the savegame feature is useless, that's even worse than Doom's original issue with the target pointers. This really is a case where accuracy is entirely misplaced.
User avatar
Kinsie
Posts: 7402
Joined: Fri Oct 22, 2004 9:22 am
Graphics Processor: nVidia with Vulkan support
Location: MAP33

Re: [0.4.2] [Blood] Enemy state is reset on savegame load

Post by Kinsie »

Between this and the difficulty-flipping bug in the DOS version I'm starting to think Blood didn't handle savegames very well.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49141
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [0.4.2] [Blood] Enemy state is reset on savegame load

Post by Graf Zahl »

Doom didn't either, really, if you think about it.
Not only did it lose its target pointers, it also lost the flicker light effect from Doom 2.
Ultimately these are caused by not writing a proper object management that could automate these things. ZDoom went out of its way to build something that handles these tricky things under the hood - otherwise I'd never have been able to rewrite the savegame code 3.5 years ago to use JSON.

But not even restoring an enemy's health points - that's an entirely different level, of course.
User avatar
sinisterseed
Posts: 1349
Joined: Tue Nov 05, 2019 6:48 am
Preferred Pronouns: He/Him
Graphics Processor: nVidia with Vulkan support

Re: [0.4.2] [Blood] Enemy state is reset on savegame load

Post by sinisterseed »

Kinsie wrote:Between this and the difficulty-flipping bug in the DOS version I'm starting to think Blood didn't handle savegames very well.
That was more like a feature but it eventually turned into a bug.

To my knowledge, the intention was to have the difficulty decreasing after reload, but it got borked and instead it ramped the difficulty. Only Lightly Broiled was not affected by either.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49141
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [0.4.2] [Blood] Enemy state is reset on savegame load

Post by Graf Zahl »

Ouch! Looks like the load game code runs through the full actor initialization logic again.
This will be one nasty thing to fix because all data that may need saving but isn't needs to be identified.
The real irony is that the only thing in there that might have caused problems is the AI state, it's like cracking a nut with a sledgehammer. What a fucked up mess...
User avatar
sinisterseed
Posts: 1349
Joined: Tue Nov 05, 2019 6:48 am
Preferred Pronouns: He/Him
Graphics Processor: nVidia with Vulkan support

Re: [0.4.2] [Blood] Enemy state is reset on savegame load

Post by sinisterseed »

And it also causes silly bugs too - remember the broken Butchers after reload?

I think that's actually still there in 0.4.2, not seeing any commits or posts reporting that it was addressed yet.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49141
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [0.4.2] [Blood] Enemy state is reset on savegame load

Post by Graf Zahl »

Yes, that'd explain such a weird error for sure. Well, I'm afraid that until this is fixed I consider Blood broken and not usable.
The worst thing is that now I have to go through the ENTIRE code and find global data that needs saving. :mad:
What makes this worse is that the code contains virtually no 'const' qualifiers to help identify unchanging data. And what do you expect? Of course it writes into global tables for some cheap hacks.
Manuel-K
Posts: 75
Joined: Wed Mar 15, 2017 11:43 am

Re: [0.4.2] [Blood] Enemy state is reset on savegame load

Post by Manuel-K »

I've encountered a weird glitch where I couldn't attack with any weapon after loading a save game. The glitch was repeatable. That might be related or it might have been a problem caused by switching to a newer version.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49141
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [0.4.2] [Blood] Enemy state is reset on savegame load

Post by Graf Zahl »

I'm not surprised. Of course savegames break if they do not restore the state 100%.
User avatar
sinisterseed
Posts: 1349
Joined: Tue Nov 05, 2019 6:48 am
Preferred Pronouns: He/Him
Graphics Processor: nVidia with Vulkan support

Re: [0.4.2] [Blood] Enemy state is reset on savegame load

Post by sinisterseed »

I swear Build is a comedy of hacks and poor design decisions sometimes :v . Reminds me of Bethesda games before their time - both are funny and frustrating at the same time - especially when having to deal with them.
Manuel-K wrote:I've encountered a weird glitch where I couldn't attack with any weapon after loading a save game. The glitch was repeatable. That might be related or it might have been a problem caused by switching to a newer version.
I've never seen this one the player's side. It might have been due to the upgrade if all was fine on a clean installation but broke while upgrading.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49141
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [0.4.2] [Blood] Enemy state is reset on savegame load

Post by Graf Zahl »

Without savegame versioning this can easily happen. Guess what was one of the first savegame related things I added...
Manuel-K
Posts: 75
Joined: Wed Mar 15, 2017 11:43 am

Re: [0.4.2] [Blood] Enemy state is reset on savegame load

Post by Manuel-K »

It was between two different versions of Raze. I didn't see anything in the git log that looks suspicious.
User avatar
sinisterseed
Posts: 1349
Joined: Tue Nov 05, 2019 6:48 am
Preferred Pronouns: He/Him
Graphics Processor: nVidia with Vulkan support

Re: [0.4.2] [Blood] Enemy state is reset on savegame load

Post by sinisterseed »

There is a chance its explicit mention might have been omitted. Problem is, the eduke devs don't mention when the format gets bumped, so it's easy to overlook such things with no versioning.

Also: https://github.com/coelckers/Raze/commi ... 14e4501865

*speaks in MKII Shao Kahn voice* Round 1... fight!!
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49141
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [0.4.2] [Blood] Enemy state is reset on savegame load

Post by Graf Zahl »

Going through the Blood source right now to find things that need handling. NBlood's source is interesting because it meticulously recreates every single fuckup of the original developers - and there's quite a few that affect the savegame state. And nothing was fixed thanks to the Holy Cow of demo compatibility. There's quite a few screwups in the code where all I can ask is "What were they thinking?" - and it's all still there and will remain so forever in NBlood.

Return to “Closed Bugs [Raze]”