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.

AppGameKit/AppGameKit Studio Showcase / [ Open Source ] AGK Pathfinder / Simple dynamic pathfinding

Author
Message
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 6th Jun 2012 23:42 Edited at: 7th Jun 2012 00:08
This is for tier 1!


I neaded some pathfinding for the enemys in my raycaster and found pedrolbs great code in the codebase.

I simply added a more dynamic twist and movement code.
And making it simplier to be added to your own projects.
The only thing i didt change more then adding first nodes x/y cord is the great search routine.
I made this as an learning experience and that i neaded a good pathfinding for my raycaster.

There is alot of room for improvements to get it faster but its pretty fast already.

If you think i messed it up to much so can you find the original here !
http://www.thegamecreators.com/?m=codebase_view&i=b496ae7bec039ca2806967d3443fd672



This is still work in progress.
Iam doing this for fun and often dont have a clue wath iam doing
But strangely enough so does it work.

The sample file is extremely simple and should be easy to understand?

I will make the code cleaner and better later on.
i simply wanted to make an sample that whas easy to use for newcomers to agk.
Sometimes do you have an great idea for an game that neads pathfinding but dont know how to get it in to the game.
This should help?

Attachments

Login to view attachments
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 7th Jun 2012 10:34
Thanks for sharing Cliff!

I'll be using this in a few games at some point I'm sure

Digital Awakening
AGK Developer
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 7th Jun 2012 14:52
I don't need it for my current project. But thanks for sharing Cliff. This might come in handy later or maybe I have time to study and learn from it at some other time.

Now I wouldn't mind a video tutorial

Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 7th Jun 2012 17:47
Quote: "Thanks for sharing Cliff!"

Thats wath we are here for
Quote: "I don't need it for my current project. But thanks for sharing Cliff. This might come in handy later or maybe I have time to study and learn from it at some other time."

Always good to have some usefull source code to know about for later projects

I will try to improve it some more today as its pretty basic right now and is mostly scribble code when i tryed to get it right and working.
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 11th Jun 2012 09:41
nifty!!! PACMAN YAY

Matneee
12
Years of Service
User Offline
Joined: 17th Feb 2012
Location:
Posted: 12th Jun 2012 06:06
Oh Cool I'd pretty much ran out of excuses for not coding a pathfinder myself, so this'll hopefully come in very handy for a tile/turn-based thing I was dabbling with.
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 13th Jun 2012 22:30
Quote: "Oh Cool I'd pretty much ran out of excuses for not coding a pathfinder myself, so this'll hopefully come in very handy for a tile/turn-based thing I was dabbling with. "

Its not finished yet and have a few buggs but the basics is there
I will try to finish it soon.

One simple bugg is that if the first node is to far away from the check value so will the sprite go in the totally wrong directon offscreen
Impetus73
12
Years of Service
User Offline
Joined: 28th Aug 2011
Location: Volda, Norway
Posted: 14th Jun 2012 17:28
Bugg = bug. Nead = need. You allways get those wrong cliff

----------------
AGK user - novice
Did Amiga / AMOS programming in the 90's, just started programming again with AGK.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 14th Jun 2012 19:55
Well, he's consistent and we know what he means.

Cheers,
Ancient Lady
swissolo
14
Years of Service
User Offline
Joined: 9th Jan 2010
Location:
Posted: 14th Jun 2012 19:58 Edited at: 14th Jun 2012 19:59
wath = what. iam = I am. alot = a lot. It's all legible though, so it's not really of concern. Edit: Ancient ninja-posted about the same thing.
Anyways, this seems very accurate, I'll have to take a look.

swis
Joined: Tue Dec 16th 2008
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 14th Jun 2012 20:41 Edited at: 14th Jun 2012 20:42
Quote: "Bugg = bug. Nead = need. You allways get those wrong cliff "

Quote: "Well, he's consistent and we know what he means. "

Everybody knows me as the bad speller from sweden so why change

Probably is one problem that iam a fast typer and when i also are a bad speller ?

It gets amazing
Impetus73
12
Years of Service
User Offline
Joined: 28th Aug 2011
Location: Volda, Norway
Posted: 14th Jun 2012 22:27
I'm Norwegian, and I guess I have allot of spelling errors, but I thought I'll mention those notorious ones for you

I'd like to see some non-swedes/nowegians try to write in Swedish or Norwegian, then they would look like stuttering indians or something.

----------------
AGK user - novice
Did Amiga / AMOS programming in the 90's, just started programming again with AGK.
The Zoq2
14
Years of Service
User Offline
Joined: 4th Nov 2009
Location: Linköping, Sweden
Posted: 15th Jun 2012 02:20
Quote: "I'd like to see some non-swedes/nowegians try to write in Swedish or Norwegian, then they would look like stuttering indians or something."


That would be awesome
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 15th Jun 2012 02:50
Quote: "That would be awesome"


det sku vaer ret fedt ikke maend?

and yes it has been 6 years since I properly typed or spoke Danish...

baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 15th Jun 2012 11:50
I know this is an "English" forum but unless someone's messages are unreadable I don't think it's fair to give someone a hard time. I think in most cases people point spelling mistakes out to educate rather than give someone a hard time. I'm sure that's the case here

Cliff, I think you're always readable. Never had a problem. I have spoken a number of languages over the years with different measures of success but even the languages I was pretty good with I would not count myself as capable as most of the "foreign" language speakers on these forums. I salute you all!

I can't wait to try this code out properly at some point. I may have to re-read about the A* algorithm and make my own version though just so I understand it. My version of Dijkstra's algorithm got way too complicated...

The Zoq2
14
Years of Service
User Offline
Joined: 4th Nov 2009
Location: Linköping, Sweden
Posted: 15th Jun 2012 12:13
Quote: "Cliff, I think you're always readable. Never had a problem. "
Of course, there are a lot of people with much worse english, probably my self included.
Impetus73
12
Years of Service
User Offline
Joined: 28th Aug 2011
Location: Volda, Norway
Posted: 15th Jun 2012 19:13
Yes it was purely educational, and to prevent myself from getting too annoyed, since it was the same 2 words, misspelled over and over again, for months. We learn all the time, but not until we see the error I love cliff's enthusiastic posts, he's a great coder!

----------------
AGK user - novice
Did Amiga / AMOS programming in the 90's, just started programming again with AGK.
Marl
12
Years of Service
User Offline
Joined: 19th Nov 2011
Location: Bradford, UK
Posted: 19th Jun 2012 16:59 Edited at: 19th Jun 2012 17:09
Quote: "there are a lot of people with much worse english"

There are a lot of English people with worse English than the non-English people on this board

It's difficult to know what people want, I have a friend from the Czech Republic who complains if I don't correct his English and others who complain if I do

Let's face it, English is a messed up hotchpotch of a language;

He complains
They complain

Singular pronouns go with plural verbs and visa-versa, what's that all about?

Edit: Corrected Let's

Login to post a reply

Server time is: 2024-04-24 02:21:37
Your offset time is: 2024-04-24 02:21:37