Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: TBAI - Pathfinding and waypoint handling

  1. #1

    TBAI - Pathfinding and waypoint handling

    Hi folks,

    here is the first public version of my new TBAI module. This module supports 2D and 3D pathfinding in a grid of connected nodes and also predefined waypoint managment.

    In the attached zip file you will find the module itself, a help file, a sample script that will show off waypoint handling and a modifed version of the TBGL module, which you will need also. Of course, I will write more samples.

    If you have suggestions, then please let me know.

    Cheers
    Michael

    Attached Images Attached Images
    Attached Files Attached Files

  2. #2

    Re: TBAI - Pathfinding and waypoint handling

    The first sample is about waypoints. The scripts starts with a short path allready defined, but when you press N, you can create a new path. After that press R to let the path marker run on your new created path.

  3. #3
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    67
    Posts
    3,869
    Rep Power
    404

    Re: TBAI - Pathfinding and waypoint handling

    Mike what a wonderful surprise. Thanks.

    After you click N, left mouse click to add the first start node and subsequent nodes-- till the end node, which is when you press R.

    So Press N
    First left mouse click is Start Node
    left click additional nodes
    The last node will be the end node when you press R
    and then it will play the object moving on the new path.

    Again, thanks Mike another wonderful addition to tbgl!
    Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
    Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server

  4. #4
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Re: TBAI - Pathfinding and waypoint handling

    Great job man! ,

    very pleasant surprise. Complete module, help file and sample ... what could I ask more?
    Well, another sample

    Excellent!


    Petr

    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  5. #5

    Re: TBAI - Pathfinding and waypoint handling

    Thanks guys. I will create more samples in the next days.

  6. #6
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: TBAI - Pathfinding and waypoint handling

    wow, thanks a lot for the BIG surprise !
    I'm at work at the moment but as soon as I will go home I will run it.
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  7. #7
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: TBAI - Pathfinding and waypoint handling

    Well,

    what is impressive is that in just 230 lines of code you have created a so sophisticated application.
    An easy to understand module well documented and seems easy to be used (if I was able to understand it it is really simple ).

    A question:
    is is possible to create a path in which when the marker reach the last point it moves to the first point instead of returning on his path?
    Like a circle path I mean.

    Thanks thanks thanks for this present Michael.
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  8. #8

    Re: TBAI - Pathfinding and waypoint handling

    Thanks Eros! Yes, when you create the Marker, there is the mode parameter which you can set to STOP, LOOP, or BOUNCE. In my script it is set to BOUNCE. Set it to LOOP and it will do just that.

    [code=thinbasic]

    n = TBAI_MarkerCreate ( pathID [, direction , mode ] )

    [/code]

  9. #9
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Re: TBAI - Pathfinding and waypoint handling

    Mike,

    may I have little suggestion?
    Would it be possible to introduce equates like %TBAI_FORWARD, %TBAI_BACKWARD, %TBAI_STOP, %TBAI_LOOP, %TBAI_BOUNCE?

    It is little detail which makes code slightly more readable.


    Thanks!
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  10. #10

    Re: TBAI - Pathfinding and waypoint handling

    Sure, will do that.

Page 1 of 2 12 LastLast

Similar Threads

  1. TBAI - Please test this
    By Michael Hartlef in forum thinBasic vaporware
    Replies: 7
    Last Post: 17-02-2009, 23:53

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

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