Game Development Community

The mystery maze of A-Star!

by Ricky Taylor · 06/01/2006 (11:01 pm) · 12 comments

Well... Some time ago now I bought the RTS starter kit.

To begin with I was amazed, there seemed to be everything I needed, moving units, buildings, a lobby... All laid out ready for an RTS to be made...

It was then I made the first observation... What? That unit just walked through a building...

OK, there is no collision, its still good! But enabling collision made things worse!

Sigh... This needs some work...

After upgrading the RTS-SK to TGE 1.4, I decided to learn the magic of A-Star....

2 weeks, 14 cups of tea, and 28 peices of toast later...

We have some kind of a red line thing...

www.7thentertainment.co.uk/gg.com/Path1.png
This is all very nice you may think, but it was the start of the magic of A-Star...

A few hours later, we were ready for a race/test/maze thing:

Here are the units at the starting line:
www.7thentertainment.co.uk/gg.com/Path1/Image1.png
Here they are navigating the corner, some lagging behind!
www.7thentertainment.co.uk/gg.com/Path1/Image2.png
They've found the exit!
www.7thentertainment.co.uk/gg.com/Path1/Image3.pngwww.7thentertainment.co.uk/gg.com/Path1/Image4.png
And they're done! Well most of them!
www.7thentertainment.co.uk/gg.com/Path1/Image6.png
And here we are, fully assembled, at the finishing line!
www.7thentertainment.co.uk/gg.com/Path1/Image7.png
Once I've tidied the code I'm sure it'll make its way into the hands of the GarageGames folk...

#1
06/01/2006 (11:14 pm)
Awesome! Nice work!
#2
06/01/2006 (11:22 pm)
Hmmmm hopefully this can be released and not require the RTS kit. I haven't the need for that but i do need decent pathfinding. BTW looks good. i added in some A* designed for 2d games and it works, but i'm restricted to 45 degrees turns and i had some strict positioning rules i had to follow.
#3
06/01/2006 (11:27 pm)
Sure, Ill release it seperatly... Just two files: aiPathfinding.cc and aiPathfinding.h.

Instant pathfinding... Ill start the resource now.. =)
#4
06/02/2006 (12:32 am)
how does it in regards to players? does it do raycasts to determine if they're in the way? how will it work for large units overlap the "lines"
#5
06/02/2006 (2:42 am)
Cool. Beans.
#6
06/02/2006 (4:00 am)
Ricky, awsome work!
It will be really kind of you to post such resource.
#7
06/02/2006 (8:37 am)
This is an extremely needed feature. Great work!
#8
06/02/2006 (10:56 am)
Ramen:

Yes, it does raycasts... =)

I have done it kind of hacky, It just checks the classname.

But there is a script callback: isNodeBlocked, where you can do your own collision detection. ;)

I dont have the units "collide", I think that its OK for the units to walk through each other... But hey, thats why it'll be a resource. ;P

Others:

Ive posted the resource, give it a coupla days.
#9
06/02/2006 (11:57 am)
Thats awsome that you are releasing the pathfinding into a resource; theres A LOT of people who could make use of pathfinding. Very cool!

-Jase
#10
06/02/2006 (1:42 pm)
Ahh, the power of tea and toast. :)
#11
06/02/2006 (1:58 pm)
You sir, are a fine and generous fellow! Thanks!
#12
06/07/2006 (5:50 am)
Awsome work! Ricky.

I don't know it's legal o not, here is link to your resource, hope this could help someone.
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=10603