AlphaYellow 40 Share Posted June 4 So, I've noticed nobody talks about modding old games here, so I'll break the tradition. Many people know old games have many issues running on newer monitors with aspect ratios different from what they used to be designed for, like 4:3 and 5:4, including no support for any kind of widescreen or wider resolutions, or when they do, they have a fixed field of view or it gets reduced with a wider resolution. Many old engines have the option to set a widescreen resolution, but just don't expose it to the user through the in-game settings, so editing through the Registry or external .ini/.cfg/.xml files or other similar kind of files might be needed. Usually when it's not possible to edit settings through external files or through Registry, it's needed to edit executables or other files around it directly (usually it can be DLLs, but not only), usually by using softwares that can edit the code in those files in hexadecimal form, like the so-called hexadecimal editors, or hex editors for short. HOW OLD GAMES STORE VALUES RESOLUTION Usually old games use 4-byte integers to store resolutions, so say a game supports 640x480, 800x600, 1024x768 and 1280x960. Each of those resolutions are stored as pairs of two 4-byte integers as hexadecimal numbers, so it means 640x480 is stored as 80 02 00 00 (640) and E0 01 00 00 (480), it might be represented in the file either one after the other (80 02 00 00 E0 01 00 00) or even inverted (E0 01 00 00 80 02 00 00), or even separated by other non-related bytes. Beware that not all games allow setting a custom resolution due to rendering API or engine's memory limitations, those limits might be hardcoded in certain files and might not be easy to fix those issues without experience. ASPECT RATIO For the aspect ratio, games might use a separate value to determine the aspect ratio or it might be tied with the resolution, it varies for every game. Usually games store aspect ratio just by dividing width by the height, so usually it might be 4:3, 5:4 or 3:2 (the values are 1.333333, 1.25 and 1.5 respectively). Although, some engines might determine aspect ratio from a multiplier, it can be a floating point number like 0.5, 0.55, 0.6, 0.75, 0.8, 1,0, or even a higher number like 20, 25, 30, 35, etc. FIELD OF VIEW For field of view, games usually either determine it from the aspect ratio, or might use a separate and different value for it, by using multipliers like 0.25, 0.5, 0.75. 1.0, setting it in degrees (60º, 65º, 70º, etc.), radians or through another kind of formula. EDITING FILES So to start editing files, a hex editor like it was mentioned above is needed. Usually HxD is a good choice, it's not too hard to learn and has all that's needed for a hex editor. 1. First open the file you want to edit on it either by dragging the file onto the HxD window, or press Ctrl+O and open it from there. 2. Then, when the file is opened, it's time to search for values. First press Ctrl+F, this window will appear, if wanting to find a hexadecimal number, change the datatype to "Hex-values", for integer numbers it's "Integer number" and for floating point numbers like those shown in the "Aspect Ratio" section, change it to "Floating point number". 3. Let's take this example for Lego Racers 2. The game only supports the following resolutions by default: 640x480, 800x600 and 1024x768. 5. To find the right resolution, it's needed to find both width and height values that are close enough to eachother in a file. For that, this program made by myself can be used to determine that: https://github.com/alphayellow1/AlphaYellowWidescreenFixes/releases/tag/utilities 6. Put the downloaded executable in the same folder where the game exe is, run it, put the executable name, write one of the resolutions the game supports, set the byte search range to 15 and type Enter. 7. Since the 800x600 resolution has the least amount of close enough pairs in the executable (just 1), we'll go with it. 8. Go back to HxD, press Ctrl+G and search for the address that was found for the width: 0002A912 (just for info, each pair of numbers or letters represents 1 byte, so the highlighted value below is 2 bytes long). 9. 9. Highlight it, then go to the right side of the window in the "Data inspector" tab, and go to the row where it says Int16. 10. Change it to the desired width, and type Enter. 11. Do the same for the height, highlight the value in the right address you found in the program above and change the value in the Int16 row at the right side. Save the file. 12. Now inside the game, we can see the new resolution that was changed earlier above now appears in the graphics settings, but if it doesn't appear, just set it to the one you changed before (so change it to 800x600 and the resolution in-game will change to the one you set in the file). 13. Now during gameplay we can check the proportions look correct but the camera view looks cropped in relation to 4:3, which means the field of view is reduced with wider resolutions, this scaling behavior is called Vert-, because the vertical field of view is reduced to accomodate the new aspect ratio. This means we have to increase it. 14. For the field of view, it was found the game stores FOV values as degrees, and after some experimentation, it's found the value is 90º. Note that in some games, they might store FOV for different areas of the game in more than one place, it might be either the same value as normal gameplay one, or might be a different FOV value altogether, like using one FOV for menus and another FOV for gameplay, or even different FOVs for each mission. For first-person games, they might store a FOV value for the camera and another one different altogether for the weaponmodel. Also cutscenes might have its own FOV assigned to it (either a universal FOV value for cutscenes, or even different FOV values inside the same cutscene, or each type of cutscene having its own FOV), so beware. 15. In HxD, press Ctrl+F, change the tab to "Floating point number" and type 90, change "Search direction" to "All", and click in "Search all". 16. All the found 90 values are listed below: 15. To edit each value, double click on one of the results below, and then go to the right side, and change the value in the "Single (float32)" row. You can try editing each value to a much higher one like 130, noting in which address the value is before changing it (see the second screenshot below this one), then saving the file, starting the game and going into gameplay, and seeing if the FOV became much higher, then if not, closing the game and coming back to HxD, changing the value back to 90 in the address you noted before, and going to the next value and doing the same process again until the camera FOV changes in-game. 16. It won't take long to find out it's the second value responsible for the camera FOV ingame, highlight it and change the value according to WSGF's FOV calculator: https://www.wsgf.org/fovcalc.php . Leave it as it is, and change the "number of monitors across" to 1, and change the resolution to the desired one above (in my case it's 1920x1080). 17. Copy the value after where it says "New hFOV =", only copy the number in bold. Also note that if the standard FOV isn't 90º but another number, you can change the number that is after "Old hFOV:" to that one to get the correct FOV for your aspect ratio. 18. After copying the number in step 17, go back to HxD and paste it in the "Single (float32)" row of the second address that was found in the first screenshot of step 15. 19. Now going back in-game, we can see the resolution and field of view were successfully changed and the game is fixed! ADVANCED EDITING THROUGH MEMORY HACKING If changing resolution or FOV values in files doesn't change anything in-game, then memory scanning/debugging softwares like Cheat Engine and code disassemblers like OllyDbg and x32dbg are needed. I'll expand on this section later. mrpenguinb, nogaems and Orzelek303 2 1 Reply (Quote) Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.