npruehs / ue4-rts

Real-time strategy plugin and showcase for Unreal Engine 4.
MIT License
747 stars 151 forks source link

Fog Of War - Change outside field of vision to dark instead of gray #134

Closed coolyoshi closed 4 years ago

coolyoshi commented 4 years ago

I think it would be useful to have an option to change the fog of war to something similar to Warcraft 3 where areas outside field of vision are just slightly darker:

fogofwargoals

Or if anyone knows how to implement this any help would be greatly appreciated

Zimbo1786 commented 4 years ago

Hi @coolyoshi ,

This can be done through C++ in the RTSFogofWar.cpp in this section:

        case EStratVisionState::VISION_Known:
            FogOfWarTextureBuffer[iBlue] = 0;
            FogOfWarTextureBuffer[iGreen] = 255;  ----- this line you can change to darken the known fog. Say 110.
            FogOfWarTextureBuffer[iRed] = 0;
            FogOfWarTextureBuffer[iAlpha] = 0;
            break;

It could probably also be done in the Fog of War material in the UE4 editor, but I preferred through C++.

Hope that helps.

coolyoshi commented 4 years ago

@Zimbo1786

That did the trick, you actually saved me. Edited the value in C++ and it looks perfect.

Thanks so much for the help

Zimbo1786 commented 4 years ago

No worries @coolyoshi - glad to have been able to help out.

npruehs commented 4 years ago

This should already be part of the plugin; there are three different vision states: