Defold 1.4.3 has been released

Release notes

Summary

  • CHANGE: (#7240) Update NDK 25 LTS (r25b)
  • NEW: (#7264) Factory dynamic prototype
  • NEW: (#7029) Add timer.get_info() function
  • NEW: (#7266) Update Android SDK (33.0.1 - Android 13 - API 33)
  • NEW: (#7296) Document ports and services
  • NEW: (#6902) Shader include support
  • NEW: (#7329) Update Screen Orientation options by Default on iOS and Android
  • NEW: (#7214) Create buffer in runtime
  • FIX: (#7312) Improve GUI modification performance
  • FIX: (#7315) Fix issue with components counter for cached resources
  • FIX: (#7337) Uploading empty index buffer on WebGL is very slow
  • FIX: (#7320) Fix issue when OGG file added to GO without component doesn’t work in bundle
  • FIX: (#7343) Show error in bob when referencing missing script resource properties
  • FIX: (#7355) Fix missing emitter fields of Initial Stretch X and Initial Stretch Y and Initial Angular Velocity for multiple emitters
  • FIX: (#7359) Moved dmProfile::HProfile/BeginFrame/EndFrame to the dmsdk for easier substitution
  • FIX: (#7370) Fixed issue with model vertex color in rgb format
  • FIX: (#7325) Fix Dependencies and Referencing Files popup showing blank entries for some resource types
  • FIX: (#7350) Fail the build on invalid requires
  • FIX: (#7363) Removed license header from debugger bootstrap script
  • FIX: (#7389) Fixed issue when calculating convex hull for atlas images

Engine

CHANGE: (#7240) Update NDK 25 LTS (r25b)
Defold updated from NDK r20 to NDK r25b - the latesNDK version at the moment.
Now minimum Android version API is 19 (Android 4.4)

NEW: (#7264) Factory dynamic prototype
We’ve added the possibility to change the prototype of a collectionfactory / factory component at runtime.
This allows the developer to load and spawn an arbitrary .collectionc/.goc file, further simplifying using dynamic content. The .collectionc/.goc` files still need to be part of the resource archive.
Doc: collectionfactory.set_prototype() / factory.set_prototype()

We’ve added a “Dynamic Prototype” checkbox to the factories. The prototype can only be overridden when this is checked. If set, then the collection component count cannot be optimized, and the owning collection will use the default component counts from game.project.

NEW: (#7029) Add timer.get_info() function
Sometimes it is needed to get additional information about a running timer, for instance the remaining time before it fires. This change adds a timer.get_info(handle) method which returns a table with information about a timer. Example:

local handle = timer.delay(2, true, function() end)

--after 0.5 seconds we call:

local info = timer.get_info(handle)
print(info.time_remaining) -- 1.5
print(info.delay)     -- 2
print(info.repeating) -- true

If timer cancelled or completed the function will return nil.

NEW: (#7266) Update Android SDK (33.0.1 - Android 13 - API 33)
Android SDK updated to version 33.0.1
Android target API updated to API level 33 (Android 13).

NEW: (#7296) Document ports and services
The engine ports and services are now documented in engine/docs/DEBUG_PORTS_AND_SERVICES.md.

NEW: (#6902) Shader include support
Added support for #include pragmas in shader files. This feature can be used to separate shader functions into modules that can be used across several shader files, which should help out with reusing code from your own project, or from asset extensions.

Read more in the manual: Shader programs in Defold

NEW: (#7329) Update Screen Orientation options by Default on iOS and Android
Use userLandscape, userPortrait and fullUser for android:screenOrientation on Android (read more). Use both UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown for portrait on iOS and UIInterfaceOrientationLandscapeLeft +UIInterfaceOrientationLandscapeRight for Landscape (read more).

NEW: (#7214) Create buffer in runtime
Added new function resource.create_buffer to create buffer resources dynamically in runtime. The function takes a buffer object created by other buffer resources, from the C api or via the lua buffer.create function.

API reference: API reference (resource)

FIX: (#7315) Fix issue with components counter for cached resources
Now Bob considers changes in a linked GameObject when deciding to take a collection from the cache or rebuild it.

FIX: (#7337) Uploading empty index buffer on WebGL is very slow
When updating an empty index buffer, it took 90ms in my case.

FIX: (#7320) Fix issue when OGG file added to GO without component doesn’t work in bundle
Now bob converts ogg component (resource based component) into sound component when building.

FIX: (#7343) Show error in bob when referencing missing script resource properties
Bob now reports an error for missing script resource properties.

FIX: (#7355) Fix missing emitter fields of Initial Stretch X and Initial Stretch Y and Initial Angular Velocity for multiple emitters
Adds emitter fields of Initial Stretch X and Initial Stretch Y and Initial Angular Velocity to emitters that added after a particle effects that use more then one emitter. Previously these fields were missing from template.emitter which caused these fields to be greyed out for particle effects that used more than one emitter. Also clicking on those fields and adding a value causes an error java.lang.NullPointerException: Unknown.

FIX: (#7359) Moved dmProfile::HProfile/BeginFrame/EndFrame to the dmsdk for easier substitution
This change allows for easier custom implementation of the profiling data in an extension.

FIX: (#7370) Fixed issue with model vertex color in rgb format
This fixes an issue when importing vertex colors in 3-tuples. We convert it into 4-tuples, with alpha=1.0f.
It is now also possible to avoid setting any textures at all in case your model doesn’t need them.

FIX: (#7336) Use min x and y scale for particle effect scale in gui
The previous fix for particle effect scale only partially solved the problem of inconsistent particle effects scaling between gui and game objects. The original issue was that the x component of the scale was always used when scaling in the gui. The partial fix applied in #7163 used the smallest scale component of x, y and z, which made particle effect scaling in gui more consistent. The problem is that on window resize only the x and y component of the scale of a gui node is affected while the z component remains at its original value, which would produce an incorrect result for particle effects.

The correct solution, which is applied in this fix is to use the smallest of the x and y component when applying a scale to particle effects in gui. This is consistent with how other nodes are scaled and it is also consistent with how particle effects on game objects are scaled using smallest uniform scale value (using x, y, z in 3d/go and only x and y in 2d/gui).

Editor

FIX: (#7312) Improve GUI modification performance
This improves the editing performance of highly-referenced GUI files by around 25% (reduces the number of successors in a real-world project from 200k to 150k).

FIX: (#7325) Fix Dependencies and Referencing Files popup showing blank entries for some resource types
Fix Dependencies and Referencing Files popup showing blank entries for some resource types

FIX: (#7350) Fail the build on invalid requires
The editor will now fail the build if a script file requires an existing lua module, but starts the require argument string with a slash.

FIX: (#7363) Removed license header from debugger bootstrap script
The Defold license was accidentally applied to the debugger bootstrap script which made the script too large to send as a message when attaching the debugger.

FIX: (#7389) Fixed issue when calculating convex hull for atlas images
The hull calculation was incorrect and produced overlapping triangles.

15 Likes

I am struggling to understand how Factory dynamic prototype feature works exactly. Can’t even seem to find documentation. Any references?

The documentation is factory.set_prototype() and collectionfactory.set_prototype(), although I missed adding the prototype property.
I also noticed that part of the documentation has fallen away in the generation step:

factory.set_prototype():

  • Requires the factory to have the “Dynamic Prototype” set
  • Cannot be set when the state is COMP_FACTORY_STATUS_LOADING
  • Setting the prototype to “nil” will revert back to the original prototype.

The dynamic property setting allows you to set it dynamically at runtime.
It has the draw back that it cannot optimize the memory usage for each component world at creation time. I.e. the collection that holds the factory will use more memory.

@agulev explains it in a bit more detail here:

2 Likes

I see you need to reference a .goc or .collectionc . Considering we may not have seen these extensions, how do you get hold of files like that?

They are the output from compiling a .go (GameObject) and .collection (Collection) files.

Here is a small example of the feature in action.
DynamicPrototype.zip (7.5 KB)

Note this is an advanced way of manipulating which resources gets loaded and when.
We do not recommend it for regular users. It is intended for live update users.

5 Likes


Splash screen says version 1.4.2

Screenshot 2023-03-02 011500
The same in About

Hi!
Are you not seeing an update link in either the project selection window, or in the bottom right corner of the editor?

Since you mention it, yes I did find there’s an update link. Thank you.
Yet, the pictures of defold I posted before was downloaded and installed from the main defold download page at Download Defold. Hence that page possibly still points to 1.4.2 version of defold

Hi! 1.4.3 broke collection factories for us. In bundled builds collectionfactory.create() returns an empty table and nothing gets spawned. When running from the editor this doesn’t happen.

1 Like

Oh no. I’m sorry to hear this. Can you please create a ticket on GitHub and we’ll start an investigation immediately.

2 Likes

Thanks a lot! Here’s the issue: https://github.com/defold/defold/issues/7434

3 Likes
3 Likes