This website works best on Firefox. • Advantages • Get it
Table of Contents
Description
Details
FAQ
Donations
Requirements
Installation instructions
Upgrade instructions
Uninstallation instructions
Version history
Contact info
Credits
Tools used
Licensing and Legal
Name: Emperor Resolution Customiser
Version: 1.2022.8.0
Author: XJDHDR
Download locations:
Nexus Mods: | Direct link | Ad supported interstitial link |
Description
Program that lets you change the resolution Emperor runs at as well as apply specific patches.
Details
With the wide variety of screen sizes and resolutions available, it is important for a game to be able to give the player options. This is especially required for LCD monitors in that running a game outside its native resolution creates a blurry image. By default, Emperor only allow you to choose between two resolutions: 800x600 and 1024x768. Though this was manageable at the time due to these being the most common resolutions used then, screens have since gotten bigger and denser. The switch to LCD further caused issues due to their blurring images that run outside their native resolutions, as well as the adoption of widescreen aspect ratios meaning that 4:3 resolutions are stretched and distorted.
This started to change on the 5th of February, 2012 when a Widescreen Gaming Forum member named JackFuste uploaded copies of Pharaoh's EXE that he had modified to run on a few widescreen resolutions. From there, he went on to upload a number of packs and fixes containing edits for all 4 of the Impressions Studios' 2D City Building strategy games to run on a number of common resolutions and whatever resolutions users requested. While a massive improvement over the default options, the main issue was that Jack was for the most part the only one making these fixes and any resolution not already available had to be requested. Another thing that can be seen is that he became better at modifying the resolutions over time, ultimately adding some fixes to the UI in his latest mods that weren't present in earlier versions. This meant that his fixes as they stand have varying levels of quality and some resolution options simply never had fixes created.
A small area of progress here came from another Widescreen Gaming Forum member named Mario who, on the 4th of September, 2018, uploaded his own modifications for Zeus and Emperor that came with a guide describing how he created his fixes. With this guide, it was now easier for people to create their own fixes.
And that is where this project comes in. This program gives you the ability to change what resolution the game runs at. It does so by modifying the 1024x768 option so that it will instead run the game at the resolution you specified (within reason - some numbers cause bugs or simply can't be supported). It also resizes various elements of the game's UI to fit the new resolution. To do this, this resolution customiser needs an unmodified copy of the game's EXE. Once done, it will create a modified copy of that EXE that you can drop into the location you installed the game. In short, this utility will give you a modified copy of Emperor's EXE that will run at the resolution you specified and which has all of the fixes that are present in the last EXEs Jack released.
You can optionally apply two additional patches to the game as well. The first is a fix for the inability to switch the game into windowed mode if you have customised the game's resolution. The second is for an optional increase to the maximum number of sprites that can exist on a game's map at once to 2x the original limit.
Finally, this program can also automatically resize the game's background images to fit the new resolution.
FAQ
- Is this open source? What language did you use?
- Yes, it is. I have placed the source code under a Modified BSD 4-Clause license, and you can find it on GitHub. The language used is C#.
- What versions of Emperor are supported?
- Currently, the following versions are supported:
- GOG
- English CD version (published by both Sierra and Sold Out) patched to v1.1
- French CD version patched to v1.1
- Italian CD version patched to v1.1
- I would like to add support for more versions but to do so, I need to know where I can find them.
- How fast is this program?
- Patching just the EXE without resizing any images: Instantaneous. The program finishes pretty much right after clicking the button.
- Patching the EXE and resizing images: During the testing phase, this took around 3 seconds. However, after I added multithreading to the image processing stage, the process takes around half a second on my PC (1st gen Ryzen 5 at stock speeds).
- I tried to use this and saw an error that says, "Emperor.exe was not recognised. Only the following unmodified distributions and languages are currently supported: ..."
- This means that you tried to use a version of Emperor that my program doesn't recognise. In order to apply the required changes, I have to add and modify code to Emperor's EXE. To do this, I need to know exactly where the required changes need to be made. If my program applies its changes to the wrong offsets in the EXE, it will cause problems. Due to this, I opted for a whitelist approach to figuring out where the changes need to be made. The program will only work if the Emperor.exe is recognised.
- What limits are there to the resolutions this program can set?
- One big limit is the maximum resolution. The size of the city viewport is determined by two multipliers that are fed into formulae to determine what size they are drawn to. Both of these are signed 8-bit numbers which means that they can reach a maximum of 127. This means that the maximum size of the game's usable UI (meaning the city viewport, top menubar and right sidebar) is 10384x2560. That said, I have configured the program to allow a higher resolution than this, where any gaps created by larger numbers will be filled in by a background. I have set these to be 2x larger so that the usable part of the game's window will never be less than 25%.
- So in short, the maximum resolution you can set is 20768x5120, with the game's usable UI being limited to 10384x2560 and will be drawn in the top-left corner of the window if smaller than the overall resolution.
- Besides this, your selected resolution also needs to be at least 800x600, as the game is not designed to be displayed on a resolution smaller than this.
- The width component also needs to be divisible by 4, as major visual bugs happen if this is not the case.
- I used this utility and the game's resolution didn't change.
- This is most likely because your game is still configured to run at 800x600. There are two resolution options in the game: 800x600 and the 1024x768 option, which is patched by this program to use the resolution values you supplied. The setting in the game's Display menu can be patched by this program to display the new resolution values instead of 1024x768, if you selected the option to patch the game's `EmperorText.eng` file.
- There are four ways you can choose to do this:
- Automatic way: One of the optional downloads is My Emperor INF. Download this archive and copy the contents into your Emperor folder.
- Semi-automated way: Another optional download is Display option patcher scripts. Drop the appropriate script into your Emperor folder then run it.
- Manual way: Launch the game, load a map then open the "Options->Display" menu then choose the "1024x768" option.
- Manual and hard way: Open "Emperor.inf" in the folder you installed Emperor using a hex editor and look at the 17th byte. If it's value is equal to "1" or "2", change it to "3".
- The game crashes if I try open the world map.
- This is almost always caused by the game trying to load a world map image that is too small to fit inside the viewport.
- The program's "Resize Images" option creates map images that are the correct size. So the solution is to let the program create such images and then copy them into Emperor's DATA folder.
- After starting the game, I see an error which says that some sg3 and 555 files could not be found.
- This is almost always because you deleted the game's DATA folder.
- If you didn't make a backup of the entire folder before starting, the only solution is reinstalling the game.
- I'm using the GOG version of the game and building animations are static or don't show up.
- There appears to be an incompatibility between the game and an overlay or something that the GOG Galaxy client adds to the game's process, causing the above problem.
- To solve this, run the game's executable directly and do not launch it through the Galaxy client.
- If the above doesn't work, try exit the Galaxy client in question before running the game directly.
- I'm not running the game through the Steam/Galaxy client and animations are still static or don't show up.
- I tried your suggestion above, and animations are still static or don't show up.
- Another quirk in the game is that it uses a counter maintained by Windows to track how animations should play. This counter continuously ticks upwards for as long as you have your PC running. Once the counter reaches a high enough value, Emperor is unable to correctly read its value.
- To solve this, restart your PC if it has benn running for a long time. This resets the counter's value.
- Finally, if this doesn't work, other software that adds overlays to a game (e.g. MSI Afterburner, EVGA Precision, Shadowplay, etc.) could also cause this same issue. If you're using such software, try to disable the overlay, add an exception for Emperor and/or close the program in question.
- The game's window extends beyond the screen's edges.
- Menus and buttons don't work properly because their activation points don't line up with their graphics.
- This is because you're running the game on a High DPI screen and Windows scaled the game to compensate.
- To solve this, download and install the Emperor manifest found under my download page's Optional files section.
- If the above doesn't work, disable the DPI scaling compatibility option. To do so, right-click on Emperor.exe. Switch to the Compatibility tab. Then click on Change high DPI settings. Then, tick the Override high DPI scaling behaviour. Scaling performed by: option. Then select the Application option in the drop box. Then click on OK for every menu. If any options are greyed out, click on the Change settings for all users button under the Compatibility tab.
- What are the files you have under the "Misc" section?
- The first is my old widescreen fixes pack that I used to have on Sourceforge before I created this utility. It contains all of the modified EXEs I could find for Emperor that JackFuste created as well as a bunch of docs, files and helper scripts that I created which make it easier to get the game setup after installing a widescreen fix.
- The second is an archive containing all of the widescreen fixes created by JackFuste that I've managed to find, and which are what I used to create my old widescreen pack.
- The third is the widescreen fix that Mario created and uploaded to the WSGF post I mentioned above which has subsequently become unavailable due to changes made on the website, which included deleting all files uploaded there.
- These three files are provided as-is with no support whatsoever from me. I consider all of these uploads depreciated by my utility and have mainly uploaded them to preserve their history. You might need to download the widescreen fixes pack if you are using a version of the game that is not currently supported by my utility. Otherwise, you should be using my Resolution Customiser instead of these.
- I have an unrecognised version of the game. Can you please add support for it?
- Yes, I am willing to add support for other versions of the game. There are three conditions though:
- First, I am only willing to add support for fully patched copies of the game (i.e. v1.0.1.0). Digital distributions of the game are already patched. If you're using a CD version, you can download the relevant patch from here.
- Next, the game's EXE must not be modified in any way. In particular, I will not add support for no-CD patches under any circumstances. If you are using one, remove it. If you are using some other type of modification to the EXE, I recommend providing this resolution customiser an unmodified copy of the game then re-apply your modifications to the modified EXE that this program creates. If this modification is good, you could even suggest that it be added to my program.
- Finally, I need to know where I can find this version of the game. This is because I need to be able to take a look at the game's files to find out at what offsets they need to be modified and test the modifications.
- Why don't you support no-CD patches?
- The biggest reason is because these patches are used to facilitate piracy, which is both immoral and damages PC gaming. People who disagree will reply with excuses like: "I only pirate games to try them out", "games are too expensive", "I would never have paid to begin with", "game devs are greedy", "DRM is useless", "only paying customers suffer from DRM", and so on. To those people: Don't bother! I've heard all of those ad-hoc excuses, and none of them stand up to scrutiny.
- Next, even if we remove that aspect from the discussion, there is no way I can know what exactly was changed in the EXE to remove the copy protection or what bugs and incompatibilities this removal potentially caused. Additionally, there could be any number of variations of these patches where different groups would remove the copy protection in their own way, leading to different code layouts and hence, different offsets that would need to be found.
- In short, the only legitimate reason I can see for using a no-CD patch is if the copy protection has stopped working on modern PCs, meaning that the game can't be played at all without one. This is not the case as far as I'm aware. If you are desperate to play this game without any DRM present, the only way I'm willing to support is to buy the GOG version.
- The display menu option for selecting my resolution still says "1024x768".
- The option "Patch EmperorText.eng" fixes this problem so that this menu option will display the correct resolution. Therefore, the only reason you should have this problem is that you either didn't provide a EmperorText.eng to patch, or you deselected the option.
- Otherwise, this is only a cosmetic issue. Selecting this option will run the game at your chosen resolution despite what that text says.
Donations
While I don't expect any payments for my mods and have no plans to charge anything for them, any donations will be greatly appreciated. If you would like to do so by looking at an advert instead of making a payment, you may use this interstitial link which redirects back to this mod's Nexus Mods webpage: Emperor Resolution Customiser at Nexus Mods
Alternatively, you may make payments through Ko-fi, Liberapay, Patreon or PayPal:
Finally, this website has been set up to accept contributions from Brave Rewards and Flattr.
Requirements
This program requires an unmodified copy of Emperor: Rise of the Middle Kingdom.
It also requires that you have the .NET Framework v4.0 or later, which Windows from 8 onwards have installed by default.
Installation instructions
- NOTE: Please do not delete any files or folders in the game's install location. Especially DO NOT delete the DATA folder. You only need to overwrite the originals with the new files created by this program.
- Open the location you installed Emperor and backup Emperor.exe as well as every JPEG file inside the DATA folder.
- Extract the archive you downloaded from Nexus Mods wherever your user account has write access, using 7-zip or your favourite archive extraction program.
- Run Emperor Resolution Customiser.exe. A window will then appear containing all the options available. You can click on the ? button to get a description of what each item does.
- There are three ways you can select an Emperor.exe to patch. First, you can use the Select Emperor.exe button to select where you have installed the game. Second, if you copy the right files into the base_files folder, the program will use those (see the readmes in there for which files are needed and where to copy them). Finally, if you copy this program's files into the folder you installed Zeus, it will use those files.
- Once you have picked the options you want, click on the Generate EXE button. The program will then drop the new files into the patched_files folder.
- Copy-paste the files inside the patched_files folder to the location you installed Emperor, overwriting any files already present.
- If you have any questions or problems, please read through this Readme first (especially the FAQ).
Upgrade instructions
I hope you made a backup of the game's original files before you followed the installation instructions, as this program is designed to patch unmodified EXEs and not ones it has already patched. If so, run through the installation instructions again with the backups and updated utility. If not, you will need to reinstall the game before doing so.
Uninstallation instructions
I hope you made a backup of the game's original files before you followed the installation instructions. If so, copy-paste the backed up files into the location you installed Emperor and overwrite if asked. If not, you will need to reinstall the game.
Version history
- 1.2022.8.0
- Release date: 13 August 2022
- Added support for the French and Italian CD versions of the game.
- Edited the messages that display when a game's EXE is not suitable for patching to give more details of what the problem is.
- Fixed a bug where the background image resizing code will fail if the original images are marked as "Read Only".
- Moved all Strings used in the Resizer into a String Database and converted the UI to use the MVVM model. This was done to make it easier to translate the program's text into other languages.
- 1.2022.4.0
- Release date: 1 May 2022
- Added an option to patch the game's EngText file to have the correct resolution numbers displayed in the Display settings menu.
- Added support for the English CD versions of the game published by Sierra and Sold Out.
- Modified image editing code so that it gives a single message box with a list of any missing images after patching, rather than one separate message box for every missing image.
- Changed UI colour scheme from the drab grey to a brown scheme that more closely matches the colours used by the game.
- 1.2022.2.0
- Release date: 1 February 2022
- Added an option to stretch the menu images to the size of the game's window instead of adding a black border around them.
- Changed the maximum resolution limits so that they are actually 2x bigger than the game's usable UI rather than ~2.01x.
- 1.2022.1.0
- Release date: 31 January 2022
- Initial release.
Contact info
You can find me at the following places under the username XJDHDR:
Credits
My thanks goes to:
- God for creating us all and everything else.
- Nexus Mods for providing an excellent place for modders to upload their work.
- JackFuste for creating many of the original widescreen fixes for this game.
- Mario for describing how he made his widescreen fixes.
- IcySon55 for his contributions towards adding the ability for my program to modify the games' EngText files.
- Vadim_Panenko for creating the increased sprite limit modifications.
Tools used
- JetBrains Rider - C# IDE
- SmartGit - Git client
- IDA Free - Disassembler and Debugger
- HxD - Hex editor
- Notepad++ - Text editor
- LHammonds' Readme Generator - Provided the template this readme follows.
- Jetbrains WebStorm - HTML, CSS and JS editor.
- Firefox - Test the webpages I created.
- 7-Zip - Compressed archive creation and extraction
Licensing and Legal
This program is licensed under a Modified BSD 4-Clause license and it's terms may be found here.
Though you are technically allowed to redistribute the files you downloaded without restriction, please can you talk to me about uploading the file elsewhere before doing so. I might be interested in doing so myself.