Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / Anyone need 2d Grid based path finding AI?

Author
Message
PowerFang
21
Years of Service
User Offline
Joined: 6th Feb 2004
Location: Australia (But currently in the USA)
Posted: 11th Sep 2004 22:11
Heyas,

I've got a program that can find the best route from point to point on a grid. Can handle all types of weighting like terrain or danger or anything you need really.

Just curious if this is anygood to anyone

p.s. i'll post a demo once i polish it up
Ilya
21
Years of Service
User Offline
Joined: 10th Aug 2003
Location:
Posted: 12th Sep 2004 05:29 Edited at: 12th Sep 2004 05:29
No but I need 3d object based A* pathfinding AI.

Sephnroth
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: United Kingdom
Posted: 12th Sep 2004 05:31
I would be interested to see it ^_^

My game is supposed to be strictly internet multiplayer, but I considered the idea of like a "practice" or skirmish mode or maybe even bots - I would definatly need something like what you are offering for that ^_^

p4 2.4ghz, 768ddr ram, Geforce FX 5200
Innovate, redefine, recreate whats in your mind. It isnt fate, you decide, only you can cross that line.
PowerFang
21
Years of Service
User Offline
Joined: 6th Feb 2004
Location: Australia (But currently in the USA)
Posted: 13th Sep 2004 14:08
Send me an email at:
BaskersInc @ Hot Mail . com

and just let me know about size of grid and weightings needed and such and i'll customise it as needed.
aprilfan
22
Years of Service
User Offline
Joined: 3rd Oct 2002
Location: Hell
Posted: 21st Sep 2004 12:20
I like the sound of that, I'd love to see it.
Agent
20
Years of Service
User Offline
Joined: 7th Sep 2004
Location: Sydney, Australia
Posted: 27th Sep 2004 04:04 Edited at: 11th Nov 2004 11:58
I sent you an email regarding this, a week ago. Still waiting for a response. I could really use this sort of code for my current project. You could email me any details at sektor at optushome.com.au if you were feeling nice
PowerFang
21
Years of Service
User Offline
Joined: 6th Feb 2004
Location: Australia (But currently in the USA)
Posted: 30th Sep 2004 16:12
soz, replied
Agent
20
Years of Service
User Offline
Joined: 7th Sep 2004
Location: Sydney, Australia
Posted: 18th Oct 2004 05:04
Still hangin on this. You sent me an email saying hi, but nothing I can use yet Is it coming?
Tapewormz
22
Years of Service
User Offline
Joined: 15th Sep 2002
Location: Winnipeg, Mantoba, Canada
Posted: 7th Nov 2004 00:50
It's probably just an A* routine.

Agent
20
Years of Service
User Offline
Joined: 7th Sep 2004
Location: Sydney, Australia
Posted: 7th Nov 2004 18:19
Whatever it is, I still want it. If it works, I can use it in my current project.
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 9th Nov 2004 03:43 Edited at: 9th Nov 2004 04:04
@Agent/Powerfang...if I where you I would edit your posts above and remove your mail addys before a bot trawls em and starts sending you spam, once it starts it never stops

Mentor.

ps heres a simple pathfinder for you, this example code was made to be inserted into any program, you make a grid of your play area, then it calculates all the possible paths to your specified target location, so you can get several units to go to the players location for example.
you check the array coresponding to the objects location and according to the number for that array location move the object left/right/forwards/back to the next location, then get the direction code for that location etc

dim a(26,26)
rem start main proggy with this


arrayini:
for l=0 to 26
for i=0 to 26
read x
a(i,l)=x
next i
next l
return
rem gosub this to load array with data for current map,
rem you can pick what data you need by useing restore <label>
rem before you call this, so for example for level 1 you could put
rem restore level1:gosub arrayini (you need 27x27 data)
rem in the array any number under 10 means the location is blocked

settarg:
restore targdat
if a(targx,targy)<>0 then goto targdat
for l=-1 to 1
for i=-1 to 1
read sval
if a(targx+i,targy+l)=0 then a(targx+i,targy+l)=sval
next i
next l
targdat:
data 12,13,11,12,15,11,12,14,11
return
rem call this with the position of targx and targy set by your selection
rem routine, if you have selected a wall then it returns without doing
rem anything, so you don`t get a path



makepath:
count=1:lastcount=1
do
for i=1 to 26
for l=1 to 26
if a(i+1,l)=0 and a(i,l)>10 then a(i+1,l)=11:inc count
if a(i-1,l)=0 and a(i,l)>10 then a(i-1,l)=12:inc count
if a(i,l+1)=0 and a(i,l)>10 then a(i,l+1)=14:inc count
if a(i,l-1)=0 and a(i,l)>10 then a(i,l-1)=13:inc count
next i
next l
if lastcount=count then goto escloop
lastcount=count
loop
escloop:
return
rem call this to make the path, you must reset the array with the data for
rem the level if you call this again for a new path, IE: to call once...
rem gosub settarg
rem gosub makepath
rem to call again
rem gosub arrayini
rem gosub settarg
rem gosub makepath
rem it needs a fresh array every time you call for a new path
rem 11 is left, 12 right, 13 down, 14 up

PC1: P4 3ghz, 1gig mem, 3x160gig hd`s, Radeon 9800pro w cooler (3rd gfx card), 6 way speakers.
PC2: AMD 2ghz, 512mb ram, FX5200 ultra, 16 bit SB.
Mini ATX cases suck.

Login to post a reply

Server time is: 2025-05-15 22:43:41
Your offset time is: 2025-05-15 22:43:41