# \[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:** 3

<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 19, 2015, 8:31am UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222/41 "2015-05-19T08:31:20Z")

</div>

> [@marksomnian;286192](#):
>
> Hi,  
> For some reason the FOW is running in the editor and everything is black. Could you shed some light as to why this could be?

Hi,  
I think you’re experiencing the same setup issue as DragonHunt10. Have you gone through the steps i posted in post #29? Pay particular attention to:

1. The FOW\_Mat\_Instance material must have PP\_Fow\_Mat as its parent. Set both of the Texture Parameter Values to a plain white texture.

If your whole scene is black it means that the post-process is projecting a black texture on your scene, which is the equivilant to having your whole scene fogged. Changing the textures to a white texture will reveal the scene.

Hope that helps,

---

<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 19, 2015, 8:40am UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222/42 "2015-05-19T08:40:38Z")

</div>

> [@Grizz;286632](#):
>
> Hey nice work, but I am having trouble getting it to run. I am new to C++ so this might be a noob mistake. I just want to implement it in the top down template and see if I can modify it to fit my project. First, when I created the project I need to include the header file of the FogOfWarWorker in the FogOfWarWorker.cpp since otherwise it gives me an error at the top. When I try to compile after this Manager-\>GetWorld() gives me an error that says “Error: pointer to incomplete class type not allowed”. The only thing different in my code is the project name I also didn’t start this as a c++ project but as a blueprint project, would that even make a difference? If I ever get to implement part of this you would get the credit of course 🙂

Hi,

There is no need to include FogOfWarWorker.h in FogOfWarWorker.cpp, rather include your project header-file (mine is called RpgTest.h, yours probably has a different name), and include FogOfWarWorker.h in your project header file. I’m unsure of whether it matters if you start your project as a blueprint or c++ project. I startet mine from the Top Down template as well and just added coded through the “Add code to project”-option in the editor. If you want to take a look at a working sample, there’s a link in post #29 which should be fairly stripped down.

If you continue to struggle, I could probably take a look at your project if you make it available to me.

Cheers,

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_863d5d18](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_863d5d18](https://forums.unrealengine.com/u/anonymous_user_863d5d18)\
**Post date:** [June 13, 2015, 2:01pm UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222/43 "2015-06-13T14:01:36Z")

</div>

Hi, looks very well, but how install it? Sure i can make all these .h and .cpp files, but what about linking it to blueprints? Should i recteate it from scratch with images or here’s just that sample project from video with things installed already? Or any other kind out of the box solution?

---

<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:** [June 16, 2015, 11:47am UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222/44 "2015-06-16T11:47:14Z")

</div>

> [@happyhorror;310481](#):
>
> Hi, looks very well, but how install it? Sure i can make all these .h and .cpp files, but what about linking it to blueprints? Should i recteate it from scratch with images or here’s just that sample project from video with things installed already? Or any other kind out of the box solution?

You could either recreate from scracth or download an example implementation in post #29.

Cheers,

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_863d5d18](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_863d5d18](https://forums.unrealengine.com/u/anonymous_user_863d5d18)\
**Post date:** [June 29, 2015, 1:53am UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222/45 "2015-06-29T01:53:02Z")

</div>

> [@;312477](#):
>
> You could either recreate from scracth or download an example implementation in post #29.
> 
> Cheers,

ty, would be nice put link into 1-st post

i tryed this example and here is my confusion:

i made second player start by copy/past, setted number of players 2 and launched game, first player have correct fog of war, all fine, but second don’t have it at all :(, should i make any additional configuration? in RTS units usually have assigned player who control them and visibility rules between players, also in warcraft 3 there was additionaly rectangle area objects that can have visibility for certain players

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_45c2a24d](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_45c2a24d](https://forums.unrealengine.com/u/anonymous_user_45c2a24d)\
**Post date:** [July 14, 2015, 11:30pm UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222/46 "2015-07-14T23:30:37Z")

</div>

Hi :

I tried this effect, and it looked awesome. The problem is that when I deploy the game on to Android device, it crashed.

In order to get the C++ code built for Android SDK and IOS xcode, the modf function has to use double instead of float.  
The place it crashes is the RHIUpdateTexture2D function call. I am wondering if you can find a way to fix it or go around it?

Thanks,

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_45c2a24d](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_45c2a24d](https://forums.unrealengine.com/u/anonymous_user_45c2a24d)\
**Post date:** [July 14, 2015, 11:43pm UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222/47 "2015-07-14T23:43:24Z")

</div>

Hi :

I successfully got it work on PC and mobile preview view by not using the postprocess component. But when deploy and launch the game on android device, it crashes at RHIUpdateTexture2D function call from the rendering thread. I am wondering if you can figure out a way to fix or go around this problem.

The math function modf(float, float) has to be changed to modf(double, double) for both android and ios.

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:** [July 29, 2015, 7:50pm UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222/48 "2015-07-29T19:50:17Z")

</div>

> [@happyhorror;320750](#):
>
> ty, would be nice put link into 1-st post
> 
> i tryed this example and here is my confusion:
> 
> i made second player start by copy/past, setted number of players 2 and launched game, first player have correct fog of war, all fine, but second don’t have it at all :(, should i make any additional configuration? in RTS units usually have assigned player who control them and visibility rules between players, also in warcraft 3 there was additionaly rectangle area objects that can have visibility for certain players

Hi,

The practical application of this particular FOW-solution for an RTS is way beyond the scope of the tutorial, it is only intended to illustrate a way of graphically handling FOW for a single player. You may, however, register multiple actors to a single FOW-manager by calling AFogOfWarManager::RegisterFowActor(AActor\* Actor) with the desired actor as the parameter.

I’m not entirely sure on what you mean by “in warcraft 3 there was additionaly rectangle area objects that can have visibility for certain players”, though I guess it would be possible to extend the solution to accomodate fogging/unfoggin of other shapes than circles, though I have unfortunately no immeadiate plans to do so.

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:** [July 29, 2015, 8:02pm UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222/49 "2015-07-29T20:02:36Z")

</div>

> [@Li;332500](#):
>
> Hi :
> 
> I successfully got it work on PC and mobile preview view by not using the postprocess component. But when deploy and launch the game on android device, it crashes at RHIUpdateTexture2D function call from the rendering thread. I am wondering if you can figure out a way to fix or go around this problem.
> 
> The math function modf(float, float) has to be changed to modf(double, double) for both android and ios.
> 
> Thanks,

Hi ,

Unfortunately I have no insight into how RHIUpdateTexture2D works on different platforms. Saw your question on the answerhub, and hopefully one of the devs or someone from the community could shed some light on it.

Regarding the modf, I’ve removed the entire line on my end since the “fractions”-variable is unused. For future reference I discovered later a modulo-function in Epic’s math library, FMath::Fmod(float X, float Y) that should probably work hassle-free on all platforms.

Cheers,  
.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_ae3b5ec2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_ae3b5ec2](https://forums.unrealengine.com/u/anonymous_user_ae3b5ec2)\
**Post date:** [August 23, 2015, 10:20pm UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222/50 "2015-08-23T22:20:28Z")

</div>

Hey I would also personally like to just use blueprints but I do know some C++ and i’m taking a course on it in college right now so I guess this would be a good project for me to just go ahead and stick with good ole code i used to make a bunch of mods with allot simpler programming languages like LUA and java. What i’m wanting is gonna need some tweaking so i’m probly gonna most likely be pming you.

---

<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:** [August 24, 2015, 12:54pm UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222/51 "2015-08-24T12:54:41Z")

</div>

> [@Justinroebuck;362625](#):
>
> Hey I would also personally like to just use blueprints but I do know some C++ and i’m taking a course on it in college right now so I guess this would be a good project for me to just go ahead and stick with good ole code i used to make a bunch of mods with allot simpler programming languages like LUA and java. What i’m wanting is gonna need some tweaking so i’m probly gonna most likely be pming you.

Sure, PM away 🙂

---

<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:** [September 2, 2015, 7:02pm UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222/52 "2015-09-02T19:02:06Z")

</div>

Updated material and LevelInfo’s construction script for 4.9.  
To upgrade, change the material node SceneTexture:Color to SceneTexture:PostProcessInput0 and change the construction script of LevelInfo to mimic the screenshot in the main post.

Cheers,

---

<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:** [October 2, 2015, 11:19am UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222/53 "2015-10-02T11:19:48Z")

</div>

Hey man, i cant compile this code, got errors ☹

---

<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:** [October 2, 2015, 11:50am UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222/54 "2015-10-02T11:50:07Z")

</div>

> [@;391487](#):
>
> Hey man, i cant compile this code, got errors ☹

Okay if you could post or PM me the error list I could take a look at it. Please include the engine version you’re compiling with as well.

---

<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:** [October 3, 2015, 1:56pm UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222/55 "2015-10-03T13:56:49Z")

</div>

> [@](#):
>
> \> ╤ючфрхЄё сшсышюЄхър C:\Users\Documents\Unreal Projects\MOBAa\Intermediate/Build/Win64\UE4Editor\Development\UE4Editor-MOBA.lib ш юс·хъЄ C:\Users\Documents\Unreal Projects\MOBAa\Intermediate/Build/Win64\UE4Editor\Development\UE4Editor-MOBA.exp  
> 1\>FogOfWarManager.cpp.obj : error LNK2019: ёё√ыър эр эхЁрчЁх°хээ√щ тэх°эшщ ёшьтюы “\_\_declspec(dllimport) public: unsigned int \_\_cdecl FRHIResource::AddRef(void)const " (\__imp_?AddRef@FRHIResource@@QEBAIXZ) т ЇєэъЎшш “public: \_\_cdecl TRefCountPtr\<class FRHITexture2D\>::TRefCountPtr\<class FRHITexture2D\>(class TRefCountPtr\<class FRHITexture2D\> const &)” (??0?$TRefCountPtr@VFRHITexture2D@@@@QEAA@AEBV0@@Z)  
> 1\>FogOfWarManager.cpp.obj : error LNK2019: ёё√ыър эр эхЁрчЁх°хээ√щ тэх°эшщ ёшьтюы “\_\_declspec(dllimport) public: unsigned int \_\_cdecl FRHIResource::Release(void)const " (\__imp_?Release@FRHIResource@@QEBAIXZ) т ЇєэъЎшш “public: \_\_cdecl TRefCountPtr\<class FRHITexture2D\>::~TRefCountPtr\<class FRHITexture2D\>(void)” (??1?$TRefCountPtr@VFRHITexture2D@@@@QEAA@XZ)  
> 1\>FogOfWarManager.cpp.obj : error LNK2019: ёё√ыър эр эхЁрчЁх°хээ√щ тэх°эшщ ёшьтюы “\_\_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) т ЇєэъЎшш “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)  
> 1\>FogOfWarManager.cpp.obj : error LNK2019: ёё√ыър эр эхЁрчЁх°хээ√щ тэх°эшщ ёшьтюы “\_\_declspec(dllimport) public: static enum ENamedThreads::Type \_\_cdecl FRenderCommand::GetDesiredThread(void)” (\__imp_?GetDesiredThread@FRenderCommand@@SA?AW4Type@ENamedThreads@@XZ) т ЇєэъЎшш “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)  
> 1\>FogOfWarManager.cpp.obj : error LNK2019: ёё√ыър эр эхЁрчЁх°хээ√щ тэх°эшщ ёшьтюы “\_\_declspec(dllimport) public: static enum ESubsequentsMode::Type \_\_cdecl FRenderCommand::GetSubsequentsMode(void)” (\__imp_?GetSubsequentsMode@FRenderCommand@@SA?AW4Type@ESubsequentsMode@@XZ) т ЇєэъЎшш “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)  
> 1\>FogOfWarManager.cpp.obj : error LNK2019: ёё√ыър эр эхЁрчЁх°хээ√щ тэх°эшщ ёшьтюы “\_\_declspec(dllimport) class FRHICommandListImmediate & \_\_cdecl GetImmediateCommandList\_ForRenderCommand(void)” (\__imp_?GetImmediateCommandList\_ForRenderCommand@@YAAEAVFRHICommandListImmediate@@XZ) т ЇєэъЎшш “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)  
> 1\>FogOfWarManager.cpp.obj : error LNK2001: эхЁрчЁх°хээ√щ тэх°эшщ ёшьтюы “”\_\_declspec(dllimport) class FRHICommandListExecutor GRHICommandList” (\__imp_?GRHICommandList@@3VFRHICommandListExecutor@@A)”  
> 1\>FogOfWarManager.cpp.obj : error LNK2001: эхЁрчЁх°хээ√щ тэх°эшщ ёшьтюы “”\_\_declspec(dllimport) bool GIsThreadedRendering" (\__imp_?GIsThreadedRendering@@3\_NA)"  
> 1\>FogOfWarManager.cpp.obj : error LNK2001: эхЁрчЁх°хээ√щ тэх°эшщ ёшьтюы “”\_\_declspec(dllimport) bool GMainThreadBlockedOnRenderThread" (\__imp_?GMainThreadBlockedOnRenderThread@@3\_NA)"  
> 1\>C:\Users\Documents\Unreal Projects\MOBAa\Binaries\Win64\UE4Editor-MOBA.dll : fatal error LNK1120: эхЁрчЁх°хээ√ї тэх°эшї ¤ыхьхэЄют: 9

Engine version - 4.9

---

<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:** [October 3, 2015, 4:38pm UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222/56 "2015-10-03T16:38:16Z")

</div>

> [@;392306](#):
>
> Engine version - 4.9

Hi,  
This looks like a linker error where the build tool is unable to find RHI (Rendering hardware interface)-related classes. I wrote a bit about it in the main post and you’ll have to:

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.

Hopefully it will now compile.

Cheers,

---

<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:** [October 4, 2015, 8:49pm UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222/57 "2015-10-04T20:49:22Z")

</div>

Yeah, its working now.  
I am new in c++, is there any way to register actor to fowmanager by blueprints? Because my actor isnt controlled by player, its controlled by AI (player sending commands to AI), and it spawns not on begin play. I have no idea how to register it by c++ =/

---

<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:** [October 5, 2015, 12:01am UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222/58 "2015-10-05T00:01:09Z")

</div>

– double post –

---

<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:** [October 5, 2015, 12:28am UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222/59 "2015-10-05T00:28:41Z")

</div>

Well, i dont know, but i am getting crash after starting play =\_=

---

<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:** [October 5, 2015, 12:31am UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222/60 "2015-10-05T00:31:01Z")

</div>

Here is a log after crash… Any ideas?

> [@](#):
>
> Access violation - code c0000005 (first/second chance not available)
> 
> “”
> 
> UE4Editor\_Engine!APlayerController::ClientMessage() [d:\unrealengine-release\unrealengine-release\engine\intermediate\build\win64\ue4editor\inc\engine\engine.generated.1.cpp:3869]  
> UE4Editor\_MOBA\_5841!AFogOfWarWorker::Init() [c:\users\documents\unreal projects\mobaa\source\moba\fogofwarworker.cpp:24]  
> UE4Editor\_Core!FRunnableThreadWin::Run() [d:\unrealengine-release\unrealengine-release\engine\source\runtime\core\private\windows\windowsrunnablethread.cpp:66]

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

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