Improve The Collisions System:

0 favourites
  • 9 posts
From the Asset Store
Particles support animations, collisions, effects and etc.
  • It's been many years that we have the same basic collision system and I think with the new C3 RunTime it could have an Upgrade, as its one of the core behaviours that we use in almost all the Games.

    The issues:

    All these years every time that I try to use the collision for specific cases I never succeed and you ended up spending a lot of time of the development looking for ideas and alternatives for no reason where it could be simply integrated into Construct.

    Example:

    A lot of times I tried to use the bullet behaviour because that was perfect for my needs and simple, but the collisions "bounce out of solid" it never worked properly causing the objects behave abnormally sliding between each other and teleporting instead of bouncing naturally as it would happen if you will use the Physics behaviour which it works smoothly.

    Here is an example:

    Capx: https://www.dropbox.com/s/6cpi1lr61i4rfy2/Collisions%20Problems.capx?dl=0

    Another case is maybe you just need to use the "Move At Angle" Expression but you have no way to do the collisions swell

    I mostly never succeed with the collision when I do a game that is not a platform.

    I propose:

    To have a separate "Collision Behaviour" that works as smooth as the physics and that you could change settings like (Mass, linear Damping, maybe Angular Dumping, etc....) so whenever you add this behaviour to an object then it will calculate the collisions and will adjust automatically the Behaviour that you currently use to move that object.

    Example:

    1-If you are using bullet behaviour, then when the object collides it will automatically change the object (Angle, speed, acceleration, etc....) for you as you have added the New "collision behaviour" to the object

    2-Something similar to help the "Move At Angle"

    3-Also alow to make a perfect round collision bounding box automatically or add a feature like the physics which let you choose a "Circle Collision Mask"

    It's a very needed improvement I hope you take it into consideration as most of my projects weren't platformer and this has been a huge problem for me in almost every project.

    If anyone has more ideas to improve the Collisions please share it here

    And if anyone wants to vote for the Collision Upgrade please vote here:

    https://construct3.ideas.aha.io/ideas/C3-I-1493

    Thanks for reading

  • An idea to add circle collision mask was first suggested 3 years ago, still no comments from Scirra...

    construct3.ideas.aha.io/ideas/C3-I-223

  • I agree that a circle collision mask option would be useful (and more performant in some cases).

    However the rest I'm a little confused by to be honest. It sounds like you want collisions to have full physics simulated responses, in which case why wouldn't you just use the physics behavior?

    The problems you are describing with 'bounce out of solid' etc. happen in every engine I have used that provide similar functionality - most engines don't provide any automatic collision handling outside their physics engine.

  • An idea to add circle collision mask was first suggested 3 years ago, still no comments from Scirra...

    https://construct3.ideas.aha.io/ideas/C3-I-223

    Thanks for pointing it out I haven't seen it before, and also I saw that it been merged three times which suggest that people having problems swell and they are looking forward for solutions.

    Three years is a long time for something that basic that it should be there already. Although not sure if just adding the circle Mask will solve all the problems I think it will need a bit more work than that but that is a start.

  • simstratic

    Hoh, by referring to the physics I meant just as an example of what I would like to have as a smooth collision using bullet, it can be basic too as long as it doesn't behave doing the teleporting and stuff but didn't mean to replicate the whole physics collisions.

    you want collisions to have full physics simulated responses, in which case why wouldn't you just use the physics behavior?

    Yeah that's the first thing I did I spend over a week now trying to balance the Physics settings so I can use just that which would have been perfect but it wasn't possible to make the balance I needed

    Example:

    The balance between (Collisions against objects and Speed To Move objects)

    -Whenever I make the "Speed To Move objects" at the right speed that I need then it will break the "Collisions against objects"

    -And whenever I make the "Collisions against objects" right then it brakes the "Speed To Move objects" so I couldn't have the right valance.

    I could have had everything working on the same day if I could just have more control over the balance.

    The problems you are describing with 'bounce out of solid' etc. happen in every engine I have used that provide similar functionality - most engines don't provide any automatic collision handling outside their physics engine.

    I see, good to know as I haven't used any other engine yet, is there anything that they do other engines to make it better that we could do here?

  • I do feel your pain in trying to balance a physics system, I have been there and it can be frustrating to get right. If your a making a billiards type game like in your capx, some advice would be:

    - Start without collisions. Hit a single ball around until the velocity feels right for the scale, by tweaking density, friction and impulse force.

    - Then test collisions against other balls. Tweak the elasticity and friction of the balls until that feels right.

    - Mass doesn't matter in collisions, it's the relative mass, i.e. the difference in mass between two objects colliding, and mass is calculated by the object size and density, so if the balls are the same this shouldn't really matter.

    - Then bring in the table/walls (immovable objects with infinite density) and tweak their elasticity and friction.

    - If you're still having problems, Construct uses Box2D which is used in a lot of engines, try their documentation and ask around in other forums and you might get some advice on parameters that work well for you.

    In regards to other engines, I find the bullet and solid behavior in Construct better behaved than in other engines. For example, their bullet behavior uses stepping (similar to the physics engine itself) whereas as others will go straight through walls at high velocities.

    But they all fall over in the same circumstances, which you have here, a high density of moving solid objects. In your capx you can see most of the problems occur in the corners or when there is a cluster of balls. The engine is calculating the right collision position, normals etc. but when the object wants to move into a position where another object wants to move too - it becomes a very complex problem to solve.

    One engine returns collision points and normal (outside the physics engine) which is useful if you are coding collisions yourself - but that comes with being limited to single simple collision shape for an entire sprite - i.e. no complex, animated collision polygons like in Construct.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • if you make a pool game don't use stepping collisions because they are unpredictable in nature, make your own collisions with events

  • simstratic

    Thanks for all the tips and for taking the time but I already did all that and as I explained once you start tweaking the second part it will mess up the first part so I cannot have both balanced as I need at least on my case. But is not the first time that I have problems with the collision that the bullet has when I tried to use it with different games so is not only this Game that we need to focus, I'm talking more generally.

    eleanorjmorel

    Looks like is the way to go creating your own systems

  • Anyway Thanks to all for the inputs:

    It's good that I didn't have many hopes on this and glad that at least I have solutions from Rojoh for the collision, I just need to study it and tweek them for my needs.

    So if everyone thinks that doesn't need changes the bullet collisions I'm fine with that as long as I have other solutions like the ones from Rojoh, just thinking new devs to construct would find hard to make those systems at the beginning.

    Peace )))

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