[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.
SanyaWaffles
Posts: 818
Joined: Thu Apr 25, 2013 12:21 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Windows 11 for the Motorola Powerstack II
Graphics Processor: nVidia with Vulkan support
Location: The Corn Fields

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

Post by SanyaWaffles »

This is an ugly bug indeed. Also mixing const data with non-const data... what are they thinking?
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 »

The saddest thing here is that the bug was 1:1 recreated with the source reconstruction for NBlood - it is very clear that the objective here was to remain as close to the base as possible, instead of reworking the setup to fix it. PCExhumed has similar problems that even the utterly broken parts of the game were recreated.

About mixing const and non-const - welcome to the 90's! This was how programming was done 25 years ago.
User avatar
ReaperAA
Posts: 51
Joined: Fri Oct 19, 2018 8:27 am
Graphics Processor: nVidia with Vulkan support

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

Post by ReaperAA »

I am really surprised that the savegame bugs were recreated in NBlood. This doesn't even have to do anything with demo compatibility.

Afterall, even many Doom ports (those that even retain demo compatibility) fixed the savegame issues.
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 »

It was probably done to have a full recreation of the source with all its glorious issues, since Blood never had a source release and faithful ports until recent.
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 »

lowskill. wrote:It was probably done to have a full recreation of the source with all its glorious issues, since Blood never had a source release and faithful ports until recent.
Even though using C++, it recreated lots of things 1:1, among them the actor date clobbering after loading. I'm not sure if he just overlooked the problem or intentionally kept it broken.

That part itself wasn't so hard to fix - but I noticed that NoOne's extensions did not save any of the newly added data - completely relying on actInit to set everything up. So I had to go over the entire code first to see if there's other data that may need saving. I'm just through with that - now it's ensuring that actInit won't be needed here anymore and that everything it does is correct in the loaded data.
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 just finished going through the entire code.
It really looks like the only thing that needed treatment after loading was the AI state, so calling a full actor reinit for it was total overkill.

But thanks to the broken setup, NoOne's extensions never needed to save their added state, it all got reinited anyway. And examining this part was somewhat more work. It looks like I got everything right away yesterday evening but I had to double check. So with the indexer for the AI state I added yesterday and the saving of the extended state I hope this allows resuming the game from a proper setup. Of course this will need a bit more testing to make sure it's working.
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 »

Groovy, it's rather impressive that this major issue was addressed so quickly.

I'll be sure to investigate the infamous Butchers in the next 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 just ran a quick test with the actor reinit disabled. The game still appears to work so this looks it was utterly redundant, aside from resetting the AI state, which is not written out in a way that allows restoring it. I'd appreciate if this can be tested a bit - if it works I'll make a PR for NBlood out of it - I'm really interested in how this will be received, it'd tell a lot about the project's goals.
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 »

To emphasize again:
Graf Zahl wrote:I'd appreciate if this can be tested a bit - if it works I'll make a PR for NBlood out of it - I'm really interested in how this will be received, it'd tell a lot about the project's goals.
While the change seems to work for the regular zombie - at least in E1M1 - to be really assured that this thing is working it will have to see some more extended testing. Anyone up to it?
Once this is confirmed to work I can also make a PR for NBlood from it - right now is too early.
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 »

Welp, I guess I know what I'm doing tomorrow :V
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 »

There seems to be something wrong. I attacked a zombie that was charging me, then saved, quit, reloaded and he just walks around without seeing me for a few seconds and then stands at a random location.

Edit: Just tested it again – it breaks as soon as I save. The indexing and deindexing breaks it on its own.
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 »

Ok, better there than during loading, though. Weird that it worked for me yesterday. I hit the zombie with the pitchfork until it fell down, then saved, reloaded and it resumed normal operations afterward.
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 »

Graf Zahl wrote:Ok, better there than during loading, though. Weird that it worked for me yesterday. I hit the zombie with the pitchfork until it fell down, then saved, reloaded and it resumed normal operations afterward.
But did you also quit the game?
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 »

Tested out the new changes to the saving system in Episode 1 and 3 of Blood and so far, it seems to have done its job. Emphasis on "so far", who knows what else might show up later.

Zombies, Gargoyles, Cultists, Spiders, Gill Beasts, and even Butchers seem to do their job correctly. I've not been able to reproduce even the infamous missing knives of the Butchers, but I'm still cautious of that one, just a feeling that that's not the last we've seen from it.
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 »

Good to see that the butcher issue was related to this. I'm well aware that calling success on this one may be premature but we're definitely on the right track.

Return to “Closed Bugs [Raze]”