Orange Faster Pathfinding

● ARCHIVED · READ-ONLY
Started by Hudell 14 posts View original ↗
  1. Orange - Faster Pathfinding 1.0
    Hudell
    Introduction
    This plugin will make the default pathfinding process faster.

    How to Use
    This is a very simple plugin. Just activate it on your plugin manager and you're done.
    You do not need this plugin if you're using SuperOrangeMovement.

    Plugin
    Get it from here

    License
    Free for any game.

    Credit and Thanks
    - Hudell
  2. This actually sounds kind of interesting. Are the actual results going to be identical to the original and just cached/memoized or is it running a different algorithm entirely? 
  3. The route will be the same. The only exception will be when an event moves and blocks the path, the character walking will only realize the path is blocked when they reach the blocking event. But if that is a problem I can make it work like before even with a cached route.
  4. Thank you :)
  5. How much faster is it compared to the default algorithm?
  6. Tsukihime said:
    How much faster is it compared to the default algorithm?
    It depends on the distance clicked. The logic behind the pathfinding is the same (with a few extra if conditions), I only changed it to not recalculate the route after every single step, but to keep a cache of the last route instead.
  7. Hudell said:
    It depends on the distance clicked. The logic behind the pathfinding is the same (with a few extra if conditions), I only changed it to not recalculate the route after every single step, but to keep a cache of the last route instead.
    That should be so much faster no matter how you look at it lol


    I didn't look at how the pathfinding was implemented, but if it's doing a full cycle everytime you take a single step, then you're saving an incredible amount of time.


    The fact that the game wasn't grinding to a halt when I was walking from one side of a 50x50 map to the other must mean javascript is pretty fast already.
  8. Tsukihime said:
    That should be so much faster no matter how you look at it lol

    I didn't look at how the pathfinding was implemented, but if it's doing a full cycle everytime you take a single step, then you're saving an incredible amount of time.

    The fact that the game wasn't grinding to a halt when I was walking from one side of a 50x50 map to the other must mean javascript is pretty fast already.
    The default pathfinding also have a clever trick: If it can't find the perfect path in X iterations, it will just move towards the best it found.

    That's why the pathfinding is "clever" on simple maps, but quite "dumb" on more complicated maps.

    On this plugin I made a param to let you configure this max number of iterations. If you set it to 0, the character will only walk straight lines.
  9. I found a tiny bug: if your character stands next to and with the back facing an event that's set to fire on player touch, it doesn't work if you click the event. You'll have to move at least one tile further away from the event for the character to get to turn around and then trigger it when clicking on it. To reproduce, use the Quick Event Creation right-click menu and create a door, place the starting position in front of it, and test play. If you click on the door nothing happens, but if you move a tile or more away first and then click on it, it's fine.
  10. Galenmereth said:
    I found a tiny bug: if your character stands next to and with the back facing an event that's set to fire on player touch, it doesn't work if you click the event. You'll have to move at least one tile further away from the event for the character to get to turn around and then trigger it when clicking on it. To reproduce, use the Quick Event Creation right-click menu and create a door, place the starting position in front of it, and test play. If you click on the door nothing happens, but if you move a tile or more away first and then click on it, it's fine.
    Ah, that makes sense. I'll fix it when I get home.
  11. Fixed it now, sorry for the delay :X
  12. Can we put parameter 0 for tell unlimited searchlimit?
  13. If you set it to zero, the character will only walk straight lines. You can increase the search limit to make the pathfinding smarter (the limit is not about distance, it's about complexity). I wouldn't increase it too much though, as it can cause lag on complex maps. 
  14. Sorry to reply to an older thread, but this is the only place I can find information about this plugin.

    The plugin command works well, but I keep receiving the the following error when using the script call:

    TypeError
    Cannot read property '_x' of null

    I'm trying to include it in the movement routes. I have Event002 trying to follow Event001 using this.setCharacterDestination(1, true); in Event002. This is using "Move Character To" version 1.3 in RMMV.