Page 1 of 3 123 LastLast
Results 1 to 10 of 23

Thread: Maze Solver - A-Star Path Finding

  1. #1

    Maze Solver - A-Star Path Finding

    Hello All,

    I've been pretty quiet lately because I've been busy learning thinBasic and how to develop a module. I now have something to show, as my first attempt. I will welcome your criticism of it, as I will learn from what you have to say. Perhaps others will learn from your comments as well.

    This is a very simple application. You draw a maze on the screen, pick starting and ending points, and let the computer try to find a path through the maze. There are some sample maze files included to get you started.

    The path-finding is accomplished using the A* (A-Star) algorithm, which is provided in a module for speed reasons. The module was coded in "C" using the DevC++ IDE.

    To install, uncompress the zip file into your thinBasic UserScripts folder, and copy the thinBasic_ASTAR.dll file to your LIB folder. The SDK folder has the source files the module was compiled from.

    I'm not a "C" programmer, so please let me know if I did something wrong in my module.

    Known Problems:

    I developed this application at home on a Windows 2000 Pro OS, I just ran it at work on XP, and it seems to act a little differently.

    I'm having problems with the fonts in the Help About dialog box. Sometimes they render correctly, othertimes they do not.

    I'm also not clear on how to handle the WM_PAINT message. I tend to get multiple repaints of the screen when I only want one.

    The module is not very well developed. If there is sufficient interest, I will develop it further and make it more useful. I'm not a game developer, so I'm not sure what you guys would want.

    Thanks for taking a look!

    Randall

    Updates:
    • 2007.10.06 main window is now resizable and mazes will adapt to winwow client area

    Attached Files Attached Files

  2. #2
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,153
    Rep Power
    736

    Re: Maze Solver - A-Star Path Finding

    Hi Randall,

    what a shock !
    This is absolutely incredible script and module!

    Profi layout, fast execution, even helpfile !

    I will check the repaint / font problems ... but this are just details comparing to work you did.


    Terrific!,
    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

  3. #3
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,153
    Rep Power
    736

    Re: Maze Solver - A-Star Path Finding

    Regarding fonts,

    it seems to me like some resource leak or something.
    It should be correct to do something like
    [code=thinbasic]
    DeleteObject(hFont2)
    DeleteObject(hFont3)
    [/code]
    ... when exiting about proc. Maybe something similar for painting, but I am not very good at raw SDK paint functions, so maybe somebody else will know better

    I must play with your script again and again. Really nice !


    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

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

    Re: Maze Solver - A-Star Path Finding

    Randall,

    what a present
    Nice idea, perfect module, professional script complete and well written in all parts. You have spent a lot of time on it, I'm pretty sure about that. I have no words because you have showed to me once again the many possibilities thinBasic and especially thinBasic modules can have.

    Regarding refresh rate and some strange %WM_PAINT firing, I'm quite sure it is a problem in UI (User Interface) module. In today released thinBasic preview 1.4.0.1 I have changed some code on how internal UI Windows message pump handle %WM_PAINT message. It makes some positive difference for example with previous one version when window goes outside screen and return, covered area does not get repaint while with current online one it des. But I need some time to understand what I'm doing wrong with %WM_PAINT. So for the moment do not worry about that or at least not too much. I will use this script for testing.

    Regarding fonts, I need some more time to study your script and see how things are done.

    Thanks again for this present.
    I'm sure it will focus the attention for some big time
    Be prepared to implement thinBasic_ASTAR module

    Ciao
    Eros

    Attached Images Attached Images
    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

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

    Re: Maze Solver - A-Star Path Finding

    Randall,

    as we are used to do for interesting complete projects like this one, I have created a dedicated forum named AStar and moved your posts into it.

    You are also moderator in this forum. Being a moderator doesn't mean anything other than you have some more forum power over posts. So feel free to do what you prefer with your new creature here.

    Ciao
    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

  6. #6
    thinBasic MVPs Michael Hartlef's Avatar
    Join Date
    Sep 2006
    Location
    Germany
    Age
    58
    Posts
    3,299
    Rep Power
    348

    Re: Maze Solver - A-Star Path Finding

    Great man! I will still release my path module, the more the better. I will have a close look at yours. Again thank you very much!

  7. #7
    Member matthew's Avatar
    Join Date
    Mar 2007
    Location
    England
    Age
    47
    Posts
    489
    Rep Power
    66

    Re: Maze Solver - A-Star Path Finding

    Excellent looking program Randall, really interesting.
    Operating System: Windows 10 Home 64-bit
    CPU: Intel Celeron N4000 CPU @ 1.10GHz
    Memory: 4.00GB RAM
    Graphics: Intel UHD Graphics 600

  8. #8
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    68
    Posts
    3,865
    Rep Power
    405

    Re: Maze Solver - A-Star Path Finding

    Randall, I am just amazeD

    It is so quick and clever. I couldn't fool it yet, probably won't but I will keep trying. Very cool idea for a game and also of course what looks like a neat module to study!!
    THanks so much!! Really really neat!!!
    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

  9. #9

    Re: Maze Solver - A-Star Path Finding

    Thank you all so very much for your kind comments!

    I was only able to create it because of all the sample code and forum posts you all have so graciously supplied. Anytime I wasn't sure how to code something, I could either find a sample program or code snippet in the forums that showed me the way. My thanks go out to all of you for unselfishly sharing your code and expertise. I am honored to add my code alongside the excellent code already posted on this forum site.

    Thanks again,

    Randall

  10. #10

    Re: Maze Solver - A-Star Path Finding

    Quote Originally Posted by Michael Hartlef
    Great man! I will still release my path module, the more the better. I will have a close look at yours. Again thank you very much!
    Thanks Michael,

    If you would like to incorporate my code into your path module, please feel free to do so.

    Randall

Page 1 of 3 123 LastLast

Similar Threads

  1. Maze Solver - Updated Version 06 Oct 07
    By Randall in forum AStar - (A Star) path-finding algorithm
    Replies: 13
    Last Post: 07-10-2007, 16:01

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
  •