Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,602
Reaction score
3,832
First Language
Java's Crypt
Primarily Uses
RMMZ
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
 

dragoonkain

Villager
Member
Joined
Oct 17, 2015
Messages
20
Reaction score
16
First Language
English
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? 
 

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,602
Reaction score
3,832
First Language
Java's Crypt
Primarily Uses
RMMZ
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.
 
Last edited by a moderator:

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,877
First Language
English
How much faster is it compared to the default algorithm?
 

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,602
Reaction score
3,832
First Language
Java's Crypt
Primarily Uses
RMMZ
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.
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,877
First Language
English
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.
 
Last edited by a moderator:

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,602
Reaction score
3,832
First Language
Java's Crypt
Primarily Uses
RMMZ
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.
 

Galenmereth

Retired
Veteran
Joined
May 15, 2013
Messages
2,248
Reaction score
2,163
First Language
English
Primarily Uses
N/A
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.
 
Last edited by a moderator:

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,602
Reaction score
3,832
First Language
Java's Crypt
Primarily Uses
RMMZ
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.
 

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,602
Reaction score
3,832
First Language
Java's Crypt
Primarily Uses
RMMZ
Fixed it now, sorry for the delay :X
 

XGuarden

Veteran
Veteran
Joined
May 10, 2016
Messages
448
Reaction score
17
First Language
French
Primarily Uses
Can we put parameter 0 for tell unlimited searchlimit?
 

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,602
Reaction score
3,832
First Language
Java's Crypt
Primarily Uses
RMMZ
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. 
 

Anchovy

A Fish Called Amy
Veteran
Joined
Jan 9, 2019
Messages
40
Reaction score
26
First Language
English
Primarily Uses
RMMV
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.
 

Latest Threads

Latest Posts

Latest Profile Posts

I hate doing voice over videos but people said they like hearing about the details.
Modern Town Overworld, World of Solaria Dungeon, 80's Retro-Futuristic Font | RPG Maker News #73

I been slowing down and not focusing on project currently.
I had this idea for VTubers vs MOTHER and its a bunch of Vtubers finding eight melodies to fight a psychic alien and a fat kid. IDK, kinda find it hard to use RPG Maker for more than 15 minutes
Working on some wizard/magic bases:
TestChara-10-hover.gif

I mean, technically it's a flying base but I haven't made any wings yet, so magic hovering is it for now.

Forum statistics

Threads
112,300
Messages
1,067,185
Members
145,928
Latest member
Sudrisch
Top