Character not moving in River Access Cave

For discussion of the code running behind the game

Moderator: Staff

nemesis
Senior Member
Posts: 157
Joined: Fri Apr 29, 2011 7:53 am
Location: Sachsen/Germany

Character not moving in River Access Cave

Postby nemesis » Mon May 23, 2011 12:24 pm

When moving through the River Access Cave and reaching

Code: Select all

-- Event Chain 02: Prevent player from going long route before cave collapse


and triggering this event several times, the character cannot be moved and the menu mode cannot be started. This happens for me mostly after the second or third time this event was started.

However, quit mode is still possible.

Either anyone will fix this or I will have a look later what is causing this later.
nemesis
Senior Member
Posts: 157
Joined: Fri Apr 29, 2011 7:53 am
Location: Sachsen/Germany

Re: Character not moving in River Access Cave

Postby nemesis » Mon May 23, 2011 2:51 pm

Seems to be a bug in the pathfinding routine. I guess, movement is not started correctly and therefore, the destination is never reached, so the event is never stopped.
User avatar
Roots
Dictator
Posts: 8665
Joined: Wed Jun 16, 2004 6:07 pm
Location: Austin TX
Contact:

Re: Character not moving in River Access Cave

Postby Roots » Mon May 23, 2011 5:32 pm

Yeah I've been aware of this issue and it doesn't seem limited to just this event. If you go to top left of the map and walk through the side wall passage, the first round trip between the wall works fine, but the second time the sprite disappears and just gets stuck (doesn't move along its path through the wall). I hadn't started looking into it yet. If its a bug in the pathfinding that would make sense, as I already took a look at the event management code and didn't see any reason why it wouldn't work.

densuke has already been working with pathfinding over the past couple of days so maybe he'll find something.


You know what, I just recalled that the pathfinding code saves past paths to a destination. I bet what is going wrong is that there's a problem re-using the saved path. Probably because it doesn't take the path origin position into account. I bet if I disable that, this will fix that bug.
Image
User avatar
Roots
Dictator
Posts: 8665
Joined: Wed Jun 16, 2004 6:07 pm
Location: Austin TX
Contact:

Re: Character not moving in River Access Cave

Postby Roots » Mon May 23, 2011 5:54 pm

Found the bug and fixed it in commit #1915. The problem was that when we decided to re-use a previous path, it wasn't setting the sprite's direction and "moving" status. The code saw that when it updated the sprite it wasn't attempting to move, hence why it never tried to move it.
Image
nemesis
Senior Member
Posts: 157
Joined: Fri Apr 29, 2011 7:53 am
Location: Sachsen/Germany

Re: Character not moving in River Access Cave

Postby nemesis » Tue May 24, 2011 8:29 am

Very good. :approve:

Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests