I’m looking to create a space game with large number of ships flying about to different systems as well as many planets with simulated economies.
Think of Starsector, Bethesda style NPC scheduling and Stellaris.
My goal is maximum performance, I want to simulate potentially thousands of ships and hundreds of economies at the same time. Not every tick of course but every few seconds. Every system would have 5-40 objects.
Many strategy or simulated games struggle with performance when they reach massive scales.
I know it’s early to think about performance but I want to know the pitfalls to avoid and what I should start doing right away.
I’ve already gave it a good amount of thinking how I’d approach this.
I’d create a fully simulated world in the level or star system where the player currently is and a background simulation of every other star system where only the most necessary calculations are performed.
What I want to know is:
1 - How do I even start?
2 - What kind of data structures do I use? Do I use classes (to represent NPC Ships, Planets, Inventory Containers, etc.), pure structs or Json? Do I use a CArray, Inline TArray or just normal TArray?
3 - How do I use Parallelism? Is it handled automatically by Unreal? Do I use a standard library? I’m not familiar in this part of the engine.
4 - Is it possible for this to work with GAS? Ability Components are only for actors that exist in the level? Does GAS perform with thousands of ability components? Should I create a GAS-lite kind of system?
5 - What is the most performant nested container setup (Item inside Inventory inside Ship inside Planet inside Star System)? Are there alternatives?
Though I did find a great post about Multithreading in Unreal which I’ll definitely study