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
Page 1 of 2 1 2
Enemys surrounding player #217134
07/21/08 15:14
07/21/08 15:14
Joined: Jul 2008
Posts: 56
I
iam_ufo973 Offline OP
Junior Member
iam_ufo973  Offline OP
Junior Member
I

Joined: Jul 2008
Posts: 56
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!

Re: Enemys surrounding player [Re: iam_ufo973] #217171
07/21/08 19:55
07/21/08 19:55
Joined: May 2006
Posts: 90
England
TigerTao Offline
Junior Member
TigerTao  Offline
Junior Member

Joined: May 2006
Posts: 90
England
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.

Re: Enemys surrounding player [Re: TigerTao] #217178
07/21/08 20:30
07/21/08 20:30
Joined: Mar 2003
Posts: 3,010
analysis paralysis
NITRO777 Offline
Expert
NITRO777  Offline
Expert

Joined: Mar 2003
Posts: 3,010
analysis paralysis

Re: Enemys surrounding player [Re: NITRO777] #217181
07/21/08 20:43
07/21/08 20:43
Joined: May 2006
Posts: 90
England
TigerTao Offline
Junior Member
TigerTao  Offline
Junior Member

Joined: May 2006
Posts: 90
England
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.

Re: Enemys surrounding player [Re: TigerTao] #217247
07/22/08 09:27
07/22/08 09:27
Joined: Jul 2008
Posts: 56
I
iam_ufo973 Offline OP
Junior Member
iam_ufo973  Offline OP
Junior Member
I

Joined: Jul 2008
Posts: 56
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.

Re: Enemys surrounding player [Re: iam_ufo973] #217459
07/23/08 09:19
07/23/08 09:19
Joined: Jul 2008
Posts: 56
I
iam_ufo973 Offline OP
Junior Member
iam_ufo973  Offline OP
Junior Member
I

Joined: Jul 2008
Posts: 56
TigerTao did u receive my pm?

Re: Enemys surrounding player [Re: iam_ufo973] #217477
07/23/08 11:06
07/23/08 11:06
Joined: Jul 2008
Posts: 56
I
iam_ufo973 Offline OP
Junior Member
iam_ufo973  Offline OP
Junior Member
I

Joined: Jul 2008
Posts: 56
SOME ONE HELP PLEASEEEEEEEEEEEEEEEEEEEEEEEEEEEEE

Re: Enemys surrounding player [Re: iam_ufo973] #218131
07/26/08 16:54
07/26/08 16:54
Joined: Dec 2005
Posts: 116
T
tD_Datura_v Offline
Member
tD_Datura_v  Offline
Member
T

Joined: Dec 2005
Posts: 116
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++

Re: Enemys surrounding player [Re: tD_Datura_v] #218228
07/27/08 12:23
07/27/08 12:23
Joined: Jul 2008
Posts: 56
I
iam_ufo973 Offline OP
Junior Member
iam_ufo973  Offline OP
Junior Member
I

Joined: Jul 2008
Posts: 56
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.

Re: Enemys surrounding player [Re: iam_ufo973] #218500
07/29/08 01:16
07/29/08 01:16
Joined: Dec 2005
Posts: 116
T
tD_Datura_v Offline
Member
tD_Datura_v  Offline
Member
T

Joined: Dec 2005
Posts: 116
If and when, I become well enough to read my own code again, I shall consider it.

Page 1 of 2 1 2

Moderated by  HeelX, Spirit 

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