Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
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.... |
||||
|
I call it: Robbo's intersecting path algorithm or RIPA for short :) |
||||
|
cool |
||||
|
I like the name RIPA, cheers mate :) |
||||
|
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....... |
||||
|
A @Robbo, could you perhaps please make a simple .ccb demo showing your RIPA method in action, think would be helpful. Many thanks. |
||||
|
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.... |
||||
|
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; |
||||
|
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 |
||||
|
that's fine. When I have completed my current project can upload a basic sample ccb file for this also... |
|