Defold 1.2.156 has been released

Defold 1.2.156

This release adds support for joint constraints in 2D physics. You can now create joint constraints between collision object components in runtime, we are planning to add support for this in editor in the future as well.

Engine

  • DEF-3025 - Added: Support for 2D physics joints in runtime.
  • #4144 - Changed: Both armv7 and arm64 are included by default when building Android custom engines.
  • #3128 - Changed: Changed precision for the position value in shaders to highp.
  • #3114 - Fixed: Crash when playing flipbook animations.
  • #4149 - Fixed: Crash on Win32 when closing engine window.
  • #4146 - Fixed: Android debug bundles are now always debuggable in Android Studio.
  • #3118 - Fixed: Crash in ares_addrinfo_callback.
  • #4114 - Fixed: Profiler stringtable deadlock.
  • #3116 - Fixed: Font outline disappeared when anti-aliasing was turned off.
  • #4119 - Fixed: Hot-reload didn’t work when redirect server port was in use.
  • #4099 - Fixed: go.set_parent() ignored keep world transform when removing parent.

Editor

  • DEFEDIT-1626 - Added: The Evaluate Lua field in the Debugger now has history you can access using Up / Down.
  • DEFEDIT-1645 - Added: Modernized look of some dialog boxes. This work is ongoing.
  • DEFEDIT-1678 - Fixed: Partial path not clickable when full path exists on the same Console line.
  • DEFEDIT-1682 - Fixed: Search in Files frames match incorrectly on Linux.
  • DEFEDIT-4102 - Fixed: Show nicer error message when debugger failed to connect.
  • DEFEDIT-4106 - Removed: Removed non-working Scene settings tab from Preferences. It will return in a future release.
23 Likes

Excited! Will there be an example? :wink:

4 Likes

I have a super ugly test project I used while developing, so I think we should create a good sample/manual for it instead… :slight_smile: But in essence you need to call physics.create_joint between two collisionobject components. You will need to specify a unique joint name (ie unique to collisionobject A) so you can address it later on with physics.destroy_joint, physics.set_joint_properties, physics.get_joint_properties, physics.get_joint_reaction_force, physics.get_joint_reaction_torque etc…

Super simple example:

-- connect two collisionobjects with a fixed joint constraint
physics.create_joint(physics.JOINT_TYPE_FIXED, "obj_a#collisionobject", "my_test_joint", vmath.vector3(0), "obj_b#collisionobject", vmath.vector3(0), { max_length = 20 })

If you turn on physics debug you will be able to see joint as lines as well. :+1:

11 Likes

Wow! I guess this only applies to dynamic bodies?

1 Like

If anyone is wondering what’s happening with the issue numbers we are moving our issue tracker from JIRA (DEF-xxxx) to GitHub (Issue-xxxx or simply #xxxx). The issue tracker will remain private for now but it makes our own workflow easier when we have the issues closer to the source code.

6 Likes

Dynamic and static bodies.

2 Likes

Great!
Looking forward to have a “Add Joint” here:
%E6%97%A0%E6%A0%87%E9%A2%98

1 Like

Yes, that’s the plan, but for now you have to make do with the API and programmatically adding joints.

3 Likes

Playing with the joint features, I can imagine some kind of helicopter delivery game could be fun based on these physics game feels.

Slight variation where you could have a 1 button game where you try to swing around a level avoiding things.

12 Likes

In the latest mail from Bengan at Defold there is a description of the new physics feature, but the link is to https://www.defold.com/manuals/physics/ which still has no single word about joints :confused: The only one I found is in API for now.

Oh, I’ll make sure to update! Thanks!

3 Likes

First version: https://www.defold.com/manuals/physics/#_joints

5 Likes

I’m glad you guys decided to skip the editor support for joints so we get to use them sooner!

Btw I have also been using physics.set_gravity() since the day 1.2.155 released. Even though I’m not doing anything cool with it, it’s really nice to be able to set it from code, rather than editing the game.project file.

3 Likes

Why haven’t we solved this old problem yet? :face_with_thermometer:

1 Like

This is next on our list of improvements to physics. But it is dependent on another engine change where we need to make it cheaper to know when a transform hierarchy has changed. We really don’t want to poll for scale changes every frame but rather have a system where we have some kind of dirty flag or similar.

5 Likes

I’m very happy to read this. On what sprint do you plan to do it?

1 Like

It has not been decided yet. We plan one sprint at a time. What I can say is that the issue has a high priority in the backlog.

6 Likes

I think precision for the view_proj should be changed to highp too.

3 Likes

You need to set highp for view_proj as well… On the Galaxy S10e sprites begin to shake at distances greater than 16384px.

2 Likes