# How can I do some heavy logic processing without freezing my game?

**URL:** <https://forums.unrealengine.com/t/how-can-i-do-some-heavy-logic-processing-without-freezing-my-game/292862>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [September 4, 2014, 11:30am UTC](https://forums.unrealengine.com/t/how-can-i-do-some-heavy-logic-processing-without-freezing-my-game/292862 "2014-09-04T11:30:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![evillego6](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@evillego6](https://forums.unrealengine.com/u/evillego6)\
**Post date:** [September 4, 2014, 11:30am UTC](https://forums.unrealengine.com/t/how-can-i-do-some-heavy-logic-processing-without-freezing-my-game/292862/1 "2014-09-04T11:30:15Z")

</div>

I’m working on a turn based strategy game where the AI will do some very heavy decision making at the beginning of its turn. While this is going on, the game appears to freeze for about a second before continuing. How can I make the game just sit there without the big hiccup while my blueprints are determining what the AI should do during it’s turn? I tried calling the event that starts the AI Turn processing through a timer, but that hasn’t helped. Thank you

---

<div class="post-metadata">

**Author:** ![kat0r](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@kat0r](https://forums.unrealengine.com/u/kat0r)\
**Post date:** [September 4, 2014, 11:35am UTC](https://forums.unrealengine.com/t/how-can-i-do-some-heavy-logic-processing-without-freezing-my-game/292862/2 "2014-09-04T11:35:33Z")

</div>

Do it in another thread?

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...

That would at least not freeze the game, as the gameloop can run while you process. You still have to wait for the results, no way around that.

Edit: I see this is in Blueprint scripting - I do not know if you can do Threading there natively, but it should be possible to do a simple C++ threading part, that just calls your Blueprint code.
