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] [Powerslave/Exhumed] Raze 1.1.2 - Using heart item causes graphical error #415

Closed
ghost opened this issue May 29, 2021 · 14 comments
Closed
Labels
bug Something isn't working

Comments

@ghost
Copy link

ghost commented May 29, 2021

Happened in level 2- using the heart item causes a glitch where a sprite covers the center of the screen, and makes the game virtually unplayable.

Exhumed_0000

@coelckers
Copy link
Member

You are not the first person to report corruption when using the heart, but I can't reproduce it myself.
Did you by any chance autoload any graphics mods for one of the other games?

@sinisterseed
Copy link
Collaborator

It shouldn't be mod related, but I have no idea what causes this random stupidity.

I used to be able to trigger it randomly in vanilla, but nothing as of late. It seemed to be more common when continuing a game from a save as opposed to starting fresh.

@sinisterseed sinisterseed added the bug Something isn't working label May 29, 2021
@coelckers
Copy link
Member

It's probably one of the animation sequences being fucked up. That entire code is an atrocity of bad sprite offsets being compensated by animations that have the screen offset baked in.
If it wasn't for potential mod compatibility I would have torn it all apart and built proper animations out of the sprites that can be used in a sane fashion.

@Gaerzi
Copy link
Contributor

Gaerzi commented May 29, 2021

How many Exhumed mods actually exist? Might be worth doing that anyway.

@sinisterseed
Copy link
Collaborator

Not many, that's for sure. And from what I've seen, they're all just maps.

@ghost
Copy link
Author

ghost commented May 29, 2021

@coelckers I can attach a save file.
save0000.zip

@coelckers
Copy link
Member

@Dzierzan
Copy link

Dzierzan commented Jun 6, 2021

@Gaerzi

Well.... zero? There's only one custom map pack with 3 levels. Voxel pack which only replaces some sprites with voxels. Skybox addon which just updates skyboxes and a small mini addon which replaces M60 sprites.

@coelckers

Powerslave/Exhumed is not really good for modding and its low popularity never spawned serious mods, You should go ahead and torn that apart and then built proper animations out of the sprites.

@sinisterseed
Copy link
Collaborator

sinisterseed commented Jun 6, 2021

That's... very interesting. Actually all there ever was made for PS/Exhumed are very small scale mods and some visual enhancements?

Great news since it means this can be reworked in a sane fashion without risking to break any mods at all (since there's almost... nothing to break to begin with).

@Dzierzan
Copy link

Dzierzan commented Jun 6, 2021

Yeah, and there's also upscale pack for that too, but again, this is just a visual enhancement. So @coelckers should go ahead and rewrite that if that helps. Nothing will be lost.

@coelckers
Copy link
Member

Closing because I have never been able to reproduce this.

@coelckers coelckers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 1, 2022
@michaelneverwins
Copy link

michaelneverwins commented Feb 12, 2023

I see that this is closed, but just in case it helps, here's another save file.

save0000.zip

The glitch happened right after I quick-saved, so I closed Raze to make a copy of the save file. Opening Raze back up to confirm that it happens consistently, I'm now seeing that the glitch is there as soon as I load my save from the main menu:
2023-02-12_17-42-19
Loading the save again from there, it's gone:
2023-02-12_17-42-44
Using the heart makes it appear again:
2023-02-12_17-42-48
Taking a quick bath in the lava to hurt myself and then using the heart again makes this happen:
2023-02-12_17-43-02
Should I even be able to use the heart more than once or is that part of the glitch? (Edit: The manual implies that the heart is a one-time-use item. I thought I had seen it disappear the first time I used one. But now it doesn't. So I think that is part of the glitch, or a separate one.)

In any case, I've done this a few times so it's happening consistently at least for me. I'm using Raze 1.6.2 on Linux Mint 20.3.

@michaelneverwins
Copy link

michaelneverwins commented Feb 12, 2023

Unzipping my save file and searching session.json for relevant text, I found the following:

"items":[250,2,2,2,1,1,0,0]

Note that, in that save, I have 2 scarabs, 2 torches, 2 hands, 1 eye, and 1 mask — in addition to the glitchy heart, which I suppose should also be showing 1 to 5 of those little squares lit up in the meter to the right of the item icon, unless the heart isn't supposed to work that way.

So I changed the 250 to 3, zipped it back up, and loaded the modified save. The glitch no longer occurs. It still seems to be using the heart automatically for some reason when I load from the main menu, leaving the item counter at 2, but then I load again and it shows 3, and using the heart (even twice) doesn't cause weird sprites to appear.

Edit: Repeated the test with my modified save for screenshots (below). Note the item meter is now showing 2 (after first use) and then 1 (after second use), whereas in earlier screenshots it didn't look like this.
2023-02-12_19-41-06
2023-02-12_19-41-17
(I still have no idea how my original (unmodified) save file ended up with 250 for what is apparently the heart item counter.)

@michaelneverwins
Copy link

michaelneverwins commented Feb 13, 2023

After writing the comment above, it occurred to me that I had used the heart item several times in that level prior to encountering this glitch — perhaps, say, about half a dozen times (while wondering why I wasn't running out of hearts), but I wasn't counting — and 250 is pretty close to a power of two — off by half a dozen, in fact — as if the counter for this item had been corrupted by some kind of overflow bug. Meanwhile, as I noted in my testing of the graphical glitch, the game seemed to be using the heart when I loaded my save from the main menu immediately after starting Raze. So I got an idea for reproducing the glitch from scratch, and it works. The following was done after renaming my raze.ini file and letting Raze create a fresh one, to ensure I was using the default configuration.

  1. Started Raze and selected Exhumed.
  2. Opened the console and entered map lev5 to go to the fifth level. (There's a heart on the left across some water.)
  3. Jumped into the water, let the fish bite, and got the heart.
  4. Saved the game, with a heart in the inventory and less than full health. (save0000.zip)
  5. Exited out of Raze, started Raze again, and selected Exhumed.
  6. From the main menu, loaded the save created in step 4. This caused the heart to be used up, filling my health, despite the fact that I hadn't picked up any magic.
  7. Jumped into the water and let the fish bite some more.
  8. Saved the game, now with less than full health and the heart used up. (save0001.zip)
  9. Exited out of Raze, started Raze again, and selected Exhumed.
  10. From the main menu, loaded the save created in step 8. This caused my health to be filled up again, and the heart was back in my inventory.
  11. Saved the game, with a mysterious heart item that shouldn't exist. (save0002.zip)

If you unzip that third save and open session.json, you will see

"items":[255,0,0,0,0,0,0,0]

where the number of hearts which should be 0 has rolled over to 255.

At this point, I jumped into the water so the fish kept biting, and repeatedly

  • saved the game,
  • exited Raze,
  • started Raze, and
  • loaded my save from the main menu.

After doing this enough times, the glitch appeared: save0003.zip

The weird sprites start showing up on the screen when the heart item's counter reaches 249. So I believe the root cause of the graphics glitch is that, when loading a save in which the player has less than full health, the game may erroneously use a heart even if there is no heart to use.

I tested this on lev5 because the heart is right there at the beginning, and I figured that I needed to obtain the heart and have it selected in order to initiate this bug. However, further testing indicates that this isn't necessary.

I started a new game, ran to the first enemies, took damage, saved the game (save0004.zip), exited Raze, opened Raze, loaded the save, and saved again (save0005.zip). In this last save, I now have a heart selected in the inventory, and it shouldn't exist. Unzipping this last save's session.json, I see the 255 again. So it seems that opening Raze and immediately loading any save which has less than full health and no hearts will result in a glitched heart that will start causing graphics glitches after half a dozen uses.

Edit: The bug I'm seeing is clearly not just a graphics glitch, even if it is the root cause of one, so I've created a separate issue, #888.

@mjr4077au mjr4077au reopened this Mar 16, 2023
coelckers pushed a commit that referenced this issue Jul 23, 2023
* Change originates from b71c725.
* Matches PCExhumed and GDX.
* Logic in game requires this variable to be signed.
* Fixes #415.
* Fixes #888.
@sinisterseed sinisterseed changed the title [Powerslave/Exhumed] [1.1.2] Using heart item causes graphical error [BUG] [Powerslave/Exhumed] Raze 1.1.2 - Using heart item causes graphical error May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants