Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Automap shuffles things on loadgame. #915

Closed
Catoptromancy opened this issue Jul 26, 2022 · 8 comments · Fixed by #916
Closed

[Bug] Automap shuffles things on loadgame. #915

Catoptromancy opened this issue Jul 26, 2022 · 8 comments · Fixed by #916

Comments

@Catoptromancy
Copy link

Catoptromancy commented Jul 26, 2022

Latest git: commit f3f3cb0
Built on Debian 11, 5.10.0-16-amd64 #1 SMP Debian 5.10.127-1 (2022-06-30) x86_64 GNU/Linux

http://www.geocities.ws/catodemos/doom/ports/crispyDOOM0019a.png

The items on the automap can get randomly shuffled around each time the savegame is loaded, while game is kept open. Sometimes every item shows on the same coordinate, sometimes just one or two items are noticeably moved.
This seems to happen more often on larger maps with lots of items, near the exit....or maybe it is just more noticable.
Can be triggered on smaller maps, but seems to take make more loaded games, and fewer items move.

Just save a game, IDDT for things in automap, then reload savegame multiple times and keep checking voids in automap. Voids are easy to spot things in.

Wad:
https://static.angryscience.net/pub/hosted/tnt2/TNT2_beta2.zip

Savegame: Large map, lots of items, at almost 100%.
http://www.geocities.ws/catodemos/doom/ports/tnt2_beta2_doomsav5.dsg

$ crispy-doom -iwad tnt.wad -merge tnt2_beta2.wad -deh TNT2_beta2.DEH

That savegame and pwad can trigger lots of items to move in a dozen reloads. Using plutonia.wad on map23 with game saved at player start, can take a dozen reloads just to see any movement.

@JNechaevsky
Copy link
Collaborator

JNechaevsky commented Jul 26, 2022

Yeah, I can reproduce it, but on my side there is a firework effect on automap. 😳

It does not seems to be related to automap interpolation code. Commenting out this block seems to be fixes drawing:
https://github.com/fabiangreffrath/crispy-doom/blob/master/src/doom/p_mobj.c#L561-L565

Edit: ...or strict this block to (mobj->interp < 0 && !automapactive)? Can't re-check for now until evening.

@fabiangreffrath
Copy link
Owner

Hm, I'm a bit surprised we don't set oldx etc in saveg_read_mobj_t(). Maybe this could help.

str->x = saveg_read32();

@rfomin
Copy link
Collaborator

rfomin commented Jul 26, 2022

Hm, I'm a bit surprised we don't set oldx etc in saveg_read_mobj_t(). Maybe this could help.

I can confirm, this patch fixes http://www.geocities.ws/catodemos/doom/ports/tnt2_beta2_doomsav5.dsg save for me:

diff --git a/src/doom/p_saveg.c b/src/doom/p_saveg.c
index 3884b44d..4e263513 100644
--- a/src/doom/p_saveg.c
+++ b/src/doom/p_saveg.c
@@ -418,6 +418,12 @@ static void saveg_read_mobj_t(mobj_t *str)

     // struct mobj_s* tracer;
     str->tracer = saveg_readp();
+
+    str->interp = 0;
+    str->oldx = 0;
+    str->oldy = 0;
+    str->oldz = 0;
+    str->oldangle = 0;
 }

 // [crispy] enumerate all thinker pointers

@fabiangreffrath
Copy link
Owner

Could you please file a PR for this? That'd be easier for me to handle from my phone office in Croatia. 😁

Is Woof also affected?

@rfomin
Copy link
Collaborator

rfomin commented Jul 26, 2022

Could you please file a PR for this?

Done.

Is Woof also affected?

No, we load or reset these fields in Woof, depending on the savegame version.

@mikeday0
Copy link
Collaborator

Could you please file a PR for this? That'd be easier for me to handle from my phone office in Croatia. 😁

Is Woof also affected?

Safe travels! I have always heard Croatia is a beautiful place.

@fabiangreffrath
Copy link
Owner

Safe travels! I have always heard Croatia is a beautiful place.

Thank you! It is beautiful, though it's incredibly hot today. But the Adriatic Sea compensates for an 18 hour car drive.

@JNechaevsky
Copy link
Collaborator

He-ey, have a good and calm vacation! ☕☀️🌊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants