Skip to content
This repository has been archived by the owner on Feb 28, 2023. It is now read-only.

Latest commit

 

History

History
248 lines (146 loc) · 10.1 KB

README-WineD3D.md

File metadata and controls

248 lines (146 loc) · 10.1 KB

How to play The Sims 2 under WineD3D

The original purpose of this repository is to collate a collection of patches to describe how The Sims 2 can work under the Wine Compatibility Layer.

Thanks to the bug busters who have patched the source and found workarounds. For players, The Sims 2 is playable with the odd glitch! For developers, there's some interesting things to uncover. This repository will maintain notes and mirror patches and Wine binaries where available for you to test, debug or play.

Download Binaries

See the Releases page for the compiled binaries, which can be downloaded and used as-is, or added to front-ends such as PlayOnLinux or PlayOnMac.

The binaries are currently compiled without 64-bit support (SysWOW64), meaning they require a 32-bit Wine prefix.

Package Compiler OS Compiler Arch Wine Prefix Notes
linux-x86 Ubuntu 16.04 i386 32-bit
mac-x86 macOS 10.14.2 amd64 32-bit macOS 10.15 will deprecate 32-bit support.

macOS builds are considered experimental.

Building

Wine can be built on GNU/Linux and macOS.

  1. Clone this repository to acquire the patches.

    git clone https://github.com/lah7/sims-2-wine-patches.git
    
  2. Download a copy of the Wine source code from https://dl.winehq.org/wine/source/

  3. Install the dependencies.

    https://wiki.winehq.org/Building_Wine#Satisfying_Build_Dependencies

  4. Patch the source and build:

    tar -xvf wine-XXX.tar.bz2
    ln -s wine-XXX a
    patch -p0 < /path/to/file.patch
    cd wine-XXX/
    ./configure --prefix=/path/to/build/
    make install -j4
    

To speed up compiling, change -j4 to the number of processor cores you have.

If running via make only, you can use the wine script to run the build.

Credits

Comment Author Notes
124 swswine Initial patch and discovery
160 Robert Walker Updated to Wine 3.5.
161 Alexandr Oleynikov Updated to Wine 3.7 with staging patches.
164 Paul Gofman Updated to Wine 3.18, works with newer drivers.

See bug report 8051 on Wine's bug tracker for development discussions.

Thank you to Alexandr Oleynikov for suggesting mod workarounds and maintaining the Lutris installer.

Known Issues & Workarounds

Hardcoded 256 vertex shaders

The Sims 2 requests 1024 vertex shader constants, but Wine has a hardcoded limit of 256. Direct3D 9 normally supports up to 8192, using hardware shaders first (where available), followed by software emulation. Software emulation is currently not supported in Wine.

Undocumented or unimplemented D3D9 interfaces

The developers of The Sims 2 used some obscure features of Direct3D 9 as discovered in the bug report discussion. Some of these will require implementation in Wine which are quite the task:

Shader Models: 3D Rendering (Early Sims 2 versions only)

Shader Model 2 and Shader Model 3 reveal differences, particularly in the original release (no patches, no expansions). Newer expansion packs use an improved rendering engine with fewer differences between SM2 and SM3.

Shader Model 2 with useShaders false Shader Model 2 with useShaders true Shader Model 3 with useShaders false Shader Model 3 with useShaders true
SM2, shaders disabled SM2, shaders enabled SM3, shaders disabled SM3, shaders enabled

The Shader Model version can be set via Wine's registry:

HKEY_CURRENT_USER\Software\Wine\Direct3D\MaxShaderModelPS
HKEY_CURRENT_USER\Software\Wine\Direct3D\MaxShaderModelVS

REG_DWORD => 2

By opening the cheat console (CTRL+SHIFT+C), you can toggle between parameters that will effect rendering in-game:

boolProp useShaders false
boolProp lightingEnabled false

In order to play earlier versions of the game, you will need to force Shader Model 2 via the registry, turn on shaders and disable the lighting engine. Write the following:

boolProp useShaders true
boolProp lightingEnabled false

And save to:

C:\users\<YOURNAME>\My Documents\EA Games\The Sims 2\Config\userStartup.cheat

Base game rendering with shaders, no lighting

This is not necessary when using newer versions of the game and expansion packs. Results may differ on different graphic cards and drivers.

Note: Previous Wine patches/binaries mentioned in bug reports and this repository forced Shader Model 2 in the source code, but this is no longer the case.

Shader Model 3: Blue Snow

If you have the Seasons expansion pack, you may experience blue snow outside the lot, you can workaround this by forcing Shader Model 2 via the registry.

Blue snow on The Sims 2 Seasons

Corrupted family thumbnails

The 'red eagle' pose appears on the neighbourhood screen and during loading screens.

Red Eagle Pose

The only exception is when a new default neighbourhood is loaded for the first time in which the thumbnails were already pre-rendered.

This can be fixed by installing a modified no-censor mod by @tannisroot. This disables the anti-censoring functionality which happens to fix the thumbnails when saving.

You can download thumbnails_fix.package from this archive.

Skin tone mismatch

A Sims' skin colour may not match between their head and body.

Skin Tone Mismatch

This can be fixed by running this cheat code prior to entering the household:

boolProp skipTangentsInVertexData true

Polygon Explosion

Icons above a Sim's head (like the one when you get a new friend) can appear glitchy.

Black screen after resolution changes (or when minimized)

Changing resolution while in a household can sometimes result in a black screen.

This can be fixed by running this cheat code:

boolProp createNVidiaWorkaroundTexture false

Alternately, you may set the Wine prefix to run inside a virtual desktop.

Black boxes for "High" shadows (NVIDIA only)

This also happens under the NVIDIA driver on Windows. This previously did not happen with earlier versions of the NVIDIA driver (around 396.x and before) and the original Wine patches.

Black Shadow Bug

This can be fixed by installing the Sim Shadow Fix (v0.4) mod.

Huge log files

As the patches expose a lot of FIXMEs in Wine. This can fill up to many hundreds of MBs, causing potential slowdown.

Other Notes

  • If there are any technical explainations, feel free to create a pull request or issue.
  • Please do not submit test reports to AppDB when using patched copies of Wine as the test results do not reflect "vanilla" Wine or wine-staging.
  • To view FPS and shader version in-game, press CTRL + SHIFT + S
  • There are some engine differences/improvements between the original release, later expansion packs and the Origin version.

Workarounds

The aforementioned workarounds are either cheat codes that are entered via the CTRL + SHIFT + C cheat console while playing, or saved to this file to run when the game starts:

C:\users\<YOURNAME>\My Documents\EA Games\The Sims 2\Config\userStartup.cheat

Note that some rendering cheat codes require you to re-enter the household to take effect.

Mods (custom content) are saved in this directory:

C:\Users\<YOURNAME>\My Documents\EA Games\The Sims 2\Downloads

If you've installed The Sims 2 via Lutris, these mods are already included.

Bug Reports

Developers and hackers, these are the bug reports on WineHQ Bugzilla:

Links