CocoonJS Physics stops working?!? Please help!

Discussion and feedback on Construct 2

Post » Mon Mar 31, 2014 7:42 pm

I have made a bubble shooter. You swipe over the screen and after that the ball shoots. (via impulse at angle)
Sometimes, after playing about 5 minutes I simply cannot shoot the ball anymore. It's like the ball is Immovable but its definitely not a wrong physics setting or enything else. All of the rest still works (Pause menu with buttons, sounds etc..) its still the ball which do not shoot. Sometimes it happens after 5 mins, sometimes after 15 and sometimes at the first start of the game. If I close the game and start it again it will work for another amount of time. This is both with the cocoonLauncher and exporter from xcode.

I have tried Box2DWeb Physics, Box2D-ASM physics and cocoon physics. All the same. Only cocoon native physics not working (game doesnt start).

I just dont know how I can resolve this. Cant send it to apple cause of that problem.


Would be great If someone can help.

Regards,
Kraudi2k
Working on "EVERBLAST"
Image
B
31
S
6
Posts: 221
Reputation: 2,837

Post » Tue Apr 01, 2014 9:59 am

Btw. What is the difference between Physics Impulse and Physics Force?
Working on "EVERBLAST"
Image
B
31
S
6
Posts: 221
Reputation: 2,837

Post » Tue Apr 01, 2014 10:27 am

I have found physics on mobile browsers to not work very well and that includes on cocoonjs I'm afraid. Any fps slowdown changes the physics characteristics of the objects so object interactions are different each time you run the same scene and if you play on a different device. And collisions cause little slowdowns...

I thought that only the cocoonjs physics worked on cocoonjs without causing crashing. Have you tried running a zip in the launcher in debug to see what errors are reported?

As for impulse and force. Wiki might give a more detailed answer. Force pushes for the time it is applied in increments of one tick. An impulse should change a body's momentum as if a force was applied for a fixed time. In fact impulse = force x time. So, an upward force of 1 for 10 seconds will result in the same upward velocity as an upward force of 2 for 5 second or an impulse of 10 being applied.
A big fan of JavaScript.
B
76
S
20
G
74
Posts: 2,255
Reputation: 46,484

Post » Tue Apr 01, 2014 10:35 am

Thank you. Yes I tried over the launcher with debug but there is no error at all. Thats what I dont unterstand. Exporter via xCode its the same. But as I told it happens completely random. Changed now from impulse to force but I have to to test it a couple of times to see If the problem still exists. Otherwise the game works at excellent fps from iPhone 4 to the newest devices. No stuttering and plays always the same with physics set to fixed.

its just that damn random problem that exists.


I also tried bullet instead of physics which works but as my ball is a circle it is not good with collisions on the edges of solids. Thats why I tried using physics
Working on "EVERBLAST"
Image
B
31
S
6
Posts: 221
Reputation: 2,837

Post » Tue Apr 01, 2014 11:40 am

Have you a capx (or a screen shot of the spawn event at least) you are able to share? Is it possible that the ball is spawning inside another physics object? If you're pinning the previously spawned ball, is it possible that the pin action is affecting the wrong ball (just a guess but I've had that happen!)?
A big fan of JavaScript.
B
76
S
20
G
74
Posts: 2,255
Reputation: 46,484

Post » Tue Apr 01, 2014 12:19 pm

The ball is already placed on the layout (different starting position for each level)

here is the swipe events

Image

may you find something:)

strange is. exported via node webkit and all works fine.. no problems with ball not shootable.


Edit: Tested now 10-12 times with force instead of impulse and it works. Dont know if its luck or a solution.
Working on "EVERBLAST"
Image
B
31
S
6
Posts: 221
Reputation: 2,837

Post » Tue Apr 01, 2014 1:46 pm

Nothing stands out - it all looks OK to me. Don't know why force would work where impulse won't. Could be that giving an impulse so close to enabling physics movable was the problem. If you get a problem with using force you could try setting the velocity instead... I'm glad it seems fixed though!
A big fan of JavaScript.
B
76
S
20
G
74
Posts: 2,255
Reputation: 46,484

Post » Tue Apr 01, 2014 6:08 pm

It happened again. Damn!

Edit: Added some debug stuff and found out when the problem happens the "On any touch start" will be activatedd but the "On any touch end" not. But I don't know why and why it does not work again when I restart the layout.
Working on "EVERBLAST"
Image
B
31
S
6
Posts: 221
Reputation: 2,837

Post » Tue Apr 01, 2014 10:10 pm

Yes, there is a issue to the cocoonJS native phyiscs. Only the Box2D web engine works. Maybe asm to, but not tested.
@ Scirra: Please clarify with ludei. thx
B
13
S
4
G
1
Posts: 107
Reputation: 1,337

Post » Wed Apr 02, 2014 5:13 am

Im using the Box2D :)
Working on "EVERBLAST"
Image
B
31
S
6
Posts: 221
Reputation: 2,837

Next

Return to Construct 2 General

Who is online

Users browsing this forum: NN81 and 5 guests