⇠ More posts

Defold release 1.5.0

By Björn Ritzl on Aug 19, 2023

Tagged as: Release notes


Defold 1.5.0

Summary

  • BREAKING CHANGE: (#7609) Add support for multiple liveupdate zip archives
  • NEW: (#7800) Add option to avoid copying or cloning buffer in resource.set_buffer
  • NEW: (#7780) Bob.jar support for Apple Silicon (M1/M2) chips using JDK for arm64
  • NEW: (#7803) Material constant array support for go.get/go.set
  • NEW: (#7788) Make sure that unloading of a gui component removes its dynamic textures
  • NEW: (#7798) Error about syncfs is now a warning message
  • NEW: (#7772) Update all cameras in the focus stack
  • NEW: (#7849) Get and set node materials from gui scripts
  • NEW: (#7876) Use asynchronous build on the extender by default.
  • NEW: (#7787) Add conditional breakpoints
  • FIX: (#7852) Set the correct previous state for xinput devices
  • FIX: (#7813) Sound stopped event
  • FIX: (#7812) Shader include with pragmas doesn’t translate to ES3 correctly
  • FIX: (#7821) Fix issue with long comments in shaders
  • FIX: (#7794) Fix profiler step blinking
  • FIX: (#35) Set extension version as user agent
  • FIX: (#7822) Fix issue when wasm-web arch can’t be built without js-web
  • FIX: (#7869) Make sure old LiveUpdate flow works fine
  • FIX: (#7793) Fix bug when debugger stops with an error if GUI text node contains newline
  • FIX: (#7791) Don’t replace all occurences of empty string
  • FIX: (#7825) Fix issue when CMD+H doesn’t hide the editor on MacOS

Engine

BREAKING CHANGE: (#7609) Add support for multiple liveupdate zip archives It is now possible to load and mount multiple resource archives using liveupdate.add_mount(name, uri, priority, callback). A loaded mount can be removed using liveupdate.remove_mount(name) and a list of all mounted archives can be retrieved using liveupdate.get_mounts(). When the engine needs a resource it searches the list of mounted archives from the highest priority mount (priority is assigned when an archive is mounted) down to the base archive in search of the resource.

After mounting a .zip file, its resources are immediately available. There is no longer a need to reboot the game to access the new content. Resources in a mounted .zip file are no longer verified. It is up to the developer to verify the integrity of downloaded and mounted archives.

In order to facilitate this functionality the manifest and archive file format has been updated to version 5. This means that existing .zip files won’t load. The liveupdate.ref will be removed and as such the liveupdate workflow should trigger again.

A future improvement will be a way for developers to specify how liveupdate content is split into multiple archives when building. For now the excluded content is stored in a single archive and it is up to the developer to manually split the content into multiple archives.

NEW: (#7800) Add option to avoid copying or cloning buffer in resource.set_buffer Added an argument table for resource.set_buffer with the optional flag transfer_ownership to set a buffer handle immediately on a resource instead of copying or cloning the incoming buffer to the destination buffer. This can be used to improve performance in some cases where heavy use of buffers will invoke lots of data copying. Similar to resource.create_buffer, to set the handle directly on a resource from an external lua buffer do this:

resource.set_buffer(path, buf, { transfer_ownership = true })

NEW: (#7780) Bob.jar support for Apple Silicon (M1/M2) chips using JDK for arm64 Now it is possible to use bob.jar with JDK for arm64 (Apple Silicon chips) on Mac.

NEW: (#7803) Material constant array support for go.get/go.set Added support for setting constant array values from a table via go.set:

go.set("#sprite", "uniform_array", {
        vmath.vector4(1, 0, 0, 1),
        vmath.vector4(0, 1, 0, 1)
})

Calling go.get on the same target will return the entire array as a table as well:

go.get("#sprite", "uniform_array")
-- result: { vmath.vector4(1,0,0,1), vmath.vector4(0,1,0,1) }

NEW: (#7788) Make sure that unloading of a gui component removes its dynamic textures Make sure that unloading a GUI component removes any dynamic textures associated with it to free up memory and prevent memory leaks.

Added GuiDynamicTexturesSizeMb counter to the profiler.

NEW: (#7798) Error about syncfs is now a warning message This change will log a user friendly warning instead of an error in HTML5 builds if the mounted file system fails to sync.

NEW: (#7772) Update all cameras in the focus stack Changed how the focus stack for cameras work. Instead of just updating the camera on the top of the stack, the engine now updates all cameras that have acquired focus via the message msg.post(id, "acquire_camera_focus"). This means that all cameras that have acquired focus will send set_view_projection messages to the render script. Each camera component can be identified in the render script by using the sender in the render script:

function on_message(self, message_id, message, sender)
    if message_id == hash("set_view_projection") then
        -- here, we use the sender.path to identify the camera, but you can combine path and fragment to create a more
        -- precise identifier for the camera
        self.my_cameras[sender.path] = { view = message.view, proj = message.proj }
    end
end

NEW: (#7849) Get and set node materials from gui scripts GUI scripts have three new functions:

gui.get_material(node) - Gets the node material assigned in the editor (or an empty hash of “” if none assigned) gui.gui.set_material(node, material) - Sets a material for a gui node from either material string or hash as specified in the list of materials in the GUI file gui.reset_material(node) - Reset the material for a node to the default node specified in the GUI the node belongs to.

In addition to the GUI functions, you can also get and set materials in the gui via go.get and go.set:

go.get("#my_gui", "materials", { key = "my_custom_material_1" })
-- returns the hash of the resource, e.g hash("/path/to/material.materialc")
go.property("material_property", resource.material("/other_material.material"))
function init(self)
     -- this changes the material with key "my_custom_material1" to use a different material ("/other_material.material")
     go.set("#my_gui", "materials", self.material_property, { key = "my_custom_material_1" })
end

NEW: (#7876) Use asynchronous build on the extender by default. Using of the asynchronous build process fixed an issue when some big extensions fail to build with Internal Server Error.

FIX: (#7852) Set the correct previous state for xinput devices Fixed an issue where gamepads connected from the start doesn’t trigger any ‘connected’ actions to the input system.

FIX: (#7813) Sound stopped event Added a new message id for the sound component when a sound instance has been stopped via sound.stop. The new sound message id is called sound_stopped and will be passed into the lua callback specified when playing a sound.

FIX: (#7812) Shader include with pragmas doesn’t translate to ES3 correctly Fixed an issue where using header guards in shader includes produces the wrong output.

FIX: (#7821) Fix issue with long comments in shaders Fixed issue when long comments in shaders can’t be processed.

FIX: (#7794) Fix profiler step blinking Fix the issue where the profiler blinks when the property Update Frequency other than 0.

FIX: (#35) Set extension version as user agent Fixes #32

FIX: (#7822) Fix issue when wasm-web arch can’t be built without js-web Fixed an issue when Bob doesn’t build the project for wasm-web architecture if the platform specified as js-web.

FIX: (#7869) Make sure old LiveUpdate flow works fine

Editor

NEW: (#7787) Add conditional breakpoints You can set a Lua condition that must evaluate to true for the breakpoint to be triggered. You can do it using new breakpoint popup that you can open by right-clicking on the breakpoint code editor area or pressing Alt F9.

FIX: (#7793) Fix bug when debugger stops with an error if GUI text node contains newline Fix issue when debugger stops if a text node has a newline symbol and then debugger tries to get information about such a node on the breakpoint.

FIX: (#7791) Don’t replace all occurences of empty string The problem: when running replace-all with an empty string find term, the editor got stuck in an infinite loop finding the next occurrences.

the editor no longer locks up executing the “Replace All” command in the code editor view when the search term is empty

FIX: (#7825) Fix issue when CMD+H doesn’t hide the editor on MacOS Fixed issue when CMD+Hon MacOS shows Java About window instead of application hiding.