A script to upscale The Sims 2's user interface for 4K (HiDPI) displays.
Through the use of graphic rules, it's easy to play The Sims 2 at high resolutions, but the buttons, text and interface become super tiny.
At time of writing, there are no 4K modifications out there to fix the UI.
I discovered that the game's modularity (ui.package
) allows us to double
the UI geometry and graphics.
This "mod" is a script that upscales UI resources and graphics from your copy of the game. Other resolutions (like 1440p) could work too by tweaking the script.
The theory works, but there's a few minor visual glitches that make the game feel buggy or makes it difficult to play.
The patcher tool is currently being worked on. Hang tight!
If you're a player: Your best experience is playing in 1080p for now. If you don't mind visual glitches, feel free to try this script.
If you've like to get involved:
Unit tests are an optional check everything is in working order.
You'll need to copy a file from The Sims 2 University into the tests
folder:
724723ddc5b020a55bdefc60a7cf1304 The Sims 2 University/TSData/Res/UI/ui.package
File not included. With this file, you can run:
python -m unittest discover ./tests/
This tests the package read, write and compression procedures are working correctly.
You can use this script to upscale any game version, expansion pack, even if you have existing UI modifications installed. This works by:
- Increasing the font size in
FontStyle.ini
- Extract
ui.package
and then:- Use
imagemagick
to upscale the graphics - Double the geometry and size for UI elements
- Use
- Generate a new
ui.package
(uncompressed, see #2)
First things first, you'll need:
- Python 3 (to run this script)
- Imagemagick (to process images)
- SimPE (to extract resources)
This script was designed on a Linux system, since The Sims 2 works under Wine! It should run on Windows, WSL2 and Mac too, providing you have the utilities installed and are accessible in your PATH (so you can run them without typing the full path to the executable)
Note: If you play an expansion pack, you'll need to run these steps once for the base game, then repeat them all for the expansion pack used to play the game, such as The Sims 2 Mansion and Garden Stuff (Sims2EP9.exe)
Unfortunately, this step is manual as I hit a snag (#1) figuring out how to decompress files without needing SimPE.
- In SimPE, open the game's
TSData/Res/UI/ui.package
(from the game's installation folder) - Select "jpg/tga/png Image" in the resource tree, select all and extract to the input folder.
- Repeat step 2, but for "UI Data" too.
- Repeat step 2, but for "Accelerator Key Definitions" too.
From the base game's installation folder, copy TSData\Res\UI\Fonts\FontStyle.ini
into
the input folder.
python3 ./sims2-4k-ui-converter.py
This will process the files and produce a new ui.package
.
For more parameters, add --help
at the end. For example, you can choose the
directory to use while processing (like a RAM Disk), otherwise, the default will
use input
, temp
and output
directories in this folder.
-
Navigate to the game's UI folder, usually:
C:\Program Files (x86)\EA Games\The Sims 2\TSData\Res\UI\
It is strongly recommended to backup the original
ui.package
for the game (like adding.bak
to the end of the file) -
Copy
output/ui.package
into this folder. As the script doesn't support compression yet (#2), this file is expected to be significantly larger.
- Repeat these steps again for base game or expansion pack that you use to play the game.
The scripts in this repository are licensed under GPLv3.
If you wish to let the wider Sims community know, be sure to leave a link to this repository!
Thank you to these wiki pages for documenting the UI files and DBPF format: