Sometimes no onMoveComplete event for iso characters ?
Shri

Gio,

 

I am working on an isometric game.

It involves one player controlled character 'herding' around other non-controlled characters.

Sometimes, the herded characters will become stuck. I can see the animation continueing to loop, but the character is stuck on the grid space (like the old cartoons where the guys legs move but he doesn't go anywhere).

 

It looks like maybe the the onMoveCompete event is not firing ?

 

Any assistance you can provide would be appreciated.

 

cheers

1 Comment
Gio

I know what you mean and I probably know why it happens.

 

when you set a destination for your character, wade.iso calculates a path to reach it. This takes into account any objects with collisions, including your other characters. When the character starts moving along the calculated path towards its destination, if other characters move too, the collision information changes on the grid, so the previously calculated path may become invalid. It sounds like at some point your character wants to go into a cell that's occupied by someone else, therefore it gets stuck.

 

It probably should stop playing the walk animation, that is certainly something to fix on our side. However this probably won't solve your problem.

 

If I understand correctly, you may have several characters with collisions moving next to each other. In this case it may be a good idea to disable collisions for the characters (or some of the characters) while they are moving, by changing their collision map. Then you can re-enable collisions again when you need to calculate new paths, or something like that.

 

I think it would be a good idea to implement a new type of event (let's call it onStuck) in the next update of wade.iso, so that when a character gets stuck that event fires and you can decide what to do (whether you want to re-calculate a new path, go back to the last cell, or wait a while to see if the path is cleared).

Post a reply
Add Attachment
Submit Reply
Login to Reply