- [Train Simulator 2015] Change Resolution (to Anything!)
- 17 Jun 2015 11:15:37 pm
- Last edited by KermMartian on 19 May 2018 12:20:56 pm; edited 1 time in total
I recently bought Train Simulator 2015 in the summer Steam Sale. It had been on my to-buy list for quite some time, and $7 for the game plus three content packs seemed like a good investment to me. I was particularly excited to feel like I was driving a real train with my five-monitor, wrap-around desktop: my five monitors combine to create a virtual display space about 68" diagonal and 4400x2100 pixels. Unfortunately, when I installed Train Simulator 2015 and started it up, I found that the largest resolution it offered was about 1680x1050. Never one to easily accept defeat, I set about the task of figuring out how to modify the resolution to a custom value.
The Problem: Finding the Resolution Setting
Most modern Windows programs store settings in one of two places: the registry or the AppData folder. The registry is a huge collection of data used by Windows and by installed programs, containing information about preferences, devices, file associations, registration keys, and so much more. The AppData folder, contained in your C:\Users\Username\ directory, contains configuration files, screenshots, cached data and files, and so on. However, in hours of searching, I couldn't figure out where Train Simulator 2015 was storing its resolution settings. I couldn't find any relevant settings in the registry or anywhere in AppData. I even tried a differential analysis: I saved a copy of the registry, opened TS2015 and changed the resolution, closed it, then saved another copy of the registry and diffed it against the first copy, to no avail.
The Solution: PlayerProfiles.bin
Thanks to this thread on the Steam community forums, I found out that the PlayerProfiles.bin file in the TS2015 Contentdirectory holds the current player profile. Inside that file are a series of settings, each mapping a key (like ScreenResX, ScreenResY, or FullScreen) to a value (like 800, 600, or 1). If you try to open the file in a text editor, it will look garbled; in order to parse and modify it properly, you'll need a hex editor. I recommend the venerable XVI32 if you're using Windows. If you open [Your Steam Directory]\steamapps\common\RailWorks\Content\PlayerProfiles.bin using XVI32 and begin looking through the contents, you'll see that almost all of the entries are formatted as follows:
Code:
You can change any of these values directly in XVI32 by double-clicking on the hexadecimal value you want to change (such as 44 11 00 00, the horizontal resolution of 4420 pixels) and typing in the new value. Once you have changed any value(s) you wish to change, simply save the file and re-launch Train Simulator. Experimentally, I've found that if you set the ScreenResY value above 2200 pixels, Train Simulator will reset to a default resolution such as 1024x768 pixels.
4-byte key string length
key string
2-byte value length
integer value
4-byte guard
Setting your TS2015 Resolution
You'll want to change up to three settings: ScreenResX, ScreenResY, and FullScreen. Each value is a four-byte integer, stored little-endian, meaning that the least significant byte is stored first. If you're not familiar with converting numbers to hexadecimal, you can use Windows Calculator in programming mode ([Alt][3]) for the task. If you want to set an arbitrary windowed size, you'll want to set FullScreen to 0 (00 00 00 00); if you want to keep the game full-screened, set it to 1 (01 00 00 00) instead.
Setting the X and Y resolution:
1) Convert the value (for example, 4420 pixels) to a 32-bit hexadecimal number (like 0x00001144). This has four bytes: 00 00 11 44.
2) Turn the integer into a little-endian value by reversing the order of the bytes (but not the digits within each byte). For example, 44 11 00 00.
3) Using XVI32, find the text that corresponds to the setting you want, such as ScreenResX. In the hexadecimal view (the left-hand pane), you'll see 04 00 after the text, indicating an integer 4 bytes long. Change the four bytes directly after the 04 00 to the sequence of four bytes you computed in step (2).
4) The final sequence of bytes after the string ScreenResX in this example would be 04 00 44 11 00 00 FF 56 FF FF: 4 bytes, then the 4-byte value 0x00004420, then the 4-byte guard FF 56 FF FF. When you've made your change, save the file, close XVI32, and re-launch Train Simulator 2015.
Conclusion
I hope this helps you! If you have any questions, please feel free to post them in this topic, and I'll do what I can to help.
The Problem: Finding the Resolution Setting
Most modern Windows programs store settings in one of two places: the registry or the AppData folder. The registry is a huge collection of data used by Windows and by installed programs, containing information about preferences, devices, file associations, registration keys, and so much more. The AppData folder, contained in your C:\Users\Username\ directory, contains configuration files, screenshots, cached data and files, and so on. However, in hours of searching, I couldn't figure out where Train Simulator 2015 was storing its resolution settings. I couldn't find any relevant settings in the registry or anywhere in AppData. I even tried a differential analysis: I saved a copy of the registry, opened TS2015 and changed the resolution, closed it, then saved another copy of the registry and diffed it against the first copy, to no avail.
The Solution: PlayerProfiles.bin
Thanks to this thread on the Steam community forums, I found out that the PlayerProfiles.bin file in the TS2015 Contentdirectory holds the current player profile. Inside that file are a series of settings, each mapping a key (like ScreenResX, ScreenResY, or FullScreen) to a value (like 800, 600, or 1). If you try to open the file in a text editor, it will look garbled; in order to parse and modify it properly, you'll need a hex editor. I recommend the venerable XVI32 if you're using Windows. If you open [Your Steam Directory]\steamapps\common\RailWorks\Content\PlayerProfiles.bin using XVI32 and begin looking through the contents, you'll see that almost all of the entries are formatted as follows:
Code:
[<- Len ->] [<---------- Key ---------->] [Len] [<-Value->] [<-Guard?>]
0A 00 00 00 53 63 72 65 65 6E 52 65 73 58 04 00 44 11 00 00 FF 56 FF FF
0x000A = 10 "ScreenResX" 4 0x1144=4420 ---
4-byte key string length
key string
2-byte value length
integer value
4-byte guard
Setting your TS2015 Resolution
You'll want to change up to three settings: ScreenResX, ScreenResY, and FullScreen. Each value is a four-byte integer, stored little-endian, meaning that the least significant byte is stored first. If you're not familiar with converting numbers to hexadecimal, you can use Windows Calculator in programming mode ([Alt][3]) for the task. If you want to set an arbitrary windowed size, you'll want to set FullScreen to 0 (00 00 00 00); if you want to keep the game full-screened, set it to 1 (01 00 00 00) instead.
Setting the X and Y resolution:
1) Convert the value (for example, 4420 pixels) to a 32-bit hexadecimal number (like 0x00001144). This has four bytes: 00 00 11 44.
2) Turn the integer into a little-endian value by reversing the order of the bytes (but not the digits within each byte). For example, 44 11 00 00.
3) Using XVI32, find the text that corresponds to the setting you want, such as ScreenResX. In the hexadecimal view (the left-hand pane), you'll see 04 00 after the text, indicating an integer 4 bytes long. Change the four bytes directly after the 04 00 to the sequence of four bytes you computed in step (2).
4) The final sequence of bytes after the string ScreenResX in this example would be 04 00 44 11 00 00 FF 56 FF FF: 4 bytes, then the 4-byte value 0x00004420, then the 4-byte guard FF 56 FF FF. When you've made your change, save the file, close XVI32, and re-launch Train Simulator 2015.
Conclusion
I hope this helps you! If you have any questions, please feel free to post them in this topic, and I'll do what I can to help.