Gamestudio Links
Zorro Links
Newest Posts
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
Data from CSV not parsed correctly
by jcl. 04/20/24 08:32
Zorro FIX plugin - Experimental
by jcl. 04/20/24 08:30
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (7th_zorro, Aku_Aku, 1 invisible), 579 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Zombie spawning OR Procedurally Populated Environment #317452
03/31/10 19:16
03/31/10 19:16
Joined: Oct 2002
Posts: 806
Zapan@work Offline OP
User
Zapan@work  Offline 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.pdf

There 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? laugh

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
W
Wicht Offline
User
Wicht  Offline
User
W

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: Wicht] #317553
04/01/10 09:28
04/01/10 09:28
Joined: Feb 2009
Posts: 2,154
Damocles_ Offline
Expert
Damocles_  Offline
Expert

Joined: Feb 2009
Posts: 2,154
Its easy if you have doors seperating the areas.

By passing a door or other "plane" you can always determine wich room
was entered and which one was left.
Then you only spwan into rooms that are not the current
or the one adjacent to the current.
(hence the invisible rooms)

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 Offline
Expert
EvilSOB  Offline
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,
Code:
...
   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: EvilSOB] #317585
04/01/10 12:22
04/01/10 12:22
Joined: Oct 2002
Posts: 806
Zapan@work Offline OP
User
Zapan@work  Offline OP
User

Joined: Oct 2002
Posts: 806
How can I decide where to place a zombie? Should we place hundreds of spawn_points in the level or create some regions (2D shapes with a Z-Height). I like the idea behind the region but how can we create such a thing?

Re: Zombie spawning OR Procedurally Populated Environment [Re: Zapan@work] #317596
04/01/10 12:58
04/01/10 12:58
Joined: Sep 2005
Posts: 980
Aue, Sachsen, Germany
W
Wicht Offline
User
Wicht  Offline
User
W

Joined: Sep 2005
Posts: 980
Aue, Sachsen, Germany
You have to "connect" a spawnpoint with such a little cube. I would do it with a special data structure. Maybe some connected arrays.

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 Offline
Expert
EvilSOB  Offline
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 Offline
Serious User
PrenceOfDarkness  Offline
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.
Re: Zombie spawning OR Procedurally Populated Environment [Re: PrenceOfDarkness] #320892
04/25/10 16:51
04/25/10 16:51
Joined: May 2009
Posts: 1,816
at my pc (duh)
darkinferno Offline
Serious User
darkinferno  Offline
Serious User

Joined: May 2009
Posts: 1,816
at my pc (duh)
agree with PrenceOfDarkness, i dont see why this is so difficult

Re: Zombie spawning OR Procedurally Populated Environment [Re: darkinferno] #320956
04/26/10 06:38
04/26/10 06:38
Joined: Nov 2004
Posts: 7,121
Potsdam, Brandenburg, Germany
Machinery_Frank Offline
Senior Expert
Machinery_Frank  Offline
Senior Expert

Joined: Nov 2004
Posts: 7,121
Potsdam, Brandenburg, Germany
.. as long as it takes scene management into account. Otherwise it can slow the system down in bigger levels.


Models, Textures and Games from Dexsoft

Moderated by  checkbutton, mk_1 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1