[REQUEST/EXAMPLE] Per instance collision filtering

0 favourites
From the Asset Store
Per Pixel Destruction like in "Worms" (perfect performance, no third party plugins)
  • Problem Description

    The platform movement is in desperate need of an event that disables collision filtering to allow for individual instances of an object using the movement to react differently to solids. Disabling/Enabling solids for an object is a global change of the solids state, rather than an objects "interpretation" of the solids state.

    Attach a Capx

    https://www.dropbox.com/s/3ezha00yp7da5 ... tairs.capx

    Description of Capx

    Shows a demo of a staircase with enemies, the player and the enemies all using the platform movement.

    Instead of "stairLtoRup" > Set Solid Disabled, I need an event that says: "PlayerObject" > Disable Collision Filtering that works per instance (so, if there's multiple enemies with platform movements, they can each have their collision filterings disabled, and it won't affect the other enemies of the same object.

    Also, this example could be written so that collisions are only detected if certain conditions are met, in which case this example could be written in reverse so that collisions only come on rather than off if certain conditions are met

    Steps to Reproduce Bug

    • Move player with arrow keys
    • Jump off/fall off stairs to ground
    • Notices how enemies react differently to the stairs depending on the players state.

    Observed Result

    The staircase's state changes to accommodate the player, whereas the players reaction to the stairs should only affect the player and not the other platform movement objects.

    Expected Result

    I would like to have instead of "stairLtoRup" > Set Solid Disabled, I need an event that says: "PlayerObject" > Disable Collision Filtering that works per instance (so, if there's multiple enemies with platform movements, they can each have their collision filterings disabled, and it won't affect the other enemies of the same object.

    Affected Browsers

    • Chrome: (YES/)
    • FireFox: (YES/)
    • Internet Explorer: (YES/)

    Operating System and Service Pack

    Windows 7 Sp3

    Construct 2 Version ID

    r224

  • Is this detailed enough, Ashley ?

  • Thanks for putting this together. Tbh I think Ashley wanted a topic here to placeholder for an update to the platform behaviour - this forum is the evernote for tweaks to c2. The case for collision filtering solids is incredibly strong if the behaviour is to be used by more than just one actor.

  • Thanks for putting this together. Tbh I think Ashley wanted a topic here to placeholder for an update to the platform behaviour - this forum is the evernote for tweaks to c2. The case for collision filtering solids is incredibly strong in if the behaviour is to be used by more than just one actor.

    Exactly! It needs to work on a per-instance basis so any kind of NPC that uses the platform engine can respond differently to it's surroundings.

  • Ashley is this a difficult switch to implement into a quick update for c2?

  • Thanks for putting this together. Tbh I think Ashley wanted a topic here to placeholder for an update to the platform behaviour - this forum is the evernote for tweaks to c2. The case for collision filtering solids is incredibly strong in if the behaviour is to be used by more than just one actor.

    I'm still keen on having this as I can't really advance with a game I was working on until it's possible to ignore solids for an object per object. Ashley any ideas when this might be available?

  • No, sorry, we can't give an ETA on any features.

  • No, sorry, we can't give an ETA on any features.

    Would you say it would be difficult or relatively simple to implement for a future C2 update?

  • I've looked in to this a little more. I'm still a little confused by this proposal. So it looks like you want the ability to disable the staircase's solidity independent of the enemies - so you can stand on the staircase while enemies pass through it, or pass through it while enemies stand on it.

    However I'm not sure actually how your suggested "disable collision filtering" action would work, and how that would solve this. The only "collision filtering" the platform behavior does is to filter out any disabled solids. If you disable that "filtering", then it will act like all solids are enabled. So then you will always go up the stairs, never through them.

    So I think I kind of see what you want, but I don't really understand what your proposed action would actually do internally, and how that fixes this. My first thought would be to have a Platform action to say something like "disable solid for this instance only", which isn't anything to do with disabling filtering. Alternatively there could be something like the LOS behavior where you can optionally choose a custom object/family to be solids instead of just using the solid behavior, and then you'd have to have two sets of objects for player and enemy collisions, which could then be separately disabled.

    Either way, the Platform behavior has some of the most complex code in the engine, so I doubt this will be straightforward.

  • I've looked in to this a little more. I'm still a little confused by this proposal. So it looks like you want the ability to disable the staircase's solidity independent of the enemies - so you can stand on the staircase while enemies pass through it, or pass through it while enemies stand on it.

    However I'm not sure actually how your suggested "disable collision filtering" action would work, and how that would solve this. The only "collision filtering" the platform behavior does is to filter out any disabled solids. If you disable that "filtering", then it will act like all solids are enabled. So then you will always go up the stairs, never through them.

    So I think I kind of see what you want, but I don't really understand what your proposed action would actually do internally, and how that fixes this. My first thought would be to have a Platform action to say something like "disable solid for this instance only", which isn't anything to do with disabling filtering. Alternatively there could be something like the LOS behavior where you can optionally choose a custom object/family to be solids instead of just using the solid behavior, and then you'd have to have two sets of objects for player and enemy collisions, which could then be separately disabled.

    Either way, the Platform behavior has some of the most complex code in the engine, so I doubt this will be straightforward.

    Ashley Fair enough, my wording wasn't probably the finest! I think it can be described as simply "per individual instance of any object, can we disable it's interaction and reactions to solid objects" rather than changing the solid's interaction with everyone else. I definitely think the closest would be "disable solid for this instance only" but I know Ruskul and JackieChan had some ideas on this, and JC described the request as "It would be great to have a "ignore collision with selected solid" feature in construct 2 that would work with all behaviors".

    Does my example give any clear indication as to what I kinda need?

  • But if you have an action that says "for this instance, ignore solids", won't it then fall through the floor if it's standing on a solid? It sounds like the only way is to say "for this instance, ignore solids of <family>".

  • But if you have an action that says "for this instance, ignore solids", won't it then fall through the floor if it's standing on a solid? It sounds like the only way is to say "for this instance, ignore solids of <family>".

    Ashley Yes, exactly, this way you can create, as I did in the example, sets of stairs that when you walk under, the stairs become un-solid and when you land on, they become solid, just like an angular jump-through; the difference being that now enemies and even other players would be able to use the stairs as well; at present, if the player is walking under the stairs, the stairs are non-solid, and if the player is on the stairs, the stairs are solid. This action would allow the enemies and multi-players to interact individually with the stairs.

  • Zebbi , this still needs some tuning, but the basics are there.

    Is this what you want to do?

    Yes, i know, it is just a workarround for probaly only the this specific capx. Still hope it brings you to somewhere else then a status quo.

    https://drive.google.com/open?id=0B1SSu ... 3RYeTdfZUk

    Ashley, if you would like to take a look, mayby this shows you the purpose of what is asked. On the other hand i understand that is the same question as 'Can we plz have private obstacle maps?'. Wich i doubt is possible.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Zebbi , this still needs some tuning, but the basics are there.

    Is this what you want to do?

    Yes, i know, it is just a workarround for probaly only the this specific capx. Still hope it brings you to somewhere else then a status quo.

    https://drive.google.com/open?id=0B1SSu ... 3RYeTdfZUk

    Ashley, if you would like to take a look, mayby this shows you the purpose of what is asked. On the other hand i understand that is the same question as 'Can we plz have private obstacle maps?'. Wich i doubt is possible.

    Hmm, seems that the "enemies" are still controlling the overall global solid on/off, which is causing the problems where you can bash your players head against the bottom of the stairs sometimes, you fall off sometimes and you don't always walk under them properly, what was the workaround you implemented?

    Private obstacle maps isn't really what's needed I don't think, just individual object flags for solids.

  • No global solid on/off controlling in what i tried to do. Because thats the cullpritt.

    Just using a jumptrough that is not gooing to the bottom, jumping the enemys on it automatical.

    Player had to press up key allready to acces the stairs, just extending that.

    Yes player jumps against the solids, sorry i hurt his head.

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