Indie Dev

Hello Guest!. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, sell your games, upload content, as well as connect with other members through your own private inbox!

pathfinding lag when clicking unpassable tile

polar_fawkes

Towns Guard
the player character pathfinding seems to recalculate every step when the clicked tile is either unpassable or an event set to same layer as player. this results in super jittery movement. if one clicks the adjacent, passable tile, the movement is smooth. i get that we need to keep checking the path to see if it was an event that was blocking the path that has since moved, but it's very noticable and jarring.

have yet to test with iphone export, but i would assume it would experiecne the issue as well. wouldn't feel right to put a tutorial sign saying 'click adjacent to avoid lag'
 

eivl

Local Hero
Xy$
0.00
Not sure, but cant seem to replicate what you are telling us. Can you instruct me how to replicate this?
 

polar_fawkes

Towns Guard
setup:
create a new map. 120x120. fill x:0..119, y:0..59 with unpassable tile. set start party position to around x67y67. create an event about x72y72, add a graphic, ensure it is set to same level as player. add some placeholder, like give gold 10, erase event.

control:
using a mouse, single-click lmb on a passable tile on the far right of the screen. map scroll and character movement is smooth.

steps to reproduce:
from fresh boot, click on the unpassable tile on the far right of screen that is touching the passable tile. each time the sprite's animation completes and it is centred on the tile, for a split second, the game stops moving. common events, the player character, screen scroll. this occurs for each tile walked until one reaches tile.

from fresh boot, single click the unpassable common event pickup. again, while clicking on the passable tile adjacent to the common event will yield smooth player movement/screen scroll, clicking directly on the common event yields the same problem. upon arrival at each tile, the game stops for a noticeable split-second.

theory:
on mouse click, we are immediately calculating the route, flagging it as 'unreachable,' and executing one movement of an alternative route that gets the player as close to the xy request of the player as we can calculate. we then, quite intelligently, don't just assume that it will remain unreachable. after all, what if the route is simply blocked by a high-frequency movement, same level as character event? so, on arrival at new tile, if unreachable, recalculate.

the issue is, our pathfinding takes a noticeable split-second to process. i have absolutely no clue if anyone on these forums actually is under the employ of/in contact with the american wing/distributor for rpg maker mv, much less if those surely lovely individuals then have a line of communication through their contact at kadokawa to their internal qa department to file bugs(if they have a jira/bugzilla/whatevs), but this bug is a huge pain point during long play sessions where maps are scrolling more often than not. this is especially a problem with click and drag/high apm gameplay preferences(a hugely marketable selling point for me as a developer).

as i typed this, i also should note, i have the game window resolution set to 1280x720 via a plugin. it's possible that QA just didnt go out of their way to test a plugin that didnt exist before launch, and thus optimized pathfinding to be perfetly optimized for the farthest tile from the centre of the screen of the default resolution.
 

eivl

Local Hero
Xy$
0.00
When i get home and on my editor i will test this. what plugin do you use for changing the resolution?
 

polar_fawkes

Towns Guard
a couple more i spotted that might be related.
resolution: YEP_CoreEngine
diagonal movement: GALV_DiagonalMovement
Mouse: TDDP_MouseSystemEx
 

eivl

Local Hero
Xy$
0.00
try deactivating diagonal movement. What most of these plugins do is to split every tile in multiple parts, so in stead of 1 tile you will have 25. and then pathfinding might be problematic. disable diagonal movement and see if the problem is still there.

If it is, please send me a project where this problem exist (a demo with one map) so i can look more at it.
 

eivl

Local Hero
Xy$
0.00
It is just in fact to overcome the way movement is coded from the start.

If this is the case then we would need to replicate pathing on a 5*5 scale or whatever the diagonal plugin uses.
 

polar_fawkes

Towns Guard
christ.... workaround might be to provide a version without diagonal pathing for mobile, export an exe with it enabled for pc because it's best w controller anyway. but then id need a way to enable it on-fly for those who would prefer high-apm diablo-esque navigation, or discourage it altogether. id like to include that high apm support if possible tho. no need to force the player unless i cant figure out how to disable diagonals during game.

this might totally be doable. again ill keep you posted on what i find when i get a chance to do some dev work later.
[doublepost=1452811834,1452811654][/doublepost]the thing that blows my mind on the kadokawa-side responsibilities, is command and conquer 1 and warcraft 1 solved this issue super efficiently. in the 90's. in dos. with multiple actors calculating pathing simultaneously. diagonal should come before mouse input in the feature list. it's such a strange business model we're dealing with here @eivl...
 

eivl

Local Hero
Xy$
0.00
well.... i would say that it is the plugin authors job to make it work, but it is very easy to forget about tuch and pathing methods as they are not easy to test. I know who Galv is, he is extremely talented, he is as an example making a plugin that supports airship top/down scrolling combat with laser and rockets and stuff like that! like the old Raptor game ;)


What you could do is make a small project sample (like 10 MB or so) that demonstrates the problem and i will talk to Galv about it! ;)
 

polar_fawkes

Towns Guard
totally. and i suppose you're right. kadokawa is putting out a product that they intend to be 4-directional. yeah you're totally right. thanks for clarifying there. i go into rages without looking at the basic economics of the situation sometimes.

awesome! re: galv! let's definitely hold off on escalating to the man himself until i've had time to try to repro under the conditions you suggested. my work(dayjob) is going fucking craaazy right now, so i havent been able to check yet.

disclaimer: i'm totally being short-sighted and not keeping in mind that this is a public board, not a shooting-the-shit private chain of messages. if anyone else is reading this, my overarching sentiment is that the the plugin guys(developers) know more than the users(designers/consumers/me). all respect goes to the people who do this for free, sorry for getting shouty as i explore the speculative bounds of verbosity
 
Top