Sprite Collision Bug

Get help using Construct 2

Post » Wed Feb 19, 2014 5:20 am

Hey Construct Community,

I'm making a top-down zombie game, and the zombies follow the player. They overlap and stack on top of one another, so I added an ignored 8-directional movement to the zombies. This solved the problem, but now when they collide in large groups, some zombies will automatically be moved to a nearby position, essentially "squeezed out" of their original position, and it does not look clean.

Any tips or links as to how to get the zombies to properly collide with one another while continuing to move towards the player?

Thanks.

Capx: https://www.dropbox.com/s/vresjtu7h0lhm9q/collisiontest.capx

Note: In the .capx, run around the horde of zombies or stay behind the wall to get them compacted, and take notice of their collisions.awmace52014-02-19 13:18:01
B
22
S
4
G
1
Posts: 153
Reputation: 1,938

Post » Fri Feb 21, 2014 10:17 pm

?
B
22
S
4
G
1
Posts: 153
Reputation: 1,938

Post » Fri Feb 21, 2014 10:30 pm

The problem is the bullet behaviour. If you take it off and just use 8-dir, and try to manually munch zombies together, they don't jump around. I don't have an actual solution, but you'd need to use your own seeking/movement algorithm using 8-dir commands. You could ask if anyone has already done this. Or, use a different method.
B
71
S
21
G
230
Posts: 3,687
Reputation: 128,845

Post » Fri Feb 21, 2014 10:37 pm

You have a couple zombies who still have bounce of solids enabled.

They caused that jump when objects are directly behind them and running into something.
Click the zombie in your project tree, then set the bullet behaviour bounce of solids disabled, this should set it for all.
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,562

Post » Fri Feb 21, 2014 10:39 pm

@blackhornet I can't use Pathfinding and 8 direction combined though?

@lennaert In my .capx all the zombies have bounce off solids disabled and the problem still occurs.
B
22
S
4
G
1
Posts: 153
Reputation: 1,938

Post » Fri Feb 21, 2014 10:44 pm

I must have done something different then

capx

edit: nvm I see it now, if the horde becomes really big, it still happens here too, it seems to happen when they turn.
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,562

Post » Fri Feb 21, 2014 10:47 pm

I initially thought I fixed it with that method as well, but when there are 8+ zombies they begin to teleport to a nearby position.
B
22
S
4
G
1
Posts: 153
Reputation: 1,938

Post » Fri Feb 21, 2014 11:03 pm

Pathfinding won't work if you want to actively use 8-dir - it takes too long. Multiple movement behaviours typically don't play well with each other (in my experience).
B
71
S
21
G
230
Posts: 3,687
Reputation: 128,845


Return to How do I....?

Who is online

Users browsing this forum: plinkie and 17 guests