custom 8grid movement behavior - tips and advice?

Get help using Construct 2

Post » Fri Apr 27, 2012 11:19 am

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)

Bonus (+100pts)
- 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)
Bonus (+10.000pts)
- 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?
B
4
Posts: 19
Reputation: 363

Post » Sat Jul 28, 2012 6:48 pm

[QUOTE]
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 ?[/QUOTE]

Would you be able to post a capx of your successful grid movement?
B
11
S
2
G
2
Posts: 26
Reputation: 2,974


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 3 guests