Game Development Community

Spawning An Army...

by James Laker (BurNinG) · in Torque Game Engine · 04/16/2004 (12:07 am) · 8 replies

Sooo many questions..

Is it possible to spawn bots randomly in a area...
Eg... I'm trying to make my an army of about a 200 bots (Not
sure if this is possible)...

Now, I want them to spawn them in an area.... Is there a way to do this easily by making an "area" of some sort and randomly spawning them there? Or should i go place a crapload SpawnSpheres?

Also... After the bots are spawned... I need them to run down
a hill aka Braveheart style... Again... can i make them run
to an Area? And Can i Make them choose random Paths, rather than
telling them to use a specific one?

Another thing... Is there a way to become a bot? eg... Pressing
"/" swaps you to the next bot...

hehe... writing Thread i'm starting to think this should be
easy...
Thanx in advance
James

#1
04/16/2004 (1:00 am)
Look this thread for a better spawning process:

http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=2347

It shouldn't be difficult to change it so your bots are spawned randomly in an area, even a rectangular one (well, it's an army...)

Here's a thread for the bot snatching process ;)

http://www.garagegames.com/mg/forums/result.thread.php?qt=5274


Making them run into an area, following a 'straight line', shouldn't be difficult :m Just a 'setMoveDestination' inside a specific area, delimited by markers or something like that...



And about the 200bots... well, they are quite a lot :) I've 10, but on a scene that is quite complex and my bots don't have multiple resolutions. On a simpler scene, I have used 50 bots (just a terrain with some .dts shapes scattered around). My bots have 900 polygons... If you use simpler bots you may reach a nice number...


If your battle idea is the same as mine, it's a nice one! :D
#2
04/16/2004 (1:34 am)
Thanx a lot...
Hehe... I doubt that its the same ;)
My bots are dumb... the way i like it... Then
I don't have bad feelings after killing 'em all :D

My bots has LOD in as well... So i hope that helps...
I seriously need about 200bots... I was hoping for 1000...

My bots need only a few simple rules:
Run->PlayerBase
If BotSees->Player && BotIsArcher 
   StandStill_And_Shoot
ElseIf BotIsFootman
   If BaseReached
     Hit->PlayerBase
   End If
End if

If only Code was this simple.... ;)
But i think i'll have to dig in the code to make them
more stupid... Me when i just downloaded the Engine :)

Cheers
James
#3
04/16/2004 (7:20 am)
Wow... I imagine you are planning a really good middle age battle! That's something I will try someday too.

Instead of drawing those 1000 soldiers, you may use some tricks. Have you ever seen any Dynasty Warriors game? They are really simple. There may be more than 2000 soldiers in a battlefield, but there's a heavy fog which hides everything, so 100m away from you there's nothing to see, nothing to draw. You will need something like that if you want a thousand soldiers to hack'n'slash around :)

However, if your soldiers' LOD is properly done, you may be able to avoid the fog, which is not a nice solution. Anyway, the heavy computational load comes from the collision among so many objects. You could avoid the collision check for those soldiers that are too far away...

Have you already tested something? I remember I used 100 LightMaleHumanArmor models on a simple mission (just terrain and a small .dif) on an old GeForce2...
#4
04/16/2004 (7:53 am)
Might consider making a version of the existing fxShapeReplicator to replicate AI players insted of static shapes.
#5
04/16/2004 (11:31 am)
You will want to rewrite the collision and movement code for the AIs. In my experiments, cutting that down gave some HUGE performance benefits.
#6
04/19/2004 (12:19 am)
Luis: Its actually a few battles, that take place in different eras.

1: Ancient Apeman time
2: Early Medieval
3: Roman Times
4: The Invention of gun powder (1600 - 1700)
5: Early 1900 (Around World War I, II)
6: Modern day

And it's not normal battles... Cant really say more ;) We are reaching our first phase (of 7) of our game.

I spawned 500 Bots... and it still runs alright (nothing runs smooth on my P4 2.4ghz with Super crap onboard Screencard).

John: are there any improvements over the shape replicator than
placing the trees one by one? I never really noticed anything?
Maybe i should start looking at it... Hoped i didn't have to go to code at all... Oh well...

Ben... i'm no guru... Is that gonna be hard to do? The collision
sounds hard... :( isn't that what makes the bots stay above ground, etc?

Thanx for the input guys!
Me
#7
04/19/2004 (12:31 am)
As luis said what you could do is use a different collision mask (i.e so they only collide with terrain) when they are x distance from the player, presumeably to far to see them clearly. even let them run through each other if your not gonna see it. I think only checking for terrain collision to maintain the 'ground' level would considerably increase the performance.
#8
04/19/2004 (1:24 am)
Hmmmm... That actually makes sense to me, Westy...
I could probably let them only colide with my projectiles and
terrain...
Yippee... The bottleneck in my brain has broken :)