Page 5 of 9 FirstFirst ... 34567 ... LastLast
Results 41 to 50 of 90

Thread: A* pathfinding example !

  1. #41

    A* pathfinding example !

    Found a bug:

    Set a block around the startpoinht so there is no way out!

    Then start Pathfinding, you will get an exception!

    Could you please fix that?

    I understood it now and if you don't mind I may use your Astar.pas as pathfinding for my game in progress?

    Thanks a lot!

    Firle

  2. #42

    A* pathfinding example !

    Quote Originally Posted by Firlefanz
    Found a bug:

    Set a block around the startpoinht so there is no way out!

    Then start Pathfinding, you will get an exception!

    Could you please fix that?

    I understood it now and if you don't mind I may use your Astar.pas as pathfinding for my game in progress?

    Thanks a lot!

    Firle
    hmm, you mean like walls all around the start point? i'll check out that later.

    no, i don't mind at all, it isn't really mine, i just made come changed to it, cairnswm wrote it (see page 1), he said: "My standard license: Free for any use ".
    This is my game project - Top Down City:
    http://www.pascalgamedevelopment.com...y-Topic-Reboot

    My OpenAL audio wrapper with Intelligent Source Manager to use unlimited:
    http://www.pascalgamedevelopment.com...source+manager

  3. #43

    A* pathfinding example !

    Hi delfi,

    could you pleeease fix it? I am getting exceptions often because my unit is locked just like I described..this should not raise an exception.

    Thanks a lot,
    Firle

  4. #44

    A* pathfinding example !

    Quote Originally Posted by Firlefanz
    Hi delfi,

    could you pleeease fix it? I am getting exceptions often because my unit is locked just like I described..this should not raise an exception.

    Thanks a lot,
    Firle
    this seems really weird, does your game really have that much lock situations? i'm sure the problem is in searching the array for closest item, it should be rather easy for you to fix it.
    This is my game project - Top Down City:
    http://www.pascalgamedevelopment.com...y-Topic-Reboot

    My OpenAL audio wrapper with Intelligent Source Manager to use unlimited:
    http://www.pascalgamedevelopment.com...source+manager

  5. #45

    A* pathfinding example !

    It is not often, but possible! And should never raise an exception then!

    The Player can itself build stuff into the level. If it happens he looks a unit then, I get an exception...

    Okay, I will fix it myself. I only thought you would like to do so yourself, because you made such a nice topic here, and when you later make improvements to your version and I want to have them, my bugfixing is lost. Perhaps I try to fix it and post the new unit here.

    Firle

  6. #46
    Legendary Member cairnswm's Avatar
    Join Date
    Nov 2002
    Location
    Randburg, South Africa
    Posts
    1,537

    A* pathfinding example !

    This sounds like it should throw a custom exception from within the code that other programs can catch. So if you just catch enay exception for now the final fix (custom exception) should work as well.
    William Cairns
    My Games: http://www.cairnsgames.co.za (Currently very inactive)
    MyOnline Games: http://TheGameDeveloper.co.za (Currently very inactive)

  7. #47

    A* pathfinding example !

    I would prefer the bool variable if path is found is set to false and the list is empty. Or if the unit has space to move it would be cool if it patrols this area then

    But the main point is to get rid of the exception which terminates my project from time to time...

    firle

  8. #48

    A* pathfinding example !

    you are right, but the code was not supposed to make a exception and i did not predict such a case, i'll fix it, it will just return no path status.

    edit:

    actually the path finder tried to predict such a case, but the code is wrong:

    change:
    if high(astack) = 0 then begin patherror:= true; exit; end;

    to:
    if high(astack) = -1 then begin patherror:= true; exit; end;

    and the path finder will tell you that there is no path:

    astar.Found = false

    edit: here is fix:

    http://www.gtatools.com/temp/astar1.rar
    This is my game project - Top Down City:
    http://www.pascalgamedevelopment.com...y-Topic-Reboot

    My OpenAL audio wrapper with Intelligent Source Manager to use unlimited:
    http://www.pascalgamedevelopment.com...source+manager

  9. #49

    A* pathfinding example !

    Thanks a lot!

    if length(astack) = 0 then begin patherror:= true; exit; end;

    I added this line to your bugfix position before,
    now I just took your new astar.pas and test it, thanks a lot!

    firle

  10. #50

    A* pathfinding example !

    Path squeezes between 2 diagonal boxes?

Page 5 of 9 FirstFirst ... 34567 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •