Defold 1.3.5 has been released

Release notes


NEW: (#5265) Added option to instantly clear spawned particles when stopping particlefx


When particlefx.stop() is called all emitters immediately stop spawning new particles but already spawned particles will continue to live until they reach their end of life. Clearing/removing already spawned particles is only possible by either unloading the collection the particles belong to or by setting the tint alpha in the particlefx material to 0.0.

To give developers a better alternative to clearing spawned particles It is now possible to specify this when the particle effect is stopped:

particlefx.stop(url, { clear = true })
gui.stop_particlefx(node, { clear = true })

NEW: (#3232) New properties for nodes : enabled and visible


New properties for GUI nodes: enabled and visible.

enabled is a property that toggles a node tree. This value was available in the runtime using gui.is_enabled() and gui.set_enabled() and now it’s avaliable from the editor as well.

visible is a property that toggles rendering for a node. This option may be useful when a node should be used for anchoring or as a click zone, but shouldn’t affect rendering at all. New methods added for work with the property: gui.get_visible() and gui.set_visible().

NEW: (#6628) Add support for drawing to multiple render targets


Many graphical effects (e.g Many-light pipelines / deferred rendering, ssao, temporal antialiasing) operate on several components of a frame such as position, normals and albedo color. These are usually generated by drawing the scene once into several render targets that can be used in other parts of the rendering pipeline.

MRT is available from OpenGL 3 / ES3 / WebGL2 (and baseline vulkan) and support is now available in the Defold render.* API when creating a new render target:

function init(self)
    -- render target buffer parameters
    local color_params_rgba = { format = render.FORMAT_RGBA,
                                width = render.get_window_width(),
                                height = render.get_window_height(),
                                min_filter = render.FILTER_LINEAR,
                                mag_filter = render.FILTER_LINEAR,
                                u_wrap = render.WRAP_CLAMP_TO_EDGE,
                                v_wrap = render.WRAP_CLAMP_TO_EDGE }
    local color_params_float = { format = render.FORMAT_RG32F,
                           width = render.get_window_width(),
                           height = render.get_window_height(),
                           min_filter = render.FILTER_LINEAR,
                           mag_filter = render.FILTER_LINEAR,
                           u_wrap = render.WRAP_CLAMP_TO_EDGE,
                           v_wrap = render.WRAP_CLAMP_TO_EDGE }

    -- Create a render target with three color attachments
    -- Note: No depth buffer is attached here
    self.my_render_target = render.render_target({
           [render.BUFFER_COLOR0_BIT] = color_params_rgba,
           [render.BUFFER_COLOR1_BIT] = color_params_rgba,
           [render.BUFFER_COLOR2_BIT] = color_params_float, })

function update(self, dt)
    -- enable target so all drawing is done to it
    -- draw a predicate to the render target

NEW: (#6488) Sign iOS app extensions while preserving entitlements


An App Extension lets you extend custom functionality and content beyond your app and make it available to users while they’re interacting with other apps or the system. Examples are app specific stickers in iMessage or extensions to the sharing dialog.

App Extensions must be included in the PlugIns folder and they must be signed. It is easy to include extensions in a PlugIns folder by adding the PlugIns folder as a bundle resource to be included in the application bundle.

This change automatically signs any files in PlugIns with the .appex file extension when the application is bundled while at the same time preserving the app extension entitlements.

FIX: (#6767) Updated to LZ4 1.9.4 (63df16d)


Updated internal LZ4 compression to 1.9.4. The update LZ4 implementation results in faster decompression compare to old versions.

FIX: (#5454) Migrate build system to python3


The Defold build system has been migrated from Python 2 to Python 3.

FIX: (#6757) Added collectionproxy.get_resources()


Returns a list of all the resources that the collection proxy is dependent on:

   local resources = collectionproxy.get_resources(proxy_url)
   for _, v in ipairs(resources) do
       print("Resource: " .. v)

This functionality will later be used for removing old live update content from disk.

FIX: (#6766) Make sure game.arcd isn’t compressed in apk/aab


Keep the main resource archive game.arcd in the Android bundle uncompressed to prevent unnecessary memory allocations in runtime.

FIX: (#6742) Exclude unnecessary information from html build report.


Exclude game.project information and build options related to authorisation from the generated build report.

FIX: #6788 GUI text doesn’t render if render script has previously early-outed


This fixes an issue with text not always rendering when skipping a frame, for instance during an early out in the render script.

FIX: #6816 Fix issue when engine can’t play more than 32 sounds simultaneously


Use sound.max_sound_instances as maximum count of simultaneously played sounds.


NEW: (#6269) Read authentication token for dependencies from system environment


When using project dependencies hosted in private repositories on GitHub or behind basic authentication on a private server the authentication token has to be part of the userinfo portion of the URL:

This is not recommended as it may result in developers accidentally leaking their access token when sharing a list of their dependencies in a support ticket or in the Defold forum.

To avoid this it is now also possible to store the authentication token in a system environment variable and let Defold read this when resolving dependencies. Defold will inspect the dependency URLs and replace any userinfo password field starting and ending with __ (two underscore characters) with the value from the system variable specified by the string enclosed within the __ prefix and suffix:

In the above URL the __MY_GITHUB_TOKEN__ will be replaced by the value of the system variable MY_GITHUB_TOKEN.

FIX: (#6666) Ignore empty lines in .defignore


FIX: (#6400) Report defignored files as non-existent


Additionally, this changeset makes the editor sync resources after save if .defignore file was modified.

FIX: (#6753) Improve editor behavior with legacy Spine projects


User-facing changes

  • Prevent legacy Spine projects from corrupting Gui scenes with Spine data unless extension-spine has been added as a dependency.
  • Improve error message if a Collection, Game Object, or Gui contains embedded data that is not understood by the editor. The message now includes a common-cause solution (e.g. “Could the project be missing a required extension?”).

FIX: (#6732) [DEFEDIT] Safeguard against IOExceptions when generating convex hulls


User-facing changes

  • IOExceptions were not being caught correctly for image reads associated with .atlas and .tilesource files.
  • Removed unnecessary image reads when Sprite Trimming is disabled.

CHANGE: (#6760) Redesign game.project form #6760


This changeset alters the UI of forms that requested navigation (currently only game.project form) in a following way:

  • the form shows sections UI organized in groups;
  • the form shows at most one section at a time.


This is sorely needed for Void Scrappers :pray:



And what I’ve been waiting for a while… :partying_face:


Hmm. Size of lua is x2 now :frowning: :scream:


1 Like

1.3.5 --use-lua-source

1 Like

This is a pretty huge release! Congratulations! :partying_face:


Link in release notes :

CHANGE : (#6760) Redesign game.project form #6760

Links to (#6732) , should be -

[ ]

Hmm, perhaps @britzl knows more :thinking:

What was the problem and how does it work now with the fix?

I remember in UE4 I had to change some settings or the FULL audio system would collapse and restart with too many sounds at once.

The problem was if more than 32 sounds were playing at the same time, new ones could not start. This was generally fine most of the time - if there are 32 sounds you can’t really tell that one is missing. The problem is that it sometimes happened when a new music track was supposed to play.

As far as I can tell, it does work now with the fix.

1 Like

Hmm, we generate bytecode for HTML5 build now. The size should be roughly the same as source but load faster. I need to do some tests myself to check.

I’m also confused by the result of --use-lua-source. It seems like there might be both source and bytecode in the bundle…


Hey guys
@britzl @Mathias_Westerdahl @AGulev

Since Defold 1.3.5, the HTML5 export doesn’t work anymore (at least for me).


1: the HTML5 export worked fine with Defold 1.3.4.

2: I never touched this .lua file.
The main thing I did (except working on my project, but on existing files only) is to update the Spine dependency (to make it work with Defold 1.3.5).

3: at first, this error message was mentioning another unused .lua file, but I remove it and now the message is still displayed (mentioning the .lua file you can see above). I assume that it has nothing to do with a .lua file in particular.

1 Like

We now run the luac tool to convert also Lua 5.1.5 Lua source code into bytecode (we previously only did it for LuaJIT enabled platforms). Could you please try and bundle with bob.jar and share the output?

java -jar bob.jar --platform=js-web --verbose --archive clean build bundle

Could you please also share either the entire project or only the file itself with me (

1 Like

Hi, just sent you an email with the project (shared repo).

1 Like

You’re right. There’s something a bit strange here. Here’s an example of converting monarch.lua to bytecode using both LuaJIT and Lua 5.1.5:

Original Lua file
39398 monarch.lua

Using Lua 5.1.5 to generate 32 and 64 bit bytecode
52126 monarch.lua.luac32.unstripped
57646 monarch.lua.luac64.unstripped

Using Lua 5.1.5 to generate 32 and 64 bit bytecode stripped from debug info (line numbers)
27050 monarch.lua.luac32.stripped
29678 monarch.lua.luac64.stripped

Using LuaJIT to generate 32 and 64 bit bytecode
31211 monarch.lua.luajit32.unstripped
31211 monarch.lua.luajit64.unstripped

Using LuaJIT to generate 32 and 64 bit bytecode stripped from debug info (line numbers)
20640 monarch.lua.luajit32.stripped
20640 monarch.lua.luajit64.stripped

So as you can see the generated Lua bytecode using Lua 5.1.5 becomes larger than the source file. I need to debug and understand why. The same is not true when using LuaJIT bytecode which always becomes smaller.

Another interesting thing which we are not supporting is stripping of debug information from the bytecode. This makes the bytecode significantly smaller, but stacktraces becomes useless. It could perhaps be an option we could add to bob.jar to allow developers to really shrink their Lua size.

1 Like

And what about compression (we compress all files in the game archive)?

Original Lua file and compressed size
39398 monarch.lua
13902 monarch.lua.lz4
11642 monarch.lua.lz4.gz

Lua 5.15 bytecode and compressed size
52126 monarch.lua.luac32.unstripped
23098 monarch.lua.luac32.unstripped.lz4
18472 monarch.lua.luac32.unstripped.lz4.gz
27050 monarch.lua.luac32.stripped
13332 monarch.lua.luac32.stripped.lz4
10924 monarch.lua.luac32.stripped.lz4.gz

LuaJIT bytecode and compressed size
31211 monarch.lua.luajit32.unstripped
16278 monarch.lua.luajit32.unstripped.lz4
13426 monarch.lua.luajit32.unstripped.lz4.gz
20640 monarch.lua.luajit32.stripped
11319 monarch.lua.luajit32.stripped.lz4
9254 monarch.lua.luajit32.stripped.lz4.gz

.lz4 = size of file as when compressed in the game.archive
.gz = size of file when sent “over the wire” for HTML5

This shows some interesting results:

  1. Compressed source gives you the smallest final bundle! If you are chasing bytes and a bundle that is as small as possible then you should always bundle with the --use-lua-source option with bob.jar.
  2. The difference between Lua 5.1.5 bytecode and LuaJIT bytecode is still there. Annoying.
  3. Stripped and compressed bytecode is a lot more similar in size between Lua 5.1.5 and LuaJIT. And also smaller than Lua source code.
1 Like

I am not able to reproduce this result. Did you do this from a completely clean project?

delete build and .internal folder.

Full cmd line.

java -jar bob/bob.jar --settings bob/settings/dev_game.project_settings --archive  --texture-compression true --with-symbols --variant debug --platform=js-web --bo bob/releases/dev/web -brhtml bob/releases/dev/web/report.html --use-lua-source clean resolve build bundle

Ah, hold on. I was testing the wrong thing. The --use-lua-source option will set the resource as uncompressed and unencrypted:

This was added as an option to appease Apple that were concerned by the fact that Lua was “obfuscated and encrypted”.

We need a new flag to toggle this behavior, something like --use-uncompressed-lua-source.

1 Like
--variant release

Also 0.9MB