nickm980 / smallville

Generative Agents for video games. Based on Generative Agents: Interactive Simulacra of Human Behavior
https://nickm980.github.io/smallville/
MIT License
654 stars 53 forks source link

Example game bug where agents slide diagonally instead of moving straight #9

Open nickm980 opened 1 year ago

nickm980 commented 1 year ago

Describe the bug

Agents will occasionally move diagonally to the next square instead of turning right at 90 degree angles (for example at the timestamp 0:03) when calling this function

moveAgent({ scene: this, name: "Medina", location: "Red House", })

https://github.com/nickm980/smallville/assets/81270095/3e357f18-09da-4348-b135-f025fe22a6bb

Expected Behavior

Agents should move 90 degrees to their next location without any diagonal movement

Desktop (please complete the following information):

OS: Windows Browser: Chrome Version: 113.0.5672.127

Stan-Stani commented 1 year ago

I'll look into this

Stan-Stani commented 1 year ago

https://github.com/prettymuchbryce/easystarjs

So it looks like navmesh doesn't support axis-aligned movement out of the box. I looked into some other solutions and easystar seems like it might be better if we really need this kind of movement.

nickm980 commented 1 year ago

https://github.com/prettymuchbryce/easystarjs

So it looks like navmesh doesn't support axis-aligned movement out of the box. I looked into some other solutions and easystar seems like it might be better if we really need this kind of movement.

Ok - it's not a huge problem because it's mostly aesthetic, but we should probably eventually switch to easystar. It might be better to work on #18 and #17 first and come back to this later