[Behavior] Box2D+ (asm.js r2.3.0; v2.0)

From the Asset Store
2d mushroom sprite 2d game character enmy sprite game art
  • Hi Tombas,

    This was an update to v2.12:

    Bugfix: destroy all joints didn't always work.

    Change: position and velocity iterations. No clamp of entered values, so you can change them to what you want (but beware, large values will cause a performance problem).

    To everyone: Box2D+ is only available at itch.io store

  • Colludium

    Just using your plugin for my new project, a trials game:

    twitter.com/DavitMasia/status/1214155158810218496

    I was gonna ask if is possible limit the distance of thw wheel joint, but saw a previous post saying is not possible?

    Doing front/back flips on aire with high speed managed from the bike, makes the suspension on the front wheel goes too large.

    One idea is on runtime change the frequency to 9 so it remains statics whille doing flips, and on floor set again to 4. But is not possible change Frequency various times on runtime. It looks is cumulative? I tried, like ok, then 9 on air and then i set -4 , but only really changes up, never you can give less ¿?

    You can’t change frequency without re-creating the joint. And if you re-create the joint at a different distance from the bike, it will become the “default” distance for the wheel. So the front suspension will become shorter or longer

    Is possible to fix this? so we can change frequency on runtime without re-create joint ?

  • matriax

    That looks great!!

    Unfortunately it is not possible to modify the distance joint parameters with the library I used for this plugin. It's not broken, it is just not a supported feature - it doesn't have the js to asm.js bindings that are required to make it work.

  • Colludium What will be the best way to achieve a rear suspension system on a moto with box2D+ ?

    Like this:

    motorcycle.com/blog/wp-content/uploads/2017/12/120417-ask-mo-linkage-suspension-honda-pro-link-diagram-609x388.jpg

    At this moment using the wheel joint for both. But for the rear one to be more realistic?

    Here is the last we have with a ragdoll attached:

    twitter.com/DavitMasia/status/1216850398604120064

  • matriax - That example video looked good. I think that, for a game, you don't need to accurately replicate everything about a vehicle's suspension if it looks about right. I guess that if you want it more realistic then you could use revolute joints to joint suspension items together, with the pivots at the same place as per a real setup. You'd need a distance joint or two to give the spring bounciness of suspension as well. It all depends on what effect you want to achieve.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Colludium The rear suspension still not works as desired.

    Planning using this limited revolute joint (red)

    i.paste.pics/191cfb30fbd2dadb62fa1e275b1be5b8.png

    But the main problem is how to make this force (yellow) that will keep the wheel in position and act like a spring.

    There is no angular spring joint in this plugin, only in Chipmunk.

    There is something similar on Box2D+ that may i miss? Or if the real Box2D physics have it can you add to the plugin? And if none of that, what you think will be the best solution?

  • matriax

    I don't know how to do what you're trying to achieve. There is no such feature to box2d that I am aware of. You could position a distance joint anchored on the swingarm and to the body above the swingarm, with the distance set to greater than the anchor spacing. Then add another one anchored below. That way the distance joints will act as a spring, always trying to center the swingarm. But I have not tried this and I have no experience of making machines like bikes using box2d, so it may not work.

  • I found a bug. If the imagepoint is not on center, for some reason it gets lots of resorces from GPU ¿?

    I have two GPU, in a new project a sprite with center imagepoint and box2d it gives 0-1% for both. If i change the imagepoint from center it goes to GPU1=23% and GPU2=48%.

    What's wrong?

  • matriax - That doesn't make any sense. Box2D+ has not control over your GPU, and the draw calls are made by c2's webgl renderer (and not Box2D+). I just tested it and found no difference in the use of my GPU.

  • Is a weird thing, with C2 Physics and Box2D+ plugin, if imagepoint is not on center it gets more GPU.

    Tested with chipmunk, and imagepoint on center or other the GPU use is the same, so i guess something between C2-Box2D.

    Btw, today looks better stats, GPU0=20% and GPU1=11% , but on a blank project it gets more from GPU1 until 26% on diferent image center and just one sprite so no idea, i have to test some 3D card configuration, maybe something is wrong.

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