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

A game.xml mod above a gameconfig.bin mod will crash when loading levels #441

Open
5 tasks done
ElspethThePict opened this issue Oct 5, 2024 · 2 comments
Open
5 tasks done
Labels
bug Something isn't working

Comments

@ElspethThePict
Copy link
Contributor

ElspethThePict commented Oct 5, 2024

Before opening this issue, I ensure that...

  • I have read the FAQ and confirmed my issue is not mentioned in it.
  • I have checked both open and closed issues and confirmed this bug has not already been reported.
  • I am not asking for tech support (e.g. game closing on startup, error when trying to build, etc).
  • I am not asking for modding support or reporting a bug in a specific mod; this bug either occurs without mods enabled or is directly related to the mod loader.
  • This bug is not related to any unofficial fork/port of the decompilation, and any issues with those should be kept in the appropriate repository.

Expected Behavior

Both mods load, XML additions applied over modified .bin config

Actual Behavior

Application crashes to desktop when loading a level that uses global scripts

Steps to Reproduce

  1. Supply two mods, one with a modified gameconfig.bin and one with a game.xml that adds objects.
  2. Place the game.xml mod above the other in the mod list and activate both.
  3. Attempt to start a regular stage that uses global objects, like Green Hill Zone
  4. Application closes

Screenshots

No response

Log File

No response

Decompilation Version

Current latest

Game

Sonic 1

Game Version

Mobile (Sega Forever)

Game Revision

No response

Platform

Windows 10

Additional Comments

No response

@ElspethThePict ElspethThePict added the bug Something isn't working label Oct 5, 2024
@ElspethThePict
Copy link
Contributor Author

I've fixed this in my own fork by reversing the load order of XML files in

RetroEngine::LoadXMLVariables()
RetroEngine::LoadXMLPalettes()
RetroEngine::LoadXMLObjects()
RetroEngine::LoadXMLSoundFX()
RetroEngine::LoadXMLPlayers()
RetroEngine::LoadXMLStages()

In truth, this has likely simply moved the bug to affect XML mods placed below gameconfig.bin mods in the list but the expected behaviour there is already undesired (the gameconfig file overwrites the XML changes completely).

@ElspethThePict
Copy link
Contributor Author

Other users have found that the mod without an xml doesn't need a gameconfig.bin to cause the crash, and adding even a blank game.xml file fixes the issue. Given that this issue also doesn't happen when there are no new global objects in the xml, I believe RetroEngine::LoadXMLObjects() is crashing when it fails to find an xml file.

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

1 participant