The Daily Click ::. Forums ::. Klik Coding Help ::. Pathfinder for CNC or TGF?
 

Post Reply  Post Oekaki 
 

Posted By Message

EleXor



Registered
  21/01/2003
Points
  269
31st December, 2003 at 07:46:27 -

*TOPIC*


:F

 
n/a

EleXor



Registered
  21/01/2003
Points
  269
31st December, 2003 at 07:47:19 -

SO does anyone know place to get / and or does it excist* anyway








*( I can't spell that ;( )

 
n/a

Tigerworks

Klik Legend

Registered
  15/01/2002
Points
  3882
31st December, 2003 at 07:57:08 -

Yes.

 
- Tigerworks

Jigen



Registered
  12/12/2002
Points
  142
31st December, 2003 at 12:53:59 -

what do you mean with a pathfinder?

 
AKA. Indiana Jones
Join to my forums.
http://s4.invisionfree.com/DOF_Creations/index.php?act=site

Kris

Possibly Insane

Registered
  17/05/2002
Points
  2017
31st December, 2003 at 13:47:47 -

something that finds paths, assumably

 
"Say you're hanging from a huge cliff at the top of mt. everest and a guy comes along and says he'll save you, and proceeds to throw religious pamphlets at you while simultaniously giving a sermon." - Dustin G

Daniel[Crazy_Productions]

Possibly Insane

Registered
  29/12/2002
Points
  2505
31st December, 2003 at 19:52:32 -

take a look at this tutorial: http://ai-depot.com/Tutorial/PathFinding.html

 
Beware of life ...so far noone have survived it.......

EleXor



Registered
  21/01/2003
Points
  269
1st January, 2004 at 12:03:21 -

Umm i mean't, like in RTS game, i click some where, and the soldier walks there. The problem is, he won't dodge any rocks / buildings. So he just bump and bump to it :/ Tell me addres for one? ;F

 
n/a

Tina Petersen



Registered
  19/09/2003
Points
  350
1st January, 2004 at 14:36:33 -

theres a pathfinding extension for MMF! dunno if its there for TGF or C&C
http://extensions.cyber-gaming.co.uk/extensions/pathfind.zip
by z33z

 
- Eternal Life, Or Your Money Back -
http://www.befun.dk/
Currently looking for a home (team)

Kris

Possibly Insane

Registered
  17/05/2002
Points
  2017
1st January, 2004 at 15:35:11 -

what algorithm is that? doesn't look like A*...

 
"Say you're hanging from a huge cliff at the top of mt. everest and a guy comes along and says he'll save you, and proceeds to throw religious pamphlets at you while simultaniously giving a sermon." - Dustin G

Beejay Urzo



Registered
  21/11/2003
Points
  13
2nd January, 2004 at 03:52:04 -

Um, try putting little sprite "detectors" on the objects that will block your path (ie. buildings, rocks etc) and when the character of your game comes near that object, make your character move a little left, or right, up or down, then to the direction of the desired possition. The psuedocode will be like:

loop
{
if charcter is moving up or down and bumps detector,
go left for 1 second then look at direction desired.

if charcter is moving left or right and bumps detector,
go up for 1 second then look at direction desired.
}

of course you must have the desired possition saved (like a value; or just place a sprite, so that that will be the marker for the possition) until you click on another region.

also you can calculate the distance of the x or y of the character in relation to the x or y of the detector and move to the desired way. By this you can have the best possible path for your character (well, best possible means for this crude code)

example

loop
{
if character is moving up or down and bumps detector
-check if which left or right edge of the detector
the character is nearer.
-go to that direction for 1 second then look at
desired direction.

if character is moving left or right and bumps detector
-check if which upper or lower edge of the detector
the character is nearer.
-go to that direction for 1 second then look at
desired direction.
}

Of course this will loop unitl, eventually, the object will not be detected by the detector sprite and continue on its way.

Just convert it to a Click code, I'm much at ease doing pseudocodes.

Don't worry, this works 'coz i've tried it in CNC once and you won't need any extensions. Only the painstaking proccess of putting detectors on every objects. (well you can copy the whole object with the detectors around it and just paste it)

But it will be hard I tell you!!! HARD!!!

(Joke)lol

Image Edited by the Author.

 
The windows are falling... eat your burger

Tina Petersen



Registered
  19/09/2003
Points
  350
2nd January, 2004 at 04:53:36 -

uhm! that wouldn that make the character shake like a rattlecage???

 
- Eternal Life, Or Your Money Back -
http://www.befun.dk/
Currently looking for a home (team)

Beejay Urzo



Registered
  21/11/2003
Points
  13
3rd January, 2004 at 01:44:07 -

Theres a 1 second time for it to look back to the desired direction, so it will not shake... (it'll be slow though). If you want it fast, decrease the time (the faster the loop time the more "shakey it will be")

Oh, you can also have shapes for your detectors so it will conform to your object.

Besides... as i've told you, this is just a crude alternative.

 
The windows are falling... eat your burger

tdc052621



Registered
  20/12/2002
Points
  908
4th January, 2004 at 20:35:01 -

???????????????????????????????????????????????????????????????????????????????????????

 
n/a

Kris

Possibly Insane

Registered
  17/05/2002
Points
  2017
5th January, 2004 at 11:01:07 -

why not put the detectors around the object and have them detect the 'backdrop' instead?

 
"Say you're hanging from a huge cliff at the top of mt. everest and a guy comes along and says he'll save you, and proceeds to throw religious pamphlets at you while simultaniously giving a sermon." - Dustin G

Jimmy Brzezicki



Registered
  16/09/2003
Points
  1057
8th January, 2004 at 08:42:20 -

If you want to know a really long and boring but otherwise easy way then you simply say that when the object is trying to move into a specific zone from a spcific zone it first moves in the direction of a specific point (eg the corner of whatevers in the way). There are obviously a lot of permutations and you're engine needs the objects to know where they're going, and you can't just throw down the terrain and call it a map. But if you can be bothered to do it it'll work.

 
Why the hell am I on the computer at 1 in the morning? No, don't answer.
   

Post Reply



 



Advertisement

Worth A Click