As always, thanks to all our BETA testers! Much appreciated!!
Defold 1.10.0
Box2D Version 3
This release includes an updated (optional) version of Box2D (version 3). We are working towards making it the default version, but there are some tasks left before that can happen.
Also note that while the integration has been built on top of the same data formats as before and should largely behave the same, please be aware that projects can potentially behave slightly differently now. According to the documentation, the new Box2D version is more or less a full rewrite of the physics engine, which means that some settings might need to be tweaked.
If you want to change to the new version you can change this by using an app manifest. To read more about app manifests, please have a look at the app manifest documentation.
Known differences:
- Trigger vs Trigger collisions - The documentation in Box2D for Triggers (aka Sensor in Box2D terminology) mentions: A sensor shape generates overlap events but never generates a collision response. Sensors do not collide with other sensors and do not have continuous collision.
- This means that the new version of Box2D will only generate
trigger_response
events on enter and exit with kinematic and dynamic objects. Two triggers that overlap will not be detected.
- This means that the new version of Box2D will only generate
Stricter .defignore
pattern matching
Weâve updated the implementation of .defignore
patterns to more strictly adhere to the rules stated in the documentation. Previously, a pattern like /import
would naively match any path that starts with /import
. This meant that if you added a file named /important.json
to the project, it would be ignored. Weâve updated the rules to now only match the /import
directory itself and anything below it.
Summary
- BREAKING CHANGE: (#10337) Update box2d to version 3 (by Jhonnyg)
- BREAKING CHANGE: (#10240) Add a wrapper api for our profiler properties (by JCash)
- NEW: (#10274) Reduce the size of the
dmanifest
file in the build and in LiveUpdate (by AGulev) - NEW: (#10268) Parallel native code building on Extender for different architectures (by AGulev)
- NEW: (#9983) GPU skinning support (by Jhonnyg)
- NEW: (#10284) Add callbacks for progress and completed load (by smagnuso)
- NEW: (#10123) Create 3d textures via resource.create_texture (by Jhonnyg)
- NEW: (#10355) Use vulkan as default renderer on osx (by Jhonnyg)
- NEW: (#9984) GL ES for the Linux ARM64 target to support running on Raspberry Pi and Linux handhelds (by aglitchman)
- NEW: (#10252) Added new window API functions (by britzl)
- NEW: (#10314) Add editor HTTP server extensibility (by vlaaad)
- NEW: (#10241) Make color fields editable (by sprocketc)
- NEW: (#10344) Show hovers from language servers (by vlaaad)
- NEW: (#10298) Create atlas images on drag & drop from the asset tree (by sprocketc)
- NEW: (#10249) Add
zip.pack
to editor scripts (by vlaaad) - NEW: (#10308) Persist saved colors of color picker (by sprocketc)
- NEW: (#10231) Update properties on label drag (by sprocketc)
- NEW: (#10357) Projects can list paths to not load in .defunload (by matgis)
- NEW: (#10253) Introduce color dropper (by sprocketc)
- FIX: (#10257) Show Lua errors when building or bundling for HTML5 (by AGulev)
- FIX: (#10269) Make sure the LiveUpdate manifest is deterministic (by AGulev)
- FIX: (#10254) Take Bobâs parameters into consideration to decide which resources should be rebuilt (by AGulev)
- FIX: (#10300) Output crosscompilation errors from pipeline (by Jhonnyg)
- FIX: (#10175) Update to latest vulkan + MoltenVK versions (by Jhonnyg)
- FIX: (#10313) Create texture script regression (by Jhonnyg)
- FIX: (#10329) Fix build time reporting to support multithreaded builds (by AGulev)
- FIX: (#10267) Async texture update support for vulkan (by Jhonnyg)
- FIX: (#10351) Merge shader resources (by Jhonnyg)
- FIX: (#10291) Added profiler backend for HTML5 (by JCash)
- FIX: (#10293) Unified Windows MSVC detection between local/packaged sdks (by JCash)
- FIX: (#10388) Fix Build Report issues (by AGulev)
- FIX: (#10381) Fix WebGPU detection (by ekharkunov)
- FIX: (#10374) Added missed libraries in app manifest for Vulkan variant for linux platform (by ekharkunov)
- FIX: (#10387) Fix run OSX with OpenGL backend (by ekharkunov)
- FIX: (#10401) Add engine version and sdk into dmloader for html5 bundle (by AGulev)
- FIX: (#10266) Improve parallel code loading on editor startup (by vlaaad)
- FIX: (#10279) Do not clean the bundle folder to speed up the bundling process (by AGulev)
- FIX: (#10367) Fix multi-editing of gui node properties (by matgis)
- FIX: (#10424) Correctly apply Gui template rotation to imported nodes when building (by matgis)
Engine
BREAKING CHANGE: (#10337) âUpdate box2d to version 3â by Jhonnyg
Box2D has been updated to Version 3, which is now the default physics engine for 2D. Since the latest Box2D version is more or less a full re-write, using the new version might cause existing projects to simulate or behave differently. If you want to keep using the old physics implementation for your projects, you can switch to the old version by using an app manifest:
To read more about app manifests, head over to App manifest
Know differences from the previous version of Box2D used in Defold:
- Trigger vs Trigger collisions - The documentation in Box2D for Triggers (aka Sensor in Box2D terminology) mentions: A sensor shape generates overlap events but never generates a collision response. Sensors do not collide with other sensors and do not have continuous collision.
- This means that the new version of Box2D will only generate
trigger_response
events on enter and exit with kinematic and dynamic objects. Two triggers that overlap will not be detected.
- This means that the new version of Box2D will only generate
BREAKING CHANGE: (#10240) âAdd a wrapper api for our profiler propertiesâ by JCash
If you are a native extension developer and are using the DM_PROFILE()
macros, there has been an api change.
The changes needed to update should be minimal.
Previous:
DM_PROPERTY_PROPERTY_GROUP(rmtp_TestGroup1);
DM_PROPERTY_BOOL(rmtp_TestBOOL, 0, FrameReset, "", &rmtp_TestGroup1);
Now, weâve added the parent as an explicit argument, and weâve converted the enum into a Defold specific enum:
DM_PROPERTY_GROUP(prop_TestGroup1, "", 0); // excplicit parent pointer, 0 in this case
DM_PROPERTY_BOOL(prop_TestBOOL, 0, PROFILE_PROPERTY_FRAME_RESET, "", &prop_TestGroup1);
NEW: (#10274) âReduce the size of the dmanifest
file in the build and in LiveUpdateâ by AGulev
The dmanifest
in the release bundle no longer contains the full project path to the file url
, as this information is only needed for debugging. This reduces its size.
NEW: (#10268) âParallel native code building on Extender for different architecturesâ by AGulev
Now, Extender builds different architectures for the same platform simultaneously to speed up the build process.
For example, armv7-android
and arm64-android
or js-web
and wasm-web
.
NEW: (#9983) âGPU skinning supportâ by Jhonnyg
Model components can now support GPU skinning when using materials with a âlocalâ vertex space. There are now two new builtin model materials that can be used (model_skinned
and model_skinned_instanced
) that can support either instanced or non-instanced models.
The GPU skinning uses a floating point texture
to store all the bones of each animation. This means that in order for this to work, the client must have support for floating point textures
. This can potentially be an issue on WebGL1, but in generally floating point textures are extremely well supported so in most cases this will not be an issue.
NEW: (#10284) âAdd callbacks for progress and completed loadâ by smagnuso
Added two extra parameters to the CUSTOM_PARAMTERS
for HTML5 builds:
start_success
- Function that is called just before main is called upon successful loadupdate_progress
- Function that is called as progress is updated. Parameter progress is updated 0-100
NEW: (#10123) âCreate 3d textures via resource.create_textureâ by Jhonnyg
The engine can now support 3D textures in runtime. Use these resource functions to work with 3D textures:
- resource.create_texture
- resource.create_texture_async
- resource.set_texture
Examples:
-- Create a 3D texture that can be used in a compute shader
local t_backing = resource.create_texture("/my_backing_texture.texturec", {
type = graphics.TEXTURE_TYPE_IMAGE_3D,
width = 32,
height = 32,
depth = 32,
format = resource.TEXTURE_FORMAT_RGBA32F,
flags = resource.TEXTURE_USAGE_FLAG_STORAGE + resource.TEXTURE_USAGE_FLAG_SAMPLE,
})
-- create a buffer that can hold the data of a 8x8x8 texture
local tbuffer = buffer.create(8 * 8 * 8, { {name=hash("rgba"), type=buffer.VALUE_TYPE_FLOAT32, count=4} } )
local tstream = buffer.get_stream(tbuffer, hash("rgba"))
-- populate the buffer with some data
local index = 1
for z=1,8 do
for y=1,8 do
for x=1,8 do
tstream[index + 0] = x
tstream[index + 1] = y
tstream[index + 2] = z
tstream[index + 3] = 1.0
index = index + 4
end
end
end
local t_args = {
type = graphics.TEXTURE_TYPE_IMAGE_3D,
width = 8,
height = 8,
depth = 8,
format = resource.TEXTURE_FORMAT_RGBA32F
}
-- This expects that the texture resource "/my_3d_texture.texturec" already exists
-- and is a 3D texture resource. To create a dynamic 3D texture resource
-- use the "resource.create_texture" function.
resource.set_texture("/my_3d_texture.texturec", t_args, tbuffer)
NEW: (#10355) âUse vulkan as default renderer on osxâ by Jhonnyg
Vulkan is now the default renderer on OSX (x86_64-macos and ram64-macos).
Q: What are the benefits of using Vulkan?
A: Many! These are some typical points:
- OpenGL is deprecated on osx. This means that OpenGL can get fully removed from the mac ecosystem at any point in time.
- More new potential features (compute shaders are supported by default, among many other modern features)
- Improved rendering performance (mainly for 3D)
- You can profile the rendering in Xcode to get accurate timings for a frame
- In general reduced runtime memory footprint
- OpenGL is complete and will likely not get any more updates in the future. Using modern tech means we can add and improve rendering in the future.
Q: I donât want to use Vulkan, can I use OpenGL?
A: Yes, you can use an app manifest to switch back to OpenGL. Read more about app manifests here: App manifest
NEW: (#9984) âGL ES for the Linux ARM64 target to support running on Raspberry Pi and Linux handheldsâ by aglitchman
This PR changes the graphics API from desktop OpenGL to OpenGL ES for the Linux ARM64 target. Devices on this platform usually do not have support for desktop OpenGL because they are built on mobile chips. Also added gamepad mapping for Linux handhelds to the gamepads database.
NEW: (#10252) âAdded new window API functionsâ by britzl
Added new window.* API functions:
window.set_size(width, height)
window.set_position(x, y)
window.set_title("Defold rocks!")
local scale = window.get_display_scale()
FIX: (#10257) âShow Lua errors when building or bundling for HTML5â by AGulev
Fixed an issue where building or bundling for HTML5 ignored errors in Lua code.
FIX: (#10269) âMake sure the LiveUpdate manifest is deterministicâ by AGulev
Fix issues where engine_versions
in the LiveUpdate manifest may have a different order from build to build.
FIX: (#10254) âTake Bobâs parameters into consideration to decide which resources should be rebuiltâ by AGulev
Now Bob knows which resources may be affected by its parameters and rebuilds only those resources. For example, if the first bundle is done with --texture-compression
and the second bundle is done without it, all textures, atlases, and other related resources will be rebuilt.
This should improve the experience when bundling without the clean
parameter for Bob.
FIX: (#10300) âOutput crosscompilation errors from pipelineâ by Jhonnyg
Fixed an issue where some shaders canât be crosscompiled to a certain shader version.
FIX: (#10175) âUpdate to latest vulkan + MoltenVK versionsâ by Jhonnyg
Vulkan has been updated to v1.4.307 and MoltenVK has been updated to use a special fork of MoltenVK that adds input attachment via programmable blending, which is a prerequisite for the Defold Rive integration.
FIX: (#10313) âCreate texture script regressionâ by Jhonnyg
Fixed an issue where dynamic texture resources where not created correctly on non-opengl graphics adapters due to a miscalculation of the data size parameter.
FIX: (#10329) âFix build time reporting to support multithreaded buildsâ by AGulev
Build time report now supports multithreaded Bob builds
FIX: (#10267) âAsync texture update support for vulkanâ by Jhonnyg
The vulkan backend can now upload texture data in parallell.
FIX: (#10351) âMerge shader resourcesâ by Jhonnyg
Shader resources can now be merged between different stages of the same shader program:
my_shader.vp:
uniform shared_uniforms {
vec4 tint;
};
uniform sampler2D shared_texture;
void main()
{
vec4 shared_color = texture(shared_texture, vec2(texcoord0));
gl_Position = view_proj * vec4(position.xyz * tint.x + shared_color.r * 0.001, 1.0);
var_texcoord0 = texcoord0;
}
my_shader.fp:
uniform shared_uniforms {
vec4 tint;
};
uniform sampler2D shared_texture;
void main()
{
vec4 shared_color = texture(shared_texture, var_texcoord0.st);
color = tint * shared_color;
color.a = 1.0;
}
Previously, shared_uniforms and shared_texture would be used as two separate resources in the engine, which means that the same resource would be bound twice even though they are supposed to be used as a single resource.
Furthermore, the pipeline will now also make sure that outputs from a shader stage matches the inputs of the next shader stage (e.g vertex shader + fragment shader). Previously, this example would cause non-opengl adapters to behave incorrect:
my_shader.vp:
out vec4 out_position;
out vec3 out_normal;
out vec2 out_uv;
my_shader.fp
in vec3 out_normal;
in vec2 out_uv;
in vec4 out_position;
With the new remapping system, the locations of the outputs from the vertex shader will correctly match the inputs of the fragment shader.
Note: Remapping of resources will currently only work with the ânew shader pipelineâ. To migrate your old shaders to the new pipeline, head over to Shader programs in Defold to read more.
FIX: (#10291) âAdded profiler backend for HTML5â by JCash
Weâve added a new profiler backend that allows you to do in game profiling on HTML5 builds.
We also added a function profiler.dump_frame()
that allows for logging the current frame to the output:
function update(self, dt)
profiler.dump_frame() -- dump to output at the end of the frame
end
It will yield output like:
INFO:PROFILER: Profiler threads:
INFO:PROFILER: Thread 'Main': 0.003033
INFO:PROFILER: 'Step': time: 3.033 ms self: 0.011 ms count: 1
INFO:PROFILER: 'Frame': time: 3.022 ms self: 0.007 ms count: 1
INFO:PROFILER: 'Sim': time: 0.635 ms self: 0.012 ms count: 1
INFO:PROFILER: 'Update': time: 0.033 ms self: 0.012 ms count: 1
INFO:PROFILER: 'collectionproxyc': time: 0.000 ms self: 0.000 ms count: 1
INFO:PROFILER: 'DispatchMessages': time: 0.002 ms self: 0.002 ms count: 16
INFO:PROFILER: 'scriptc': time: 0.002 ms self: 0.002 ms count: 1
INFO:PROFILER: 'Update': time: 0.000 ms self: 0.000 ms count: 1
INFO:PROFILER: 'UpdateTransforms': time: 0.004 ms self: 0.004 ms count: 1
...
INFO:PROFILER: Profiler properties:
INFO:PROFILER: 'rmtp_Resource': 22
INFO:PROFILER: 'rmtp_CpuUsage': 13
INFO:PROFILER: 'rmtp_Memory': 104720
INFO:PROFILER: 'rmtp_GOInstances': 1
INFO:PROFILER: 'rmtp_TimerCount': 0
INFO:PROFILER: 'rmtp_ScriptCount': 1
INFO:PROFILER: 'rmtp_ComponentsAnim': 0
INFO:PROFILER: 'rmtp_ParticlesAlive': 0
You add profile scopes/properties using the dmSDK api: API reference (dmProfile)
FIX: (#10293) âUnified Windows MSVC detection between local/packaged sdksâ by JCash
This PR makes it easier to use locally installed Visual Studio and Windows SDK.
FIX: (#10388) âFix Build Report issuesâ by AGulev
Build report now uses archive builder instead of reading actual archive
FIX: (#10381) âFix WebGPU detectionâ by ekharkunov
FIX: (#10374) âAdded missed libraries in app manifest for Vulkan variant for linux platformâ by ekharkunov
FIX: (#10387) âFix run OSX with OpenGL backendâ by ekharkunov
FIX: (#10401) âAdd engine version and sdk into dmloader for html5 bundleâ by AGulev
Editor
NEW: (#10314) âAdd editor HTTP server extensibilityâ by vlaaad
Now editor scripts may add routes to the built-in HTTP server, e.g.:
function M.get_server_routes()
return {
http.server.route("/my-extension/files/{*file}", function(request)
local attrs = editor.external_file_attributes(request.file)
if attrs.is_file then
return http.server.external_file_response(request.file)
else
return http.server.response(404, "Not found")
end
end)
}
end
NEW: (#10241) âMake color fields editableâ by sprocketc
Added an editable text input to allow setting custom colors directly on the properties panel.
NEW: (#10344) âShow hovers from language serversâ by vlaaad
NEW: (#10298) âCreate atlas images on drag & drop from the asset treeâ by sprocketc
Enable dragging & dropping images from the asset tree to the atlas scene view.
NEW: (#10249) âAdd zip.pack
to editor scriptsâ by vlaaad
Now itâs possible to create zip archives using editor scripts:
zip.pack("build/dist.zip", {"build/wasm-web", "assets"})
NEW: (#10308) âPersist saved colors of color pickerâ by sprocketc
Persist custom saved colors on project prefs.
NEW: (#10231) âUpdate properties on label dragâ by sprocketc
Dragging the labels of numeric properties now updates their value depending on the drag direction. When this action is supported, the label will be highlighted on mouse over, and the mouse cursor will switch to horizontal-resize. Left-right / up-down gestures both work. Some property types may override the default step (1), to a more sensible default. Holding SHIFT
while dragging multiplies this step by 10, and holding CTRL
divides it by 10, to allow different precision levels on a case by case basis.
NEW: (#10357) âProjects can list paths to not load in .defunloadâ by matgis
You can now list files and resources to exclude when loading the project in a .defunload
file below the project directory. This may be of interest to large projects that contain multiple independent modules, where excluding parts of it can reduce memory usage and load times in the editor.
Simply put, the .defunload
file allows you to hide parts of the project from the editor without making it a build error to reference the hidden resources.
The patterns in .defunload
use the same rules as the .defignore
file. Unloaded Collections and Game Objects will behave as if they were empty when referenced by loaded resources. Other resources that match .defunload
patterns will be in an unloaded state, and cannot be viewed in the editor. However, if a resource that is loaded depends on them, the unloaded resources and their dependencies are loaded automatically.
For example, if a Sprite depends on images in an Atlas, we have to load the Atlas, or the missing image will be reported as an error. If this happens, a notification will warn the user about the situation and provide information about which unloaded resource was referenced from where.
The editor will prevent the user from adding references to .defunloaded
resources from loaded resources, so this situation only occurs when resources are read from disk.
NEW: (#10253) âIntroduce color dropperâ by sprocketc
Display a color dropper button when we move the mouse over a color input field. For now, the dropper can only be used to capture pixel values within the editor.
FIX: (#10266) âImprove parallel code loading on editor startupâ by vlaaad
The editor is more reliable when loading its code on startup.
FIX: (#10279) âDo not clean the bundle folder to speed up the bundling processâ by AGulev
From now on, the bundle option in the editor does not clean the bundle folder (equivalent to the distclean
option in Bob) to speed up bundling.
FIX: (#10367) âFix multi-editing of gui node propertiesâ by matgis
Fixed a regression where most Gui node properties would be hidden in the property editor when multiple Gui nodes were selected.
FIX: (#10424) âCorrectly apply Gui template rotation to imported nodes when buildingâ by matgis
We were mistakenly mixing quaternion and Euler rotation math when baking Gui template node transforms into the imported nodes when building from the editor.