Tutorial: Removing the Fog of War effect

Information and discussion for custom maps and mods.
Post Reply
Daz
Posts: 4
Joined: Mon Aug 05, 2002 3:41 pm

Tutorial: Removing the Fog of War effect

Post by Daz »

I noticed this had been asked for by a couple of people and the developers suggested it wasn't something they were interested in providing an option for so I thought I'd post this up.

The fog and its effects can be removed via a mod with some very simple .yaml editing.

What do I need?

You need a mod that includes the system.yaml, defaults.yaml, aircraft.yaml and vehicles.yaml files which are all under the rules folder.
Those files could just be edited in the ra mod but I recommend backing up both the original files and your own modified files as you may wish to restore the former for online play and the latter may be replaced when a new OpenRA version is released.

You'll need a text editor to edit the .yaml files. Notepad doesn't seem to lay the files out correctly but Wordpad works. Personally I use Notepad++.

Editing system.yaml.

Open system.yaml in your text editor.

Search for the word "fog" or manually go to line 151.

We're interested in these three lines:

Code: Select all

ShroudPalette@fog:
		IsFog: yes
		Name: fog
Delete the three lines of code. We now need to tell the game what to do instead of the deleted code when it starts looking for a section named fog.

Just above the ShroudPalette@fog: section is this section

Code: Select all

	PaletteFromRGBA@disabled:
		Name: disabled
		R: 0
		G: 0
		B: 0
		A: 180
Copy the above and paste it where the "ShroudPalette" code was.
Replace the two instances of "disabled" with "fog", this tells the game that this bit of code is the bit relating to fog.
Change the value for A from 180 to 0, this sets the alpha value for the fog to zero which means completely transparent.

Your code should now read:

Code: Select all

	PaletteFromRGBA@fog:
		Name: fog
		R: 0
		G: 0
		B: 0
		A: 0
Do a search for "HiddenUnderFog", you should find this line under the "FLARE" section.

Code: Select all

HiddenUnderFog:
Delete this line, removing it tells the game not to hide the relevant entities when they're under fog.

This concludes the editing of system.yaml, so save and close it.

Editing defaults.yaml.

Open defaults.yaml in your text editor.

You need to remove all instances of two lines of code.
The first line we're interested in is:

Code: Select all

HiddenUnderFog:
Removing this tells the game not to hide the relevant entities (and their inheritors, i.e. the actual units) when they're under fog.

The second line we're interested in is:

Code: Select all

GpsDot:
Removing this line tells the game not to draw a dot for units under fog when you have a GPS Satellite, it causes a crash if you remove the "HiddenUnderFog" lines but leave the "GpsDot" lines so it needs to be removed.

There are six instances each of these two lines to remove from the defaults.yaml file. The easiest way is to run a search on them.

When you have removed all six instances of each line of code you can save and close defaults.yaml.

Editing vehicles.yaml.

Do a search for "GpsDot" and remove the line:

Code: Select all

GpsDot:
There is only one instance of the code in vehicles.yaml, once you've removed it you can save and close the file.

Editing aircraft.yaml.

Do a search for "GpsDot" and remove the line:

Code: Select all

-GpsDot:
There are two instances of the code in aircraft.yaml, once you've removed both you can save and close the file.

You can now run the game (remember to run the mod that you've made the changes to) and there will be no fog of war effect at all in the main window. The radar screen displays the visual effect where the fog should be but units will still be visible.
[align=center]
Image
[/align]

beedee
Posts: 94
Joined: Mon Sep 06, 2010 5:02 am
Location: Wellington
Contact:

Post by beedee »

This is technically an exploit, unless everyone agrees to using these changes I highly suggest you don't use them on pain of everyone hating your guts.

It also runs the risk of causing desynchronization due to an inconsistent game state across players.

Daz
Posts: 4
Joined: Mon Aug 05, 2002 3:41 pm

Post by Daz »

I'm assuming people realise you need the same version of the game to play with each other online, if you don't that's quite a large oversight in development.

This is also the modding section of the forum, if modding the game is an exploit why have a modding section or make the game modable at all?
Last edited by Daz on Sat Jul 30, 2011 7:23 pm, edited 1 time in total.
[align=center]
Image
[/align]

User avatar
riderr3
Posts: 98
Joined: Sat Feb 26, 2011 11:26 pm
Location: Camo pillbox
Contact:

Post by riderr3 »

Some kind of hack :P

beedee
Posts: 94
Joined: Mon Sep 06, 2010 5:02 am
Location: Wellington
Contact:

Post by beedee »

Daz wrote: I'm assuming people realise you need the same version of the game to play with each other online, if you don't that's quite a large oversight in development?

This is also the modding section of the forum, if modding the game is an exploit why have a modding section or make the game modable at all?
I know this isn't clear but you aren't meant to directly hack on the core mod files to mod the game, you're supposed to create a separate mod that uses the core mods as a base and overrides their behaviour. Directly changing the files in the way you've outlined above leads to the same problems that the original RA had when someone modified their rules.ini without sharing it with the other players. The only way we could really deal with this is doing some sort of hash check on all the mod files during the lobby handshake and reject connections that don't match but this isn't something we've got around to implementing yet.

chrisf
Posts: 246
Joined: Mon Sep 06, 2010 4:59 am

Post by chrisf »

It might be worth making sure that HiddenUnderFog contributes to the synchash.

Generalcamo
Posts: 50
Joined: Sun Sep 26, 2010 12:06 am

Post by Generalcamo »

Instead of this hackish way, why not get the devs to implement a fog of war checkbox?

Daz
Posts: 4
Joined: Mon Aug 05, 2002 3:41 pm

Post by Daz »

Generalcamo wrote: Instead of this hackish way, why not get the devs to implement a fog of war checkbox?
Because they've already said they're not interested in doing so in previous threads on the matter.
[align=center]
Image
[/align]

knivesron
Posts: 93
Joined: Wed Aug 10, 2011 5:05 am

Post by knivesron »

i followed your instructions and it dident seem to work for me, it just booted as normal ra does

Post Reply