Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Announcements and Showcase
Robbo's path finding algorithm

Robbo
Guest
Quote
2023-03-13 02:54:26

Been working on new path finding algorithm to suit my needs for indoor (and maybe outdoor) areas and finally got it working.

I would say (for now) its better then A*star algorithm in terms of speed as it doesn't check distance on every connecting path node but rather groups all path nodes into a single path to check against thus much less things to check...

I will post a video soon hopefully....


Robbo
Guest
Quote
2023-03-13 03:07:50

I call it: Robbo's intersecting path algorithm

or RIPA for short :)


edwin123
Registered User
Quote
2023-03-13 05:02:05

cool


just_in_case
Moderator
Quote
2023-03-13 07:20:50

I like the name RIPA, cheers mate :)


Robbo
Guest
Quote
2023-03-22 03:33:20

Cheers guys.

Here is my pathfinding code made available for free to anyone who wants it:

https://robo25.itch.io/fastest-pathfinding-method-its-a-ripa

Its runs superfast and if you name the paths and path names correctly will give you the optimal route also - all without using any distance checks at all.......


Guest
Guest
Quote
2023-03-23 11:52:01

A
@Robbo, could you perhaps please make a simple .ccb demo showing your RIPA method in action, think would be helpful. Many thanks.


Robbo
Guest
Quote
2023-03-23 12:54:36

You would need to code that yourself.

The final path array is calculated for you so just get the node from the name, and its position then send your character to that position - its fairly simple.
You can borrow existing code for this purpose if you like - either 'Just_in_case' free code or 'Svens' version all have the ability to move a player from one location to another. They both include player rotation also or you can use the CC API to do all of that bit easier with "ccbAICommand(alien, "moveto", PlayerPos);"

There are other version floating around also...
Every xxx ms check if the player has reached the next position and if so then move to the next position and so forth....


Robbo
Guest
Quote
2023-03-23 13:01:31

Get the name of the next node starting from the beginning with something like:

var PathID = 0;
var pathNext = pathFull[PathID];
// get the node from 'pathNext' and then its position

when reached that path increment the index and get the next path as above:

PathID = PathID + 1;
var pathNext = pathFull[PathID];

and just check you don't go above the ID max value with:
var pathEndID = pathFull.length -1;


creaturefreak
Registered User
Quote
2023-03-24 05:41:30

Robbo wrote:
You would need to code that yourself.

The final path array is calculated for you so just get the node from the name, and its position then send your character to that position - its fairly simple.
You can borrow existing code for this purpose if you like - either 'Just_in_case' free code or 'Svens' version all have the ability to move a player from one location to another. They both include player rotation also or you can use the CC API to do all of that bit easier with "ccbAICommand(alien, "moveto", PlayerPos);"

There are other version floating around also...
Every xxx ms check if the player has reached the next position and if so then move to the next position and so forth....


Hi Robbo,

Thanks for posting the initial code for your "Path finding" I tried it out in the script window and it seems to do as you say,
it printed the "path", however the difference between your approach and say Svens Pathfinding is quite different. You post the algorithm and code but did not make an example to show it working in CC. That's completely fine for those who are skilled enough at coding but for those who are not it's more difficult. Some users are wired differently in terms of being able to code
directly in JS or use the behaviors/action system. I can code very basic stuff and it really comes hard to me to grasp more complex stuff. Now as far as graphics and creating art, that's my trade and I do that for a living so that comes more naturally.

Please understand I'm not being judgmental on you putting up the raw-code , your contributions are always generous and welcomed, just saying putting up a video like you have in the past we can see it actually working as non-coders. Sven takes it a bit further and offers the code and cc file etc. Again that's his choice. Some of us will never be able grasp "coding" like some will never grasp..oil painting or 3d modeling and animation etc. Any way man that's my 2 cent and again thanks for posting this, and it helps our community.

CF


Robbo
Guest
Quote
2023-03-25 06:56:48

that's fine. When I have completed my current project can upload a basic sample ccb file for this also...


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internation?l" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact