Command & Conquer™ Tiberian Sun™ and Firestorm™

Command & Conquer™ Tiberian Sun™ and Firestorm™

29 ratings
Integer Scaling Windowed Mode with Magpie
By andshrew
This guide explains how to configure the Steam version of the game to use Windowed Mode, which can then be integer scaled to your desktop resolution using Magpie.
   
Award
Favorite
Favorited
Unfavorite
Overview
While Tiberian Sun includes support for running at reasonably modern resolutions, there are limits to its compatibility (ie. 1440p will crash) and the games presentation becomes unusably small.

When running the game in Windowed Mode it is possible to configure the game to run at resolution where the interface is still usable (ie. 720p), and then use an application like Magpie[github.com] to upscale the window to your full desktop resolution.

The examples in this guide will upscale the game from 1280x720 to 2560x1440.

Preparing Tiberian Sun
Choosing a source resolution suitable for integer scaling
This guide will use the terms target resolution to refer to your desktop resolution, and source resolution to refer to the resolution that the game will run at in windowed mode.

Integer scaling means that each pixel in the the source resolution will be evenly scaled, resulting in a clean and sharp output at your target resolution. In ideal circumstances you can scale to the full height and width of your target resolution, but in cases where this is not possible you will see borders around the image.

When choosing the source resolution that you intend to scale up from, you need to think about the limitations of the game (ie. at what resolution does the interface become unusable, or the game crash) and what resolution you will be scaling to.

In my testing Tiberian Sun runs reasonably well at a resolution of 1280x720. This resolution will conveniently integer scale up to a 1440p or 4k target resolution, making it an ideal candidate.

You can use this website[scalefactor.pages.dev] to assist with finding resolutions that will scale well to your target resolution.

Update Tiberian Sun Configuration
We need to configure Tiberian Sun to enable support for windowed mode, along with enabling it to see our source resolution.

Ordinarily windowed mode requires your desktop to be running in 16bit colours, but the version of the game on Steam uses DDrawCompat[github.com] and this can trick the game into thinking we are using this.

Open Steam and select the game. Click the gear icon -> Manage -> Browse local files.


An Explorer window will open in the games installation directory.

Edit DDrawCompat.ini

Locate DDrawCompat.ini and open it in Notepad.

Add the following line to the bottom of the file to enable windowed mode to work correctly:
DesktopColorDepth = 16

Locate the line with SupportedResolutions, and edit this to include your source resolution - in this example 1280x720.
SupportedResolutions = 640x400, 640x480, 800x600, 1280x720

Alternatively, you can comment this line out by placing a # at the start. Doing this will then present all available resolutions to the game.

#SupportedResolutions = 640x400, 640x480, 800x600

Save the file and close Notepad.

Edit SUN.ini

This step is required to enable the game to see higher resolutions. If you are intending to use one of the stock resolutions as your source resolution then you can skip this step.

Locate SUN.INI and open it in Notepad.

Scroll through the file to locate the [Video] section. Add the following line directly beneath the [Video] entry.
AllowHiResModes=yes

Save the file and close Notepad.

Set to Launch in Windowed Mode

Back in Steam with the game selected, click the gear icon -> Properties.

On the general tab, at the bottom enter the following launch option:
-win


The game is now ready to launch in windowed mode.
Preparing Magpie
Magpie[github.com] is an open source scaling tool, which can take almost any Windows application window and then scale it to your preference. For this to work Magpie must be left running when you play the game.

Download the latest release of Magpie from https://github.com/Blinue/Magpie/releases/latest

Extract the zip file and run Magpie.exe.

Add a Scaling Configuration
Magpie includes several preconfigured scaling configurations. We need to add a new one using the Nearest scaling effect that is configured with an appropriate scaling factor.

Our source resolution is 1280x720 and our target resolution is 2560x1440, so we need a scaling factor of 2 (1440 / 720 = 2).

As it happens, Magpie includes an Integer Scale 2x as one of it's pre-sets so you don't actually have to create one in this instance.

However for the benefit of the guide, if the source resolution was 1280x720 and the target resolution is 3840x2160 then we would need a scaling factor of 3.

To create an integer Scaling configuration for this, click Scaling configuration, scroll to the bottom and click New scaling mode. Enter a name like Integer Scale 3x, and select to copy from the existing Integer Scale 2x.


The newly created configuration will appear at the bottom of the list. Click the arrow on the right to expand it, and then click the diagonal arrows to open the settings.


Change the width and height scaling options to 3.



Scaling Factor Notes
  • You can use this website[scalefactor.pages.dev] to assist with finding resolutions that will scale well to your target resolution
  • Always use the same scaling factor for both the width and height
Launch the Game and Create a Magpie Profile
With everything prepared, the game is now ready to launch.

Start Magpie and then launch Tiberian Sun from Steam.

The game should currently be running in a window on your desktop.

In Magpie, click New Profile. Click the select a window dropdown. This will list applications which are currently running, so locate Tiberian Sun on the list (note select "Tiberian Sun" and not "[DDrawCompat] Tiberian Sun").


The new profile will appear on the left hand side, click it to view the settings. Change the Scaling mode to Integer Scale 2x (or the configuration you created in the previous step). For Tiberian Sun, you should be able to leave the other settings as their defaults.


Select the Tiberian Sun window and press Windows key + Shift + A. This will instruct Magpie to scale the application. Press the same combo again to disable the upscale, or alt+tab.

With the game now running full screen, take this opportunity to make sure that the game is running at your preferred source resolution. Click Options -> Display -> select 1280x720.
Conclusion and Final Notes
With these steps completed you should now have Tiberian Sun running at a usable resolution, which is being cleanly scaled up to your desktop resolution. It's time to Command and Conquer!

NVIDIA Overlay Incompatibility with DDrawCompat
If you use an NVIDIA GPU and their overlay software, there is currently an incompatibility between that and DDrawCompat[github.com] which results in the game menus becoming unresponsive over time.

You can work around this by disabling the NVIDIA overlay before playing the game.

There is an updated version of DDrawCompat available here[github.com] which should resolve the issue, allowing you to use the overlay while playing the game. You would simply copy this .dll file into the games directory, overwriting the existing version. Hopefully a future release of DDrawCompat will include this fix, and EA will update the game to automatically use that version.

Additional Notes
  • Magpie must be running for it to be able to upscale the games window.
  • If you don't want to use the button combo to activate the upscaling then you can configure the games profile to automatically upscale when the window is in the foreground (ie. whenever it is selected). Note that if you use this then sometimes the intro FMV will display as a black screen, you can alt-tab out and back in to fix this.
  • If you use multiple monitors you may want to enable the 3D game mode option in the Magpie profile for the game. This will prevent the mouse escaping the upscaled window. Note that using this option seems to break the in-game mouse hover tooltip function (eg. showing the price of a unit when mousing over the right hand menu).
  • If your target resolution is 1080p, you may struggle to find a source resolution which scales well to this. If your GPU drivers support it, you could create a custom resolution such as 960x540 to use as your source resolution, and then apply the Integer Scale 2x configuration to evenly scale up to your target of 1080p.
  • I am not affiliated with Magpie, other applications which perform similar scaling are available however I have not used these. The steps to configure Tiberian Sun to run in windowed mode should be applicable to them too.
10 Comments
Dealman Mar 8 @ 4:24pm 
I had to fiddle with this a bit, if you have the TSPatch installed the -win parameter seems to be ignored. Instead launch "tsconfig.exe" and set the resolution and windowed mode in there.

Also, I had to set the renderer to Direct3D 9 otherwise Magpie wouldn't work and would only display a white screen.
andshrew  [author] May 2, 2024 @ 10:09am 
@FahQ, that at least confirms that DDrawCompat is seeing the setting. That message is fine, it's just another location it can try to load configuration from. So is it actually even trying to launch in window mode, or does it automatically go to full screen?
FahQ Apr 30, 2024 @ 10:42pm 
03:19:43.567 [directory] DesktopColorDepth = 16

Also noticed this
03:19:43.566 Loading global config file: C:\ProgramData\DDrawCompat\DDrawCompat.ini
03:19:43.566 File not found, skipping
andshrew  [author] Apr 30, 2024 @ 2:56pm 
Hi @FahQ, is it just giving you the message about requiring 16bit pixel depth still, or does it not even try to launch in windowed mode? I can't immediately think of anything wrong, but in the games directory will be a file called "DDrawCompat-game.log", you could look in that after launching the game to at least confirm that the DesktopColorDepth is being set to 16 properly when the game loads.
FahQ Apr 30, 2024 @ 2:03pm 
Hey andshrew, i added the line to trick the game into thinking its 16bit colour, and i also added the -win line in advanced options. The still wont open in windowed mode though. Any reason you can think of that im doing something wrong?
andshrew  [author] Apr 12, 2024 @ 4:35am 
@Throbulator Your resolutions line looks OK, although you could try adding a "#" to the start of it and see if that makes any difference in terms of what resolutions you then see in-game (the # should allow it to see every available one):

#SupportedResolutions = 640x400, 640x480, 800x600, 1920x1080

I may be misunderstanding what you are saying, but if your monitor resolution is 1920x1080 then you won't be able to upscale to 4k. On that web site, you enter your monitor (or desktop) resolution in the Target Resolution box, and then it shows what lower resolutions you could use as the resolution for the game that you can then scale up to 1920x1080. As I mentioned, for 1080p you don't have many options that scale evenly, unless you are able to add a custom resolution like 960x540 which you could then scale up with a 2x factor to 1920x1080.

Also, if your desktop resolution is 1920x1080, you may not be able to run the game windowed at the same resolution.
Throbulator Apr 10, 2024 @ 2:41am 
im setting it to my monitor res which is 1920x1080.
SupportedResolutions = 640x400, 640x480, 800x600 , 1920x1080
i was trying to upscale to 4k the website you gave out said my soure res could do it if i used a factor of 2 in magpie.
andshrew  [author] Apr 7, 2024 @ 5:13am 
@Throbulator Are you trying to set 1280x720 like the guide, or another resolution? If another resolution, can you copy and paste the SupportedResolutions line from your INI file.

If you are trying to use 1280x720, it may be that your GPU isn't presenting that as an available resolution to Windows. If you go to change the resolution of your screen in Windows does it show up on your resolution list?
Throbulator Apr 7, 2024 @ 2:54am 
Im sorry but no matter how i edit the first ini. file i cant get the resolution to show up in the option menu. Do you know anything that would be causing that to happen?
TITUS Mar 28, 2024 @ 9:56am 
ya bu kadar ayarı steam niye yapmıyor da bizi uğraştırıyor !!!!? 800/600 çözünürlük mğ kaldı 22.yüzyılda ......