Defold 1.9.4 BETA

Defold 1.9.4 Beta

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 GitHub: Release v1.9.4 - beta · defold/defold · GitHub

Summary

  • NEW: (#9474) The physics contact_point_event now returns the correct contact point
  • NEW: (#9413) Upgrade emscripten to 3.1.65
  • NEW: (#9383) Start work on WebGPU adapter
  • NEW: (#9438) New vmath functions
  • NEW: (#9441) Added a font name to the .glyph_bank generated name
  • NEW: (#9450) Add configurable options for emscripten compiler.
  • NEW: (#8743) Instancing support for models
  • NEW: (#9415) Added font glyph api to dmSDK
  • NEW: (#9388) Improved Debug->Simulate Resolution functionality
  • NEW: (#9393) Show logs from a selected target in the editor’s console
  • NEW: (#9440) Build only the WASM version of the engine when running Build HTML5
  • FIX: (#464) Fix issues building certain combinations of pod dependencies
  • FIX: (#9414) Added dmUtf8 to dmSDK
  • FIX: (#9477) Added android:appCategory="game" into AndroidManifest.xml
  • FIX: (#9483) Fix the build report in JSON format.
  • FIX: (#9487) Updated zlib to 1.3.1.1
  • FIX: (#9511) Fix editor-related build scripts on windows
  • FIX: (#9532) Fix for double destroying the timer callback
  • FIX: (#9539) Fixed rare crash when reaching max number of animations
  • FIX: (#9419) Retain gui overrides if the template gui scene is modified externally
  • FIX: (#9426) Fix the issue where the hash script property can’t be reversed
  • FIX: (#9425) Fix text sync with language servers
  • FIX: (#9429) Better handling of errors in tilemaps when the tilesource is broken.
  • FIX: (#9444) Fix the detection of require in a tail function call by the editor.
  • FIX: (#9510) Make the building artifacts independent for the Build HTML5 and Build options
  • NEW: (#9531) Add editor.bob() function to editor scripts

Engine

NEW: (#9474) The physics contact_point_event now returns the correct contact point
This is a bug fix for the contact_point_event, where the position is now the contact point itself.
This makes it similar to the contact_point_response event, which was the intention.

If you need the old position (the world position of the object itself), you can use either message.a.instance_position/message.b.instance_position.

NEW: (#9413) Upgrade emscripten to 3.1.65
Emscripten has been updated to 3.1.65 from 3.1.55. This is a prerequisite for the coming WebGPU support

NEW: (#9383) Start work on WebGPU adapter
WebGPU has been added as an experimental graphics backend for web platforms. To test WebGPU, run bob.jar with the following commands in the project folder of your project:

java -jar path-to-latest-bob.jar build bundle --archive --platform=js-web --debug-output-wgsl=true

Note that this is a technical preview of our WebGPU support, and some things are not yet implemented. It is not recommended to publish an application yet that uses this backend, but it is encouraged to try it out!

NEW: (#9438) New vmath functions
Added new vmath functions:

  • vmath.quat_matrix4 - get quaternion from matrix4
  • vmath.matrix4_compose - create matrix4 from translation (vector3|vector4), rotation (quaternion) and scale (vector3)
  • vmath.matrix4_scale - create matrix4 from scale (vector3) or from number (uniform scale) or 3 number (x, y, z)
  • vmath.clamp - clamp input value in range [min, max]. Input value can be number, vector, vector3, vector4. In case of vector type clamp applies per vector component. min, max also can be number, vector, vector3, vector4.

NEW: (#9441) Added a font name to the .glyph_bank generated name
The .glyph_bank filename now includes the name of the font used for glyph bank generation.

NEW: (#9450) Add configurable options for emscripten compiler.
Add options to application manifest to control stack size (stackSize)/overall memory size (initialMemory)/minimum supported browser versions (minSafariVersion/minChromeVersion/minFirefoxVersion). In some cases it can help to reduce binary size because Emscripten doesn’t apply code-generation for supporting old browsers.

NEW: (#8743) Instancing support for models
Model components can now use hardware instancing! This means that models that share the same mesh but has its own transform and normal matrices can now be rendered with a single draw call instead of individual draw calls. This is useful for repeated geometry, such as trees, foliage, static props such as trash cans, boxes or even complete buildings.

The simplest route to start using instancing is to add an attribute in the vertex shader that holds the world matrix, or a normal matrix:

attribute mat4 mtx_world;
attribute mat4 mtx_normal;

When any attribute is marked as an instanced attribute, instanced draw calls will automatically be created. This also works for custom vertex attributes. Here’s an example of using an custom instanced attribute for storing an individual tint attribute per model:

The color attribute in this case has its vertex step function marked as instance in the material, which means that this attribute will be repeated per instance instead of per vertex:

This enables us to draw all boxes with just one draw call instead of 4, even with custom vertex data per model!

To read more about instancing in Defold, please consult the Manual entry.

A simple example that shows how to use the new functionality is available here:
instancing-test.zip

FIX: (#464) Fix issues building certain combinations of pod dependencies
This issue fixes issues when building for instance the Yandex SDK

Fixes #389

FIX: (#9414) Added dmUtf8 to dmSDK
This allows native extensions to easily convert utf8 strings into codepoints, for use with e.g. font generation.
The header file is located at <dmsdk/dlib/utf8.h>

FIX: (#9477) Added android:appCategory="game" into AndroidManifest.xml
Google Play requires the android:appCategory attribute in the AndroidManifest.xml. Since Defold is a game engine, we have added android:appCategory="game" into the default AndroidManifest.xml.

If you need a different category for your app, create a custom manifest and choose the appropriate category: R.attr  |  Android Developers.

[!WARNING]
If you already have a custom AndroidManifest.xml, please take note of these changes.

FIX: (#9483) Fix the build report in JSON format.
Fix the issue where the build report in JSON format is not being generated.

FIX: (#9487) Updated zlib to 1.3.1.1

FIX: (#9511) Fix editor-related build scripts on windows
When running on Windows (MinGW), invoking run.command didn’t forward the env variables to the program. Previously, we had a code that did env JAVA_CMD=.../bin/java bash ./scripts/lein ..., and I removed it in favor of using the env = lein_env kwarg without knowing about the implications for Windows. Restoring.

FIX: (#9532) Fix for double destroying the timer callback
In rare cases, the timer callback was destroyed twice, causing a crash

Editor

NEW: (#9415) Added font glyph api to dmSDK
We’ve added a api to our dmSDK for manipulating font resources.
This allows for writing extensions such as extension-font, making it possible to avoid storing large amounts of pre rendered glyph images in the default game, and instead generate them at runtime.

The api has been added to dmsdk/gamesys/resources/res_font.h.

#include <dmsdk/gamesys/resources/res_font.h>

dmRender::HFont    dmGameSystem::ResFontGetHandle(FontResource* font);
dmResource::Result dmGameSystem::ResFontGetInfo(FontResource* font, FontInfo* info);
dmResource::Result dmGameSystem::ResFontGetCacheCellInfo(FontResource* font, uint32_t* width, uint32_t* height, uint32_t* max_ascent);
bool               dmGameSystem::ResFontHasGlyph(FontResource* font, uint32_t codepoint);
dmResource::Result dmGameSystem::ResFontAddGlyph(FontResource* font, uint32_t codepoint, FontGlyph* glyph, void* imagedata, uint32_t imagedatasize);
dmResource::Result dmGameSystem::ResFontRemoveGlyph(FontResource* font, uint32_t codepoint);

NEW: (#9388) Improved Debug->Simulate Resolution functionality
A few improvements were made to the Debug->Simulate Resolution functionality in the editor:

  • The selected resolution is now saved for a project, including custom resolutions.
  • The selected resolution is applied every time the engine starts.
  • A few new iPhone devices and a new “Handheld” section were added.
  • Resolution simulation now works for all launched instances.

NEW: (#9393) Show logs from a selected target in the editor’s console
When a remote target is selected, the editor tries to connect to the target’s log service to display them in the console.

NEW: (#9440) Build only the WASM version of the engine when running Build HTML5
Building two versions of the engine can take a long time, and considering that WASM is supported by 100% of modern browsers, it doesn’t make sense to build both versions every time a developer wants to test a game.
From now on, Build HTML5 will build only the wasm version of the engine.

FIX: (#9419) Retain gui overrides if the template gui scene is modified externally
Fixed an issue where gui node property overrides would be lost from referencing .gui files if the referenced template .gui file was modified by an external process.

FIX: (#9426) Fix the issue where the hash script property can’t be reversed
Hash values can be reversed to their string equivalents in Debug builds, simplifying the development process. This fix makes hashes added in go.property() reversible as well.

FIX: (#9425) Fix text sync with language servers

FIX: (#9429) Better handling of errors in tilemaps when the tilesource is broken.
If a tilemap uses a tilesource without a texture, it’s impossible to show the palette, which previously resulted in an error.

FIX: (#9444) Fix the detection of require in a tail function call by the editor.
Fixed an issue where using a tail call with require was impossible in the editor:

local result = require("my_module").call(42)

FIX: (#9510) Make the building artifacts independent for the Build HTML5 and Build options
From now on, the Build HTML5 and Build options produce separate build artifact folders in the build directory. This means alternating between these options will no longer require rebuilding the project from scratch each time, speeding up the workflow for HTML5 testing.

NEW: (#9531) Add editor.bob() function to editor scripts

Now you can perform bob tasks using editor scripts. Some examples:

  1. Print help in the console:
    editor.bob({help = true})
    
  2. Bundle the game for the host platform:
    local opts = {
        archive = true,
        platform = editor.platform
    }
    editor.bob(opts, "distclean", "resolve", "build", "bundle")
    
  3. Use a custom build server and extra settings files for overriding game.project settings:
    local opts = {
        archive = true,
        platform = editor.platform,
        build_server = "https://build.my-company.com",
        settings = {"test.ini", "headless.ini"}
    }
    editor.bob(opts, "distclean", "resolve", "build")
    
18 Likes

Trying instancing. What should i see?
Is example working?
In winows i see


In web i see

Also i try to make experiment in my game, but it not worked


// Positions can be world or local space, since world and normal
// matrices are identity for world vertex space materials.
// If world vertex space is selected, you can remove the
// normal matrix multiplication for optimal performance.

attribute highp vec4 position;
attribute mediump vec2 texcoord0;
attribute mediump vec3 normal;

attribute mediump mat4 mtx_world;
attribute mediump mat4 mtx_normal;

uniform mediump mat4 mtx_view;
uniform mediump mat4 mtx_proj;

uniform mediump vec4 light;

varying highp vec4 var_position;
varying mediump vec3 var_normal;
varying mediump vec2 var_texcoord0;
varying mediump vec4 var_light;

void main()
{
    mat4 mtx_worldview = mtx_view * mtx_world;
    vec4 p = mtx_worldview * vec4(position.xyz, 1.0);
    var_light = mtx_view * vec4(light.xyz, 1.0);
    var_position = p;
    var_texcoord0 = texcoord0;
    var_normal = normalize((mtx_normal * vec4(normal, 0.0)).xyz);
    gl_Position = mtx_proj * p;
}


This green was island.

2 Likes

Hi!
I haven’t tried it myself yet, but did the test example work for you?
https://github.com/user-attachments/files/16597305/instancing-test.zip

No, the first 2 screenshots from test project(

It looks good in editor. But when build it looks broken


1 Like

Yeah, tested it myself now, with the same result, and I see warnings:

WARNING:GAMESYS: Material /main/model.materialc has specified a vertex constant named 'mtx_worldview', but it does not exist or isn't used in any of the shaders.
WARNING:GAMESYS: Material /main/model.materialc has specified a vertex constant named 'mtx_world', but it does not exist or isn't used in any of the shaders.

I suspect something is not setup correctly.
I’ll defer to the wisdom of @jhonny.goransson to answer this one…

1 Like

I’ll take a look. The pr was 6000 lines, I guess one of them is wrong :sweat_smile:

12 Likes

Oh…was this not completely intentional? Debug text in GUI space and lines in world space? It makes sense to me. Won’t it be much more confusing to have debug text in world space, particularly in 3D, where odds are it will be completely off camera or rotated at some odd angle? Now if you want the old behavior you’ll have to do some advanced word-to-screen calculations, or modify the render script.

Also isn’t this a pretty big backwards-compatibility breakage? Anyone using the built-in render script will have completely broken, probably invisible or unreadable, debug text now.

I realize that anyone can simply change the render script to revert this, but it seems like an odd and sudden change. What about deprecation?

Wasn’t this already in 1.9.3? I was expecting the new device resolutions to be in this version

It was already in 1.9.2 actually. The release notes are generated from a script pulling data from GitHub, and it seems something went wrong here… :thinking:

1 Like

I fixed an issue with the script that generates release notes. The initial post has been updated.

2 Likes

Thank you! :+1:

A fix is on the way, thanks for testing!

3 Likes


particles are broken https://github.com/vokaimoh/blocks-cubes-2048
what should they look like blocks-cubes 0.0.0.2

Is this with the absolute latest beta? Can you link the hash?


I checked on this version (it got even worse…)


Sometimes it looks like this

1 Like

Ok I’ll take a look, thank you!

1 Like

There’s a fix on the way for this, thanks for reporting!

3 Likes

I have a suggestion that I think would be great for Defold and potentially increase the amount of people who are actually contributing to the source code.

I think, in these release notes, next to each bullet point, the names of any independent contributors should be listed. If someone contributes to the engine with a new feature or bug fix, that person should be credited publicly. I’ve seen other open source projects do this, and it always seems to be appreciated and mentioned by the users of the project. I think it encourages people to contribute and feel good about what they’ve done.

I don’t think it would be particularly difficult either. Since each bullet point links to its respective GitHub issue already, this addition would just require looking at the commits for each issue and noting if there are any names that aren’t on the Defold team.

No worries if not, but this kind of thing would help. It seems Defold doesn’t have many non-team-member contributors compared to other projects (take Raylib as an example). I understand this engine is more complicated and wholistic than a C framework, but the point still stands.

5 Likes