# \[TUTORIAL\] Fog Of War

**URL:** <https://forums.unrealengine.com/t/tutorial-fog-of-war/18222>\
**Category:** World Creation\
**Tags:** unreal-engine\
**Created:** [January 3, 2015, 8:44pm UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222 "2015-01-03T20:44:57Z")\
**Posts on this page:** 20\
**Page:** 6

<div class="post-metadata">

**Author:** ![stunder](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@stunder](https://forums.unrealengine.com/u/stunder)\
**Post date:** [January 30, 2016, 5:33pm UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222/101 "2016-01-30T17:33:07Z")

</div>

Well, i dont know, never had problems with replications, but now… Clients always get black fowtexture =\_=

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_02adf4fd](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_02adf4fd](https://forums.unrealengine.com/u/anonymous_user_02adf4fd)\
**Post date:** [February 1, 2016, 11:19am UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222/102 "2016-02-01T11:19:35Z")

</div>

> [@Alexarg;463708](#):
>
> @anonymous_user_02adf4fd thanks for this, this is very helpful and well explained.  
> A question, I am having some heavy fps oscillation, that cause i believe, a noticeable stuttering.  
> Are any of you having this kind of effect? It is expectable? My rig is pretty good. I’m using w10, so maybe could be related to that.
> 
> Thanks again!!

Alexarg,

I had major fps-oscilliations with fow-texture sizes set to 2048, though none at 1024. I would guess i depends a bit on your rig. Another user also reported “lag” on win10, but none i compatability mode. I use Windows 10 (and DX11) though I haven’t had any fps drops. I wouldn’t know what to do except update your gpu-drivers and possibly try setting the texture size to 512.

Cheers,

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_02adf4fd](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_02adf4fd](https://forums.unrealengine.com/u/anonymous_user_02adf4fd)\
**Post date:** [February 1, 2016, 11:30am UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222/103 "2016-02-01T11:30:55Z")

</div>

> [@;463667](#):
>
> Hello! I got strange problem, FOW dont work in packaged game… Do u have any ideas?

Hi ,

which platform are you packaging for? I’ve only tested 64-bit windows builds which seem to work. On other platforms, I have no idea. As for networking, I’ve no experience developing networked games so there’s no out of the box-support for multiplayer features. If I were to look into it, I think the easiest way to do it is to have each client own the Fow-manager and spawn a Fow-worker-thread, calculate the fog and update local textures. If you aim to have the server do all of the fow-work, you’d probably have to create a worker thread on the server per connected client, replicated the textures to the client when they’re updated and make the client update the post-process shader. To make it work properly and efficiently would require a major rewrite.

Cheers,

---

<div class="post-metadata">

**Author:** ![FAZIC](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/fazic/32/465016_2.png) [@FAZIC](https://forums.unrealengine.com/u/FAZIC)\
**Post date:** [February 6, 2016, 6:03pm UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222/104 "2016-02-06T18:03:03Z")

</div>

Thank you for good guide^\_^

---

<div class="post-metadata">

**Author:** ![ClaudioPiccinni](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ClaudioPiccinni](https://forums.unrealengine.com/u/ClaudioPiccinni)\
**Post date:** [February 25, 2016, 6:17pm UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222/105 "2016-02-25T18:17:27Z")

</div>

Amazing work mate, congrats.  
And thank you for sharing.

---

<div class="post-metadata">

**Author:** ![Heoki](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Heoki](https://forums.unrealengine.com/u/Heoki)\
**Post date:** [March 10, 2016, 1:54am UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222/106 "2016-03-10T01:54:28Z")

</div>

Has anyone been able to get this working in 4.11? My problem is that it’s not showing up. The whole map is revealed. I am using the same project from 4.9 that had it working.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_02adf4fd](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_02adf4fd](https://forums.unrealengine.com/u/anonymous_user_02adf4fd)\
**Post date:** [April 7, 2016, 10:53am UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222/107 "2016-04-07T10:53:33Z")

</div>

> [@Heoki;490195](#):
>
> Has anyone been able to get this working in 4.11? My problem is that it’s not showing up. The whole map is revealed. I am using the same project from 4.9 that had it working.

Heoki,

I upgraded from 4.10 to 4.11 without any problems. Maybe post #65 adresses your problem. I would advise you to do some debugging around the Event OnFow Texture Updated.

Cheers,

---

<div class="post-metadata">

**Author:** ![Heoki](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Heoki](https://forums.unrealengine.com/u/Heoki)\
**Post date:** [April 10, 2016, 4:06am UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222/108 "2016-04-10T04:06:02Z")

</div>

Ah, I just tried in 4.11.1 and its working again. It hadn’t been working on any previous version of 4.11 that I’ve tried.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b467b02b](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b467b02b](https://forums.unrealengine.com/u/anonymous_user_b467b02b)\
**Post date:** [April 12, 2016, 7:29am UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222/109 "2016-04-12T07:29:01Z")

</div>

Hi!  
Thanks for an awsome tutorial. I got it to work for a RTS multiplayer game and all is good 🆒

Though i can’t wrap my head around how to change color of the “not-in-visual” fog parts. We wouild lika to have a more greyish tone to different the in-game props shadows and the FOW. I changed the textures in the Material Instance with no succes. Any idea?

Thanks

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_02adf4fd](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_02adf4fd](https://forums.unrealengine.com/u/anonymous_user_02adf4fd)\
**Post date:** [April 13, 2016, 6:36am UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222/110 "2016-04-13T06:36:44Z")

</div>

> [@State128;511094](#):
>
> Hi!  
> Thanks for an awsome tutorial. I got it to work for a RTS multiplayer game and all is good 🆒
> 
> Though i can’t wrap my head around how to change color of the “not-in-visual” fog parts. We wouild lika to have a more greyish tone to different the in-game props shadows and the FOW. I changed the textures in the Material Instance with no succes. Any idea?
> 
> Thanks

Hi,

You can change the lightness/darkness of the shroud of darkness by altering the 100-value in the code here:

```auto

else {
	sum += (Manager->blurKernel* * 100);
}

```

and here:

```auto

else {
	Manager->TextureData[x + y * signedSize] = FColor((uint8)100, (uint8)100, (uint8)100, 255);
	}

```

Cheers,

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b467b02b](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b467b02b](https://forums.unrealengine.com/u/anonymous_user_b467b02b)\
**Post date:** [April 13, 2016, 9:47am UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222/111 "2016-04-13T09:47:32Z")

</div>

Thanks for a quick answer. I think my questions was kind of unclear, my apologies 🙂

We need to alter the Color, to make it more whiteish or greenish. As i interpretate your answer it only affects the black alpha color.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_02adf4fd](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_02adf4fd](https://forums.unrealengine.com/u/anonymous_user_02adf4fd)\
**Post date:** [April 13, 2016, 10:44am UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222/112 "2016-04-13T10:44:20Z")

</div>

> [@State128;511866](#):
>
> Thanks for a quick answer. I think my questions was kind of unclear, my apologies 🙂
> 
> We need to alter the Color, to make it more whiteish or greenish. As i interpretate your answer it only affects the black alpha color.

I see. One way to handle it is to do a small rewrite since the horizontal blur data is stored as Uint8 and not FColor. That rewrite would quadruple the memory footprint of the buffer (which isn’t necessarily terrible but should be avoided). Alternatively you could maybe create some kind of color-gradient or curve where 0 grades to black 127 grades to the color of your choice and 255 grades towards white (fully unveiled). Then in this line:

```auto

Manager->TextureData[x + y * signedSize] = FColor((uint8)sum, (uint8)sum, (uint8)sum, 255);

```

you’d use “sum” as the input for your curve, and the resulting RGB instead of sum. I’d have to experiment a bit with the math to get it “right” maybe with an S-curve or something semi-fancy, though you could probably get by using linear interpolation.  
Some pseudo code would be:

```auto

if(sum < 127) {
  transform 0->127 to 0->1
  lerp from black to the color of your choice
} else {
  transform 128->255 to 0->1
  lerp from the color of your choice to black
}

```

You’d probably also want to change the current alpha for the shroud of darkness from 100 to 127 for the “color of your choice” to match more excactly.

Cheers,

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b467b02b](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b467b02b](https://forums.unrealengine.com/u/anonymous_user_b467b02b)\
**Post date:** [April 13, 2016, 4:14pm UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222/113 "2016-04-13T16:14:44Z")

</div>

Nice! I’ll have a go at it when i find some time. Really appreciate ur effort mate. If i get something working I’ll post it here later.

Have a good one.

---

<div class="post-metadata">

**Author:** ![ClaudioPiccinni](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ClaudioPiccinni](https://forums.unrealengine.com/u/ClaudioPiccinni)\
**Post date:** [April 17, 2016, 9:25am UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222/114 "2016-04-17T09:25:18Z")

</div>

Hi ,  
is there any sample project for versions 4.10 o 4.11? I’m not being able to build/upgrade the one provided in #29 with my 4.10 version.  
I’m no c++ freshman, but still I’m mortified to admit that I’m very unexperienced with the whole ue4 c++/api implementation, and I’m having difficulties implementing the code you provided in the main post.

Specifically, how do you create FRunnable classes? I can find the new Actor class, but nothing that hints to multi-thread/thread/runnable classes.  
If I just copy/paste FogOfWarManager’s cpp/h files into a New Actor, then I can’t compile because it’s missing the FogOfWarWorker.  
And if I paste FogOfWarWorker’s cpp/h files into an Empty Class I get these errors when compiling:

```auto

CompilerResultsLog:Error: Error FogOfWarManager.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: unsigned int__cdecl FRHIResource::AddRef(void)const " (__imp_?AddRef@FRHIResource@@QEBAIXZ) referenced in function "public:__cdecl TRefCountPtr<class FRHITexture2D>::TRefCountPtr<class FRHITexture2D>(class TRefCountPtr<class FRHITexture2D> const &)" (??0?$TRefCountPtr@VFRHITexture2D@@@@QEAA@AEBV0@@Z)
CompilerResultsLog:Error: Error FogOfWarManager.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: unsigned int__cdecl FRHIResource::Release(void)const " (__imp_?Release@FRHIResource@@QEBAIXZ) referenced in function "public:__cdecl TRefCountPtr<class FRHITexture2D>::~TRefCountPtr<class FRHITexture2D>(void)" (??1?$TRefCountPtr@VFRHITexture2D@@@@QEAA@XZ)
CompilerResultsLog:Error: Error FogOfWarManager.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void__cdecl FRHICommandListImmediate::UpdateTexture2D(class FRHITexture2D *,unsigned int,struct FUpdateTextureRegion2D const &,unsigned int,unsigned char const *)" (__imp_?UpdateTexture2D@FRHICommandListImmediate@@QEAAXPEAVFRHITexture2D@@IAEBUFUpdateTextureRegion2D@@IPEBE@Z) referenced in function "public: void__cdecl `public: void __cdecl AFogOfWarManager::UpdateTextureRegions(class UTexture2D *,int,unsigned int,struct FUpdateTextureRegion2D *,unsigned int,unsigned int,unsigned char *,bool)'::`5'::EURCMacro_UpdateTextureRegionsData::DoTask(enum ENamedThreads::Type,class TRefCountPtr<class FGraphEvent> const &)" (?DoTask@EURCMacro_UpdateTextureRegionsData@?4??UpdateTextureRegions@AFogOfWarManager@@QEAAXPEAVUTexture2D@@HIPEAUFUpdateTextureRegion2D@@IIPEAE_N@Z@QEAAXW4Type@ENamedThreads@@AEBV?$TRefCountPtr@VFGraphEvent@@@@@Z)
CompilerResultsLog:Error: Error FogOfWarManager.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static enum ENamedThreads::Type__cdecl FRenderCommand::GetDesiredThread(void)" (__imp_?GetDesiredThread@FRenderCommand@@SA?AW4Type@ENamedThreads@@XZ) referenced in function "private: void__cdecl TGraphTask<class `public: void __cdecl AFogOfWarManager::UpdateTextureRegions(class UTexture2D *,int,unsigned int,struct FUpdateTextureRegion2D *,unsigned int,unsigned int,unsigned char *,bool)'::`5'::EURCMacro_UpdateTextureRegionsData>::SetupPrereqs(class TArray<class TRefCountPtr<class FGraphEvent>,class TInlineAllocator<4,class FDefaultAllocator> > const *,enum ENamedThreads::Type,bool)" (?SetupPrereqs@?$TGraphTask@VEURCMacro_UpdateTextureRegionsData@?4??UpdateTextureRegions@AFogOfWarManager@@QEAAXPEAVUTexture2D@@HIPEAUFUpdateTextureRegion2D@@IIPEAE_N@Z@@@AEAAXPEBV?$TArray@V?$TRefCountPtr@VFGraphEvent@@@@anonymous_user_e71e0d8a?$TInlineAllocator@$03VFDefaultAllocator@@@@@@W4Type@ENamedThreads@@_N@Z)
CompilerResultsLog:Error: Error FogOfWarManager.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static enum ESubsequentsMode::Type__cdecl FRenderCommand::GetSubsequentsMode(void)" (__imp_?GetSubsequentsMode@FRenderCommand@@SA?AW4Type@ESubsequentsMode@@XZ) referenced in function "public: static class TGraphTask<class `public: void__cdecl AFogOfWarManager::UpdateTextureRegions(class UTexture2D *,int,unsigned int,struct FUpdateTextureRegion2D *,unsigned int,unsigned int,unsigned char *,bool)'::`5'::EURCMacro_UpdateTextureRegionsData>::FConstructor __cdecl TGraphTask<class `public: void__ cdecl AFogOfWarManager::UpdateTextureRegions(class UTexture2D *,int,unsigned int,struct FUpdateTextureRegion2D *,unsigned int,unsigned int,unsigned char *,bool)'::`5'::EURCMacro_UpdateTextureRegionsData>::CreateTask(class TArray<class TRefCountPtr<class FGraphEvent>,class TInlineAllocator<4,class FDefaultAllocator> > const *,enum ENamedThreads::Type)" (?CreateTask@?$TGraphTask@VEURCMacro_UpdateTextureRegionsData@?4??UpdateTextureRegions@AFogOfWarManager@@QEAAXPEAVUTexture2D@@HIPEAUFUpdateTextureRegion2D@@IIPEAE_N@Z@@@SA?AVFConstructor@1@PEBV?$TArray@V?$TRefCountPtr@VFGraphEvent@@@@anonymous_user_e71e0d8a?$TInlineAllocator@$03VFDefaultAllocator@@@@@@W4Type@ENamedThreads@@@Z)
CompilerResultsLog:Error: Error FogOfWarManager.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) class FRHICommandListImmediate &__cdecl GetImmediateCommandList_ForRenderCommand(void)" (__imp_?GetImmediateCommandList_ForRenderCommand@@YAAEAVFRHICommandListImmediate@@XZ) referenced in function "public: void__cdecl `public: void __cdecl AFogOfWarManager::UpdateTextureRegions(class UTexture2D *,int,unsigned int,struct FUpdateTextureRegion2D *,unsigned int,unsigned int,unsigned char *,bool)'::`5'::EURCMacro_UpdateTextureRegionsData::DoTask(enum ENamedThreads::Type,class TRefCountPtr<class FGraphEvent> const &)" (?DoTask@EURCMacro_UpdateTextureRegionsData@?4??UpdateTextureRegions@AFogOfWarManager@@QEAAXPEAVUTexture2D@@HIPEAUFUpdateTextureRegion2D@@IIPEAE_N@Z@QEAAXW4Type@ENamedThreads@@AEBV?$TRefCountPtr@VFGraphEvent@@@@@Z)
CompilerResultsLog:Error: Error FogOfWarManager.cpp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) class FRHICommandListExecutor GRHICommandList" (__imp_?GRHICommandList@@3VFRHICommandListExecutor@@A)
CompilerResultsLog:Error: Error FogOfWarManager.cpp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) bool GIsThreadedRendering" (__imp_?GIsThreadedRendering@@3_NA)
CompilerResultsLog:Error: Error FogOfWarManager.cpp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) bool GMainThreadBlockedOnRenderThread" (__imp_?GMainThreadBlockedOnRenderThread@@3_NA)

```

---

<div class="post-metadata">

**Author:** ![Sneppy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Sneppy](https://forums.unrealengine.com/u/Sneppy)\
**Post date:** [April 26, 2016, 8:24am UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222/115 "2016-04-26T08:24:54Z")

</div>

Tutorial was fantastic, thanks a lot!

> [@](#):
>
> Specifically, how do you create FRunnable classes? I can find the new Actor class, but nothing that hints to multi-thread/thread/runnable classes.

Did you manage to compile?  
FRunnable is a base class declared in Core/Public/HAL/ThreadingBase.h; you simply want to create an empty class and extend FRunnable. When you use the “new c++ class” wizard from the editor just select none as parent class (but if you choose Any other parent class and copy/replace the entire code it will work fine).  
The compilers error are probably caused by the fact that you didn’t include “RHI” and “RenderCore” in the public dependecies modules (file YourProject.build.cs in Source/YourProject folder) and the UpdateTextureRegions function as unresolved links.

> [@](#):
>
> 1. Open the file named MyProject.Build.cs
> 2. Locate line PublicDependencyModuleNames.AddRange(new string] { “Core”, “Engine”…
> 3. Add the strings “RHI”, “RenderCore” to the array.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_a2509f6c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_a2509f6c](https://forums.unrealengine.com/u/anonymous_user_a2509f6c)\
**Post date:** [April 30, 2016, 11:30pm UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222/116 "2016-04-30T23:30:54Z")

</div>

Hi I have 0 experience in C++, I have updated Build.CS, I created 2 new C++ Classes with no parent, and copy past info from post #1. when I try to build in VS I get the following errors  
(1)  
Severity Code Description Project File Line Suppression State  
Error The first include statement in source file ‘D:\GameDesign\GameJamWorkSpace\MyProject4\Source\MyProject4\FogOfWarManager.cpp’ is trying to include the file ‘RpgTest.h’ as the precompiled header, but that file could not be located in any of the module’s include search paths. MyProject4 D:\GameDesign\GameJamWorkSpace\MyProject4\Intermediate\ProjectFiles\EXEC 1

(2)  
Severity Code Description Project File Line Suppression State  
Error MSB3073 The command ““C:\Program Files (x86)\Epic Games\4.11\Engine\Build\BatchFiles\Build.bat” MyProject4Editor Win64 Development “D:\GameDesign\GameJamWorkSpace\MyProject4\MyProject4.uproject” -waitmutex -2015” exited with code -1. MyProject4 C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets 37

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_02adf4fd](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_02adf4fd](https://forums.unrealengine.com/u/anonymous_user_02adf4fd)\
**Post date:** [May 2, 2016, 7:46am UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222/117 "2016-05-02T07:46:59Z")

</div>

> [@anonymous\_user\_8ce2497dnoVoxel;522493](#):
>
> Hi I have 0 experience in C++, I have updated Build.CS, I created 2 new C++ Classes with no parent, and copy past info from post #1. when I try to build in VS I get the following errors  
> (1)  
> Severity Code Description Project File Line Suppression State  
> Error The first include statement in source file ‘D:\GameDesign\GameJamWorkSpace\MyProject4\Source\MyProject4\FogOfWarManager.cpp’ is trying to include the file ‘RpgTest.h’ as the precompiled header, but that file could not be located in any of the module’s include search paths. MyProject4 D:\GameDesign\GameJamWorkSpace\MyProject4\Intermediate\ProjectFiles\EXEC 1
> 
> (2)  
> Severity Code Description Project File Line Suppression State  
> Error MSB3073 The command ““C:\Program Files (x86)\Epic Games\4.11\Engine\Build\BatchFiles\Build.bat” MyProject4Editor Win64 Development “D:\GameDesign\GameJamWorkSpace\MyProject4\MyProject4.uproject” -waitmutex -2015” exited with code -1. MyProject4 C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets 37

@,

In FogOfWarManager.cpp the third code line reads:

```auto

#include "RpgTest.h"

```

This is the include to the main header file of your project. You’ll have to change this to the name of the “main header file” of your project. Looking at your error message, my best guess is that it’s called “Myproject4.h” on your end.

Cheers,

---

<div class="post-metadata">

**Author:** ![ClaudioPiccinni](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ClaudioPiccinni](https://forums.unrealengine.com/u/ClaudioPiccinni)\
**Post date:** [May 7, 2016, 11:24am UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222/118 "2016-05-07T11:24:44Z")

</div>

> [@Sneppy;519774](#):
>
> Tutorial was fantastic, thanks a lot!
> 
> Did you manage to compile?  
> FRunnable is a base class declared in Core/Public/HAL/ThreadingBase.h; you simply want to create an empty class and extend FRunnable. When you use the “new c++ class” wizard from the editor just select none as parent class (but if you choose Any other parent class and copy/replace the entire code it will work fine).  
> The compilers error are probably caused by the fact that you didn’t include “RHI” and “RenderCore” in the public dependecies modules (file YourProject.build.cs in Source/YourProject folder) and the UpdateTextureRegions function as unresolved links.

Thank! I did not add RHI and RenderCore modules!

---

<div class="post-metadata">

**Author:** ![Rama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rama/32/882413_2.png) [@Rama](https://forums.unrealengine.com/u/Rama)\
**Post date:** [May 22, 2016, 2:09am UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222/119 "2016-05-22T02:09:25Z")

</div>

> [@anonymous\_user\_964c5f2d;452316](#):
>
> Hey man, that’s super nice of you to give thanks. As for multi-threading and dynamic texture creation in UE4, I learned both topics from tutorials so he should get at least 85% of the gratitude 🙂

I just saw this thread!

This is an incredible sharing @anonymous\_user\_964c5f2d, thanks!

And it looks great too!

Congratulations on this awesome implementation!

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/d/5/1d57a8e5169943feabcbbb4ae09aceedd074b46f.jpeg) ](https://www.mediafire.com/convkey/a416/xh2a0w6qocsc9xb6g.jpg?size_id=3)

Rama

---

<div class="post-metadata">

**Author:** ![orgertot](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@orgertot](https://forums.unrealengine.com/u/orgertot)\
**Post date:** [June 1, 2016, 3:57pm UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222/120 "2016-06-01T15:57:18Z")

</div>

Hey so im no c++ profi.  
I just c&p every thing in and added these RHI and RenderCore.  
But now I have 200+ errors.

It starts with “FogOfWarManager.generated.h” couldnt be opened. Where did i miss to generate this?

Thanks

[Previous page](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222.md?page=5)

[Next page](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222.md?page=7)
