Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by vicknick. 06/13/24 08:51
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (henrybane), 1,246 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19059 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Enemy to enemy avoidance #210780
06/12/08 20:43
06/12/08 20:43
Joined: May 2006
Posts: 90
England
TigerTao Offline OP
Junior Member
TigerTao  Offline OP
Junior Member

Joined: May 2006
Posts: 90
England
Im trying to make several enemies (using same action script) to avoid obstacles and eachother.

Ive used the object avoidance from the AI example of AUM57 though c_content is for pro only (I have A7 com) so I used c_trace instead. This kind of works.

However with enemies keeping a distance from eacother, my enemy action script is starting to use alot of traces (upto 6 ATM and getting bigger) which cannot be good.

Is there a easier/better/faster way?

I was thinking of using c_scan to have scanned enemies call out their position to the scanning fellow enemy and then they kind of work out who can go where depending on who is nearest to the player but this is very complicated to me. Is this good AI procedure?

I suppose an example may be helpful. So if a bunch of enemies are in front of me then I want them to approach me when I get near, avoiding eachother (not to stack up one behind the other) and setting themselves around me in a circle.

Any hints are welcome.

Re: Enemy to enemy avoidance [Re: TigerTao] #210816
06/13/08 02:22
06/13/08 02:22
Joined: May 2008
Posts: 73
Richmond, VA (USA)
coma_dose Offline
Junior Member
coma_dose  Offline
Junior Member

Joined: May 2008
Posts: 73
Richmond, VA (USA)
DUDE! Intense Pathfinding 2 is out! I was reading the new features and there was something about avoiding other entities as in other moving entities. Its free too! Like lite-c, and herpes... ::snicker::

Last edited by coma_dose; 06/13/08 02:23.
Re: Enemy to enemy avoidance [Re: coma_dose] #210903
06/13/08 19:06
06/13/08 19:06
Joined: Jul 2004
Posts: 1,205
Greece
LarryLaffer Offline
Serious User
LarryLaffer  Offline
Serious User

Joined: Jul 2004
Posts: 1,205
Greece
Quote:
Its free too! Like lite-c, and herpes... ::snicker::


lol... I should put this in my sig.


INTENSE AI: Use the Best AI around for your games!
Join our Forums now! | Get Intense Pathfinding 3 Free!
Re: Enemy to enemy avoidance [Re: coma_dose] #210917
06/13/08 19:50
06/13/08 19:50
Joined: May 2006
Posts: 90
England
TigerTao Offline OP
Junior Member
TigerTao  Offline OP
Junior Member

Joined: May 2006
Posts: 90
England
Intense Pathfinding 2 is very cool and it does have the enemies keep a place and so no other enemy will try to walk into that spot.

However deconstructing the code is beyond me. Though it looks like its a job between tracing and storing offset vector positions based on the target vector the enemies move to.

It makes sense, if a vector is taken, move to nearest vector. Rinse and repeat. I will try a basic version of this and add more and more enemies to it.

IP2 has some very cool functions in it that I could use though. I would recommend others to peruse the code, very well commented.

Re: Enemy to enemy avoidance [Re: TigerTao] #210920
06/13/08 20:28
06/13/08 20:28
Joined: Jul 2004
Posts: 1,205
Greece
LarryLaffer Offline
Serious User
LarryLaffer  Offline
Serious User

Joined: Jul 2004
Posts: 1,205
Greece
Intense Pathfinding 2 works in the most mainstream way. It uses Dijkstra to find a path from any point inside the level to another. After the path is found, the agent starts to move, but if another agent is in the way it will prioritize in walking around the agent than following the path. Once his way ahead is clear, he will resume following the original path to his destination.

Dijkstra is similar to A* and works with waypoints spread around the level. The obstacle avoidance (the second layer i discussed) works by storing every dynamic agent's position to an array and then doing some vector math to calculate if an agent needs to be avoided or not, and if our hero should turn left or right and how steep the turn should be, etc. All these are done to prevent any runtime traces to happen, cause traces are costly and bring your fps down fast when working on many agents simultaneously.

However, i think IP2 was a blunder because i didn't provide clear instructions on how you can use it in your project. So if you don't mind c-script and you can do without dynamic avoidance (the vector stuff..), you can still get Intense Pathfinding 1 which is much simpler to install to your own projects.

So, whatever you choose, good luck with your project. I know pathfinding can be pretty frustrating, but don't let that bring you down..

Cheers,
Aris

PS: c_content isn't Pro only afaik... You might want to recheck if it works with your version, cause I'm pretty sure that it does.


INTENSE AI: Use the Best AI around for your games!
Join our Forums now! | Get Intense Pathfinding 3 Free!
Re: Enemy to enemy avoidance [Re: LarryLaffer] #210973
06/14/08 08:59
06/14/08 08:59
Joined: May 2006
Posts: 90
England
TigerTao Offline OP
Junior Member
TigerTao  Offline OP
Junior Member

Joined: May 2006
Posts: 90
England
Thanks Aris. I dont mind using c or lite-c as long as I start to understand AI.

As for the c_content I did have another look and yes it does work for A7 com. I blame the manual smile

Re: Enemy to enemy avoidance [Re: TigerTao] #211463
06/16/08 20:25
06/16/08 20:25
Joined: May 2008
Posts: 73
Richmond, VA (USA)
coma_dose Offline
Junior Member
coma_dose  Offline
Junior Member

Joined: May 2008
Posts: 73
Richmond, VA (USA)
Tiger: I deconstructed Intense Pathfinding 1 laugh never actually used it to make a game not because of it, but other factors. I never had any problems with customizing the poo out of it.

Larry: Ha! Yea I was going to do it too but I thought better of it because everyone already knows how much I hate lite-c; which is like trying to plow a field with chopsticks.


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