Pivot Joints and apparent elasticity

@fdt40: link works for me.

So I tried Montage’s solution and made all my static objects dynamic, and attached them to non-colliding static “anchor” invisible objects. While it did seem to improve the stretchy joints on the ragdoll somewhat it didn’t remove the problem for especially hard/fast collisions, and adding an extra display object, physics body, and joint to fake each static object was way too slow on devices I tested on, for the # of objects I have in a level. It basically halved my framerate. As Montage said, I guess I am out of luck.

I have spent probably a week on this one particular problem without a satisfactory solution or workaround. It seemed like there was some traction with Ansca on this issue a few months ago. Are stretchy joints still being looked at as an issue, or are they working as intended? [import]uid: 9422 topic_id: 3208 reply_id: 38909[/import]

@XenonBL
Same here. After spending a month on/off trying to work around these issues including countless experiments with various joints connections and tweaking of density, physics iterations, and such, it just looks like there are some thing that you can’t do with Corona and you should either try to work this limits into your advantage by altering the gameplay where applicable or use another platform.
Some things that, at least for me, never worked and as such are out of question when Corona is in question are whatever physics that involve strong forces and collisions with joints, especially things like shooting ragdolls, ball-chains and such. I would love to see an example of Ragdoll-Blaster type of game, but I guess doing it you would need so much additional joints/static bodies, so many physics iterations and not to say countless hours of tweaking parameters that the whole thing may not be feasible.
But then again, believable physics is not an easy thing to do on any platform. What I learned from month of (mostly unsuccessfully) trying to fix these issues is that the good physics is as much (or more) a question of thoughtful game design as of skillful coding. By that I mean balancing all gameplay parameters so that the user never gets the chance to put the physics world in a state of illogical distress. So if your game is all about throwing things as forcefully as possible into joint-ridden structures (as one of my prototypes was) then I guess you really are out of luck. But if you can think of the ways to introduce subtle gameplay modifications that would guide user interactions to produce a more acceptable physic behavior, then you might not need to spend countless hours tweaking.
I am just starting to apply this advice to my own prototypes. While it might not still have produced acceptable results it’s certainly more fun to spend time thinking and experimenting with gameplay itself rather than tweaking the parameters, so I’m already much better. Hope this helps a bit.
Cheers :slight_smile:
[import]uid: 48785 topic_id: 3208 reply_id: 38931[/import]

@junk

Yeah, it’s good advice in general. Every platform has its limitations, and you can either spend months trying to fit a square peg in a round hole or be clever and work your game design around the limitations. I guess what’s frustrating for me is that some features in Corona only seem half implemented, or there are bugs that are not even acknowledged, so it’s difficult to know what the true limitations are.

During my testing on the stretchy joints issue I discovered that weld joints can’t be destroyed using removeSelf, and friction joints don’t appear to function at all. So while there is definitely something flaky about Corona’s version of Box2D, it’s difficult to know if my problems are due to inherent limitations of Box2D, bugs in Corona’s implementation, or my own ineptitude as a programmer.
[import]uid: 9422 topic_id: 3208 reply_id: 39025[/import]

The issue is that you already spent a considerable amount of time “investigating”. In my case, I studied Lua from zero, then started developing for the game, the physics was left for the last part because I THOUGHT it would work fine, but it doesnt!
I managed to convince a partner for the project, now he is disappointed and wants to abort the project!
I dont get why we have to waste time with trial and error and at the end hit the wall anyways.
A pivot is something simple, but then doesnt work and you have to find a workaround.
I dont think is fair, if the guys of Ansca “promised” physics, we should have physics and pivot is the simplest form of it… why it doesnt work like a charm!
So, seems that the physics promised by Ansca is just for balloons or pillars, but you try do do a simple ragdoll and ends up with the legs inside the body, trembling in the floor and not lying flat but as if he is doing push-ups instead.
Again, I think it is not fair. [import]uid: 41639 topic_id: 3208 reply_id: 39082[/import]

Any update to any of this?

I am working on creating something like a pendulum or chained ball swinging for an iPad game - and even using these examples, things are really weird and buggy.

The joints seem to stick together somewhat at least, but I am facing another problem:

Basically, the pendulum keeps swinging forever - the force seems to be constant or decreasing so slowly that it seems constant. I mean, ideally i would like, say, 10 swings and then to see everything settle - but this seems to go into tens of thousands.

To me, it seems like this relates to the gravity - I’ve tried changing it to higher values, changing the density of my ball body to no luck. And setting the physics scale doesn’t work either - according to the “width of a sprite in pixels and divide it by its real-world width” guide, at the scale I want things (something the size a yoyo pretty close-up), I need to set my scale to something in the 1000s which just makes everything super buggy.

You can see the same thing in the example codes posted, as far as I can see, and my code is basically the same.

So how would you create a rope pendulum that actually stops swinging?

I guess I’ll have to work around it, so it saddens me that I might have to settle for something that’s not nearly as good looking as I would like to because of weird physics implementations. Every project I’ve approached with something relating to physics has been filled with headaches because of the way everything has been implemented.

That said I am grateful for everything Corona allows me to do – I really love it and I’ll stick with it!
[import]uid: 13935 topic_id: 3208 reply_id: 41954[/import]

Any news on this? I’ve spent the last two months learning lua/corona and now it seems that the physics will be a deal breaker!

The only ‘working’ example of a vehicle I’ve seen is ‘Billy Cart’, which is all very good but is a hack, is not using the correct joints and would not do for an actual driving game.

The second example at the link below is how joints should work - is this still not possible using Corona?
http://www.emanueleferonato.com/2009/04/06/two-ways-to-make-box2d-cars/

Thanks! [import]uid: 74917 topic_id: 3208 reply_id: 55840[/import]

WHERE IS ANSCA ON THIS ISSUE!!!

Ansca should be utterly embarrassed by these problems. I love Corona but this is unacceptable. Everyone over at Ansca should drop everything to fix these sort of things. If there is some secret implementation that makes joints actually work then please document it very clearly.

I have spent countless hours trying to deal with this problem and no matter what I can’t get Corona to work as it should. I honestly don’t understand how this could be a problem. Take object1, object2, put a joint between them and they are stuck by the joint. They shouldn’t zoom around the screen, or spazz out, or shake back and forth repeatedly. I have invested a GREAT deal of time and money (time is always money) trying to get Corona to work properly. My last app used a simple weld joint to keep two simple object together. Weld should mean weld forever and ever, but when the welded objects slowly bump into a wall there would always be a noticeable and unprofessional looking bounce between the welded objects–the two objects would stretch apart a bit and then snap back together. I did what I could to minimize the effect, but it still is noticeable and looks like crap. And apparently there is nothing I can do about it.

Now I’m making another app that requires a VERY simple ragdoll. What I thought would be a simple hour or two of programming to create a nice looking simple ragdoll has turned into a nightmare! Come on Ansca these problems are just silly! Don’t say Corona has a physics engine until you fix these problems–casue from what I see the physics engine in no way resembles the real world. I’d hate to live in the universe where this physics engine is accurate–with people stuck to the floor or ceiling, trembling uncontrollably, with their heads and arms flying off and buzzing around the rooms.

I agree with fdt40–this is just not fair. We were promised physics and we don’t get the simplest form of it. I don’t mean to rant but to me until Ansca fixes this (no sign of that based on their involvement with this discussion) then Corona’s built in physics engine is just a huge scam. PLEASE ANSCA–DO SOMETHING!!! [import]uid: 94309 topic_id: 3208 reply_id: 90441[/import]

Wow, I’d totally forgotten about this issue! I can’t believe I posted that in September of last year and no-one has replied until now - and that’s another complaint!

I heard nothing, and could find no advice on the matter, so I did what any sane person would do and threw Corona out of the window. I’ve been working with Cocos2D since then, and boy am I happy!

It’s really not much more difficult than Corona, and there are so many advantages. The physics for one - with Corona you’re stuck with how Ansca choose to implement it (badly by the looks of things). With Cocos2D? I need rigid joints at high speeds, so I simply increase the number of times the physics is calculated (iterations) per frame and there you have it - problem solved.

I’d 100% say if you need anything other than a bouncy ball in your game, ditch Corona. There are a wealth of other engines out there, do some reading and pick the one that suits your needs. Your sanity, wallet and sense of achievement will thank you.

If I can learn one of these ‘proper’ languages so can you! [import]uid: 74917 topic_id: 3208 reply_id: 90500[/import]

Hi All,

I’m using the evaluation version at the moment, have pretty much finished my app, and am about ready to part with cash, but I’m getting the exact issues as mentioned above, i.e. joints stretching/snagging objects (ragdoll related).

After having read this thread, my blood has run cold for 2 reasons - A. The fact that no solutions seem to be offered at present, but more seriously, B. The fact that Ansca seem to be ignoring this thread - last comments around 12 months ago.

Am I missing something? Or have I wasted my time? :-/

Regards,
Gary
[import]uid: 95113 topic_id: 3208 reply_id: 92753[/import]

I’m not following Corona development at all I’m afraid (I just get alerts in my inbox about this thread).

It does seem slightly ridiculous that no-one has responded to this thread, I feel for you! I hope you hear something, either “we are aware this is a problem, here is what we are doing about it”, or (slightly more optimistically) “don’t listen to that huntamh guy, we fixed this issue months ago all you have to do is…”

Maybe try starting a new thread? They tend to get a bit more attention.

Best of luck, otherwise see you on the cocos2D forums! [import]uid: 74917 topic_id: 3208 reply_id: 92762[/import]

I remember this post a year ago. Ya its sad. We all provided code samples of the problem but it never got addressed. My original game was going to be based around rag dolls but I killed it due to (Corona + Box2d ) elasticity problems. Walter is the guru on the Corona Dev team when it comes to Box2d. Your best bet is to summon Walter’s attention how that is done I don’t know. I lost my magic lamp :P.

[import]uid: 7177 topic_id: 3208 reply_id: 92803[/import]

I for one love Corona except largely for this issue. My guess is Ansca has tried hard to solve this issue but has no idea how to fix it. Apparently now they are ignoring the issue all together and not addressing forums like this one. I would hope they could be straight with us–we have paid lots of money (and many of us will continue to pay each year despite these issues) and deserve some honesty. If there are limitations to joints they should just tell us.

I plan to continue using Corona–I really like it for the most part. You USUALLY get lots of support from Ansca and other developers. There’s a good community of developers out there and lots of helpful modules/code that can jump start a project.

One work around for the joint problem is to use a runtime event listener. For example a simple weld joint (which for me would not work very well using the physics engine) could be accomplished like this:

local object1 = display.newImage("object1.png")  
local object2 = display.newImage("object2.png")  
  
local function weld()  
 object2.x = object1.x  
 object2.y = object2.y  
end  
  
Runtime:addEventListener( "enterFrame", weld )  

This snippet of code really helped one of my apps. After countless hours of trying to get a weld joint to work I gave up and wrote this code in about 30 seconds. I felt pretty dumb for not just doing this in the first place. Runtime listeners take up a lot of memory–they will be processed each frame–but then again so does Box2d.

The above code is for a weld joint but you could probably figure out something similar that would work for other kinds of joints. Then use the physics engine for things like gravity, collisions, and stuff like that. Joints in Corona have major problems and I doubt Ansca will fix this any time soon–BUT if your smart you can probably figure out a simple work around using event listeners.

Just my 2 cents.

[import]uid: 94309 topic_id: 3208 reply_id: 93111[/import]

Considering how easily this thread shows up on a Google Search, it’s going to hurt Ansca’s business if they don’t fix the issue. Corona’s appeal lies largely in its inclusion of Box2d physics, but if we can’t rely on them to work properly we’re going to start using other tools. Ansca, please search out and hire a Box2d expert and re-implement the engine to work properly. [import]uid: 63787 topic_id: 3208 reply_id: 94151[/import]

Last update from Ansca staff on this issue was: Tue, 2011-02-08 14:23. Is there another thread I don’t know about where someone from Ansca will talk about this? Some kind of response from Ansca would be much appreciated–even if its to just say, “we don’t know but we are trying to fix the problem.” [import]uid: 94309 topic_id: 3208 reply_id: 94162[/import]

@iqsoup, thanks for the constructive feedback. I’m going to be re-evaluating our internal processes with the explicit goal of minimizing how often you all feel like you’re in the dark. Part of the challenge is we get feedback in tons of different directions, so we obviously need to streamline that process. Any suggestions are welcome.

And yes, we would like to fix this problem. Our plan is to do a deeper investigate at the same time we upgrade Box2D from 2.1.2 to 2.2.1.

One thing that would help expedite our investigation is simple test cases that demonstrate the issue. However, I just did a quick bug scrub. I’m not seeing any active bugs on this issue (that’s one clue to me as to why it’s not getting any TLC!)

So one way to “vote” up the priority is to submit a bug (and supply a *simple* test case demonstrating the issue). You can submit one here:

http://developer.anscamobile.com/content/bug-submission [import]uid: 26 topic_id: 3208 reply_id: 94686[/import]

Firstly, thank you to everyone for their suggestions and comments, I will definitely experiment with some of those - apologies for not posting sooner, I have been out of the country on holiday.

Walter, thank you for responding. Do you have an approximate timeline on the upgrade of Box2D from 2.1.2 to 2.2.1?

I don’t know if anyone has submitted code samples since your request, but I noted on the first page of this thread, that people had submitted code with reference to this previously?

Separately, I owned a business which grew extremely rapidly from startup (too fast) and we experienced the growing pains which you are open about. Ultimately, it was aquired by a large media group in the UK a few years ago, but we had to put systems in place to capture and prioritise all of the feedback, communicate our intentions to our customers etc. - would be glad to share our experiences, even if any nugget might help you guys in a small way!

Best regards,
Gary
[import]uid: 95113 topic_id: 3208 reply_id: 95769[/import]

Should we make a petition so Ansca will finally listen to us, cause this is just stupid!!!? [import]uid: 77183 topic_id: 3208 reply_id: 100121[/import]

I’ve found a work around that–for the time being–works ok for me. I just use runtime listeners to accomplish what joints can’t. I’d love to have joints work properly though–it would save me a lot of work and open up a lot of possibilities I assume Corona would provide. I think Corona owes a little more attention to this subject–we pay lots of money EVERY YEAR to use Corona and we deserve something that works the way we expected it to. I if treated my clients this way I’d get dropped in a heartbeat.

optionniko:
Consider making a feature request–they seem to get more attention than this forum is getting.
http://developer.anscamobile.com/forums/feature-request [import]uid: 94309 topic_id: 3208 reply_id: 100140[/import]

Same problem HERE!!!. I am very angry because ANSCA has not answered yet.

UP!!! [import]uid: 140497 topic_id: 3208 reply_id: 102392[/import]

UP!!! [import]uid: 140497 topic_id: 3208 reply_id: 102951[/import]