Defold 1.4.6 BETA

Defold 1.4.6

The latest beta is now released, and we invite those interested in beta testing the new features in the editor and engine to join now.

The beta period will be 2 weeks and the next planned stable release is two weeks from now.

Please report any engine issues in this thread or in issues using Help → Report Issue

Disclaimer

This is a BETA release, and it might have issues that could potentially be disruptive for you and your teams workflow. Use with caution. Use of source control for your projects is strongly recommended.

Access to the beta

Download the editor or bob.jar from Releases · defold/defold · GitHub

Set your build server to https://build-stage.defold.com

Release notes

Summary

  • NEW: (#7521) Generate a build report for live update content
  • NEW: (#7238) Set texture float support
  • NEW: (#7559) Refactor textures as handles
  • NEW: (#7578) Resource get texture info
  • NEW: (#7585) New paramenter --max-cpu-threads for bob.jar
  • NEW: (#7583) Support texture handles in render.enable_texture
  • NEW: (#7591) Added back gesture support for Android 13
  • NEW: (#7566) Show project template URLs on editor Welcome screen
  • NEW: (#7614) Fix focus on committing values in the form view
  • FIX: (#7477) Added option to make DefoldActivity transparent on Android
  • FIX: (#7510) Crash when using a tilesource with 50 tiles
  • FIX: (#7603) Fix issue when setting up persistent file storage on HTML5 from a sandboxed iframe
  • FIX: (#7607) Cubemap faces are flipped when bundling
  • FIX: (#7373) Updated MoltenVK to v1.2.3 db8512a6
  • FIX: (#7635) Fixed issue with finding the skin in an animated model
  • FIX: (#7594) Added support for throwing a Java exception from the model compiler
  • FIX: (#7612) Fixed struct size calculation for buffer formats
  • FIX: (#7562) Clickable Lua preprocessor build errors
  • FIX: (#7570) Correct animation preview speed on high refresh rate screens
  • FIX: (#7551) Show output from the bundle process while bundling from the editor
  • FIX: (#7633) Fixed modelc exception handling for Win32
  • FIX: (#7635) Fixed issue with finding the skin in an animated model
  • FIX: (#7576) Camera frustum preview

Engine

NEW: (#7521) Generate a build report for live update content
The generated build reports will now also list excluded live update content in a separate report file.

java -jar bob.jar --verbose --platform=x86_64-macos --archive --liveupdate=yes --build-report=report.json --build-report-html=report.html clean build bundle

Will generate:

excluded_report.html
excluded_report.json
report.html
report.json
report_time.json

NEW: (#7238) Set texture float support
Exposed floating point texture formats to the resource script API:

resource.TEXTURE_FORMAT_RGB16F
resource.TEXTURE_FORMAT_RGB32F
resource.TEXTURE_FORMAT_RGBA16F
resource.TEXTURE_FORMAT_RGBA32F
resource.TEXTURE_FORMAT_R16F
resource.TEXTURE_FORMAT_RG16F
resource.TEXTURE_FORMAT_R32F
resource.TEXTURE_FORMAT_RG32F

Note that the device running your game might not support all of these features, and the constants will only be exposed if it does. To check if the device can support a certain format, you can check if it is nil:

if resource.TEXTURE_FORMAT_RGBA16F ~= nil then
    -- it is safe to use this format
end

NEW: (#7559) Refactor textures as handles
Refactored how textures and rendertargets are exposed and used in the engine, instead of passing around raw pointers, we now represent them as generic asset handles. This is the first step to bring the render and gameobject world closer together, where graphical assets can be transparently shared between them. Meaning, a texture that has been created by a script (or any texture, e.g an atlas texture) can be passed to the render scripts where it could be bound to the render state for drawing. Similarly, a render target could be created in a render script, passed to a game object and used as a texture on a model or an atlas.

NEW: (#7578) Resource get texture info
Added the new function resource.get_texture_info to get metadata from a texture resource or handle:

local my_texture_info = resource.get_texture_info(my_texture_path)

-- my_texture_info is a table that contains
{
     handle, -- the numeric handle of the texture
     width, -- width of the texture
     height, -- height of the texture
     depth, -- depth of the texture (1 for a 2D texture, 6 for a cube map and [1...slice-count] for an array texture)
     mipmaps, -- number of mipmaps the texture has
     type -- texture type
}

NEW: (#7585) New paramenter --max-cpu-threads for bob.jar
Added new parameter --max-cpu-threads for bob.jar which controls the maximum number of threads bob.jar can use. At the moment this value used only by the texture encoder.
Also, if texture compression is ON in the editor, the editor uses at least detected_max_threads - 1 in case when 2–4 threads are available and detected_max_threads - 2 if more than 4 cores are available.

NEW: (#7583) Support texture handles in render.enable_texture
Render scripts now support enabling texture handles via the render.enable_texture function. This means that you can pass a texture handle from scripts to the renderer and use them as global textures when rendering:

-- 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

NEW: (#7591) Added back gesture support for Android 13
Android 13 doesn’t support Back button anymore. Instead, it uses back gesture. This

:warning: AndroidManifes.xml updated with new flag android:enableOnBackInvokedCallback="true" for the <application> tag. If you use your own manifest, make sure you apply the same changes.

FIX: (#7477) Added option to make DefoldActivity transparent on Android
It is now possible to make the main Activity transparency by adding a meta-data option in AndroidManifest.xml:

    <meta-data android:name="alpha.transparency" android:value="true" />

Note: By default the feature is disabled and does not negatively impact performance.

FIX: (#7510) Crash when using a tilesource with 50 tiles
The “max mipmaps” value was not correctly set in res_texture, so the assert was triggered even though it should have been supported.

FIX: (#7603) Fix issue when setting up persistent file storage on HTML5 from a sandboxed iframe
Setting up persistent file storage while running an HTML5 build from a sandboxed iframe on Firefox would throw an exception and stop the game from loading. This change will catch any exceptions thrown while setting up persistent file storage and continue to load the game.

FIX: (#7607) Cubemap faces are flipped when bundling
Fixed a bug where the cubemap +z and -z sides are uploaded incorrectly on OpenGL based graphics adapters.

FIX: (#7373) Updated MoltenVK to v1.2.3 db8512a6
We’ve updated the MoltenVK library to version 1.2.3

FIX: (#7635) Fixed issue with finding the skin in an animated model
This fixes a crash when the skin didn’t have a name.

FIX: (#7594) Added support for throwing a Java exception from the model compiler
We’ve made the model compiler more robust and it will now catch any C/C++ errors, and then throw a Java error. This lets the editor handle such a case, and we minimise the risk of the user losing any edits in the project.

FIX: (#7612) Fixed struct size calculation for buffer formats
The allocated buffers used too much memory due to a miscalculation in the struct size.

Editor

NEW: (#7566) Show project template URLs on editor Welcome screen
The project templates that are used on the editor Welcome screen are downloaded from GitHub when used. This change shows the URL of each template project in the list. The URL is clickable and will download the template project if selected. This will help users understand that the templates are not stored locally with the editor but downloaded from the internet, and thus require an internet connection to use.

NEW: (#7614) Fix focus on committing values in the form view

FIX: (#7562) Clickable Lua preprocessor build errors

  • Build errors from extension-lua-preprocessor now show more information and are clickable in the Build Errors view.

FIX: (#7570) Correct animation preview speed on high refresh rate screens
The update speed for flipbook animations and particle effects were locked to 60 updates per second even if previewing on a high refresh rate screen (eg 144Hz).

FIX: (#7551) Show output from the bundle process while bundling from the editor
This fixes an issue in Defold 1.4.4 where output from the command line tool was not shown in the editor while bundling.

FIX: (#7633) Fixed modelc exception handling for Win32
We fixed a use-after-free issue that was noticed on Windows platforms.

FIX: (#7635) Fixed issue with finding the skin in an animated model
This fixes a crash when the skin didn’t have a name.

FIX: (#7576) Camera frustum preview
Added a wireframe rendering of the camera frustum for the editor.

19 Likes

@jhonny.goransson where precisely the camera wireframe should be visible?

In the scene editor when you have a camera component.

1 Like

I moved the mesh representing the camera from Operator a little bit above, but no wireframe for camera is visible (when I click on camera in Outline it focuses on the (0,0,0)

Editor: 76a0802a20bc27fa10fbd6fe2954995855022d3e
Engine: 76a0802a20bc27fa10fbd6fe2954995855022d3e

What’s the full camera settings? Your fov is zero for example, so if it’s a perspective camera the frustum planes will be conformed to the same lines I guess

2 Likes

Aaa, Operator sets it in runtime, in its script. I have the project on github, but it’s WIP and unstable: https://github.com/paweljarosz/horror_3d_game_mwdj_2023

beta bob can’t build. Also bundle html not worked too.

C:\Users\user\defold\game-mine-universe>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 clean resolve build bundle
Download archive(s)Downloading 0 archive(s)
Working...Reading classes... 1% ...done!
Cleaning... ...done!
Build Remote Engine...
Building engine... ...done!
excluded_bob\releases\dev\web\report.html (Системе не удается найти указанный путь)
Cause: java.io.FileNotFoundException: excluded_bob\releases\dev\web\report.html (Системе не удается найти указанный путь)
2023-05-19 16:51:18 SEVERE  excluded_bob\releases\dev\web\report.html (Системе не удается найти указанный путь)
Warning: Failed to clean up temp directory 'C:\Users\user\AppData\Local\Temp\15576101549370575795'

Time profiler report creation took 0,06 seconds
C:\Users\user\defold\game-mine-universe>

added “excluded_” in file path?

1 Like

Thanks. I’m on it!

1 Like

Now this is embarrassing. This issue has already detected and we did prepare a PR but it was never merged: https://github.com/defold/defold/pull/7584

The PR has been merged and cherry-picked into the beta. There will be a new version with a fix available in 30-40 minutes.

4 Likes

To give an interesting and positive note (we all work in IT we all know we don’t hear good news as much as bad, so I like to brighten days.)

I use Druid for my UI interactions. I have a Google Pixel 6 and am enrolled in Android Beta, so I have 14, UpsideDownCake.

I found that 1.4.5 with Druid the scrolling would not work on my phone, could not, for the life of me, figure out why.

Found it works perfectly fine with 1.4.6, with no changes to Druid or weird workarounds, and no changes to my code.

I’m guessing somehow related to the Back Gesture implementation for 13, which makes little sense but I also haven’t delved into the code changes of this compared to 1.4.5.

So excellent work, and keep it up!

5 Likes

By the way, tried to turn it on, but I’m not sure it’s okay. The camera component looks big with the 1 point per meter level scale in a 3d game.

I don’t know if I’m right about using 1 point per meter, but I found it handy for 3D space. If I use 1 centimeter as a point, then on a large level I have to operate with coordinates in the form of tens or hundreds of thousands of points.

Perhaps the camera could be better made more independent of the scale in the game. For example, remove the camera model or replace it with a sprite that is always rendered at the same size? I don’t know exactly.


4 Likes