Collision-Based Combat Stopping Unexpectedly

  • I'm gonna try and attach a copy of an in-progress school project. Gameplay works as desired for awhile, but in 9/10 games, after a minute or so, combat between units stops. They just start to stack up against eachother. I've tried disabling 'solid' as I know it's ignored by the physics behavior, but without solid, the units just walk past eachother (which I don't want). Anyone have insight as to why the units would suddenly stop? Thank you.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • From what I gather, this is the best way to share a project?

    drive.google.com/drive/folders/1WlHEzfFi5CKFX74r_EF4JJY8fnsj7Zhv

  • Why do you need Physics here? You should avoid using Physics with Platform, Solid and other behaviors, it can cause all kinds of problems. This is clearly a platformer game, you should remove Physics. If you only need it to "freeze" dead enemies, you can simply disable Platform behavior.

    Also, you have some logic problems in the code, I didn't check everything, but events like "Enemy Health<=0, Trigger once" are wrong. Trigger once doesn't work per instance. If one instance has Health<=0, then this event will not be executed for other killed enemy instances.

    Since you are disabling collisions, you can change this event like this:

    Enemy Health<=0
    Enemy collisions enabled
    .......Enemy disable collisions
    .......Enemy disable Platform
    .......Enemy Set animation to "Death"
    ........
    

    Same with Player sprites.

    Besides, there is a mess with collision polygons in your animations. They all are different sizes and shapes. As a result, when animations are playing, collision and overlapping checks will not work correctly, on one frame player may overlap an enemy/obstacle, on another frame not.. It's recommended to use an invisible sprite with Platform behavior, with a single frame and rectangular collision polygon. And then you pin your animated player/enemy object to that sprite (like skins).

  • Sorry for the delay, we've been troubleshooting some things and then had the holiday. Thank you dop2000 we will try your example!

    I already have it set to ignore input on Platform Behavior, but I guess I could try disabling it altogether.

    Your sprite 'pinning' idea is interesting -- I'd not heard that. Makes a good deal of sense though. I'll have to look into how to 'pin' but I imagine that can't be too difficult.

    Thank you again for your suggestions and for taking the time to investigate and reply!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)