Ads keep us online. Without them, we wouldn't exist. We don't have paywalls or sell mods - we never will. But every month we have large bills and running ads is our only way to cover them. Please consider unblocking us. Thank you from GameBanana <3

Fog editing - A Tutorial for Sonic Adventure 2

This tutorial will cover how to change the colour, distance from camera, thickness of fog and how to insert fog files into levels that don't currently have one (i.e. Green Forest and Pumpkin Hill). Some levels have multiple fog files for different areas, this tutorial will NOT cover howto add/remove multiple areas of fog in one level, simply editing existing ones using a hex editor. Also the images supplied should have all the information you need to figure things out.

1. What you'll need:

A hex editor to change values, what we'll be changing is a very short segment always at the start of a file so please don't be put off by this requirement it's not too hard, here's a link to HxD:

To get hex codes for colours go here:

Finally to get level IDs to choose the correct file and to force insert one go here:

Fog doesn't impact the sky-box so you may have to edit the sky-box textures to get the right 'look', try: by PaRappa64 if you don't know how to edit textures.

2. What to edit in an existing file:

You only need to edit the values in the purple box, some fog files have a lot of data after. Honestly if you know how to edit hex already the information I've figured out in this example should be all you need to edit files.

Also save backups, more important than ever as you can't 'undo' any saved changes in HxD. To find you fog file go to your SA2 installation and the directory: resource > gd_PC and any file name "stgXX_fog" is an existing fog file, where 'XX' is the stage number (i.e. stg22_fog is Crazy Gadget). Some levels have no files (see how to force insert one below) or multiple with A, B and sometimes C denominations. For example Metal Harbour (stage 10) has a 'B' used for the rocket flight.

2.1. Changing the colour:

Value 05, 06 and 07 are always the colour of the fog. Click on 05 and type the 6 digit colour code and HxD will overwrite the next 6 digits (rather than pushing along) then simply save. You can simply exit and reload a level in-game to see any differences, same with all edits except forcing in fog files.

2.2. Changing the strength:

Note I don't know why this works the way it does but do note this will drastically change how strong the fog is, if you want subtle changes use other methods. Take value 08 and change it to somewhere between 46 and 43 depending on what you need - of if you want to go crazy go outside those bounds, check the images below for comparison sake.

The first 4 hex values represent, from what I can gather, a sort-of 'code' that also impacts strength less severely, change them to match one of the 5 used-in-game codes (or maybe some valid unused ones?) to get the following change (based on a "45" base strength):

2.3. Changing the distance:

This time you'll want to input a UInt8 value (right-hand side of Hex editor) in hex 09, click on 09 then click on the value in the UInt8 value to change to desired number (does NOT matter if it's set to 'Big' or 'Small' endian below, none of these changes impacted by that). Distance is a number between 0 to 255, with "0" being the closest. Along with strength and the 'code' of sorts you'll want to combine these 3 values for your desired atmosphere. 

(Also please excuse my tardiness I got max and min mixed up in the next image)

3. Forcefully inserting a fog file:

Super easy just take any other fog file, make a copy and rename it to what the level missing one's name would've been (i.e. for Green Forest "stg03_fog") and insert it into the gd_PC folder. You will have to restart the game to see this change, of course as always just edit the colours etc. in the hex editor to get it 'right'. 

Note fog does not impact the sky-box, you'll want to edit the sky box textures to prevent a miss-match.

Presumably you can just delete files to remove fog too but that wont do for mods so just insert a blank one (highlight all data and delete / press back space).


Difficulty Level