🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Do You Know..............

Started by
6 comments, last by Soulz 21 years, 9 months ago
Do you know how much CPU time a program that just simulates a town of about 3000 Pop would take up if the program runs templates for each type of person E.G working man/woman house man/woman kids and the templates just outline its main quest like Working man/woman - sleep,food,giveing kids $ etc.. its for a rpg but i want to make it so when u go to a town it runs it self so if try waiting in a black smith it will close and the smith go home. ok im confused what bout you... any way i dont want to start this project if the puters cant handle that much ? Thx Im a Idiot Savant without the Savant
Im a Idiot Savant without the Savant :)
Advertisement
There is absolutely no way to answer that question without knowing how the agent functionality is going to be implemented.

Timkin
"agent functionality is going to be implemented."
????? not sure what u mean but if it was just the templates to fallow eg "after waking up go to work then after work go get food then sleep etc" ...... manly i want to know if funning a ai on 10000 ai''s would take too much cpu time????

sorry if i cant explain it better... thx for the info
The amount of CPU time taken by 10,000 AI characters would be the sum of the total time taken by each. If each character only thinks once per second you would have 1/10000th second (100 microseconds) of CPU time for each one to do it''s thinking. If the AI routines took more than 100 microseconds for each entity to think, then you''d be spending 100% of the CPU time just doing AI stuff and have nothing left for rendering or doing anything to interact with a player.

Of course, each character only thinking once per second may be WAY to slow for a real-time FPS game, but would be more than adequate for a turn based role playing game.

The type of game, how often you want the AI characters to think and how long each think function would take will determine how many AI characters you can have in the game (of course you will also have to account for any graphics rendering time as well).

botman
quote: Original post by botman
The amount of CPU time taken by 10,000 AI characters would be the sum of the total time taken by each.


...plus the overhead of managing 10,000 agents, which we can assume scales linearly with the number of agents.

Cheers,

Timkin

THX For all the info .....
.
.
Timkin remember "I''m a Idiot-savant WITHOUT the savant" but i think i understand what you are saying thx for the help

Im a Idiot Savant without the Savant
Im a Idiot Savant without the Savant :)
_IF_ programmed well, you can handle 10,000 agents easily. Keep in mind that each agent spends a lot of time just tooling around in their shop or at home. Their day could be planned once per game day, would only have to make a decision once every few minutes while they''re not in action and then have constant focus when in action. Normally, you''d only have about 10% of the agents in motion.

Computers these days have more than enough power to do this. I''ve managed to handle over 8000 units in motion with bounding-box collision detection. Without optimizations, this runs about 40 fps on a P4 1.4GHz. So, I''m sure you can handle 1000 or so simultaneous moving objects with graphics, full AI, etc. I''ll run some tests for ya...

500 units = 200 fps
1000 units = 190 fps
2000 units = 140 fps
3000 units = 105 fps
4000 units = 75-80 fps

This is on the P4 1.4GHz. This is with very simple 2D graphics and not much else. It''s in realtime with utilities loaded in for stress testing and some pretty complex physics. Other than that, it''s pretty bare bones.

- Jay

Get Tranced!
Quit screwin' around! - Brock Samson
You can''t really set an exact value for the cpu time that would be used. Simply adding up the time it takes for one would not work due to the fact that they would interact and this would add extra time. Even the interaction cannot be added simply, as it is based on which people and how many each character encounters. You could probably get a rough estimate based on population and population density, depending on what depth you want the AI to have, but it would only be a rough estimate and the figures would be a pain to figure out. The best way to figure out is probably to try a small system and build it up. You would have to do a little of this anyway to try and get a function for figuring the rough estimate, and this way you will know when you''ve pretty much reached the maximum of what the computer can handle.
mentalrotation@cox.net

This topic is closed to new replies.

Advertisement