Widescreen Gaming Forum

[-noun] Web community dedicated to ensuring PC games run properly on your tablet, netbook, personal computer, HDTV and multi-monitor gaming rig.
It is currently 17 Dec 2024, 22:50

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: 29 Jan 2006, 03:47 
Offline

Joined: 12 Nov 2005, 09:10
Posts: 4
TUTORIAL: How to change the resolution within your "Simcity4 Deluxe" config file to something widescreen. Along the way you'll learn some basics about hex editing.

Inspired by Komoto.

There are three things you need to do before starting.

First, you need a Hex editor program. I use a program called EditPad, which gets the job done and is free. I'll be using this editor from here on out.

Second, MAKE A BACKUP OF YOUR CONFIG NOW! I found my config file under My DocumentsSimcity 4.

Third, start up Simcity4 Deluxe and go to the settings menu when the region map loads up. Set the resolution you're playing at to 1600x1200. You have to do this because after some trial and error I discovered it was only possible to change the config file if it had been last saved at 1600x1200.

Now open up your SC4 Deluxe config file in EditPad.

Onced opened, change view to hexidecimal (Ctrl-H). You should see a screen like this:



Ignore the first and last columns. We want to focus on the two main columns in the middle with all the numbers/letters grouped in 2's. These are hexidecimal numbers in all their glory! Each 'group' represents a numeric value from 0 to 255. What are those letters doing there? The letters represent numbers greater than 9. 'A' stands for 10, B for 11, C for 12, D for 13, E for 14, and F for 15. Add the numbers symbols (0-9) and letter symbols (A-F) together and we get 16 total symbols used to represent numbers in hexidecimal. Hex- stands for 6, dec- stands for 10, put those words together and you get hexidecimal. Brilliant! You can also probably figure out from this that our "base 10" number system (just using the symbols 0-9 to represent numbers) is called decimal. Brilliant!

Before going on, let me explain some syntax stuff I will use concerning hexidecimal numbers. Ordinary old decimal numbers are written like you've always done, just the numbers themselves. However, when we programmers write hex numbers in code, we precede them with two characters, a 0 and an x. The '0x' is just a marker, nothing more. It's so the computer doesn't get confused as to whether the programmer, when he typed 10, meant decimal 10 or hexidecimal 10 (both have very different values!). Programmers also like hex numbers to be in groups of 2's, 4's, and 8's, even if the leftmost numbers are zeroes which you'd normally drop in the decimal system. This is to make many numbers placed side by side easier to read. So, a 9 in hex is written 0x09. A 10 in hex is written 0x0A, an 11 = 0x0B, and so on. A 10 in hex could also be written 0x000A, or 0x0000000A, and would mean exactly the same thing.

To clarify a bit on hexidecimal numbers, in case you're still a little confused. It is best to think of the letters as just symbols and nothing more. To make this clear with an example, think what happens when we add 1 + 15. In hexidecimal this is 0x01 + 0x0F. The answer is 0x10. Notice the F resets to 0 and the left number goes up by one, just like in decimal when 19 + 1 = 20. Going from here, we see that 0x10 = 16, 0x11 = 17, 0x20 = 32, 0x30 = 48, up to 0xFF which stands for 255. Add one more to 0xFF and we get 0x0100, or 256.

Now that we understand hexidecimal numbers a bit more, let's see what we need to do with this config. What we're going to do is look for the numbers in the file that represent the resolution 1200x1600, and replace them with our custom resolution. Just for sake of this tutorial this custom res is going to be 1680x1050, the size of my monitor.

First things first, we need to convert 1600x1200 to hexidecimal. Do you know these values off the top of your head? Neither do I. So open up your trusty Windows calculator and change the view mode to scientific. Make sure that the radio button labeled 'Dec' is selected. Type 1600 into the calc, and click the Hex radio button (see below).



What you should see is '640', or, correctly written, 0x0640. Convert 1200 to hex and we get 0x04B0. While we're here let's get the decimal equivalent of our custom resolution. This comes out to be 0x0690 (1680) by 0x041A (1050). So, the replacement we're going to be doing in our config is:

0x0640 -> 0x0690
0x04B0 -> 0x041A

To make it clearer as the what this find/replace looks like in EditPad, let me display the numbers in the block sequences of 2's like we see in the editor:

[06] [40] -> [06] [90]
[04] [B0] -> [04] [1A]

All I've done is divide the numbers into groups to make is clearer what the blocks would look like in the editor. So is that it? Can I search and replace now? Well...go ahead, see if you can find either of those sequences in the config file you've loaded up. You won't be successful though, as there's one more thing you need to know about.

Numbers, when stored in a file, are placed in reverse order in groups of 2's. So, when we go searching for the number 0x0640 in EditPad, it's not going to be in the block sequence [06] [04] like we'd expect. The blocks are going to be switched, and so we need to look for the sequence [04] [06] (in that order!).

Putting this all together, than means the replacement will instead look like this:

[40] [06] -> [90] [06]
[B0] [04] -> [1A] [04]

Notice that within the block the digit order has NOT changed, just the order of the blocks themselves.

A screenshot showing what blocks are going to be changed:



A screenshot showing the blocks, after they have been changed:





Now you are ready! Search and replace the blocks as show above, save, then load up Simcity 4 in your new resolution.


Top
 Profile  
 


PostPosted: 31 Jan 2006, 15:26 
Offline

Joined: 01 Jun 2004, 15:33
Posts: 46
Ah, the scientific calculator! Vewy twicky.

When I hacked Vampire Bloodlines, I parsed the dll for the 1280 string and then added in the hex for 720 to replace 1024 (so no 1280x1024 res ingame anymore, 1280x720 replaced it). It was cheesy and kludgy, but it worked!


Top
 Profile  
 
PostPosted: 22 Mar 2009, 14:59 
Offline

Joined: 22 Mar 2009, 04:59
Posts: 26
Numbers, when stored in a file, are placed in reverse order in groups of 2's. So, when we go searching for the number 0x0640 in EditPad, it's not going to be in the block sequence [06] [04] like we'd expect. The blocks are going to be switched, and so we need to look for the sequence [04] [06] (in that order!).


I know this is an old FAQ, but seeing how it is also posted in the How-To Wiki, it should probably be fixed.

The [04] mentioned in this paragraph should be [40].


Top
 Profile  
 
PostPosted: 23 Mar 2009, 11:09 
Offline
User avatar

Joined: 24 Dec 2006, 18:56
Posts: 764
Ok, I've fixed it in the wiki, thanks for this fix :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  




Powered by phpBB® Forum Software © phpBB Group