Download

Battle simulation on server in UE instance or differently?

Hey, first of all I’m super sorry for the incredibly vague title, but I don’t know how else to word it. You’ll understand in a second.

I’m currently pre-producing a game that revolves around controlling many villages in a medieval environment, and one part of the game is going to be attacking other villages.

When attacking a village, you create an “attack plan”, which is basically you putting troops in a certain pattern so they act the way you desire. Once your troops have reached the destination village, a battle will begin. The troops you sent will try and follow your attack strategy and the defender’s troops will do the same on his side.

Now to the complicated part. In order to prevent cheating, I’d very much like the battle simulation to run on a server. Troop logic is very simple, they would just find the nearest hostile troop and attack it. There will however be varying terrain (I was thinking 2 or 3 maps so villages can be different), so they’ll need to use a little bit of pathfinding. Also, replays of the fight should be able to be viewed by the defender and the attacker.

The only solution I came up with as of right now, is creating a separate instance of UE4 on the server every time a battle is supposed to happen, have that instance play out the battle, save the replay and submit the results to the database.

I know how to do that already. I don’t need help with that. However, I would very much like a simpler method, since I’m thinking running many UE4 instances isn’t the most optimal way to go about this problem. Is there a way to have one singular UE4 instance run many fights simultaneously? I.e. have different levels loaded that each play out a fight?

I should maybe mention that this would run on a Linux server with no graphical interface. If there’s another method that doesn’t involve UE4 running on the server at all, but still allows for replays to be watched, I’d be happy to hear about it.

Thanks for your help!