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 Discussion / RTS pathfinding

Author
Message
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 28th Jan 2004 04:36
You're best off learning Sin & Cos...

Ah, goed, Als u het hard vindt, doe het niet, lol.
Vraag om hulp van mensen, altijd de beste manier om het te doen, geen behoefte beklemtoond te worden.

I don't know how understandable that is... lol, I'm no good with Dutch.

Jess.


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
VishalC
21
Years of Service
User Offline
Joined: 14th Jan 2004
Location:
Posted: 28th Jan 2004 18:10
hey that's very cool. i can actually understand bits and pieces of that dutch. i do a language called afrikaans, its very similar (think it originated from dutch). ek kan nie dutch praat nie maar ek is goed in afrikaans. Hoekom praat ons in hierdie taal? Tell me if you can understand that!

If it wasn't for the last minute, nothing would get done!
Sjakie
21
Years of Service
User Offline
Joined: 17th Dec 2003
Location: Netherlands - Delft
Posted: 28th Jan 2004 18:50
Wow... Afrikaans is very similar to dutch... thats because south-africa has been a colony of holland.

@Brickman - I understand that! In english it is something like this:
I can't speak dutch but im good in afrikaans. How come we speak this language here?

@ Jess - This means: Ah ok, if you find it hard, don't do it, lol. Ask help from other people, thats the best way to do it, - and i dont understand that last part - ...

But ehm... i actually asked for help, lol

Juzt a dude who likez progging - Me loves RTS games
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 29th Jan 2004 10:56
lol, I just whacked exactly that into a translator, and switched it from English to Dutch ( I couldn't miss out on the conversation, lol )...

The text that you and Emporer Baal worte in Dutch came out as a load of sh*t when I translated it to english, lol.

Jess.


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
Sjakie
21
Years of Service
User Offline
Joined: 17th Dec 2003
Location: Netherlands - Delft
Posted: 29th Jan 2004 18:27 Edited at: 29th Jan 2004 18:30
Thats because it was sh*t! lol

This is my translation of that talk between me and Emperor baal (lol)
I know it's hard! Those drawings are hard too! AAAAAAH!!!

But ehm... help?

Juzt a dude who likez progging - Me loves RTS games
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 30th Jan 2004 05:25
lol, so you still need help with Sin and Cos? Yeah?

You're best off picking up an advanced math text book, and learning it from there, and how to actually use it in 2D, then you can apply it to your code.

Get your dad to help you if he can ( It's alot easier to explain it with drawings etc. ).

Jess.


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
Travis
21
Years of Service
User Offline
Joined: 9th Nov 2003
Location: West Aust.
Posted: 30th Jan 2004 10:07 Edited at: 31st Jan 2004 04:50
happy happy joy joy
Killercube 32
21
Years of Service
User Offline
Joined: 30th Jan 2004
Location: Planet X
Posted: 31st Jan 2004 00:16
I like your code, it's nice. Only problem i see (don't know if u want it this way) is that it takes 2 clicks for cube to move.

Anyway i think i'll use this. If i do i will include you in credits
Jess and sjakie

-killercube

I thought i said that i was playing zelda outside grandma!
It was a secret!
DarkBasic Projects:Nightwalker,RTS Game
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 31st Jan 2004 09:52
Thanks for the compliments cube

Soon, very soon, I will be working on my own ( more complex ) pathfinding system ( as I too am making an RTS, just like everyone else seems to be doing, lol ), and when I have it going strong, I'll post the code here for all to see and use


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
Travis
21
Years of Service
User Offline
Joined: 9th Nov 2003
Location: West Aust.
Posted: 31st Jan 2004 10:37 Edited at: 31st Jan 2004 11:38
that would be extremely helpful, id like to get into makign an rts and having that would be great
Sjakie
21
Years of Service
User Offline
Joined: 17th Dec 2003
Location: Netherlands - Delft
Posted: 31st Jan 2004 21:16
Yeah jess good idea

Juzt a dude who likez progging - Me loves RTS games
Sjakie
21
Years of Service
User Offline
Joined: 17th Dec 2003
Location: Netherlands - Delft
Posted: 7th Feb 2004 09:49
Hows the progress of your Pathfinding developement Jess?

Juzt a dude who likez progging - Me loves RTS games
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 7th Feb 2004 11:06
Well, not so good so far, lol.

I have been thinking ( and writing ) idea's of how I will work out the path of the object, but each time I figure it out, I realise that DB won't be able to handle the massive amounts of calculations needed to pathfind around 100-200 units per frame... ( ie, if you were to move all of your units + enemy units at the same time. )

I have an idea at the moment ( it's the same as the others, yet uses short-cuts to speed it up ) But actually implimenting it might be a bit difficult.

But, I WILL do it, and when I do, you can all see my functions

Jess.


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
Sjakie
21
Years of Service
User Offline
Joined: 17th Dec 2003
Location: Netherlands - Delft
Posted: 7th Feb 2004 16:14
OK then, ill wait

Juzt a dude who likez progging - Me loves RTS games
Sjakie
21
Years of Service
User Offline
Joined: 17th Dec 2003
Location: Netherlands - Delft
Posted: 7th Feb 2004 19:08
Hey Jess, maybe this can work:

A line with several points is drawn between unit and target (the longer the line, the more points). Check for each point if the curren position of it is ok, else move the point left and right to find a place that is good. From all the good places it finds, check wich one is the shortes to the place where the point was originally located (as that place is the shortes to the target). Then go to the next point on the line. Pretty wierd explaination, i know, maybe this helps


Maybe this is useful, dont know

Juzt a dude who likez progging - Me loves RTS games
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 8th Feb 2004 06:00
Yes, that's basically what I am trying to make, but with mine, instead of doing it like that, which would mean that the object moves up to the blockage, THEN turns toward the gap, I will check ALL available paths to the destination position, which would result in the object forst pointing at the gap, THEN moving, thus taking the shortest possible route.

ie;




In my bottom example, the unit would move straight to the first way point ( the second way point in the first example ) instead of just pointing at it's destination and moving.

As you can probably tell, this would take a bit to calculate, that is why I have scrapped a few of my idea's, as they would create way too much lagg.

Jess.


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
Slayer
21
Years of Service
User Offline
Joined: 15th Nov 2003
Location: CA
Posted: 8th Feb 2004 06:33
Tell me what you think of my path finding. Still working on it.
It works very well.

http://darkbasicpro.thegamecreators.com/?m=forum_view&t=25531&b=5

I dont know how to spell
Sjakie
21
Years of Service
User Offline
Joined: 17th Dec 2003
Location: Netherlands - Delft
Posted: 8th Feb 2004 11:16 Edited at: 8th Feb 2004 20:12
Is that done in dbc or pro? Works great btw

Juzt a dude who likez progging - Me loves RTS games
Slayer
21
Years of Service
User Offline
Joined: 15th Nov 2003
Location: CA
Posted: 9th Feb 2004 01:25
If you were talking to me. It was made in pro.

I dont know how to spell
Sjakie
21
Years of Service
User Offline
Joined: 17th Dec 2003
Location: Netherlands - Delft
Posted: 9th Feb 2004 16:40
OK Thnx 4 info

Juzt a dude who likez progging - Me loves RTS games
Sjakie
21
Years of Service
User Offline
Joined: 17th Dec 2003
Location: Netherlands - Delft
Posted: 13th Feb 2004 19:38
Damn! I tried something myself... this is HARD!!!

Juzt a dude who likez progging - Me loves RTS games
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 14th Feb 2004 03:19
It really is, yes.

You're best off setting it all up on paper.

Create an example of a simple test on paper, ie, draw out a little area that needs to be pathfinded ( pathfound? ) like we were drawing the ASCII art above.

Once you have it all drawn up with the exact directions that you want it to go, then start writing Psuedo Code of what you want to check for.

ie, first you would check for collisions and then turn it so that it's going around the object etc. ( using my original snippet as an example )

And once you have it all planned out on paper, you can START to code it, but make sure that you do it all in modules, and that you are continually testing it so you know what's working and what isn't.

Also, if you end up using a virtual grid system in the pathfinding ( A* ) then you can draw that onto the paper so that you can see where the unit will be in relation to each grid section.

Just make sure that you plan it out first, otherwise you're just gonna get stuck and extremely frustrated with it as you will not know what the problem is.

Hope I Helped...
Jess.


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
Sjakie
21
Years of Service
User Offline
Joined: 17th Dec 2003
Location: Netherlands - Delft
Posted: 14th Feb 2004 19:10
I know the problem... the cpu power...lol

Juzt a dude who likez progging - Me loves RTS games
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 15th Feb 2004 14:13
lol, yeah, you need to come up with a way of eficiently updating the destinations and setting waypoints extremely fast.

Good luck

Jess.


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
Sjakie
21
Years of Service
User Offline
Joined: 17th Dec 2003
Location: Netherlands - Delft
Posted: 17th Feb 2004 21:33
I know... the next guestion -> HOW DA F*CK????? IM BREAKIN MY HEAD ON THIS!!!!!!!!

Juzt a dude who likez progging - Me loves RTS games
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 18th Feb 2004 09:30
Try writing an A* Algorithm... Have a look here for the basics of what it is;

http://www.policyalmanac.org/games/aStarTutorial.htm

It's a bit of a read, but it's pretty good.

A* Is an entirely dynamic system, which means that you can set a unit off to it's destination, and it will find a path there even if you, say, put a bulding in it's way, it'll just walk around it.

You could also make a non-dynamic system that could potentially be alot faster ( as it wouldn't have to check every single direction each time the unit moved ), but you would encounter problems when new obsticles are placed in the units path, so you may then need to use A* to navigate around that.

It's up to you how you decide to do it all...

Hope I Helped...
Jess.


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
Sjakie
21
Years of Service
User Offline
Joined: 17th Dec 2003
Location: Netherlands - Delft
Posted: 18th Feb 2004 17:53
Hmm... looks hard... but ill try

Juzt a dude who likez progging - Me loves RTS games

Login to post a reply

Server time is: 2025-05-23 12:30:08
Your offset time is: 2025-05-23 12:30:08