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.

DarkBASIC Professional Discussion / Pathfinding (work in progress)

Author
Message
flibX0r
23
Years of Service
User Offline
Joined: 14th Feb 2003
Location: Western Australia
Posted: 8th Jul 2003 13:31 Edited at: 8th Jul 2003 13:48
After trying for days to impliment A* style pathfinding into our game (Children of Sivara), i've decided to bugger it, i'll do it a different way. And so i've decided to go with the trend of todays games: Waypoints (or path nodes). Below are some pics of the Work in Progress path node editor that i will release on completion (Open Source)




It works for the moment, but the code's messy so i'm gonna clean it up. In the program you can do the following:

-Create and Move path nodes
-Connect path nodes to other path nodes
-Define the radius of the path node (to tell what node your player is near)
-Load and Save nodes

So what do you guys think?

"But we couldn't do that Mr Flibble," questioned Rimmer. "Who'd clean up the mess?"
Twin P4 Xeon 2.0 Ghz, GeForce Quadro4 XGL 128MB, 1Gb DDR RAM, Twin 19" Flat Screens
Bangla
23
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: Sweden
Posted: 8th Jul 2003 17:01
I think it's a wonderful idea! Everyone could benefit from smart pathfinding algoriths in their games, even if AI-bots does earn their money in most shooters. And an editor is just perfect! Good job! I hope you'll complete it soon so we can have a look at it! =)

400 Mhz, 120 Meg, TNT2 - and then some...
Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 8th Jul 2003 17:44
Totally off topic, I know, but do you have enough polys in that scene?!?!? Do you think you could squeeze a few trillion more in anywhere?

Just playing.

Machine: P4 2200, 1GB RAM, GeForce4 64MB, Audigy Platinum
http://www.breakbeat-terrorism.co.uk
(It's not all about the coding)
MiniMark
23
Years of Service
User Offline
Joined: 21st Mar 2003
Location: Australia
Posted: 8th Jul 2003 18:11
Hate to inform you Fallout but this is our low poly version, we just used it to test the pathfinding. Our Game model has lots more, Flibble might even know how many more, but as they are based off same dimensions using the low poly model was a lot more efficient for testing purposes.. And I believe the source will be posted withing the next two weeks .... Just need to fully test it first.

Build A Bridge, then get OVER IT...
--Twin P4 Xeon 2.0 Ghz, GeForce Quadro4 XGL 128MB, 1Gb DDR RAM, 19" Flat Screen--
UberTuba
23
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Brittania
Posted: 8th Jul 2003 19:06
This map could be optoomised so much, the sides of those stairways
should have way less polys

Life is a terminal disease.
You never survive it.
flibX0r
23
Years of Service
User Offline
Joined: 14th Feb 2003
Location: Western Australia
Posted: 8th Jul 2003 20:06
darkfluff: Yeah, i know. Its an old version of the model and it was made mainly by modifying primitives. Our ingame model (well, models) they are cleaned up but in total have more polies cos they are heaps more detailed. But yeah, the model is a simple one i used just to make the path nodes.

I should release the source sometime, with a pthfinding routine included in it so all you need to do is load yer model, create the nodes, and load it into yer game.

"But we couldn't do that Mr Flibble," questioned Rimmer. "Who'd clean up the mess?"
Twin P4 Xeon 2.0 Ghz, GeForce Quadro4 XGL 128MB, 1Gb DDR RAM, Twin 19" Flat Screens
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 8th Jul 2003 20:22
There's A* code in the Code Snippets that I did some while back - still the fastest so far in DBPro *smug grin*. Feel free to use it.

But please don't stop doing the waypoint based stuff - it looks really cool I'm looking forward to seeing it in action!
flibX0r
23
Years of Service
User Offline
Joined: 14th Feb 2003
Location: Western Australia
Posted: 9th Jul 2003 01:23
I did it!!!! To quote Dr Zoidberg: "Woop woop woop woop woop woop woop woop..."

Oh, IanM, the thing is, it uses A* to find the path between nodes. And i don't know, my algorithm is damn fast... *evil grin*

I'll post it online soon. It now calculates the fastest and shortest path between points, and unlike A*, its 3d, meaning you can move in all 3 axis. Its sooooo cool.

"But we couldn't do that Mr Flibble," questioned Rimmer. "Who'd clean up the mess?"
Twin P4 Xeon 2.0 Ghz, GeForce Quadro4 XGL 128MB, 1Gb DDR RAM, Twin 19" Flat Screens
flibX0r
23
Years of Service
User Offline
Joined: 14th Feb 2003
Location: Western Australia
Posted: 12th Jul 2003 08:14 Edited at: 12th Jul 2003 08:17
Oki, heres the source...

Editor:


Just replace modelname.x with the name of the model you want to use as a guide to model.
Controls:
- w, s, a, d to move the selected node
- [ and ] to change the selected node
- , and . to change the radius of the node (for calculating what node your player is on
- q and e toggle the node existance
- 1, 2, 3 and 4 let you set the node links
- Enter saves the data as pathnodes.node
- L loads pathnodes.node
Note: for the moment, you cannot have seperate node areas, meaning all nodes must be able to get every other node via links and other nodes.


The big function:


Just put this and the LoadPathNodes() Function in yer game and run the function. It will return 1 if it finds the path (almost always). The pathfinding node data is stored in PathBank (which is an array).

Please reply if yo have any troubles

"Time not important only life important...
I have no life so time is irrelevent..."
Twin P4 Xeon 2.0 Ghz, GeForce Quadro4 XGL 128MB, 1Gb DDR RAM, Twin 19" Flat Screens
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 12th Jul 2003 12:16
Your code is currently missing 6 arrays - OpenList, OnOpenList, ClosedList, ParentNode, Cost and pathBank.

Can you tell me what size these should ideally be? Or better still, post the code for them so I can cut'n'paste.
ICERGB
23
Years of Service
User Offline
Joined: 8th Nov 2002
Location: Canada
Posted: 12th Jul 2003 14:04 Edited at: 13th Jul 2003 14:16
Sorry...
[message deleted]
flibX0r
23
Years of Service
User Offline
Joined: 14th Feb 2003
Location: Western Australia
Posted: 13th Jul 2003 09:12
Sorry IanM, forgot about those
Here they are:



I realize i could make it into one really big array, but i kept it like that so i could understand what i was coding

"Time not important only life important...
I have no life so time is irrelevent..."
Twin P4 Xeon 2.0 Ghz, GeForce Quadro4 XGL 128MB, 1Gb DDR RAM, Twin 19" Flat Screens

Login to post a reply

Server time is: 2026-07-21 09:55:35
Your offset time is: 2026-07-21 09:55:35