Giter Club home page Giter Club logo

sims2-4k-ui-mod's Introduction

The Sims 2 4K UI Mod

A script to upscale The Sims 2's user interface for 4K (HiDPI) displays.

About

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.

Work in Progress...

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:

Tests

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.

Script Usage

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
  • Generate a new ui.package (uncompressed, see #2)

1. Prerequisites

First things first, you'll need:

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)

2. Extract with SimPE

Unfortunately, this step is manual as I hit a snag (#1) figuring out how to decompress files without needing SimPE.

  1. In SimPE, open the game's TSData/Res/UI/ui.package (from the game's installation folder)
  2. Select "jpg/tga/png Image" in the resource tree, select all and extract to the input folder.
  3. Repeat step 2, but for "UI Data" too.
  4. Repeat step 2, but for "Accelerator Key Definitions" too.

3. Copy FontStyle.ini

From the base game's installation folder, copy TSData\Res\UI\Fonts\FontStyle.ini into the input folder.

4. Run the script

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.

5. Copy into the game

  1. 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)

  2. Copy output/ui.package into this folder. As the script doesn't support compression yet (#2), this file is expected to be significantly larger.

  1. Repeat these steps again for base game or expansion pack that you use to play the game.

License

The scripts in this repository are licensed under GPLv3.

Acknowledgements

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:

sims2-4k-ui-mod's People

Contributors

lah7 avatar lingeringwillx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

sims2-4k-ui-mod's Issues

Can the new package files be placed in "Downloads" instead?

Until #3 is resolved, we don't know if we can place the new ui.package in the user's EA Games\The Sims 2\Downloads folder instead of the game's installation directory. It would make removal of the "mod" easier for later.

I'm not actually sure how the mod system works - if it needs anything special, or if only concerns custom content (new objects, clothes, etc) and not graphical modifications to the game itself.

At the moment, the game ignores the file if placed there and does not show up in the custom content dialog box.

Fill game loading screen background

These files contain the game's loading screen (after the splash):

  • PNG 00000000-499DB772-CCC9AF70
  • PNG 00000000-499DB772-CCC9AF80

Perhaps they could be processed again to fill the entire screen (2160p)

Cursor: Family following cursor is tiny

For example, when in the neighbourhood and click a family to move into a lot - it's still the small size.

At worst, this might potentially be hardcoded into the game.

small-family-cursor

Game crashes after splash screen

Using the base game as a test, when the new ui.package is placed in C:\Program Files (x86)\EA Games\The Sims 2\TSData\Res\UI\Fonts\FontStyle.ini, the game:

  • Destroys the file (if it has write access) with 96 bytes of an empty DBPF header.
  • Crashes after the splash screen with a generic "the application must now terminate"

From what I can see, the DBPF is structurally correct, and SimPE opens it fine with the same group/instance IDs. The only thing that is absent is the "compressed directory listing". Does the game expect this? Maybe it'll work after implementing #2 or a placeholder listing?

UI: Small dialog box

Looks ugly, squashed and out of shape. At worst, are these not in any .uiScript?

small-dialog

UI: Small pie menu

A pie menu with lots of options causes overlapping, which is even worse.

Small pies

Cursor: Animated loading cursor still small

Static cursors (like the main arrow) are OK, but the animated "busy" cursor isn't processed yet.

At the moment, it shrinks to half the size (1x density), which doesn't look good.

Live Mode: "Needs" font size and sidebar misalignment

Not sure why the font title is still small, best check the .uiScript for that one.

The plumbob looks misaligned. Upon closer inspection, it's likely the background image is not accurate. The moods meter is also out of place slightly.

Misaligned 'needs' text and icon

Process RIFF files (*.uiScript) to tweak the loading screens

The loading screens are stored in the base game's ui.package. They are some kind of RIFF file with the .uiScript extension.

$ file *
00000000-499DB772-8DA3ADE7.uiScript: RIFF (little-endian) data
00000000-499DB772-8DA3ADE8.uiScript: RIFF (little-endian) data
00000000-499DB772-8DA3ADE9.uiScript: RIFF (little-endian) data
00000000-499DB772-8DA3ADEA.uiScript: RIFF (little-endian) data
00000000-499DB772-8DA3ADEB.uiScript: RIFF (little-endian) data
00000000-499DB772-8DA3ADEC.uiScript: RIFF (little-endian) data
00000000-499DB772-8DA3ADED.uiScript: RIFF (little-endian) data

RIFF is a container, so if possible, we'll need to find out what format this data is, so we can extract and repack its contents.

Sources

Current

With the rest of the UI upscaled, they don't look great at the moment:

small-loading-screen

Do all ui.package files need to be processed?

First, we need the game to accept our new ui.package so we can test the upscaled UI (#3)

I don't know if every expansion pack needs upscaling, or just the base game and the expansion pack used to launch the game.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.