⇠ More posts

Defold release 1.3.0

By Björn Ritzl on Mar 08, 2022

Tagged as: Release notes


This week marks the release of Defold 1.3.0, a fairly significant release due to the fact that we introduced the first truly breaking change in 192 releases of the Defold engine. We’ve had perhaps a handful of “near breaking changes” in the past five years, but nothing warranting a jump in the second number of the version. Let’s start by talking about the breaking change itself and the version naming scheme that we are using before we move on to the release notes.

Spine is now fully moved to an extension

In this version we are fully removing the Spine component from the engine itself and moving to the official Spine runtime. If you use Spine animations in your project then extra migration steps are needed. This marks the end of life for our custom Spine runtime and a real milestone for us as a team. When we decided to add Spine support many years ago we saw that the official Spine runtime would increase the size of the engine quite a bit for all users, regardless if they used Spine or not. This was unacceptable as one of our top priorities is to keep the size of the engine really small. Instead we decided to create our own runtime. This turned out to be a double-edged sword; our runtime was quite a bit smaller than the official runtime, but at the same time we took on a big maintenance burden.

About versioning of Defold

As was previously noted we made the decision to move from Defold version 1.2.192 to Defold 1.3.0 with this release. We did this to signal the breaking change introduced by the removal of Spine from the engine. Going forward we will use a MAJOR.BREAKING.UPDATE version scheme:

  • MAJOR - The first number (currently 1) indicates major changes to the engine. This number will very rarely change.
  • BREAKING - The second number (currently 3) indicates breaking changes that require developers to either update code or data. As before we will at all times try to avoid breaking changes at all costs. We know from our own experience working with other tools that breaking changes can be very disruptive for a project.
  • UPDATE - The third number (currently 0) indicates non-breaking updates to the engine. This includes backwards compatible bug fixes and new features. This will be the standard for almost every release going forward.

But what about semantic versioning you may ask? Semantic versioning or SemVer is a popular version naming scheme using a MAJOR.MINOR.PATCH format where MAJOR signals incompatible API changes, MINOR for backwards compatible new features, and PATCH for backwards compatible bug fixes. There’s nothing wrong with this scheme but we believe there is value for Defold and other similar products to use the first number to signal truly noteworthy upgrades to the product and not merely that a breaking change was introduced.

Release notes

Engine

  • FIX: Reset key state when canvas focus is lost (#3186). This fix improves detection of focus loss for the canvas by not only looking at the visibility change event but instead listening for focus and blur events on the canvas element. This captures much more accurately situations when the canvas is no longer getting key events and may end up with stuck keys.

  • FIX: Call setIntent when override onNewIntent for DefoldActivity (#6406). Some SDKs (for example AppsFlyer) save data in intent (in case with Appsflyer it’s deep links data). To be able to get this data app should be in singleTop mode or manually override onNewIntent and call setIntent.

  • NEW: New field enabled for properties iterator (#6355). Adds new field enabled in properties iterator for Gui nodes and components that support enable/disable messages. This functionality used in extension-poco for tests automation.

  • NEW: Add game.project field for SSL keys to verify the certificate chain during SSL handshake (#6112). To verify server SSL certificate a developer should provide a PEM file that contains public keys that should be used for verification. This file may contain public CA-root certificate keys or a self-signed certificate public keys.

This fix adds a new field network.ssl_certificates in game.project where this PEM file may be specified. If any file is specified in this field the engine turns on verification by default for all requests.

The list of CA-root certificates is included in builtins/ca-certificates, but we don’t recommend using this file directly. Create a new PEM file and copy-paste the needed CA-root certificates depending on the services you make HTTP requests to.

  • NEW: New functions gui.set_screen_position() and gui.screen_to_local() (#5886). Two new function added to make it easier to operate nodes in GUI component:

    • gui.set_screen_position(node, screen_position) - set screen position for the node;
    • local local_position = gui.screen_to_local(node, screen_position) - convert screen position to a local position of the supplied node.

Also, it fixed a bug when the returned value of gui.get_screen_position() might be affected by pivot value.

  • NEW: Added support for WebAssembly.instantiateStreaming when loading HTML5 engine (#6324). Using WebAssembly.instantiateStreaming() is the fastest way to load the engine on HTML5 since you no longer have to first load the full engine into an array buffer and then instantiate it. The feature is enabled by default but can be disabled by setting EngineLoader.stream_wasm = false;.

  • NEW: Added more dmGui::DeleteNode et al to dmsdk for use with extension-spine (#6378).

  • NEW: Spine as an extension (#5333).

  • FIX: Use Application Support folder for game logs if ./log.txt is unavailable (#6354). Fixes path to the log.txt file for macOS bundle where the creation of the file in app is impossible. If project.wrile_log checkbox is ON in game.project, engine writes logs in log.txt file. The path to the file depends on the platform (see manual). From now on macOS the file path will be /Users/user_name/Library/Application Support/projectname/log.txt

  • FIX: Files from .defignore are compiled (#6345).

Editor

  • NEW: Add custom project templates (#6316). This pull request adds support for user defined templates in the welcome screen:

    • Create a .defold folder in your user home folder. This is the same location as any custom editor css files should be located.
    • Create a welcome.edn file with the following content:
{:new-project
	{:categories [
		{:label "From Custom Template" :templates [
			{
				:name "LowRez"
				:description "Defold template project for creation of low-res pixel art games."
				:image "empty.svg"
				:zip-url "https://github.com/britzl/lowrezjam-template/archive/refs/heads/master.zip"
				:skip-root? true
			},
			{
				:name "MyProject"
				:description "Template with everything set up my way!."
				:image "empty.svg"
				:zip-url "https://github.com/britzl/lowrezjam-template/archive/refs/heads/master.zip"
				:skip-root? true
			},
		]}
	]}
}

Notes:

  • You can create as many categories as you want.
  • For now the :image has to be one of the images in editor/resources/welcome/images.
  • The :zip-url has to be hosted on a server and downloaded using HTTP GET.

  • FIX: Include debugger scripts in builtins and include the files in bundled debug builds (#6297). This change adds the Lua files required by the debugger to builtins. The files are always included in debug builds (ie variant set to debug). This makes it possible to attach the debugger to a previously bundled and already running build.