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

Support for Clean UI mod / Sims 2 hangs on initial load #46

Open
walkawayy opened this issue Aug 13, 2024 · 7 comments
Open

Support for Clean UI mod / Sims 2 hangs on initial load #46

walkawayy opened this issue Aug 13, 2024 · 7 comments
Labels
feature request Nice to have

Comments

@walkawayy
Copy link
Contributor

Operating System

Windows 11

Patcher Program Version

Built on latest nightly of 0.1.0

Installation Type

Repack or other automated installation

Describe the problem

I am using the Sims 2 Starter Pack (basically Sims 2 Ultimate Collection from Origin). Now, this may be totally a me problem in which case feel free to close the issue. But I figure I will report it just in case. So, I ran the tool in Ubuntu within WSL. I had to grant admin read/write to the folder but it worked. However, the game hangs during the initial loading screen while the music just plays. I am using the Clean UI Startship UI which is most likely not compatible with your mod. I am also launching using Sims 2 RPC. But since I don't know the code, I figure I would report it. See the pic below to see where it hangs:

image

Traceback

N/A
@walkawayy walkawayy added the patcher bug Script cannot be run or has a problem label Aug 13, 2024
@lah7 lah7 added question Further information is requested and removed patcher bug Script cannot be run or has a problem labels Aug 13, 2024
@walkawayy walkawayy changed the title Sims 2 hangs Sims 2 hangs on initial load with Clean UI Aug 13, 2024
@lah7
Copy link
Owner

lah7 commented Aug 13, 2024

It looks like Simstate's Starship UI mod introduces additional files and has them stored in the Downloads folder. As I sort of suspected, any package files in the Downloads folder won't be patched.

I'm pretty sure custom content "overrides" or "extends" the game's original files. With each 'file' in a package having a type, group & instance ID to identify them, in theory, things should had been left with inconsistent scaling. It doesn't fully explain the crash though.

  • Does anything different happen if you start the game directly (e.g. Sims2EP9.exe) bypassing the Sims2RPC launcher?
  • I'd expect a "Application crashed" dialog to appear, since it's not clear if the game is still running but it couldn't load/interact with the menu. Are there any crash dumps in My Documents/EA Games/The Sims 2/Logs/?
  • Did any of the scrolling text appear along the bottom while loading?
  • Did you patch with the compression option checked?
    • Without compression, the game would have huge ui.package files. Not sure if this has an impact on the 32-bit executable 2 GB limit. It can be patched to 4 GB. Not sure if your repack or launcher already patches that already.
  • Does it work with stock UI if you move the "Downloads" folder out and start the game?

The patcher is focused on the game's original files at the moment. A future goal should be to be compatible with other UI mods, although if it was a UI mod that patches each game file (e.g. ui.package) directly, then the patcher would work transparently.

Thanks for raising the report, I wouldn't really know since I like the original UI. There's a lot of differences (non-retail, third party launcher, custom UI, patched via WSL, etc) which makes it more fun to troubleshoot :)


So, I ran the tool in Ubuntu within WSL.

By the way, you could grab an 'artifact' from the latest build from the Actions tab if you wanted the latest EXE to run under Windows. That said, the performance difference within WSL would be trivial. I don't think running under WSL had any implications.

@walkawayy
Copy link
Contributor Author

  • Does anything different happen if you start the game directly (e.g. Sims2EP9.exe) bypassing the Sims2RPC launcher?

Still hangs on initial load.

  • I'd expect a "Application crashed" dialog to appear, since it's not clear if the game is still running but it couldn't load/interact with the menu. Are there any crash dumps in My Documents/EA Games/The Sims 2/Logs/?

No interesting logs files are made. I attached one below for a crash if I remove the Downloads folder.

  • Did any of the scrolling text appear along the bottom while loading?

No scrolling text or loading bar ever started filling. It just hangs on that first loading screen indefinitely while the music plays.

  • Did you patch with the compression option checked?

Yes, I had compression checked.

  • Without compression, the game would have huge ui.package files. Not sure if this has an impact on the 32-bit executable 2 GB limit. It can be patched to 4 GB. Not sure if your repack or launcher already patches that already.
    Sims 2 RPC applied the 4GB patch.
  • Does it work with stock UI if you move the "Downloads" folder out and start the game?

If I take the Downloads folder out, I get a crash The application has crashed. The application will now terminate. Text dump here:

Sims2Exception 2024.08.13 18.59.31.txt

The patcher is focused on the game's original files at the moment. A future goal should be to be compatible with other UI mods, although if it was a UI mod that patches each game file (e.g. ui.package) directly, then the patcher would work transparently.

Thanks for raising the report, I wouldn't really know since I like the original UI. There's a lot of differences (non-retail, third party launcher, custom UI, patched via WSL, etc) which makes it more fun to troubleshoot :)

Ya I figure supporting a modded UI is a whole new can of worms, but I wanted to bring it up since a lot of Sims 2 guides recommended the Clean UI nowadays in their Windows 10/11 setup guides.

So, I ran the tool in Ubuntu within WSL.

By the way, you could grab an 'artifact' from the latest build from the Actions tab if you wanted the latest EXE to run under Windows. That said, the performance difference within WSL would be trivial. I don't think running under WSL had any implications.

Oh nice. It seems like the tool took a similar amount of time running in Windows and in WSL with the Linux version. Probably a good 30+ minutes even on my Ryzen 7700x.

@lah7
Copy link
Owner

lah7 commented Aug 14, 2024

For the "Downloads" test, I forgot there is another file - it adds a package in the game files for the loading screen itself. Try taking that out from the game directory (TSData\Res\UI) and see if it works. Just want to check that you can get to the game without the "clean UI" mod, or if something else is causing the crash.

As a sanity check, I tested my retail copy with the latest patcher code (without compression, I got impatient) and the game starts and runs fine, minus the already known glitches. I discovered a new one (#47).

Once you confirm it can start without that mod, we could try patching Clean UI. As a test, you can hack the code to find and patch their files too.

    def _get_file_list(self) -> list:
        """
        Return a list of files that will be patched by this program.
        """
        files = []
        for filename in ["ui.package", "FontStyle.ini", "CaSIEUI.data"]:
            files += glob.glob(self.game_install_dir + f"/**/{filename}", recursive=True)
+       files += glob.glob(self.game_install_dir + f"/**/simstate*.package", recursive=True)
+       files += glob.glob(self.game_install_dir + f"/**/*clean-ui*.package", recursive=True)
+       files += glob.glob("/path/to/sims2/downloads/simstate*.package", recursive=True)
        return sorted(list(set(files)))

(Change /path/to/sims2/downloads to your equivalent C:\Users\...\Documents\EA Games\Downloads folder)

If that works, we could add an 'experimental' checkbox that asks for the downloads folder, to patch any known UI packages - but preferably it could patch any package that contains .uiScript data. I'd imagine "CAS HD fix" mod will be no good if the rest of the UI is 2x the size.

Probably a good 30+ minutes even on my Ryzen 7700x.

I've been slowly working on some parallel processing to get all those cores busy! 🔥

@lah7
Copy link
Owner

lah7 commented Aug 14, 2024

I tried the clean UI mod myself, no crashes here. I run the game under Wine on Linux.

Using the 'hack' above, the patcher didn't modify any uiScript or graphics data. It needs to be told explicitly too:

-                elif file.filename in ["ui.package", "CaSIEUI.data"]:
+                elif file.filename in ["ui.package", "CaSIEUI.data"] or file.filename.find("starship") != -1 or file.filename.find("clean-ui") != -1:

If compression is enabled, patching fails with array too small. Needs digging deeper if it's a specific file format causing that. With compression disabled, it succeeded, and it works... well.... with the usual visual bugs. I did notice the splash screen seemed static (lifeless) as it was loading.

Screenshot_20240814_220127
Screenshot_20240814_220158
Screenshot_20240814_220229

@lah7 lah7 added feature request Nice to have and removed question Further information is requested labels Aug 14, 2024
lah7 added a commit that referenced this issue Aug 14, 2024
It's theoretically possible to support custom UI mods in future (#46)
@walkawayy
Copy link
Contributor Author

Very cool! I added in your hacks and got 333 files patched instead of 331 and the game loads. It's obviously not perfect but a welcome start! I would say you'd be smart to continue as you were with base game support before even thinking about supporting custom UIs. But it's nice to know it could be possible in the future. (cropped pic because 4k pic wouldn't upload for some reason)

image

@lah7
Copy link
Owner

lah7 commented Aug 14, 2024

I encountered that glitch in your screenshot too at first. Make sure that path is right for your system: /path/to/sims2/downloads/simstate*.package, there should be about 5+ more from the Downloads folder.

Yep, it's quite nice to see too. Will track this issue as a feature request Nice to have . Glad it's not crashing now!

@walkawayy
Copy link
Contributor Author

Amazing thanks! Looks great! I am pretty busy on another project and irl work, but maybe in the future I will try to spin up on some Sims 2 knowledge and contribute if possible.

image

@lah7 lah7 changed the title Sims 2 hangs on initial load with Clean UI Support for Clean UI mod / Sims 2 hangs on initial load Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Nice to have
Projects
None yet
Development

No branches or pull requests

2 participants