Defold 1.8.1 BETA

Defold 1.8.1 BETA

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.

We hope this new workflow will highlight any issues earlier, and also get valuable feedback from our users. And please comment if you come up with ideas on improving on this new workflow.

Please report any engine issues in this thread or in issues using Help ā†’ Report Issue

Thx for helping out!

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 http://d.defold.com/beta/

Overview

Defold 1.8.1 Beta includes new engine features like error handling for file writes, options for disabling LiveUpdate auto-mounting, and support for Lua transpilers, new and improved camera component and API, as well as numerous bug fixes related to meshes, sprites, fonts, HTTP requests, and editor UI issues.

Weā€™d like to highlight the initial support for Lua transpilers in the build pipeline (both editor and bob). The first language that can be used to try the transpiler feature is Teal ā€” a typed dialect of Lua. You will need to add teal extension to the dependencies to try it out. The support is currently limited to transpilation only and excludes automatic extern generation for Defoldā€™s Lua APIs. This means it is more useful for writing type-safe standalone logic than interacting with Defold runtime, though teal allows writing necessary externs yourself.

The first iteration of an improved camera component has been added in this version of Defold. The camera API is now available in all scripts (including render scripts and gui scripts) via the camera namespace, and contain new functionality to bind a camera to the renderer instead of passing explicit view and projection matrices to it.

Summary

  • NEW: (#8870) Add error reason for fwrite in sys.save
  • NEW: (#8857) Add a new option in game.project: liveupdate.mount_on_start, which disables auto-mounts at the start of the game.
  • NEW: (#8868) Camera component refactor + improved camera module
  • NEW: (#8284) Use Teal as a typed Lua alternative
  • NEW: (#8843) Add ogg validation in the editor
  • FIX: (#8882) Support building a mesh without any samplers assigned
  • FIX: (#8845) Reset buttons state when focus lost.
  • FIX: (#8819) Make sure go.get_world_position() returns the correct value when called from the init() function.
  • FIX: (#8844) Fixed canvas flickering in the HTML5 bundle when the window is being resized.
  • FIX: (#8853) Support using no color when writing custom vertex attribute for sprites
  • FIX: (#8864) Added missing lua_source_ddf.proto to dmSDK
  • FIX: (#8880) Fixed crash when sprite material uses N samplers but shaders uses less than N samplers.
  • FIX: (#8886) Fixed an issue where font metrics were incorrect for monospaced fonts.
  • FIX: (#8893) Engine crashes when producing secondary uv sets
  • FIX: (#8906) Handle ā€˜pathā€™ option in http.request for html5 implementation.
  • FIX: (#8879) [Web] Fix sound play while AudioContext is suspended
  • FIX: (#8837) Allow setting Image property when multi-selecting
  • FIX: (#8839) Limit the number of rendered errors
  • FIX: (#8883) Changing from a material with an overridden vertex attribute causes an assert

Engine

NEW: (#8870) Add error reason for fwrite in sys.save
Fixed an issue where sys.save doesnā€™t output the reason why it couldnā€™t write to a file.

NEW: (#8857) Add a new option in game.project: liveupdate.mount_on_start, which disables auto-mounts at the start of the game.
In some cases, it might be useful to fully control from the code what exactly needs to be mounted instead of using auto-mount at the start of the application. Now, this is possible to do using the liveupdate.mount_on_start checkbox in game.project.

NEW: (#8868) Camera component refactor + improved camera module
The camera script module and the camera component has been updated:

  • The camera component will automatically acquire focus when it is created. There is no more need to send the ā€œacquire_camera_focusā€ message to the component. To disable the camera, use go.set("#camera", ā€œdisableā€) instead.

NOTE: This is a subtle change in behaviour. Previously you had to send a "acquire_camera_focus" message to the component for a camera to be updated. With the new code path, all cameras will be enabled and updated automatically until you actively send an "unacquire_camera_focus" message. Since the old behaviour was so cumbersome to work with, we **do not consider this as a breaking change** - instead we consider it to be a bugfix or simply as a workflow improvement.

  • All scripts can now access the camera namespace. There are new functions in the module that can now be used:
-- returns a list of all currently available cameras. each entry in the table is a camera URL (see msg.url)
local all_cameras = camera.get_cameras()
-- get/set properties. note that not all properties can be set
camera.get_projection(camera_url) -- read-only
camera.get_view(camera_url)-- read-only
camera.get_aspect_ratio(camera_url)
camera.set_aspect_ratio(camera_url)
camera.get_fov(camera_url)
camera.set_fov(camera_url)
camera.get_near_z(camera_url)
camera.set_near_z(camera_url)
camera.get_far_z(camera_url)
camera.set_far_z(camera_url)
camera.get_orthographic_zoom(camera_url)
camera.set_orthographic_zoom(camera_url)
  • The render API has a new function render.set_camera(camera_url, [options]) - this can be used in a render script to automatically use the view and projection matrices from the camera in the next draw call:
-- a typical camera based render loop can now look like this
for k,v in pairs(camera.get_cameras()) do
    -- note that the view and projection matrices previously set up
    -- using render.set_view and render.set_projection will be wiped by this call
    -- the 'use_frustum' option will use the cameras view projection matrix for frustum culling
    -- this will take precedence over any frustum passed in to the render.draw function
    render.set_camera(v, { use_frustum = true })
    -- set other drawing states
    render.draw(pred_scene)
end
-- unbind the camera for custom rendering
render.set_camera()
render.set_view(...)
render.set_projection(...)
render.draw(pred_gui)

The next iteration of improving the camera component involves:

  • adding a viewport property to the camera that will automatically be set when calling render.set_camera
  • adding coordinate system conversion functions (screen->world, world->screen, project/unproject and so on)

FIX: (#8882) Support building a mesh without any samplers assigned
Bob can now bundle projects with meshes that have no textures specified.

FIX: (#8845) Reset buttons state when focus lost.

FIX: (#8819) Make sure go.get_world_position() returns the correct value when called from the init() function.
Fixed an issue where objects in deep hierarchies returned the wrong value for go.get_world_position() when called from init().

FIX: (#8844) Fixed canvas flickering in the HTML5 bundle when the window is being resized.
Fixed an issue where the gameā€™s canvas flickers black (a background color) when resizing the browser window.

FIX: (#8853) Support using no color when writing custom vertex attribute for sprites
Fixed an issue where a sprite was using a material with a ā€œcolorā€ semantic type that didnā€™t get written to the vertex buffer.

FIX: (#8864) Added missing lua_source_ddf.proto to dmSDK

FIX: (#8880) Fixed crash when sprite material uses N samplers but shaders uses less than N samplers.

FIX: (#8886) Fixed an issue where font metrics were incorrect for monospaced fonts.
Monospaced fonts should always use the fixed Advance Width for each symbol as its width, instead of the glyphā€™s real width.

FIX: (#8893) Engine crashes when producing secondary uv sets

FIX: (#8906) Handle ā€˜pathā€™ option in http.request for html5 implementation.
Add ā€˜pathā€™ parameter handling for html5 implementation in http.request function.

FIX: (#8879) [Web] Fix sound play while AudioContext is suspended

Editor

NEW: (#8284) Use Teal as a typed Lua alternative
Follow-up prototyping task to Investigation: any options of using type system with Lua (strictly typed or gradually typed Lua) Ā· Issue #6398 Ā· defold/defold Ā· GitHub

NEW: (#8843) Add ogg validation in the editor

FIX: (#8837) Allow setting Image property when multi-selecting

FIX: (#8839) Limit the number of rendered errors

FIX: (#8883) Changing from a material with an overridden vertex attribute causes an assert
Fixed an issue where a component has an overridden vertex attribute and the user changes the material where the attribute doesnā€™t exist. In this case the editor triggers an assert which leaves the editor in a bad state.

26 Likes

Updated with information about the changes in the camera component (that somehow got missed in the release notes).

3 Likes

Lovely!

Looking forward to the next iteration. It took me a while to get familiar with the render script and the coordinate system so I know how other users might feel in that area.

1 Like

Hi!
try to migrate from 1.6.4, and got this Editor crashes on startup with particular spine file Ā· Issue #165 Ā· defold/extension-spine Ā· GitHub , same problem on 1.8.0

This has been fixed (in the Spine repository).

2 Likes

A fantastic addition! Btw I donā€™t see any syntax highlighting for .tl files. Is it not implemented yet?

1 Like

Yes, not implemented.

I canā€™t wait to check out the new camera improvements. Not making us acquire camera is a great moveā€¦ Especially for beginners.

3 Likes

Itā€™s necessary to manually select the staging build server in this beta as reported here and confirmed by me (if I donā€™t enter the URL, I donā€™t get a build)
I thought I didnā€™t have to do that now because of Select the default build server based on channel by vlaaad Ā· Pull Request #8318 Ā· defold/defold Ā· GitHub ?

1 Like

Hmm. So, was your build server url set to empty string?

Yes

Have not tested yet but:

Typed Lua is the most wholesome best addition you probably could make for human error reduction. Very interested.

Iā€™m not sure about your plans for it. Does it mean we can write code inside defold editor but have proper checks if a variable is mispelled, or a typo is made?

I am currentl also using Rendy. The only actual reason I use rendy is because I am using a perspective camera and need reliable world to screen and screen to world. The existing surces from defold or other places really didnā€™t work well with perspective transforms, distorting the coordinates at the edges. Something that rendy for some reason avoids.

Just contextual feedback. Great work.

3 Likes

Yes, we plan to add coordinate conversion into the camera API as first-class functions, so you should be able to use them without installing additional extensions.

4 Likes

Yes, you will get build errors if you write Teal code which uses the wrong type. Also, with the integration of a Lua Language Server in the next Defold release youā€™ll also get a lot of checking while typing code even if you donā€™t use Teal.

5 Likes

Very impressed!

If you use custom resize logic, do not forget to fix it. Or you will get low fps
CUSTOM_PARAMETERS[ā€˜resize_window_callbackā€™] = resize_game_canvas;

2 Likes