3 registered members (7th_zorro, Aku_Aku, 1 invisible),
579
guests, and 1
spider. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Zombie spawning OR Procedurally Populated Environment
#317452
03/31/10 19:16
03/31/10 19:16
|
Joined: Oct 2002
Posts: 806
Zapan@work
OP
User
|
OP
User
Joined: Oct 2002
Posts: 806
|
Hi, we want to create many zombies at runtime for our current game project (zombie-fps). These zombies should spawn always in regions which the player can not see at the current position. We want to do it like Left4Dead did it. Valve published a nice paper how they did it here: http://www.valvesoftware.com/publications/2009/ai_systems_of_l4d_mike_booth.pdfThere is a so-called "AAS" Active Area Set which we should also use. But how do we create such a thing? Has anyone a good idea besides "entity-trace-test"-things?
Last edited by Zapan@work; 03/31/10 19:17.
|
|
|
Re: Zombie spawning OR Procedurally Populated Environment
[Re: Zapan@work]
#317536
04/01/10 07:44
04/01/10 07:44
|
Joined: Sep 2005
Posts: 980 Aue, Sachsen, Germany
Wicht
User
|
User
Joined: Sep 2005
Posts: 980
Aue, Sachsen, Germany
|
Divide your Level into small cubes. Example: Use the position of the camera and the look-vector to determine the hit cubes. Each spawnpoint can create the enemies except the spawnpoints inside of the hit cubes. The calculation could be multithreaded.
|
|
|
Re: Zombie spawning OR Procedurally Populated Environment
[Re: Damocles_]
#317576
04/01/10 11:29
04/01/10 11:29
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
My idea kindof depends on the process you use to decide what co-ordinate to spawn at. Let say you just have a function that picks random locations throughout your level to spawn at. This function can choose a random co-ordinate (at ground level), check to see if th co-ordinate is inside the view fustrum, and abort this co-ordinate if it IS inside the view area. The check you can use to see if the co-ordinate is in view is this,
...
VECTOR tmp_vec; vec_set(tmp_vec, spawn_vector);
if(!vec_to_screen(tmp_vec, camera))
{
//create a zombie at vector "spawn_vector"
//it cannot be seen by the camera because of angle
}
else if(tmp_vec.z >= clip_far)
{
//create a zombie at vector "spawn_vector"
//it cannot be seen by the camera because of distance
}
else
{
//DONT create a zombie because vector "spawn_vector"
//CAN be seen by camera
}
...
This is just an idea. Untested concept and coding...
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Zombie spawning OR Procedurally Populated Environment
[Re: Wicht]
#317607
04/01/10 13:49
04/01/10 13:49
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
There will probably be many opinions on this, its up to you. IMHO, hundreds of little spawns will be 'messy' at map design time, and possibly CPU hungry, but it may be suitable in some cases...
My preferred option is yours. Create some invisible & passable 2d models that "fit" various sections of flat/open ground. This includes inside buildings etc. By open I mean no furniture, walls, etc. These are your spawn regions. Their actions will spawn zombies in random locations within that region. One action per region spawning random numbers of zombies based on the region size. As each zombies is 'spawning', you can use something like my previous code to see if its 'safe' to spawn there. If it passes the "in-sight" test, then spawn the sombie and instantly get it to do a c_rotate of 360 degrees. If it hits anything, UN-spawn that zombie.
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Zombie spawning OR Procedurally Populated Environment
[Re: EvilSOB]
#320775
04/24/10 14:41
04/24/10 14:41
|
Joined: Aug 2004
Posts: 1,305 New York
PrenceOfDarkness
Serious User
|
Serious User
Joined: Aug 2004
Posts: 1,305
New York
|
to be honest this seems sort of easy to me... I would setup spawn points where the zombies would be allowed to spawn through out the level. Then I'd have the player emit a c_scan. All the spawn points would be some sort of invisible block or something and when scanned it would check if:
A) It can see the player B) If it's to far away (B could be eliminated by adjusting the c_scan.
I'm going to be using something like this for my RPG. I will have a bunch of spawn spots through out my level, or just 1 spawn spot per room.
"There is no problem that can't be solved with time and determination." -me prenceofdarkness for instant messages on AIM.
Looking for a model designer PLEASE, SEND ME A PRIVATE MESSAGE OR EMAIL IF YOU'RE INTERESTED.
|
|
|
|