I want to create a game that has tens of thousands of soldiers in a battle. I roughed out the idea a few years ago, and had a situation where 40,000 cubes all moved at the same time, and it runs smoothly. Unfortunately, I’ve lost that code, but I know it’s possible. It’s also computationally possible, because Shogun 2 does this. It has thirty-two thousand and change max soldiers on the screen at a time, and it runs with a good enough PC (for 12 years ago). That’s not unreal engine, but it shows the machine can do it.
I thought the major challenge was the path finding, but I have a solution for that (batching – this part works). Instead, I just can’t remember how to actually move stuff around without slamming the frame rate.
I created a level where 40,000 actors are created at run time, and it runs smoothly. I added code to Add Local Offset every tick, and it runs smoothly. I disabled that code, and added a cube to each actor, and that code runs smoothly (so basically just 40,000 cubes on screen). But when I have 40,000 actors with cubes in them trying to slowly drift across the map, the frame rate drops to about 1.
I’m an experienced programmer, but was about intermediate with UE4 until about 5 years when I stopped playing with it, and now I can’t remember how to do this.
Anybody suggest what I might have done?
edit: whatever they do in sim games might be the answer.
submitted by /u/duncanmarshall
[link] [comments]
Unreal Engine