As mentioned in another thread I'm thinking about building my own behavior. I'm working on game prototypes that use grid movement (8way) and currently all my mobs (pc and npc) are using the same logic for movement (plus some basic pseudo path finding for npcs).
Thanks to the awesome help of the community I managed to achieve a good grid movement, that snaps to the grid, checks for walls and even mob collision. Would it be possible to create a behavior that does the same:
- check if mob is moving
- set movement distance (set to grid size via action)
- set movement speed
- support state/condition/variable to set mob as immobile
- support temp. deactivation of control input
- check for collision / overlap with solid objects (for walls, objects and other mobs) as 8way does
- allow custom controls (should be easy to recreate as @rexrainbow already did it in his 8wayMP Behavior)
- allow to set a "move to" grid position (based on grid size) and simply set movement direction to that angle (snapping to either 4way or 8way grid angles as mentioned in this thread)
- check if next block is empty and if not, go either left or right to avoid simple obstacles (And enable/disable this feature via setting or action. It should be only required for AI movement)
Not sure, I got all requirements but that should be about it.
1) Is it possible to build this as a behavior?
2) Is there maybe a behavior that does this already? (not looking at path finding behaviors because they tend to be to slow for larger numbers of mobs)
3) Any tips, where to start or how to tackle this biggie in js?