Pages: 1
  Print  
Author Topic: How do I do AI path finding in ENIGMA ? A*  (Read 960 times)
Offline (Unknown gender) Darkstar2
Posted on: April 23, 2014, 10:57:30 PM
Member
Joined: Jan 2014
Posts: 1244

View Profile Email
Ok it was established already that the D&D follow object avoiding does not work as it should in ENIGMA, first discovered by TKG, object tries to follow but as soon as it hits an object it stops. 

So another alternative and preferred method is through the grid system. 

Does the mp grid and path finding work in ENIGMA ? I read that A* works in ENIGMA.  Could not got it to work here,
could someone help with this ? how do I set it up?

I uploaded this quick test I made, and the code I used.
I put it in create, also tried it in step, same thing, but I know this should be put in create and not step.

Could someone take a look and let me know.  The red squares should find a path and move, nothing happens.

Everything compiles fine, no errors.  and yes MP extension is enabled. :)


https://www.dropbox.com/s/z4q5ht41uhhzho2/MPTest1.egm
Logged
Offline (Unknown gender) TheExDeus
Reply #1 Posted on: April 24, 2014, 03:05:18 AM

Developer
Joined: Apr 2008
Posts: 1872

View Profile
There was an example in the EDC. You can get it here: https://dl.dropboxusercontent.com/u/21117924/Enigma_Examples/MotionPlanning/motion_plan.gm6

I just tested it and it works, but debug drawing is a little off right now. Like draw_path() doesn't work, but that is also because of total rewrite of several systems. Maybe I will fix that later.
But the pathfinding itself works.

edit: It doesn't work for you because you use path_start, which has never worked (because of technical reasons). That has also mentioned many times.
Second thing is that your grid was too large. The blocks ended up being too fat. To make it work I had to reduce grid size by 2. You could probably fix it by offsetting as well. There is possibility a grid populating bug (as in it populates more cells than required), but I cannot see that until I fix debug. I don't have time to do any of that right now.

You example fixed: https://dl.dropboxusercontent.com/u/21117924/Enigma_Examples/MotionPlanning/MPTest1.egm
« Last Edit: April 24, 2014, 03:44:33 AM by TheExDeus » Logged
Offline (Unknown gender) Darkstar2
Reply #2 Posted on: April 24, 2014, 03:17:35 AM
Member
Joined: Jan 2014
Posts: 1244

View Profile Email
Thanks but could you please take a look at my  code (the one I uploaded in my post) and tell me what I did wrong ?

In my own example I did exactly as I should and nothing moves.

Thanks.
Logged
Pages: 1
  Print