Archived

This topic is now archived and is closed to further replies.

vaneger

200,000 combatants question

Recommended Posts

im working on making a civilization/age of empires/warcraft hybrid style game and im not sure how to deal with having armies of 100,000 per side plus allies. im pretty sure 100 thousand pointers would cramp the RAM just a bit. i am intending on using differnt unit types to stand for larger numbers of fighters but im not sure how big i can have them before memory cant take it . so is there a way to just be able to use all 200 thousand fighters or how should i break it up?

Share this post


Link to post
Share on other sites
That is a bit lofty of a goal for a real-time game. Most commercial RTS games that I have played so far only use a few thousand units at most. They may have a single unit that represents a squadron, but the individuals are treated more like hitpoints than individual units, i.e: You attack the armored cavalry regiment, and kill 15 cavalrymen, but it just looks like a single wounded cavalryman to the player that now has half the attack-damage potential.

100,000 pointers isn't really a big problem, however, it's if you have a seperate large structure for eacb one that it becomes a problem. 100,000 pointers takes up less than 1MB of data. If the majority of those pointers point to small structures it shouldnt be THAT big of a problem to manage. You could have all of the grunts share a common chunk of memory, and then have a few items that are specific to each unit. FOr instance, you could store the x,y coordinates, orientation and a handful of state flags for each unit, and only use a few MB of RAM. It's the processing that will kill you, not the RAM.

Peace


[edited by - krippy2k on January 4, 2004 11:24:47 PM]

Share this post


Link to post
Share on other sites
Sounds like you want to have something that looks like an army of 200.000 That doesn't mean you have to keep 200.000 objects in memory. You pointed that out yourself already (and so did Krippy2k). I think it can be done but you would have to make a lot of compromises.

It all comes down to how realistic you want the battle to be. Are you going to use good physics? What about the AI? All units (either being a single swordsman or an entire regiment) should be updated. But there are different things to update. It is obvious that you should draw them every frame. They should also move every frame. But you don't have to update there AI every frame. You can also choose to update the AI of 10.000 units per frame. It will take 20 frames to update all the units but nobody will notice. Inbetween frames units would just have to remember what their last decision was, like move to point (23, 30), or attack that enemy soldier.

You can also use level of detail techniques. If you'r viewing the battle from a birds eye view you really don't care that a soldier swings his sword even when he's not hitting anything. It's just an animation playing. But when you zoom in real close you'll want to see every little detail. That creates the illusion that the whole battle has that kind of detail, while the AI behind it is actually very simple.

[edit] typo's, paragraphs [/edit]

[edited by - Rule on January 5, 2004 6:30:02 AM]

Share this post


Link to post
Share on other sites
quote:
Original post by vaneger
im not sure how big i can have them before memory cant take it .

Memory won''t be the problem - processing time will be. If you want each unit/person to behave individually and not as part as a pack then you''re going to suck up a lot of time just making everybody move. And if they''re not going to move individually (let face it, with armies that big one person on their own isn''t going to have much of an effect) then just group them into squads of about 10 or 20 and you''re already massivly reduced your load on both memory and processor time.

Share this post


Link to post
Share on other sites