Defold 1.2.189 BETA

Defold 1.2.189 BETA

The latest beta is now released, and we invite those interested in beta testing the new features in the editor and engine to join now.
The beta period will be 2 weeks and the next planned stable release is two weeks from now.

We hope this new workflow will highlight any issues earlier, and also get valuable feedback from our users. And please comment if you come up with ideas on improving on this new workflow.

Please report any engine issues in this thread or in issues using Help → Report Issue

Thx for helping out!

Disclaimer

This is a BETA release, and it might have issues that could potentially be disruptive for you and your teams workflow. Use with caution. Use of source control for your projects is strongly recommended.

Access to the beta

Download the editor or bob.jar from Defold Downloads

Set your build server to https://build-stage.defold.com

Release notes

We’re continuing our focus on improving stability to the engine, especially ANR’s on Android.
And we have added a new major update with regards how to use uniform arrays.

The bob.jar build pipeline has also received a big performace boost.
E.g. it previously processed textures in a redundant manner.

BREAKING CHANGE in dmSDK!

Due to the changes with uniform arrays, we had to make some breaking changes to our DefoldSDK.
The changes are in our quite new parts of the SDK, and so we only really expect it to affect the extension-spine / extension-rive, which we have already updated to use the new sdk calls.

Uniform arrays

This sprint we’ve support for uniform arrays.
It allows you to set multiple values to the same uniform in your shader:

uniform lowp vec4 example[16];

To use it, we’ve added an options table to go.get()/go.set(), which allows you to specify the array index.
The index in Lua is 1-based, and in the shader it’s 0-based.

-- set the first vector4 in the array: example[0] = v
go.set(url, "example", vmath.vector4(1,1,1,1), {index=1})

-- set the last vector4 in the array: example[15] = v
go.set(url, "example", vmath.vector4(2,2,2,2), {index=16})

-- set an element of a vector4 in the array: example[0].x = 7
go.set(url, "example.x", 7, {index=1})

Note:

  • We currently cannot set more than one value in the editor
  • It only supports vmath.vector4

resource.get_text_metrics

We’ve deprecated the label.get_text_metrics() and gui.get_text_metrics() in favor of the new
resource.get_text_metrics()

The benefit is that you don’t have to create an instance before figuring out the size of a text.
For gui, we’ve also added gui.get_font_resource(node) in order to get the font handle.

local font = go.get("#label", "font") -- or gui.get_font_resource(node)
local metrics = resource.get_text_metrics(font, "The quick brown fox\n jumps over the lazy dog")

Engine

  • Issue-3692 - Added: Added support for uniform arrays

  • Issue-5874 - Fixed: Bob: Avoid building of textures which are not used in components

  • Issue-6092 - Fixed: Make string output consistent in userdata objects

  • Issue-6093 - Fixed: Do not throw Unable to play animation error, when changing texture for sprite

  • Issue-6106 - Fixed: Fixed fallback when live update fails to load .dmanifest

  • Issue-6116 - Fixed: Better responding to Audio Session Interruptions on iOS

  • Issue-6117 - Fixed: Bob: Don’t calculate a cache key if the resource cache is disabled

  • Issue-6119 - Fixed: Bob: Ignore the build cache for basic copy tasks

  • Issue-6120 - Fixed: Bob: Improved the require parser to better handle trailing commands

  • Issue-6132 - Fixed: Add resource.get_text_metrics()

  • Issue-6136 - Fixed: Updated some of the API docs

  • Issue-6147 - Fixed: Always release the mesh buffer resource

  • Issue-6099 - Fixed: NE: Added dmGameObject::PostDDF, dmMessage::PostDDF helper functions

  • Issue-6102 - Fixed: NE: Added dmScript::IsQuat and dmScript::IsMatrix4

  • Issue-6121 - Fixed: NE: Add dmScript::UrlToString to dmsdk for easier error reporting

Fixes for source code support when building locally

  • Issue-6091 - Fixed: Source: Target only x86_64-darwin until official M1 support
  • Issue-6095 - Fixed: Source: Converted easy_install packages to pip packages
17 Likes

awesome!
Can we also use render.constant_buffer for setup arrays? How?

self.constants = render.constant_buffer()
....
self.constants.example = { 
vmath.vector4(1,1,1,1),
vmath.vector4(1,1,1,1)
...
vmath.vector4(1,1,1,1)}

?

8 Likes

We didn’t add it in this version but it’s definitely something we should to support!

Edit: I briefly looked at it, but decided to leave it until we come up with a backwards compatible way of getting a single value versus getting an array

4 Likes

It’ll be very useful for the lights system (need for constants for all render objects). Array of light sources and simple “for” loop in shader instead pack of uniform variables.

5 Likes

Is gui.get_text_metrics_from_node deprecated too?
I’m just trying the new beta, and the function seems to still be working.

1 Like

Yes, it is deprecated.
It means we remove it from documentation, but also keep it around for backwards compatibility.

1 Like

do you usually have a time limit before is removed completely?

So far, I don’t think we’ve ever removed anything deprecated (at least as I can remember).

For sure, we’d like to at some point, to cleanup some code etc.
But then I think we’d need to update to 2.x versioning, and I think it’s a fairly big step in terms of backwards compatibility. We’ll need to discuss that further.

7 Likes

it seems like the new resource.get_text_metrics is always printing in the console

I don’t have that “options:” print anywhere and is not happening when using gui.get_text_metrics_from_node

the code I use:
local font = gui.get_font_resource(“main”)

last_node_metrics = resource.get_text_metrics(font, string.upper(words[i]))

1 Like

Thanks, I’ve updated the build with a fix, and it should be available shortly.

3 Likes

That works great! Thanks.

1 Like