Hi experts, I set an event route to move away from player but noticed that my events that is moving away will get stuck at corners. Any idea how to resolve this? Goblin is the event and the dog is the player. There is ample space for the Goblin to move upwards but he doesn't bother to do it.
Move away from player Event stuck at corner of map
RPG Maker MZ SupportThat is the result of the rather simple algorithms for pathing that come with the engine.
Theoretically it is possible to event your own evading path that works slightly better, but that is a lot of work unless you know what you're doing.
If you have no idea about pathfinding mathematics your best option is to install a plugin that provides advanced pathfinding to events.
Theoretically it is possible to event your own evading path that works slightly better, but that is a lot of work unless you know what you're doing.
If you have no idea about pathfinding mathematics your best option is to install a plugin that provides advanced pathfinding to events.
Someone wrote this on another thread which helps event find player by using pathfinding. This short code made the event a bit more intelligent and walk towards me instead of banging the wall silly. Was wondering if it can be reversed coded to do the same?
Game_Character.prototype.moveTowardPlayer = function() {
const d = this.findDirectionTo($gamePlayer.x, $gamePlayer.y)
this.moveStraight(d);
};
Game_Event.prototype.searchLimit = function() {
return 9999;
};
After re-reading Andar's message I google a different set of keywords and true enough, someone else did write a code to improve the move away behavior. Here's a link to the solution.
Bug - [Bug/Design Gap] Fix Events' "Move Away From" Behavior
DESCRIPTION I noticed something really interesting with the way that Events move when they are assigned to "Move Away from Player" in a move route. While most of the time this movement command works correctly, there are at least two situations where the event will incorrectly fail to move away...
forums.rpgmakerweb.com
Thanks @Andar for your comments. It helped me find the correct answer in another thread.
Original thread: https://forums.rpgmakerweb.com/threads/move-away-from-player-event-stuck-at-corner-of-map.146544/