Basic programming language :: thinBasic Community
September 03, 2010, 04:40:28 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: RobotDuel - Game for 2 players: http://community.thinbasic.com/index.php?topic=305.0
 
  Home Help thinGaming Search Calendar Gallery Articles Donations Tags Media Center Login Register   *

thinBasic 1.8.0.0 is out !  :: See this post ( last update: 2010.03.07 ! )  :: Latest beta version: thinBasic beta 1.8.6.0 ( last update: 2010.08.02 ! )
Main menu
Members
Total Members: 524
Latest: fh
Stats
Total Posts: 26641
Total Topics: 3531
Online Today: 24
Online Ever: 121
(August 16, 2009, 07:08:32 am)
Users Online
Users: 1
Guests: 8
Total: 9
2 Spiders, 8 Guests, 1 User
peterpuk
Yahoo spider, Google spider
Subject Statistics
Topic: TBAI - Pathfinding and waypoint handling Replies: 16 posts
Read 1115 times 0 Members and 1 Guest are viewing this topic.
Pages: 1 2
  Add bookmark  |  Print  
Author Topic: TBAI - Pathfinding and waypoint handling  (Read 1115 times)
0 Members and 1 Guest are viewing this topic.
Michael Hartlef
Creator of TBDI, TBAI and TBEM
Global Moderator
Hero Member
*****

Karma: 42
Offline

Gender: Male
Posts: 2951


OS:
Windows XP Windows XP
Browser:
Firefox 3.5.3 Firefox 3.5.3


« on: October 22, 2009, 11:28:18 pm »

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 files Thumbnail(s):


Other attached file(s):

* TBAI.zip (689.98 KB - downloaded 33 times.)
« Last Edit: October 22, 2009, 11:31:37 pm by Michael Hartlef » Logged
Michael Hartlef
Creator of TBDI, TBAI and TBEM
Global Moderator
Hero Member
*****

Karma: 42
Offline

Gender: Male
Posts: 2951


OS:
Windows XP Windows XP
Browser:
Firefox 3.5.3 Firefox 3.5.3


« Reply #1 on: October 22, 2009, 11:30:06 pm »

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.
Logged
kent sarikaya
Hero Member
*****

Karma: 26
Offline

Gender: Male
Posts: 3225


OS:
Windows 7 Windows 7
Browser:
Chrome 3.0.195.27 Chrome 3.0.195.27


WWW
« Reply #2 on: October 23, 2009, 04:02:40 am »

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!
Logged

Petr Schreiber
Global Moderator
Hero Member
*****

Karma: 77
Offline

Posts: 5077


TBGL developer

OS:
Windows XP Windows XP
Browser:
Firefox 3.5.3 Firefox 3.5.3


WWW
« Reply #3 on: October 23, 2009, 07:55:59 am »

Great job man! occasion,

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

Excellent!


Petr

Logged

psch.thinbasic.com / forum
Information about ThinBASIC 3D programming and download of free TBGL tools.

WinXP Home SP3 - Sempron 3400+ @ 1.8GHz - 1Gb RAM @ 533 - NVIDIA GeForce 9500GT 512MB / NVIDIA GeForce 6200 TC
Michael Hartlef
Creator of TBDI, TBAI and TBEM
Global Moderator
Hero Member
*****

Karma: 42
Offline

Gender: Male
Posts: 2951


OS:
Windows XP Windows XP
Browser:
Firefox 3.5.3 Firefox 3.5.3


« Reply #4 on: October 23, 2009, 11:53:35 am »

Thanks guys. I will create more samples in the next days.
Logged
Eros Olmi
Administrator
Hero Member
*****

Karma: 92
Offline

Gender: Male
Posts: 6306


thinBasic co-author

OS:
Windows XP Windows XP
Browser:
Microsoft Internet Explorer 7.0 Microsoft Internet Explorer 7.0


WWW
« Reply #5 on: October 23, 2009, 07:42:48 pm »

wow, thanks a lot for the BIG surprise !  eusadance
I'm at work at the moment but as soon as I will go home I will run it.
Logged

www.thinbasic.com | community.thinbasic.compsch.thinbasic.com
Win7Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB
Eros Olmi
Administrator
Hero Member
*****

Karma: 92
Offline

Gender: Male
Posts: 6306


thinBasic co-author

OS:
Windows XP Windows XP
Browser:
Microsoft Internet Explorer 7.0 Microsoft Internet Explorer 7.0


WWW
« Reply #6 on: October 23, 2009, 10:07:55 pm »

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  Very Happy ).

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
Logged

www.thinbasic.com | community.thinbasic.compsch.thinbasic.com
Win7Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB
Michael Hartlef
Creator of TBDI, TBAI and TBEM
Global Moderator
Hero Member
*****

Karma: 42
Offline

Gender: Male
Posts: 2951


OS:
Windows XP Windows XP
Browser:
Firefox 3.5.3 Firefox 3.5.3


« Reply #7 on: October 23, 2009, 11:36:39 pm »

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
 
n = TBAI_MarkerCreate ( pathID [, direction , mode ] )
 
 
Logged
Petr Schreiber
Global Moderator
Hero Member
*****

Karma: 77
Offline

Posts: 5077


TBGL developer

OS:
Windows XP Windows XP
Browser:
Firefox 3.5.3 Firefox 3.5.3


WWW
« Reply #8 on: October 24, 2009, 09:28:28 am »

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!
Logged

psch.thinbasic.com / forum
Information about ThinBASIC 3D programming and download of free TBGL tools.

WinXP Home SP3 - Sempron 3400+ @ 1.8GHz - 1Gb RAM @ 533 - NVIDIA GeForce 9500GT 512MB / NVIDIA GeForce 6200 TC
Michael Hartlef
Creator of TBDI, TBAI and TBEM
Global Moderator
Hero Member
*****

Karma: 42
Offline

Gender: Male
Posts: 2951


OS:
Mac OS X 10.5 Mac OS X 10.5
Browser:
Firefox 3.5.3 Firefox 3.5.3


« Reply #9 on: October 24, 2009, 10:29:38 am »

Sure, will do that.
Logged
Lionheart008
Sr. Member
****

Karma: 19
Offline

Gender: Male
Posts: 832


I'm a member of x-men team

OS:
Windows XP Windows XP
Browser:
Firefox 3.5.3 Firefox 3.5.3


« Reply #10 on: October 24, 2009, 02:49:35 pm »

hi michael. I can also only say, superb! I have tried this little tbai path game script some minutes before with thinbasic 1.7.9.0 release and it works very fine ! thank you for this good script, it will take a big step in game development for the future here, I am sure Smile

best regards, frank
Attached files Thumbnail(s):
Logged

you can't always get what you want, but if you try sometimes you might find, you get what you need Smile
Michael Hartlef
Creator of TBDI, TBAI and TBEM
Global Moderator
Hero Member
*****

Karma: 42
Offline

Gender: Male
Posts: 2951


OS:
Windows XP Windows XP
Browser:
Firefox 3.5.3 Firefox 3.5.3


« Reply #11 on: October 24, 2009, 04:00:06 pm »

I am glad you like it. Smile
Logged
Eros Olmi
Administrator
Hero Member
*****

Karma: 92
Offline

Gender: Male
Posts: 6306


thinBasic co-author

OS:
Windows XP Windows XP
Browser:
Microsoft Internet Explorer 7.0 Microsoft Internet Explorer 7.0


WWW
« Reply #12 on: October 25, 2009, 08:25:55 am »

Michael,

let me know if you would like TBAI module (help file and sample script) be distributed with thinBasic setup.
I will be happy to include them.

Ciao
Eros
Logged

www.thinbasic.com | community.thinbasic.compsch.thinbasic.com
Win7Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB
Michael Hartlef
Creator of TBDI, TBAI and TBEM
Global Moderator
Hero Member
*****

Karma: 42
Offline

Gender: Male
Posts: 2951


OS:
Windows XP Windows XP
Browser:
Firefox 3.5.3 Firefox 3.5.3


« Reply #13 on: October 25, 2009, 10:40:33 am »

If you think it is worth it, then I go ahead.  Smile Please make some space in the SVN, so I can upload the sources there.
Logged
Eros Olmi
Administrator
Hero Member
*****

Karma: 92
Offline

Gender: Male
Posts: 6306


thinBasic co-author

OS:
Windows XP Windows XP
Browser:
Microsoft Internet Explorer 7.0 Microsoft Internet Explorer 7.0


WWW
« Reply #14 on: October 25, 2009, 10:45:22 am »

Great.
Logged

www.thinbasic.com | community.thinbasic.compsch.thinbasic.com
Win7Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB
Tags: TBAI pathfinding waypoint 
Pages: 1 2
  Add bookmark  |  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC
TinyPortal v0.9.8 © Bloc
Valid XHTML 1.0! Valid CSS!


Google visited last this page August 26, 2010, 12:26:57 pm