Defold 1.8.0 Beta

Defold 1.8.0

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/

Summary

  • NEW: (#8719) Make maximum amount of text batches configurable via game.project.
  • NEW: (#8758) Add ‘slice’ as a property to get and set slice9 values
  • NEW: (#8732) New function: resource.create_texture_async
  • NEW: (#8712) Added Box2d Lua module
  • NEW: (#5848) Expose allow_sleep and awake Box2D parameters
  • NEW: (#5905) Add option to set IsBullet for Box2D objects
  • NEW: (#8680) Added Apple privacy manifests for iOS and macOS
  • NEW: (#8638) Add gui.get and gui.set
  • NEW: (#8727) Pass all known model scene attributes to shaders in editor viewport
  • NEW: (#8674) Improve resource sync performance
  • NEW: (#6259) Updated to Emscripten 3.1.55
  • FIX: (#8604) Get progress in callback for HTTP requests
  • FIX: (#8664) Fixed issue for DirectInput gamepads with multiple POV’s
  • FIX: (#8657) Add margins to the left and top edges of the atlas.
  • FIX: (#8670) Unpack buffer from argument before setting texture
  • FIX: (#8710) Produce local and world spaced models with correct custom attribute values
  • FIX: (#8757) Migrate texture fields to samplers
  • FIX: (#8698) Fix flickering on vulkan when drawing to a render target
  • FIX: (#8706) Fixed gdc tool when running on OpenGL backends
  • FIX: (#8675) Move experimental vulkan functions to mainline graphics_vulkan library
  • FIX: (#8720) Check response status when fetch wasm for streaming instantiate.
  • FIX: (#8682) Load engine and data concurrently
  • FIX: (#8755) Delete OpenGL textures using the correct context on single threaded graphics backends
  • FIX: (#8751) Fixes misc inconsistencies when setting and getting custom vertex attributes by script
  • FIX: (#8640) Clear the texture data if no buffer is passed in when using resource.create_texture
  • FIX: (#8762) Added more robust shutdown code for our dmJobThread implementation
  • FIX: (#8663) Fix navigating to referencing atlas from missing image build error
  • FIX: (#8694) Editor model rendering optimizations and fixes
  • FIX: (#8725) Add a read timeout when fetching libraries from the editor
  • FIX: (#8754) Support environment-variable replacement for usernames in dependency URLs
  • FIX: (#8769) Fixed broken gizmo manipulations for Model component
  • FIX: (#8787) Enable vulkan backend for Linux platform

Engine

NEW: (#8719) Make maximum amount of text batches configurable via game.project.
Maximum amount of text batches can be configured via game.project property graphics.max_font_batches.

NEW: (#8758) Add ‘slice’ as a property to get and set slice9 values
Added a new property to sprites for getting and setting slice9 parameters. Examples:

local values = go.get("#sprite", "slice")
local value = go.get("#sprite", "slice.x")
go.set("#sprite", "slice", vmath.vector4(1,2,3,4))
go.set("#sprite", "slice.x", 1337)
go.animate("#sprite", "slice", go.PLAYBACK_LOOP_PINGPONG, vmath.vector4(96, 96, 96, 96), go.EASING_INCUBIC, 2)
go.animate("#sprite", "slice.x", go.PLAYBACK_LOOP_PINGPONG, 96, go.EASING_INCUBIC, 1)

NEW: (#8732) Added resource.create_texture_async
Added a new resource function to create textures asynchronously: resource.create_texture_async(path, tparams, [buffer], [callback]):

  • path - the path to the resource to create (/main/my_texture.texturec)
  • tparams - texture params, width, height, format and so on
  • [buffer] - optional buffer that contains the texture data. if the buffer isn’t provided, the texture will be created with blank data
  • [callback] - optional callback that will be called when the upload has completed. The callback has the following setup:

function my_callback(self, request_id, result)

  • self - the script where the request was issued
  • request_id - the unique request id that is returned from resource.create_texture_async
  • result - a table containing:
    ‘path’ - the resource path of the texture that was updated

This function will create a new texture resource and upload the data into it in a worker thread. The function will return both a resource path and a request id for the async upload, so that specific requests can be tracked during the lifetime of the app or game. The returned resource path can be used immediately (i.e you can pass it to components with go.set), the initial texture will be a blank 1x1 texture which will later be replaced by the actual texture data.

function my_callback(self, request_id, result)
    -- texture has been updated, do something with it
   self.requests[request_id].loaded = true
   go.set("#model", "texture0", result.path)
end

local t_path, t_request_id = resource.create_texture_async("/main/my_texture.texturec", t_params, my_buffer, my_callback)
self.requests[t_request_id] = { path = t_path, loaded = false }

NEW: (#8712) Added Box2d Lua module
This allows you to get a physics body and manipulate its forces, velocities and other properties.

Example:

local id = factory.create("#factory", position)
local url = msg.url(nil, id, "collisionobject") -- get the collision object in the spawned object
self.body = b2d.get_body(url) -- get the b2body object
b2d.body.dump(self.body) -- debug print

-- add an impulse
local pos = b2d.body.get_position(self.body)
b2d.body.apply_linear_impulse(self.body, vmath.vector3(300,200,0), pos + vmath.vector3(16,16,0))

A full list of functions is available in the reference api for b2d and b2d.body.
Note that this was a first step. Next up is adding the missing structs, e.g. world, joints, fixtures and shapes support.

:warning::warning::warning::warning:

In order to support the feature of removing physics, we have now introduced two app manifest settings. If you are using a custom .appmanifest, and you wish to remove all physics, take note of these changes (or compare with a vanilla app manifest with physics removed):

      excludeLibs: [physics, Box2D, script_box2d]
      excludeSymbols: [ScriptBox2DExt]

:warning::warning::warning::warning:

NEW: (#5405) Expose allow_sleep and awake Box2D parameters

The ability is now possible via the new script api b2d.body.set_awake(body, flag) / b2d.body.is_awake(body)

NEW: (#5905) Add option to set IsBullet for Box2D objects

The ability is now possible via the new script api b2d.body.set_bullet(body, flag) / b2d.body.is_bullet(body)

NEW: (#8680) Added Apple privacy manifests for iOS and macOS
This change adds an Apple Privacy Manifest (PrivacyInfo.xcprivacy) to builtins for both iOS and macOS. The privacy manifest will also be added as a game.project setting for both iOS and macOS. If the project also contains native extensions any privacy manifests used by the extensions or any extension dependencies these will be merged with the project manifest. The merged (or original manifest) will be included in the bundled app.

Including a privacy manifest will be required by Apple when uploading to App Store Connect:

“If you upload an app to App Store Connect that uses required reason API without describing the reason in its privacy manifest file, Apple sends you an email reminding you to add the reason to the app’s privacy manifest. Starting May 1, 2024, apps that don’t describe their use of required reason API in their privacy manifest file aren’t accepted by App Store Connect.”

Source: Describing use of required reason API | Apple Developer Documentation

NEW: (#8638) Add gui.get and gui.set
Gui scripts can now query/set node properties via gui.get and gui.set:

local node = gui.get_node("my_node_id")
local node_pos = gui.get(node, "position")
local node_pos_x = gui.get(node, "position.x")

gui.set(node, "position", vmath.vector3(1, 2, 3))
gui.set(node, "position.x", 1)

We have also added a new property to the gui namespace euler which is linked with the rotation property. When changing one of them, both will change its underlying data. The important change between them is that the rotation property must be set by quaternion values, and the euler property must be set by degree values. You can set a single component of the rotation or the euler properties as usual:

gui.set(node, "rotation.x", math.rad(45))
gui.set(node, "euler.x", 45)

There are no custom script properties available, you can only get and set the already existing node properties:

"position"
"rotation"
"euler"
"scale"
"color"
"outline"
"shadow"
"size"
"fill_angle" (pie)
"inner_radius" (pie)
"slice9" (slice9)

:warning::warning::warning::warning:

Please pay attention! gui.PROP_ROTATIONand gui.set_rotation() now works with quaternions. Therefore, existing code should be fixed to use gui.PROP_EULER and ``gui.set_euler(), or the value used with gui.PROP_ROTATION` should be a quaternion. Please check your existing code and make the necessary changes.

:warning::warning::warning::warning:

FIX: (#8604) Get progress in callback for HTTP requests

Added a new parameter to the option table for the http.request function called ‘report_progress’. When report_progress is true, the amount of bytes sent and/or received for a request will be passed into the callback function:

http.request("http://my-address", "GET",
	function(self, id, response)
		if response.bytes_total ~= nil then
			update_my_progress_bar(self, response.bytes_received / response.bytes_total)
		else
			-- handle response like normal
		end
	end,
	nil, nil, { report_progress = true })

FIX: (#8664) Fixed issue for DirectInput gamepads with multiple POV’s

This fixes an crash when a gamepad has more than one POV.

FIX: (#8657) Add margins to the left and top edges of the atlas.
Fixed an issue where the margin specified for the atlas ignored the top and left edges of the atlas and was added only between images and on the right and the bottom edges of the atlas.

FIX: (#8670) Unpack buffer from argument before setting texture
Fixed an issue when using resource.set_texture with a buffer object that is acquired from a buffer resource. Previously we did not unpack the buffer correctly, which would cause script errors.

FIX: (#8710) Produce local and world spaced models with correct custom attribute values
Fixed an issue where models are using custom attributes with and without mesh colors available in the .glb file:

  • When a model is using a mesh without color data, it should produce the overridden data from the custom vertex attributes
  • When a model is using a mesh with color data, the color data should always take precedence over the custom vertex format

FIX: (#8757) Migrate texture fields to samplers
Fixed an issue in bob when building materials, if the material has specified textures they will not be used in the engine because the texture field is now deprecated. The fix migrates all the textures of a material into samplers instead.

FIX: (#8698) Fix flickering on vulkan when drawing to a render target
Fixed an issue where flickering was happening on the Vulkan and MoltenVK renderers when using a render target.

FIX: (#8706) Fixed gdc tool when running on OpenGL backends

FIX: (#8675) Move experimental vulkan functions to mainline graphics_vulkan library
Removed the experimental vulkan API + library and instead moved all the code into the mainline vulkan library. This should make building the rive extension simpler (due to less dependencies) as well as merging some of the shared functionality later on.

FIX: (#8720) Check response status when fetch wasm for streaming instantiate.
Check if fetch() was successful during wasm loading. Otherwise return Response with null body to trigger fallback logic.

FIX: (#8682) Load engine and data concurrently
Now dmloader.js loads game data and game engine (wasm + js files) concurrently.
:warning::warning::warning::warning:

The default template builtins/manifests/web/engine_template.html has been changed. If you use your own custom template, make sure to update it with these changes. Pay attention to css changes for progress bar and how progress bar animation now handling. Also change how extra_params passed according to new documentation Defold development for the HTML5 platform

:warning::warning::warning::warning:

FIX: (#8755) Delete OpenGL textures using the correct context on single threaded graphics backends
This fixes a memory leak with textures on iOS and Html5

FIX: (#8751) Fixes misc inconsistencies when setting and getting custom vertex attributes by script
We have fixed multiple issues with setting and getting custom attributes on sprites. The functionality overall is more robust now.

FIX: (#8640) Clear the texture data if no buffer is passed in when using resource.create_texture
We now explicitly clear the texture data before uploading it to the GPU texture when using resource.create_texture with no explicit buffer is being used.

FIX: (#8762) Added more robust shutdown code for our dmJobThread implementation
This fixes an issue where it was possible for get a dead lock when shutting down the job thread system.

Editor

NEW: (#8727) Pass all known model scene attributes to shaders in editor viewport
The scene view will now pass all currently supported vertex attributes to the shader when rendering models.

NEW: (#8674) Improve resource sync performance

FIX: (#8663) Fix navigating to referencing atlas from missing image build error
Fixed a regression where double-clicking a build error originating from an .atlas referencing a non-existent image resource would not take you to the referencing .atlas.

FIX: (#8694) Editor model rendering optimizations and fixes

  • Fixed a performance regression in the editor introduced by the recent addition of custom vertex attributes to models.
  • Fixed broken preview of model scene files (.gltf, .dae, etc.). Previously you’d only see the bounding boxes if you opened a .gltf file in the editor.
  • Fixed a memory leak of scene-cache data associated with the OpenGL context used for scene picking hit tests after closing an editor tab.
  • The editor will now share vertex buffers among meshes, as long as they do not use any world-space attributes.
  • The Coordinate Space setting of declared vertex attributes takes precedence, but the Vertex Space setting on the material will be used as the default for any undeclared vertex attributes where it has relevance.
  • The editor will now produce world-space normal attributes correctly, if desired.
  • The editor will no longer produce a broken normal matrix for objects that have a non-uniformly scaled parent.

FIX: (#8725) Add a read timeout when fetching libraries from the editor
Added a timeout when fetching libraries from the editor so it doesn’t block indefinitely if a server stops responding.

FIX: (#8754) Support environment-variable replacement for usernames in dependency URLs
The editor can now inject environment variables into both the username and password of library dependency URLs that use authentication.

FIX: (#8769) Fixed broken gizmo manipulations for Model component

  • Fixed a regression where the move gizmo would translate rotated Models along the wrong axis.
  • Fixed a regression where the manipulator gizmo would not be properly aligned to Model pivot points.

FIX: (#8787) +8803 Enable vulkan backend for Linux platform

We’ve fixed the building of the Vulkan backend for the Linux platform.
:warning:
If you have a custom app manifest, then you need to make sure that it’s updated with the relevant dynamicLibs change for the Linux platform. Here’s the text from the editor when selecting the Vulkan backend:

  x86_64-linux:
    context:
      excludeLibs: [graphics]
      excludeSymbols: [GraphicsAdapterOpenGL]
      symbols: [GraphicsAdapterVulkan]
      libs: [graphics_vulkan, X11-xcb]
      dynamicLibs: [vulkan]
      linkFlags: []
13 Likes

Could we also have a Fix for issue #8355 in this version? I may need to build & publish my app :roll_eyes:

This is also in beta?
I can get progress from http request?

Yes, that is also in beta. The PR was just missing the proper label for some reason

3 Likes

Awesome🔥

I’ve added it in Release Notes

With 1.7.1, two significant and long-awaited changes were made related to the HTML5 bundle (thanks, @ekharkunov ):

  • Updated the template and dmloader.js to allow game resources to load in parallel with the game engine. This will require changes to the extensions with custom HTML templates, and games where such templates are used;
  • Updated to the latest version of Emscripten - this will necessitate updating the extensions due to API changes.

Examples of the changes can be seen at:

and

Within a week, all extensions related to HTML5 bundle on github.com/defold will be updated.

What you need to do and what to look out for after updating to 1.7.1:

  1. If you have a custom HTML template (or custom dmloader.js) - compare it with the latest in 1.7.1 and make the necessary adjustments.
  2. If you have extensions, prepare updated versions to be compatible with 1.7.1. If you need help - post here, in response to this post.

We understand that it may feel like an inconvenience with all the changes, but the Emscripten update opens up many useful features (which we will be adding over time), such as:

  • WebGPU;
  • The ability to add a profiler to the web debug build.

And, of course, parallel file loading in parallel with the engine’s binary files should speed up game loading for users with fast internet.

6 Likes

There’s something amiss with possibly gui rendering that can be seen in the extension-spine sample.
Both screenshots are from the current main branch
1.7.0


1.7.1

3 Likes

Fixed in new Spine extension 2.15.1 Release Update for Defold 1.7.1 · defold/extension-spine · GitHub

4 Likes

:warning::warning::warning::warning:

Please pay attention! gui.PROP_ROTATION now works with quaternions. Therefore, existing code should be fixed to use gui.PROP_EULER, or the value used with gui.PROP_ROTATION should be a quaternion. Please check your existing code and make the necessary changes.

:warning::warning::warning::warning:

1 Like

The empty project with a custom appmanifest isn’t buildable if you exclude 2D physics:

test_171_box2d.zip (2.4 KB)

4 Likes

I have a PR ready for this, it should land in the morning.

4 Likes

I can’t seem to get gui.animate() to work with euler at all.
I used to do this and rotation worked

gui.animate(self.sun, "rotation.z", -360, gui.EASING_LINEAR, 40, 0, nil, gui.PLAYBACK_LOOP_FORWARD)	 

…but per the above notes, I must do this

gui.animate(self.sun, "euler.z", -360, gui.EASING_LINEAR, 40, 0, nil, gui.PLAYBACK_LOOP_FORWARD)	 

And it no longer moves. If I do gui.set(self.sun, "euler.z", -35) I see a change.

3 Likes

Another issue I am having is with slice changes. I have values set to vmath.vector4(0) initially, then change them to vmath.vector4(32,32,32,32) and the affected image remains the same.
If I have a single value > 0 then it works.

image

Pinging @jhonny.goransson because this looks like something we have discussed some time ago! Looks like something is broken with regards to GUI stencils (the grey box on the bottom half on the screen is not supposed to be there).

This is on Windows.

1.7.1:

1.7.0:

What platform is this?

Windows!

linux debian 12 + X11
tested with both updated and newly downloaded 1.7.1 editor

Action:
Build & Run a new desktop project

Result:
Window is not launched/displayed. CPU use of dmengine is at 100% - probably stuck at loop
Console output:

INFO:DLIB: Log server started on port 42451
INFO:ENGINE: Target listening with name: dev - 127.0.1.1 - Linux
INFO:ENGINE: Engine service started on port 34197
INFO:GRAPHICS: Installed graphics device ‘ADAPTER_FAMILY_OPENGL’
INFO:ENGINE: Defold Engine 1.7.1 (3b77500)

Expectation:

INFO:DLIB: Log server started on port 34311
INFO:ENGINE: Target listening with name: dev - 127.0.1.1 - Linux
INFO:ENGINE: Engine service started on port 36217
INFO:GRAPHICS: Installed graphics device ‘ADAPTER_FAMILY_OPENGL’
INFO:ENGINE: Defold Engine 1.7.0 (bf4dc66)
INFO:DLIB: Initialized Remotery (ws://127.0.0.1:17815/rmt)
INFO:ENGINE: Loading data from: build/default
INFO:ENGINE: Initialised sound device ‘default’
INFO:DLIB: SSDP: Started on address 192.168.43.87


With appmanifest back-end selection:

  • openGL
    1.7.0 works
    1.7.1 doesn’t work
  • vulkan
    both doesn’t work; linker is looking for local libraries
/usr/bin/ld: cannot find -lgraphics_vulkan
/usr/bin/ld: cannot find -lX11-xcb

Something’s happening with Vulkan support? I run the project today and got a crash at start.

(I’m actually on 1.7.1-alpha, SHA1: 46a11f5be9c616cab293c1b169024151e1e66107)

ERROR:GRAPHICS: Vulkan Error (…\src\vulkan\graphics_vulkan.cpp:2278) VK_ERROR_INITIALIZATION_FAILED
Assertion failed: 0, file …\src\vulkan\graphics_vulkan.cpp, line 2278

2024-04-11 11_17_rrw.zip (2.1 KB)

( It’s a “famous” Red Raging Wolf project, with Rive models, and I have to use appmanifest with Vulkan only, @jhonny.goransson )

Should I switch to some other version?