I am doing a turn-based board game in UE4 and I have come to make a first pass to the AI. I had planned to use search in Monte Carlo trees, but this requires you to create (at least) a copy of the game state for each simulation. I guess I will have to do hundreds of simulations per move.
I am pretty new to the UE4 but the problem is that there is not really any separation between sight and logic (at least the way I programmed it!). For example, I have actors that contain their static meshes, their current hardware, etc., as well as their logical state. I think that in UE4, to create a deep copy, I would have to generate new actors, etc. Obviously, in hindsight, I made a serious mistake and I should realize it sooner to be able to switch to another engine, but too late for that. now.
None of the ideas I have suggested are good:
1) Implement a special copy function that defines the static mesh, etc., on nullptr. I do not know how Unreal will react to the creation of all these actors but will not create them in the same level, my experience does not suggest it well.
2) Create AI versions of all classes, for example. an AIUnit class that can be constructed from a normal class of units but initializes only the minimum required data. I think it would work, but it would be painfully inelegant with the obvious disadvantage that I will basically have to maintain two almost identical games and keep the rules synchronized.
MCTS with UE4 does not seem to have a lot of hits on Google, so any advice would be appreciated, I'm willing to sacrifice a timeout, for example. wait 1 second each turn for AI to "think".