Processing 1000s of AI objects
I am trying to work out / calculate the feasibility and some of structure and logic of a game before I go all out into it.
What I am trying to work out is how can I manage, track and store the data for 1000s of AI active objects. The game will have 2 screens, a map and combat screen. The combat screen will process you vs ai, up to 3000 objects being rendered with AI.
However the map consists of a 50 x 50 grid = 2500 combat zones.
There will be AIs running which are building units and having their own conflicts in these zones which are unseen but you can navigate to them and watch or send your own units to join in (if you get there in time).
So in theory there could be 100s of grid zones having battles taking place, and only one of them will be visible and active with you interacting with it. Each unit can move to target, combat wont start till in range etc, even have strategic logic attached to the AI.
I also need to maintain state via load and save, I'm thinking dump all variables to xml and parse it for this.
What is the best way to structure and process this amount of data? How much can be / is typically handled by games like this?
Any suggestions? Any information is much appreciated.
asked Aug 04 '16 at 11:40 AM in Using UE4
The off-screen battle's
For these battle's you can just make a calculation for them based on units (which one defeats which one) for example: if 1 horseman can kill 2 swordsmen before dying and:
If Group A attacks Group B in theory Group A should win with 1 horseman left,
The on-screen battle
is a bit more complex and interesting, first you have to list up what you want your AI to be able to do and search the choke points that will be hard for the computer to process and write down/search the way to fix these issues.
One that might be a choke point is the AI path-finding and decision-making.
Take a look at the game Overlord and the Mount and Blade series, they have something similar.
Good luck with your project, sounds very interesting! Keep us updated!
Hope this helps you further a bit :)
Thanks for the information Elias, useful.
My thinking so far is:
World 1000 to 5000 grid system
Player and AIs 0 to 10,000 variable incrementers based on max possible static unit builds (timer is every 60 seconds) 0 to 5,000 calculations on 60 second tick for time based calculation (unit build time etc), AI will run on this also Max static non ai calculating units: 15,000 Max active units units player and per ai: 1000 (groups of approx 150, est 20 path calculations per group) AI Decisions when player is within n tiles of AI will evaluate every 15 seconds, 60 seconds on other
This is max possible end game values, I doubt maximums would be hit however. Weighted random creation of grid zones and what is in each already greatly reduce those numbers, limiting what the player and the AI can have in each grid.
Too much? Do you think this would be too much load on the CPU? Is there any way I can load any of this on the GPU? Would it be beneficial? Multi-threading, is there anything to spread load of available CPU cores? Would I need to build a system that detects and handles this or is there one built into UE4?
answered Aug 08 '16 at 12:47 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here