Enemys surrounding player

Posted By: iam_ufo973

Enemys surrounding player - 07/21/08 15:14

Hi Gang!
I am stucked at coding my enemies to surround the player.
i am making a fist-kick fighting game where i want my enemies to surround the player then start beating him but i can't code the surrounding.
Anybody help please!
Posted By: TigerTao

Re: Enemys surrounding player - 07/21/08 19:55

Im currently making some enemy AI code for exactly that and will contribute it once Ive got it done to my liking with values that can be changed to create different enemy tactics. I hope to have this done sometime next month.

I tried explaining a simple method in the meantime but its actually not very simple at all frown

Basically it was to do with creating six cube entitys (passable/invisible) that follow the player but always at a set position surrounding the player.

If an enemy approaches assign one of the positions of these cubes (the nearest) to it and have the enemy move to it and not allow another enemy to take that position.

Enemies would have to be able to pass through eachother or otherwise they would get stuck in eachother trying to get to their position.

Also the player would trace to each cube to make sure they are in the same room or within the corridor the player is in and not in a wall. If in a wall, turn them off so enemies wont smack their heads into a wall trying to get to the position.

Hope that gives you some help, sorry no code.
Posted By: NITRO777

Re: Enemys surrounding player - 07/21/08 20:30

This is an application you might use:
http://www.coniserver.net/ubb7/ubbthread...8274#Post138274
Posted By: TigerTao

Re: Enemys surrounding player - 07/21/08 20:43

Now thats pretty funky. I never thought of just using vectors :P

Thanks Tri, I think that is pretty much the type of thing I was trying (and failing) to describe.
Posted By: iam_ufo973

Re: Enemys surrounding player - 07/22/08 09:27

Originally Posted By: TigerTao
Im currently making some enemy AI code for exactly that and will contribute it once Ive got it done to my liking with values that can be changed to create different enemy tactics. I hope to have this done sometime next month.

I tried explaining a simple method in the meantime but its actually not very simple at all frown

Basically it was to do with creating six cube entitys (passable/invisible) that follow the player but always at a set position surrounding the player.

If an enemy approaches assign one of the positions of these cubes (the nearest) to it and have the enemy move to it and not allow another enemy to take that position.

Enemies would have to be able to pass through eachother or otherwise they would get stuck in eachother trying to get to their position.

Also the player would trace to each cube to make sure they are in the same room or within the corridor the player is in and not in a wall. If in a wall, turn them off so enemies wont smack their heads into a wall trying to get to the position.

Hope that gives you some help, sorry no code.



lol i used the same technique but stucked in coding bytheway we are both in the same mission so we can help eachother i am sending my email add it so we can chat online.
Posted By: iam_ufo973

Re: Enemys surrounding player - 07/23/08 09:19

TigerTao did u receive my pm?
Posted By: iam_ufo973

Re: Enemys surrounding player - 07/23/08 11:06

SOME ONE HELP PLEASEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
Posted By: tD_Datura_v

Re: Enemys surrounding player - 07/26/08 16:54

weak steer
if target accessible, turn toward target
if target not accessible, turn toward first opening, or proceed in direction

if behind agent attacking target (player), agent turns away from other agent
moves, than turns back toward target (player)
(if no obstruction to target, agent may arrive on free side of target)
result is "surround"?

also: circle sidestep
y + / -
if collide
x--
see target
x++
Posted By: iam_ufo973

Re: Enemys surrounding player - 07/27/08 12:23

tD_Datura_v thank you very much for your theory i have it in my notebook but the problem is to turn it into practical code that is why i post it here.
If you can convert it into code and put it here we would be very very thanksfull to you.
Posted By: tD_Datura_v

Re: Enemys surrounding player - 07/29/08 01:16

If and when, I become well enough to read my own code again, I shall consider it.
Posted By: VeT

Re: Enemys surrounding player - 07/31/08 10:20

try Perfect AI from aum 27-31, i worked on it and now its really wors nearly-perfect smile
Posted By: iam_ufo973

Re: Enemys surrounding player - 08/04/08 15:06

AT LAST MYSTERY SOLVED! smile
http://www.coniserver.net/ubb7/ubbthreads.php?ubb=showflat&Number=219776#Post219776
© 2024 lite-C Forums