Physics with irregular objects.

This forum is currently in read-only mode.
  • I think the collision choices don't give a very good result for anything that isn't a square, a circle, or otherwise polygonal. Should there not be a mask for the outline of an object, or at the very least a more advanced custom mask that does more than just place apparently immovable points that all connect only in straight lines?

    And while i'm on the subject of collisions in general, how about an option for multiple simultaneous masks for sprites/frames? I had a few ideas in mind and that seemed like the most convenient way to do such a thing without working around the lack of the feature. Granted I didn't get to explore much so there may already be an easy solution for THAT problem...

  • The custom mask has to be user defined because while it is possible to automatically generate a pixel-perfect mask, it would be incredibly wasteful on the CPU. If you just click the approximate shape by a custom mask, it is much faster than an automatic mask, and probably closer to what you want as well. As for straight lines only - that's just the way it is - straight lines are fast to process. As for different animation frames - that's true, there's currently no way to do that. But it's tricky - if you switch to a different animation frame with a different mask, which results in the object being stuck halfway through something else, what do you expect to happen?

  • The custom mask has to be user defined because while it is possible to automatically generate a pixel-perfect mask, it would be incredibly wasteful on the CPU. If you just click the approximate shape by a custom mask, it is much faster than an automatic mask, and probably closer to what you want as well.

    For one, the custom mask is already very frustrating to use, not the least of the reasons being that I can't edit it afterwards and there doesn't seem to be a zoom for any precision. For two, if an object happens to have a quarter circle in it or something along those lines, what do I do about that? Actual games apparently don't have any difficulty doing these things, so why should construct?

    As for straight lines only - that's just the way it is - straight lines are fast to process.

    o that's it then? "It won't do it because if someone chooses to do it this way the system requirements for their game will go up and therefore nobody must be able to do anything remotely useful as long as it takes processing power"? I've already had this argument before and it makes no sense, since you're so into using pixel shaders and all that fancy stuff but you're not into anything actually useful in creating games. I prefer functionality over gimmicks.

    As for different animation frames - that's true, there's currently no way to do that. But it's tricky - if you switch to a different animation frame with a different mask, which results in the object being stuck halfway through something else, what do you expect to happen?

    hen whoever made it that way just do it properly. I don't see why we shouldn't have to deal with design bugs we create on our own.

    You missed the multiple mask bit that I mentioned but i'll assume it was the one thing you didn't object to.

  • There's not really a need to get sour at Ashley cause he isn't turning construct into what you want it to be. Give the guy a break, he already has a million things on his plate to do for construct, I'm sure he could find a way to do what you want, but construct IS currently in beta and i think, for general use purposes, the custom mask works quite well, i mean i'm glad we even HAVE a custom mask cause we didn't before.

    Just be patient, I'm sure there will be some alternative/solution on its way, plus he does kinda know what he's talking about when it comes to all the cpu stuff, i trust his judgement on what should and shouldn't be in construct

  • There's not really a need to get sour at Ashley cause he isn't turning construct into what you want it to be. Give the guy a break, he already has a million things on his plate to do for construct, I'm sure he could find a way to do what you want, but construct IS currently in beta and i think, for general use purposes, the custom mask works quite well, i mean i'm glad we even HAVE a custom mask cause we didn't before.

    Just be patient, I'm sure there will be some alternative/solution on its way, plus he does kinda know what he's talking about when it comes to all the cpu stuff, i trust his judgement on what should and shouldn't be in construct

    But the thing is the way it's being brought to me, it's being said "this can't and never will happen". I probably wouldn't be so ticked if the suggestions weren't being brushed off so quickly.

  • Well i do kinda see where ashley's coming from with the pixel perfect mask, because people are going to make games with hundreds of objects with complex pixel perfect masks flying about and then complaining to him about why the game runs so slowly, even if pixel perfect or hybrid masks do come in, i would still like the custom one too. Perhaps a slightly more user friendly version, but i can't really complain since i'm getting this program for free, plus it's still in development, maybe a better solution to pixel perfect physics collisions will come around, who knows? not me

  • For one, the custom mask is already very frustrating to use, not the least of the reasons being that I can't edit it afterwards and there doesn't seem to be a zoom for any precision. For two, if an object happens to have a quarter circle in it or something along those lines, what do I do about that? Actual games apparently don't have any difficulty doing these things, so why should construct?

    If you want more precision while placing the points, hold down the control button and use the scroll wheel to zoom into the layout. That will allow you to place them more precisely.

  • If you want more precision while placing the points, hold down the control button and use the scroll wheel to zoom into the layout. That will allow you to place them more precisely.

    see. That would have to do for now, but it won't do anything for curved lines.

  • You might be suprised how much stuff in 'actual' games is faked, including physics. Stuff that looks awesome - like the barrels in crysis - upon further inspection, there's intersecting objects everywhere if you pile a lot of them of top of each other. Every smooth rounded surface really is composed of a bunch of flat, uncurved polygons, because that's what 3D is based on. Even when working with stuff like nurbs they're converted to polys because that's what is most efficient and fastest, and 'actual' games are also all about speed. Even the smooth looking characters in animated movies are made of a bazillion flat polygons. If you want a smooth curve, zoom way in and set a whole lot of points.

    One thing that would be very helpful though that you mentioned, is the ability to move points that have already been placed.

    Edit: I don't mean to get anyone mad with this post - just trying to point out that even game developers in AAA studios with multi million dollar budgets need to fake stuff all the time so that their games can be playable - for example, that's what normal maps are all about! 'Faked' geometry, because graphics cards have limits on the number of polygons they can push, and as such physics gets faked too.

  • For one, the custom mask is already very frustrating to use, not the least of the reasons being that I can't edit it afterwards

    Agree. David said in his original implementation that he would expand on it in the near future to properly be able to select and move around points; it is very limited at the moment, but decidedly better than not having a custom collision mask at all. It's definitely unfinished though.

    [quote:rpt6xbib]if an object happens to have a quarter circle in it or something along those lines, what do I do about that?

    Approximate it with a series of straight lines. Seriously, as far as I know, all commercial games also do this. A true curve is a rare thing to come by in computing simulation - as Arima said, they're faked. The physics interactions of a surface approximated by straight lines should be comparable to if it were a true surface. The more lines you use the more accurate it will be, but the more CPU it will use.

    Also, Box2D physics (the engine behind the Physics behavior) doesn't support curves anyway. So we're stuck there!

  • Approximate it with a series of straight lines.

    I never said it had to be a true curve.

    Since we're now talking about using straight lines anyway, why not include that type of option? I used to mess around with a Doom level editor that could take a line and curve it with an adjustable amount of precision by adding extra vertices equally along the line. Would it be too much to eventually add a feature to approximate a curve of one's choice automatically? By hand it's doable, but for the sake of accuracy there should be an option like that in the end... Maybe even an option to approximate the outline of an object as my original concern was?

    And one last thing while i'm posting this: Can a hollow object be made, either now or eventually, using these custom masks? This isn't anything that would be of use to me, but I may as well ask.

  • Box2d allows you to have collision shapes that are made up of multiple polygons, so eventually I'll impliment custom collisions so that you can add points inbetween points, start a new shape, possible subtract one shape from another to make hollow objects etc. As It stands, if you need to make a hollow object you'll need to make a small gap in one of the faces. As for curves the only type of curve box2d supports is a regular circle....any other type of implimentation would have to be by approximating a curve with straight lines and that kind of maths escapes me. Besides I find zooming in on my sprites and placing points around perfectly adiquate. Finally I'd like to remind you that Construct is free...I mean its not like we've charged you $300 and expect you to type in the co-ordinates of each point manually via actions

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • While we're on the subject of collision masks, I'm sure i've said this before but haven't got feedback

    David, surely you're aware that at the moment, the ellipse collision mask draws a perfect circle rather than an ellipse with the dimensions of the sprite right? is that going to be fixed?

  • Yeah...box 2d doesn't support ellipses....I could approximate it with a circle made out of polygons...how many points do you think I should use? I decided 32 because thats how many ends are on the London Eye

    Edit : Ellipses now work yay!

  • I dunno what that is but it works for me

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