PDA

View Full Version : Updated old project to use A* techniques



WILL
01-04-2006, 02:28 AM
Hi guys, I've recently updated an old project porting it from Delphi7 using DelphiX to Laz with JEDI-SDL. I will be releasing the game once I have it partially done.

It you've ever owned a Intellivision(before NES and the rest of the Japanese console market started) and the cartrage title 'Night Stalker' you'll be incredibly familiar with the gameplay.

Basically Robots chase you and you kill them or be killed. They get tougher to fight as you defeat them. You keep going until you die, etc... *shrug* Games were so much simplier back then. ;)

Anyhow it's a great project to practice my AI techniques on. And so I shall. Started with A* and I'm willing to share how I did it with you guys when I get back.

Well let me know if you guys are interested.

Traveler
01-04-2006, 11:51 AM
Well let me know if you guys are interested.

Of course :D Looking forward to it. How is the other game (http://www.pascalgamedevelopment.com/forums/viewtopic.php?t=2042) progressing btw?

Huehnerschaender
01-04-2006, 08:03 PM
I am always interested in the things others do ^^

So don't hesitate to show us your work when it got a showable status :)

Robert Kosek
01-04-2006, 08:38 PM
I'm interested as well. I've not done something with A*, although I do intend to use it in the future.

WILL
01-04-2006, 09:50 PM
A* is not as hard is it's made out to be. It's just a tad more involved than most simple pathfinding algos go. But it's a great way to find the best possible path, deadends or not. Plus once you've established a good routine then adding features like terrain, influence, etc is a snap.

My little game here can not only find the most direct path to the desired tile/node, but it also can take into account the the amount of robot deaths in specific spots which is great to give the aspect of learning from other enemies mistakes or simply some kind of advantage that the player may have over the computer.

There are other tricks that I will be trying aswell. So far the AI that I've implimented is a hybrid of A*, Finite State Machines and a few other tricks... perhaps even Neural Nets with Genetic Algorithims. Depends how much fun I plan on having with it.

Of course I plan on making this one multi-player via TCP. Can't hurt to have a buddy or two to help fight off your collective impending doom. ;)

Of course a compliment of EMP and Rocket launchers on top of your already handy handgun helps too. :D

When I get home I'll probably write up a little A* tutorial. After settling in and sorting out other PGD-based issues.

WILL
07-04-2006, 02:11 AM
I've posted a thread with my project's details.
Available here: http://www.pascalgamedevelopment.com/forums/viewtopic.php?t=3144

aidave
07-04-2006, 06:00 AM
A* isnt too hard, i suggest anyone to learn Dijkstra's algorithm first, and its pretty logical from there.

for our PGD entry I managed to put A* designed from scratch for 3d terrains, in under 2 days. maybe i am bragging but i tried to do it in one day ;)

WILL
07-04-2006, 02:52 PM
Brag, naw... it's just an easy algo. :) Esp. if you have a handy book right in front of you with the psudeo code. :lol:

For this little tile-based game, it only took me a few hours to add. Maybe an hour or two to fix any mistakes that I made myself and it was done and worked quite well.

Continious enviroments would take a bit mor coding to get a node system down, but other than that a basic one shouldn't take a really long time, I don't think.

How does your implimentation determine which node the enemy/player was on/at?