⇠ More posts

Defold release 1.7.0

By Mathias Westerdahl on Mar 11, 2024

Tagged as: Release notes


Defold 1.7.0

Release notes

As the version number suggests, in this version we have introduced some breaking changes. The more important changes are related to texture mip map options, and also the removal of the system_font from the builtins package. Please read those sections extra carefully.

There is also some “code cleanup” that may strictly be considered a breaking change. It relates to us removing old extension stubs. It shouldn’t affect anyone, as these extensions have been published to github and been in use for many years.

Summary

  • BREAKING CHANGE: (#8528) More options for min filter in game.project->Graphics->Default Texture Min Filter
  • BREAKING CHANGE: (#8548) Removed deprecated extensions from the code
  • BREAKING CHANGE: (#8559) Removed system_font.font from builtins
  • BREAKING CHANGE: (#8529) Turn mipmaps off in the default.texture_profiles file in builtins
  • BREAKING CHANGE: (#8553) Removed old deprecated messages
  • NEW: (#8424) Render target as a resource
  • NEW: (#8322) Increased length of debug prints for urls to 256 per part and 512 in total
  • NEW: (#8513) Add missed gui.BLEND_SCREEN constant into gui module
  • NEW: (#8525) Add camera focus message’s wrappers.
  • NEW: (#8562) Set custom vertex data API (Sprites)
  • NEW: (#8577) Add support for enabling a render target resource in render.enable_texture
  • NEW: (#8599) Flip image flag for image.load
  • NEW: (#8521) Add world to local coordinate system conversion API
  • NEW: (#8473) Add editor.delete_directory()
  • NEW: (#8510) Use async engine build in the editor
  • FIX: (#8371) Fix http request timeout usage in HTML5 build
  • FIX: (#8477) Fix issue when profiler show wrong count of GUI.ActiveNodes
  • FIX: (#8486) Fixed an issue where the game wouldn’t start if the iframe didn’t allow gamepad usage (HTML5).
  • FIX: (#8484) Fix multi-buffered render buffers on non-opengl graphics adapters
  • FIX: (#8496) Fixed an issue where attempting to use IndexedDB when it is prohibited prevents game loading in HTML5.
  • FIX: (#8493) Fix for crash caused by ray casting followed by deletion of the object
  • FIX: (#8305) add “Support texture handles in render.enable_texture” mention to API documentation
  • FIX: (#8544) Send sound_done or sound_stopped messages only if the sound is played using msg.post() with the play_id parameter.
  • FIX: (#8551) Fixed an issue where bob.jar did not delete some temporary folders after the bundling process was completed.
  • FIX: (#8552) Support sampler names in render.enable_texture
  • FIX: (#8582) Crash fixes for the GDC tool
  • FIX: (#8567) Fixed rendering of untextured sprites in the editor
  • FIX: (#8569) Added support for sprite to not have a texture assigned
  • FIX: (#8579) Check that texture width and height is valid before creating texture
  • FIX: (#8583) Use correct material tag for mesh components
  • FIX: (#8591) Add retry_count and retry_time settings to the game.project file in the html5 section.
  • FIX: (#8547) Fix issues with physics.set_shape() when Allow Dynamic Transformsis on
  • FIX: (#8561) Fixed the way the HTML5 bundler splits and renames resource files
  • FIX: (#8545) Add arm64-osx platform to manifests
  • FIX: (#8522) Graph successor memory optimizations
  • FIX: (#8531) Hide texture formats and texture compressions from *.textures_profiles that are currently not supported.
  • FIX: (#8563) Properly validate sprite texture assignments
  • FIX: (#8593) Paged atlas preview bugfix

Engine

BREAKING CHANGE: (#8528) More options for min filter in game.project->Graphics->Default Texture Min Filter Now, the field Default Texture Min Filter in game.project -> Graphics has the same options as materials do. This is a breaking change for projects that use mipmaps on their textures and the OpenGL graphics backend.

Old behavior was:

  • Options linear and nearest as Default Texture Min Filter meant TEXTURE_FILTER_LINEAR_MIPMAP_NEAREST and TEXTURE_FILTER_NEAREST_MIPMAP_NEAREST respectively.
  • If a texture without mipmaps was used with a material where Min Filter was specified with mipmaps, it used the Mag Filter option instead.

Current behavior:

  • Options linear and nearest as Default Texture Min Filter mean TEXTURE_FILTER_LINEAR and TEXTURE_FILTER_NEAREST respectively.
  • If a texture without mipmaps is used with a material where Min Filter is specified with mipmaps, it simply ignores the mipmaps part of the filter. For example, for TEXTURE_FILTER_LINEAR_MIPMAP_NEAREST, it will be TEXTURE_FILTER_LINEAR, etc.

BREAKING CHANGE: (#8548) Removed deprecated extensions from the code In this release we’ve removed old extension stubs for facebook, iap, iac, push and webview. This shouldn’t affect any users, but is only part of an internal code cleanup task. The actual extensions are found in the github repositories (e.g. https://github.com/defold/extension-iap)

BREAKING CHANGE: (#8559) Removed system_font.font from builtins This breaking change was implemented to clarify the usage of predefined fonts in builtins. The old system_font.font has been completely removed from the builtins, and two new fonts have been introduced:

  1. builtins/fonts/default.font, which uses the default df material and can serve as a font for the development process.
  2. builtins/fonts/debug/always_on_top.font, which utilizes a special material builtins/fonts/debug/always_on_top_font.material with the debug_text tag. This font is intended to be drawn on top of other elements and is used for debugging purposes (such as the profiler and the draw_debug_text message) as replacement of old system_font.font. Additionally, changes are required in default.render_script, where the old text predicate has been replaced with the debug_text predicate for clarity.

BREAKING CHANGE: (#8529) Turn mipmaps off in the default.texture_profiles file in builtins This is a breaking change for projects that use default.texture_profiles from the builtins folder. If you need mipmaps for your textures, ensure you use a custom default.texture_profiles where this option is enabled.

BREAKING CHANGE: (#8553) Removed old deprecated messages The following messages were removed:

  1. msg.post(url, "request_transform") and "transform_response" – requests the transform from an instance
  2. msg.post(url, "set_tile", ...) – use tilemap.set_tile() instead

NEW: (#8424) Render target as a resource A new resource type has been added that creates render targets that can be used as a regular texture in the engine. image

The .render file has also been refactored to support this new render resource type. You can now add .render_target files into the render prototype resource. In the render_script, you can use these render targets in the same way as before, except that you can now pass in the render resource name when binding the render target:

image

-- in a render script:
render.set_render_target("my_rt")

A new function has also been added to .script files to get all the metadata about a render target resource: resource.get_render_target_info(path)

NEW: (#8322) Increased length of debug prints for urls to 256 per part and 512 in total

NEW: (#8513) Add missed gui.BLEND_SCREEN constant into gui module Added gui.BLEND_SCREEN, which was missing in the documentation as well as in the gui module.

NEW: (#8525) Add camera focus message’s wrappers. Now it possible to activate/deactivate camera component via camera.acquire_focus/ camera.release_focus.

camera.acquire_focus("/observer#main_camera")
camera.release_focus("/observer#main_camera")

NEW: (#8562) Set custom vertex data API (Sprites) Added support for setting and getting vertex attributes for sprites via the go.set, go.get and go.animate functions. Similar to shader constants, the attributes has to be specified in the material:

image

To modify the my_color attribute:

local my_color = go.get("#sprite", "my_color")
my_color.x = my_color.x + 0.5
go.set("#sprite", "my_color", my_color)

Or alternatively, you can use go.animate:

go.animate("#sprite", "my_color", go.PLAYBACK_LOOP_FORWARD, vmath.vector4(1, 0, 0, 1), go.EASING_INBACK, i))

NEW: (#8577) Add support for enabling a render target resource in render.enable_texture Render script can now enable render targets specified in the Render Resource table in a .render file:

image

This can now be done by calling render.enable_texture:

-- draw something to a render target:
render.set_render_target("rt_res")
-- do drawing here and unbind RT
render.set_render_target(render.RENDER_TARGET_DEFAULT)

-- set the RT buffer 0 to a sampler and draw something using it
render.enable_texture("my_sampler", "rt_res", render. BUFFER_COLOR0_BIT) 
render.draw(self.my_predicate)

NEW: (#8599) Flip image flag for image.load image.load and image.load_buffer can now flip images vertically when loading:

image.load_buffer(path, {  flip_vertically = true })
image.load(path, {  flip_vertically = true })

Note that the second argument will now accept an option table, with these arguments:

premultiply_alpha - True if alpha should be premultiplied into the color components. Defaults to `false`.
flip_vertically - True if the image contents should be flipped vertically. Defaults to `false`.

NEW: (#8521) Add world to local coordinate system conversion API Add new APIs to convert world position and world transform to game object’s coordinate space. How to use:

    local test_pos = go.get_world_position("/test")
    local child_pos = go.get_world_position("/child")
    local new_position = go.world_to_local_position(test_pos, "/child")
    local test_transform = go.get_world_transform("/test")
    local child_transform = go.get_world_transform("/child")
    local result_transform = go.world_to_local_transform(test_transform, "/child")

FIX: (#8371) Fix http request timeout usage in HTML5 build

  • Fix timeout option usage in http module for HTML5 implementation.
  • Update http module documentation.
  • Wrap HttpRequestAsync arguments with struct.
  • Fix possible memory leak.

FIX: (#8477) Fix issue when profiler show wrong count of GUI.ActiveNodes Fixed an issue where nodes that aren’t directly disabled, but are disabled because one of their parents is disabled in the tree, were incorrectly counted in GUI.ActiveNodes by the profiler.

FIX: (#8486) Fixed an issue where the game wouldn’t start if the iframe didn’t allow gamepad usage (HTML5). Fixed the issue where the game doesn’t start if access to gamepads is disallowed by the permissions policy.

FIX: (#8484) Fix multi-buffered render buffers on non-opengl graphics adapters We have fixed an issue with models when using a multi-buffered render setup. This should have no effect on OpenGL-based rendering, but is important for console and vulkan adapters.

FIX: (#8496) Fixed an issue where attempting to use IndexedDB when it is prohibited prevents game loading in HTML5. Fixed an issue where, in some rare cases, if IndexedDB usage is restricted, users may encounter the “Assertion failed: IDBFS used, but IndexedDB not supported” error.

FIX: (#8493) Fix for crash caused by ray casting followed by deletion of the object Fixed a crash that occurs if physics.raycast_async() is called in the on_message() function and then the object is deleted immediately.

FIX: (#8305) add “Support texture handles in render.enable_texture” mention to API documentation For now there is no mention to support handles except a rendertarget handle:

But since 1.4.6 we have support texture handles:

-- in a regular gameobject script:
local my_texture_info = resource.get_texture_info("/my_atlas.a.texturesetc")
msg.post("@render:", "set_my_texture", { handle = my_texture_info.handle })

-- in a render script:
function update(self, dt)
    render.enable_texture(0, self.my_texture)
end

function on_message(self, message_id, message)
    if message_id == hash("set_my_texture") then
        self.my_texture = message.handle
    end
end

FIX: (#8544) Send sound_done or sound_stopped messages only if the sound is played using msg.post with the play_id parameter. The sound component will send sound_done and sound_stopped messages only if msg.post() is used with the play_id parameter, as in msg.post("#sound", "play_sound", {play_id = 1}).

FIX: (#8551) Fixed an issue where bob.jar did not delete some temporary folders after the bundling process was completed. Fixed an issue where, in some cases, bob.jar did not delete temporary folders. This could quickly fill up the disk on a CI machine.

FIX: (#8552) Support sampler names in render.enable_texture Added support for enabling and disabling a sampler by a string or hash in a render script:

render.enable_texture(unit|name|hash, texture)
render.disable_texture(unit|name|hash, texture)

Previously a texture could only be bound to the renderer by texture units, which could cause issues when certain graphics adapters optimizes away unbound textures. With this new functionality, you can bind the same textures to multiple sampler names, which will be bound to the matching sampler name by the renderer when draw calls are issued:

render.enable_texture("my_global_texture", self.tex0)
render.enable_texture("some_other_sampler", self.tex0)
render.enable_texture("a_third_sampler", self.tex0)

It’s however recommended that you use the same sampler name for all samplers in this case, this example just illustrates that it is possible to do so!

FIX: (#8582) Crash fixes for the GDC tool Fixed an issue where the GDC tool would crash immediately after starting. This is due to recent changes to our platform layer.

FIX: (#8567) Fixed rendering of untextured sprites in the editor Untextured sprites now show up in the editor viewport as long as their shader renders something.

FIX: (#8569) Added support for sprite to not have a texture assigned This fixes an issue where the engine crashed if the sprite had no textures at all. Now, the UV coordinates will encompass the entire sprite (since it has no atlas).

FIX: (#8579) Check that texture width and height is valid before creating texture Calling resource.create_texture() with a width and/or height of zero crashed the engine. This change will check that the width and height are valid and throw a Lua error otherwise.

FIX: (#8583) Use correct material tag for mesh components Fixed an issue where the wrong material tag was using when producing render lists.

FIX: (#8591) Add retry_count and retry_time settings to the game.project file in the html5 section. Two new settings are available in the game.project file in the html5 section:

  • retry_count: how many attempts the engine makes when trying to download a file.
  • retry_time: pause in seconds before retrying file loading after an error.

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.

FIX: (#8547) Fix issues with physics.set_shape() when Allow Dynamic Transformsis on. Fix issues with physics.set_shape() which appears when Allow Dynamic Transforms option in game.project is on.

FIX: (#8561) Fixed the way the HTML5 bundler splits and renames resource files Instead of using names like game.arcd0 , game.arcd1 , game.arci0 for resource files in the HTML5 bundle, this fix keeps the file extension as is and adds filename counters instead: game0.arcd , game1.arcd , game0.arci . This will facilitate the use of custom server settings for files based on their filetype.

FIX: (#8547) Add arm64-osx platform to manifests Add arm64-osx platform to release/headless manifests. Fix js-web excludeLibs list.

Editor

NEW: (#8473) Add editor.delete_directory()

NEW: (#8510) Use async engine build in the editor The editor now uses async build server API. This should help with timeouts for long engine builds caused by big extensions.

FIX: (#8522) Graph successor memory optimizations Large projects with a lot of connections will now use significantly less memory.

FIX: (#8531) Hide texture formats and texture compressions from *.textures_profiles that are currently not supported. All the unsupported texture formats and texture compressions are hidden from *.texture_profiles.

FIX: (#8563) Properly validate sprite texture assignments

  • Fixes a regression where you could build the project without properly assigning textures to all samplers in the assigned sprite material.
  • Fixes an issue where the sprite animation dropdown would contain entries for the non-primary atlas if any sampler apart from the first one was assigned first.
  • Mismatches between paged and unpaged materials and textures are now properly reported as build errors for sprites.

FIX: (#8593) Paged atlas preview bugfix