Defold 1.6.3 BETA

Defold 1.6.3 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 http://d.defold.com/beta/

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

Defold 1.6.3

Summary

  • NEW: (#8225) Detect renderable float and half float texture formats on OpenGL ES 2.0 / WebGL 1.0 devices
  • NEW: (#8227) Exclude headless dmengine from bob.jar
  • NEW: (#8267) Fix small memory leak in json.decode()
  • NEW: (#8289) Print generic error when OpenGL shader compilation or program linking fails
  • NEW: (#8270) Improve memory usage in large projects
  • FIX: (#8247) Wrap glfw calls in dmPlatform library
  • FIX: (#8244) Add support for luminance_alpha in image.load
  • FIX: (#8242) Use the WebGL 1.0 specific constant for the half float format.
  • FIX: (#8260) Set HTML5 AudioContext sample rate to 44100
  • FIX: (#8295) Fix rare multipage atlas issue with compressed textures (HTML5).
  • FIX: (#8299) Fixed triggers and back button for controllers on macOS
  • FIX: (#8283) Fix “Optimization pass failed” issue
  • FIX: (#8283) Fix issue when usage of semicolons in Lua may break compilation.
  • FIX: (#8345) Model multi material doesn’t respect the sampler names

Engine

NEW: (#8225) Detect renderable float and half float texture formats on OpenGL ES 2.0 / WebGL 1.0 devices
Adds the ability to render to 16-bit and 32-bit floating-point color buffers on OpenGL ES 2.0 and WebGL 1.0 if the device supports them. The support depends on the extensions EXT_color_buffer_half_float and WEBGL_color_buffer_float.

Closes Webgl 1 support for float render targets · Issue #8172 · defold/defold · GitHub

NEW: (#8227) Exclude headless dmengine from bob.jar
Now “vanilla” dmengine_headless (headless dmengine binary without native extensions) will be downloaded from the server if needed. It’s rarely used, but was shipped with each bob.jar for all the platforms.

NEW: (#8267) Fix small memory leak in json.decode()
Each json.decode() call allocates 1kb of memory, which should be freed after.

NEW: (#8289) Print generic error when OpenGL shader compilation or program linking fails
Adds generic error message when OpenGL shader compilation or program linking fails. Previously, the shader error message was only printed if the GPU driver provided it. Depending on the implementation, the driver may not do this and so the developer would not get any message and could not understand why the game crashed.
Also for OpenGL program linking the warning is replaced by an error, because after this failure the game cannot continue to work.

Closes #8287

FIX: (#8247) Wrap glfw calls in dmPlatform library
We have added a new engine platform library, which is the first step into upgrading and simplifying our GLFW library.

Migration plan:

  • fix console to support the new changes
  • remove building glfw in the engine
  • migrate desktop platforms to use vanilla glfw3
  • move our web and mobile code from glfw into their own implementations within the engine
  • remove the custom glfw 2.7 implementation from the engine

FIX: (#8244) Add support for luminance_alpha in image.load
Moved internal dmImage functionality into the dmsdk for loading images from binary data. The API looks like this:

namespace dmImage
{
  Result Load(const void* buffer, uint32_t buffer_size, bool premult, HImage image);
  void Free(HImage image);
  Type GetType(HImage image);
  uint32_t GetWidth(HImage image);
  uint32_t GetHeight(HImage image);
  const void* GetData(HImage image);
}

NOTE: that this also changes the API for the script image.load function since we now will return image.TYPE_LUMINANCE_ALPHA for PNGs with both grayscale and alpha channels. This is considered a bugfix so please be aware of this if you are using that function!

FIX: (#8242) Use the WebGL 1.0 specific constant for the half float format.
WebGL 1.0 supports loading half float textures. But it requires the use of HALF_FLOAT_OES constant, which has a different value from the HALF_FLOAT constant from WebGL 2.0 / OpenGL ES 3.0. This fix enables to use half float texture format on WebGL 1.0 devices.

FIX: (#8260) Set HTML5 AudioContext sample rate to 44100
HTML5 AudioContext sample rate wasn’t specified and varied depending on the output device and it could be default 44100, or it could be 8000, 16000, 22050, 32000, 48000 etc. If the sample rate of the device was less than the sample rate of your sounds, they would not be played at all. So the AudioContext is now created with sampleRate = 44100.

FIX: (#8295) Fix rare multipage atlas issue with compressed textures (HTML5).
Some old devices don’t work with multipage atlases if texture transcoded to ASTC format. For such devices, ASTC will be marked as non-supported format and the next best fits will be used (most of the time it will be ETC2).

FIX: (#8299) Fixed triggers and back button for controllers on macOS
Fixed an issue when triggers and back button on macOS weren’t caught by the gamepads input system.

FIX: (#8299) Fix issue when usage of semicolons in Lua may break compilation
Fixed an issue when our Lua parser removes semicolons which shouldn’t be removed, which breaks Lua compilation.

FIX: (#8345) Fix issue when usage of semicolons in Lua may break compilation
In some cases, a model with multiple textures would get them assigned to incorrect texture units.

Editor

NEW: (#8270) Improve memory usage in large projects

  • Improved memory usage in large projects.
  • We now report resources that fail to build due to an out-of-memory error to the Build Errors tab.

FIX: (#8283) Fix “Optimization pass failed” issue
Make sure pipeline tools use DLLs from jdk/bin folder to prevent Optimization pass failed: error on windows.

16 Likes

_crash.zip (2.4 KB)
got crash when switching scenes

dependencies#0 = https://github.com/Insality/druid/archive/refs/tags/0.10.3.zip
dependencies#1 = https://github.com/britzl/monarch/archive/refs/tags/3.7.0.zip
dependencies#2 = https://github.com/britzl/ludobits/archive/refs/tags/7.2.0.zip
dependencies#3 = https://github.com/britzl/defold-input/archive/2.8.5.zip
dependencies#4 = https://github.com/britzl/defold-metrics/archive/1.2.1.zip
dependencies#5 = https://github.com/britzl/defold-orthographic/archive/refs/tags/3.2.1.zip
dependencies#6 = https://github.com/britzl/defold-clipboard/archive/refs/tags/1.3.0.zip
dependencies#7 = https://github.com/AGulev/defold-extension-uptime/archive/refs/tags/1.2.0.zip
dependencies#8 = https://github.com/Melsoft-Games/defold-protobuf/archive/0e5d3b2.zip
dependencies#9 = https://github.com/defold/extension-spine/archive/refs/tags/2.14.0.zip
dependencies#10 = https://github.com/defold/extension-iap/archive/refs/tags/5.1.0.zip
dependencies#11 = https://github.com/indiesoftby/defold-sentinel/archive/refs/tags/1.1.0.zip
dependencies#12 = https://github.com/britzl/extension-imgui/archive/refs/tags/1.2.0.zip

0   dmengine                            0x0000000104a66ad8 _ZN7dmCrash7OnCrashEi + 104
1   libsystem_platform.dylib            0x000000018c923a24 _sigtramp + 56
2   dmengine                            0x000000010489a550 _ZN12dmGameSystem16CompSpriteRenderERKN12dmGameObject22ComponentsRenderParamsE + 2024
3   dmengine                            0x000000010489a550 _ZN12dmGameSystem16CompSpriteRenderERKN12dmGameObject22ComponentsRenderParamsE + 2024
4   dmengine                            0x000000010485aa88 _ZN12dmGameObject6RenderEPNS_16CollectionHandleE + 176
5   dmengine                            0x000000010487d520 _ZN12dmGameSystem25CompCollectionProxyRenderERKN12dmGameObject22ComponentsRenderParamsE + 124
6   dmengine                            0x000000010485aa88 _ZN12dmGameObject6RenderEPNS_16CollectionHandleE + 176
7   dmengine                            0x000000010487d520 _ZN12dmGameSystem25CompCollectionProxyRenderERKN12dmGameObject22ComponentsRenderParamsE + 124
8   dmengine                            0x000000010485aa88 _ZN12dmGameObject6RenderEPNS_16CollectionHandleE + 176
9   dmengine                            0x0000000104807178 _ZN8dmEngine4StepEPNS_6EngineE + 896
10  dmengine                            0x00000001048076fc _Z14dmEngineUpdatePN8dmEngine6EngineE + 32
11  dmengine                            0x0000000104808114 _ZN8dmEngine7RunLoopEPKNS_13RunLoopParamsE + 104
12  dmengine                            0x0000000104808098 _Z11engine_mainiPPc + 88
13  dyld                                0x000000018c5790e0 start + 2360

Hard to say why this happened. Can you reproduce the crash?

Yes, it happens every time in this project, I will try to debug this collection closer to the weekend.

Do you have any thoughts on what is worth paying attention to?

I’m afraid not.
Would it be possible for you to share the project with us (here or in DM)?
Or can you create a small repro case?

i’ll try to make minimum repo case closer to the weekend.
i found place where error happens, go.set(MAIN_SPRITE_SPRITE, “image”, atlas)

go.property("game_elements_atlas", resource.atlas("/assets/atlases/game_elements.atlas"))

local MAIN_SPRITE_SPRITE   = "main_sprite#sprite"

---@param self element_view
function init(self)
        -------crash start-----------
        if self.element.texture == const.GAME_ELEMENTS_ATLAS then
            go.set(MAIN_SPRITE_SPRITE, "image", self.game_elements_atlas)
        elseif self.element.texture == const.GAME_ELEMENTS2_ATLAS then
            go.set(MAIN_SPRITE_SPRITE, "image", self.game_elements2_atlas)
        end
        -------crash end-----------
    sprite.play_flipbook(MAIN_SPRITE_SPRITE, get_skin_sprite(self.element))
    go.set(MAIN_SPRITE_SPRITE, "scale", vmath.vector3(.5))
end

1 Like

An issue reported for beta: 1.6.3 beta - `Could not find '@render' socket` error in a new empty project · Issue #8316 · defold/defold · GitHub

1 Like

One more fix added into this beta

3 Likes

This is also fixed.

3 Likes

The order of texture samplers in the editor seems to have changed. Before it inherited from the material but now it looks like it’s in alphabetic order. Is this intended? Initially my materials work after opening the project in v. 1.6.3 because the order of the textures in the model file is kept. But after adding new models the order of the textures in the .model follows alphabetical order, which might differ from the order in the material.

I guess one workaround is to keep my samplers in alphabetical order inside the material but that was not needed before.

With the recent changes, the ordering of the samplers in the .model file should matter no more, as we now added a sampler name, that we can use to look up the sampler location at runtime.
Prior to this, the model’s textures were required to be in same order as the material samplers, making it much harder to do changes to a material.

Are you seeing any issues due to this?

1 Like

That sounds great! I still can’t get it to work though. I have an example project here that is not working for me on 1.6.3 beta.

test-samplers.zip (7.4 KB)

In this project there are two cubes that only differ when it comes to the order of the textures in the .model file. The only sampler used in the shader is tex0, but it seems to always pick the first texture in the model – one cube is brown and one is green even though both should be green. Note that both cubes are green in the editor.

I shouldn’t have to use this trick to include all samplers and multiplying the result by a very small number as described here https://forum.defold.com/t/defold-pbr-extension-alpha-testing/73729/21 now that the samplers are bound by name right?

1 Like

Is this the initial step to add more functionality to cover what on desktop is currently handled by DefOS?

1 Like

Yes, I would like to remove the old glfw completely and move the other non-desktop platforms outside of the GLFW infrastructure. The current plan is to migrate all desktop platforms to the newest GLFW library version and then look at adding new API functions one by one to cover some of the new functionality from GLFW into Defold. Eventually DefOS shouldn’t be needed. I have started with OSX yesterday, but there’s some more decoupling needed to move forward.

7 Likes

I’ll take a look after lunch.
Curious though, how can you have multiple textures on a model if the material only has one sampler? :thinking:

2 Likes

Thanks! Oh, maybe I was a bit unclear. The material uses two samplers, but I’m only using one of them in the shader.

Maybe then the other is “simplified” by the compiler and you get only one… Just a guess. Ciao!

1 Like

Perhaps. But I also tried using both samplers in the shader and the “trick” I linked above to force the compiler not to optimize. It still rendered the wrong texture.

1 Like

Looking at the compiled files, it seems there’s a bug somewhere, triggering some old backwards compatibility code (that is order dependent).

I’ll add an issue tracking this, shouldn’t be too hard to track down.

Ticket:

5 Likes

Returning to 1.6.2 after using 1.6.3 BETA for a while I get this error when building:

Works okay on 1.6.3 BETA

1 Like