Advanced game related topics
Heathen
Enthusiast
Posts: 498 Joined: Tue Sep 27, 2005 6:54 pm
Location: At my pc coding..
Post
by Heathen » Thu Jun 14, 2007 10:00 pm
Update coming
Last edited by
Heathen on Fri May 03, 2013 4:14 am, edited 78 times in total.
Heathen
Enthusiast
Posts: 498 Joined: Tue Sep 27, 2005 6:54 pm
Location: At my pc coding..
Post
by Heathen » Thu Jun 14, 2007 11:02 pm
...
Last edited by
Heathen on Fri Dec 28, 2012 10:21 pm, edited 18 times in total.
Heathen
Enthusiast
Posts: 498 Joined: Tue Sep 27, 2005 6:54 pm
Location: At my pc coding..
Post
by Heathen » Fri Jun 15, 2007 6:35 am
Thanks for pointing that out
Check the first post for an update
SCRJ
User
Posts: 93 Joined: Sun Jan 15, 2006 1:36 pm
Post
by SCRJ » Fri Jun 15, 2007 10:19 am
Thanks...but now, the code crashes with the same error on line 88:
Code: Select all
t = GetTickCount_()
FreeMemory(*path) ;<<Here.
*path = get_path(startx,starty,tox,toy,#width,#height,allowdiag,blockdiag)
Heathen
Enthusiast
Posts: 498 Joined: Tue Sep 27, 2005 6:54 pm
Location: At my pc coding..
Post
by Heathen » Fri Jun 15, 2007 11:04 am
SCRJ wrote: Thanks...but now, the code crashes with the same error on line 88:
Code: Select all
t = GetTickCount_()
FreeMemory(*path) ;<<Here.
*path = get_path(startx,starty,tox,toy,#width,#height,allowdiag,blockdiag)
I updated the example in the second post
SCRJ
User
Posts: 93 Joined: Sun Jan 15, 2006 1:36 pm
Post
by SCRJ » Fri Jun 15, 2007 11:39 am
Now it works correctly!
Good job, man
Heathen
Enthusiast
Posts: 498 Joined: Tue Sep 27, 2005 6:54 pm
Location: At my pc coding..
Post
by Heathen » Mon Jun 18, 2007 3:40 am
I optimized much of the code, now it is much much faster. The code is updated in the first post and the example is also updated.
JCV
Enthusiast
Posts: 579 Joined: Fri Jun 30, 2006 4:30 pm
Location: Middle East
Post
by JCV » Mon Jun 18, 2007 5:35 am
Hi Heathen I suggest the ff:
-use binary heap - really fast even on very large maps.
-use arrays instead of linklist
Your code looks clean and easy to understand.
[Registered PB User since 2006]
[PureBasic 5.7][SpiderBasic 2.2] [Win 10 64bit]
[Intel i7 990x 4.20 Ghz] [18GB DDR3]
Heathen
Enthusiast
Posts: 498 Joined: Tue Sep 27, 2005 6:54 pm
Location: At my pc coding..
Post
by Heathen » Mon Jun 18, 2007 7:28 am
JCV wrote: Hi Heathen I suggest the ff:
-use binary heap - really fast even on very large maps.
-use arrays instead of linklist
Your code looks clean and easy to understand.
Thanks for the suggestions
I will consider them for the next version.
Heathen
Enthusiast
Posts: 498 Joined: Tue Sep 27, 2005 6:54 pm
Location: At my pc coding..
Post
by Heathen » Fri Jun 22, 2007 5:43 am
Updated to 1.0, added binary heaps and lots of optimizations. I also added procedures for loading and saving of paths, aside from that I added a procedure called nearest_node() which can be used for finding the nearest node in a precomputed path relative to an x and y position. This way, if the object strays off of the path for whatever reason, it can pathfind to the nearest node of the precomputed path.
Heathen
Enthusiast
Posts: 498 Joined: Tue Sep 27, 2005 6:54 pm
Location: At my pc coding..
Post
by Heathen » Sat Jun 23, 2007 4:01 am
...
Last edited by
Heathen on Fri Dec 28, 2012 10:21 pm, edited 1 time in total.
Heathen
Enthusiast
Posts: 498 Joined: Tue Sep 27, 2005 6:54 pm
Location: At my pc coding..
Post
by Heathen » Wed Jul 04, 2007 8:30 pm
...
Last edited by
Heathen on Fri Dec 28, 2012 10:21 pm, edited 1 time in total.
Chrono Syndrome
Enthusiast
Posts: 169 Joined: Thu Oct 05, 2006 6:44 am
Contact:
Post
by Chrono Syndrome » Tue Jul 10, 2007 8:32 am
Great job !
Don't try to catch ze Night !
Remember: 'z' is better zen 'th' =) !
Sorry for bad english.