Defold 1.4.0 BETA

Defold 1.4.0 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.

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

ATTENTION: This release contains breaking changes!

Please pay extra attention to the release notes and the three breaking changes, as one or more of them may affect your projects. The breaking changes (listed in more detail further down) are:

  • BREAKING CHANGE: (#7081) Added physics.max_collision_object_count field in game.project
  • BREAKING CHANGE: (#7095) Use lua-cjson for both json.encode/json.decode. We’ve also removed the C++ dmJson namespace and json.h.
  • BREAKING CHANGE: (#6963) Improved GUI clipping with layers
  • BREAKING CHANGE: (#7054) Made dmObjectPool into a class, with new access function GetRawObjects()

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

  • BREAKING CHANGE: (#7081) Added physics.max_collision_object_count field in game.project
  • BREAKING CHANGE: (#7095) Use lua-cjson for both json.encode/json.decode
  • BREAKING CHANGE: (#6963) Improved GUI clipping with layers
  • NEW: (#7002) Added option to pass additional headers to the build server
  • NEW: (#7036) Option for bundling without resources to use as a build target.
  • FIX: (#7091) Fix issue when bundling projects with models
  • FIX: (#7114) Fix bug on iOS when profiler doesn’t show CPU and Memory usage
  • FIX: (#7064) Remove partially cached HTTP response on timeout
  • FIX: (#7097) Crash when using sound resource properties
  • FIX: (#7105) Close application when stop debugging
  • FIX: (#7049) Fix editor exception during build if a referenced collection overrides a resource script property
  • FIX: (#7100) Fix atlas image deduplication
  • FIX: (#7027) Make editor more resilient when opening files
  • FIX: (#7062) Fix slow loading of sprite data in the editor
  • FIX: (#7074) Copied collision 3d box doesn’t show properly in the editor
  • FIX: (#7044) Updated to stb_vorbis.c 1.22

Engine

BREAKING CHANGE: (#7081) Added physics.max_collision_object_count field in game.project

Details

Added physics.max_collision_object_count field in game.project to set maximum count of collision objects per physics world. This prevents a crash which would happen in earlier versions when using more than 1024 collision objects in a physics world.

IMPORTANT: This is a breaking change. The default value for physics.max_collision_object_count is 128. Make sure you adjust the value to suit the needs of your project.


BREAKING CHANGE: (#7095) Use lua-cjson for both json.encode/json.decode

Details

The internal library used in Defold for json encoding and decoding is lua-cjson. The decoding performance improvement is about 10x faster than before (when using jsmn). With this change a number of changes have been introduced, one of which is considered a breaking change:

  • BREAKING: The dmJson namespace and functionality has been removed from our C++ dmSdk due to its poor performance and lack of features.
  • NEW: Added the keyword json.null in order to support null values in a Lua table.
  • NEW: Added dmScript::LuaToJson(lua_State* L, char** json, size_t* length) as a new function in the C++dmSdk.

BREAKING CHANGE: (#6963) Improved GUI clipping with layers

Details

The behaviour regarding how clipping interacts with layers in GUI scenes has been modified. Instead of treating each clipping node as its own isolated node tree, where the layers only affect the child nodes, using layers can now change the ordering of the nodes freely.


FIX: (#7091) Fix issue when bundling projects with models

Details

Fixes an issue when bundling projects with model components.


FIX: (#7114) Fix bug on iOS when profiler doesn’t show CPU and Memory usage

Details

Fix a regression bug introduced in 1.3.7 when profiler doesn’t show CPU and Memory usage on iOS.


FIX: (#7064) Remove partially cached HTTP response on timeout

Details

This fixes an issue where a network request is interrupted due to a network error or timeout still left a partial response stored in the HTTP cache. Subsequent requests for the same resource would in such a case return the partial and most likely corrupted response stored in the cache. The cache will now remove any partial response on error.


FIX: (#7097) Crash when using sound resource properties

Details

Fix crash that happening when set a sound resource for a sound component that has playing sounds.


FIX: (#7105) Close application when stop debugging

Details

Fix issue introduced in 1.3.7 (regression) when Debugger stop button doesn’t close the application.


Editor

NEW: (#7002) Added option to pass additional headers to the build server

Details

It is now possible to pass additional headers to the build server when building native extensions using command line tools and the editor. The editor has a new Build Server Headers field in the Extensions tab of the Preferences menu. The bob.jar command line tool has a new --build-server-header option.

In the editor headers are added line by line in a multi-line text text area. In bob.jar headers are added one by one using multiple --build-server-header options.

Example:

java -jar bob.jar `--build-server-header="x-my-header1: header1_value" --build-server-header="x-my-header2: My name is Bob"

Will set two headers:

x-my-header1: header1_value
x-my-header2: My name is Bob

NEW: (#7036) Option for bundling without resources to use as a build target.

Details

New option for Bob --exclude-archive and a checkbox in the Bundle popup for bundling without resources. This bundle may be used as a build target.


FIX: (#7049) Fix editor exception during build if a referenced collection overrides a resource script property

Details

Fixed an editor exception during build if a referenced collection overrides a resource script property.


FIX: (#7100) Fix atlas image deduplication

Details

Atlases with duplicate images in different animations will no longer have the images duplicated in the atlas image.


FIX: (#7027) Make editor more resilient when opening files

Details

We used to save all recent files of all projects in a single user preference key. Since preference keys have a size limit, this is clearly a problem. This commit makes the editor use a different preference key per every project root, and also decreases the history limit just to be extra safe.

User-facing changes: Hopefully none :sweat_smile: . If no files in the editor could be opened before, they will now.


FIX: (#7062) Fix slow loading of sprite data in the editor

Details

Fixed slow project load times introduced by the addition of slice-9 support for sprites.


FIX: (#7074) Copied collision 3d box doesn’t show properly in the editor

Details

Collision objects are correctly copy-pasted in projects with 3D physics.


18 Likes

Can someone explain the use for this? Sounds interesting, but not sure why.

When bundling the project with this option you get an application without resources but with native extensions. This is useful when you need an empty target application to hot-reload code and content to while developing and testing on device.

Edit:
Added link to another dmSDK change regarding dmObjectPool that didn’t have a function for retrieving the internal objects.

1 Like

Does the JSON breaking change only affect extension developers, or us mere mortals too (i.e. users of json.decode()/json.encode())?

The change primarily affects extension developers (ie users of the C++ API).

For the “mere mortals” using json.decode() there will be a noticeable performance increase when working with large json structures.

For json.encode() we added json.null so that you can encode a null value if needed.

6 Likes

Jstodef need update:) @AGulev

ERROR: jstodef/src/jstodef.cpp:81: 'use of undeclared identifier 'dmJson'
            dmJson::Document doc;'

ERROR: jstodef/src/jstodef.cpp:82: 'use of undeclared identifier 'dmJson'
            dmJson::Result r = dmJson::Parse(message, length, &doc);'

ERROR: jstodef/src/jstodef.cpp:82: 'use of undeclared identifier 'dmJson'
            dmJson::Result r = dmJson::Parse(message, length, &doc);'

ERROR: jstodef/src/jstodef.cpp:83: 'use of undeclared identifier 'dmJson'
            if (r == dmJson::RESULT_OK && doc.m_NodeCount > 0) {'

ERROR: jstodef/src/jstodef.cpp:93: 'use of undeclared identifier 'dmJson'
            dmJson::Free(&doc);'

ERROR: jstodef/src/jstodef.cpp:93: 'declaration of reference variable 'doc' requires an initializer
            dmJson::Free(&doc);'

2 Likes

Yes, I know. Thank you.
We are working on extensions update.

2 Likes

I have crash in windows build. But html build worked
_crash.txt (50.0 KB)

C:\Users\user\defold\3d-experiments\bob\releases\dev\windows\3d experiments dev>3dexperimentsdev.exe
INFO:DLIB: Log server started on port 53841
INFO:ENGINE: Target listening with name: LAPTOP-K0DFPU0P - fe80::1d3f:20c6:95fb:bc74 - Windows
INFO:ENGINE: Engine service started on port 8001
INFO:GRAPHICS: Initialised graphics device 'opengl'
INFO:ENGINE: Defold Engine 1.4.0 (1dbf756)
INFO:ENGINE: Loading data from: dmanif:game.dmanifest
INFO:xMath: Registered xmath Extension

Registered lua_script_instance Extension
INFO:LFS: Registered lfs Extension

Registered game Extension
INFO:ENGINE: Initialised sound device 'default'
DEBUG:SCRIPT: [WARN 16:23:37] LOCALIZATION: libs/common.lua:22: set locale:en
DEBUG:SCRIPT: [INFO 16:23:37] LOCALIZATION: assets/localization/localization.lua:39: system locale:ru
DEBUG:SCRIPT: [WARN 16:23:37] LOCALIZATION: libs/common.lua:22: set locale:ru
DEBUG:SCRIPT: [INFO 16:23:37] WORLD: world/world.lua:15: init
DEBUG:SCRIPT: [INFO 16:23:37] Storage: world/storage/storage.lua:92: load
DEBUG:SCRIPT: [INFO 16:23:37] Storage: world/storage/storage.lua:97: from file:
{"data":"{\"debug\":{\"draw_available_cells\":false,\"draw_frustum_box\":false,\"show_mobile_input\":false,\"draw_physics\":false,\"developer\":false,\"draw_debug_info\":false},\"options\":{\"music\":true,\"sound\":true},\"version\":11,\"game\":{}}","encrypted":false}
DEBUG:SCRIPT: [INFO 16:23:37] Storage: world/storage/storage.lua:128: data:
{"debug":{"draw_available_cells":false,"draw_frustum_box":false,"show_mobile_input":false,"draw_physics":false,"developer":false,"draw_debug_info":false},"options":{"music":true,"sound":true},"version":11,"game":{}}
DEBUG:SCRIPT: [INFO 16:23:37] Storage: world/storage/storage.lua:233: save
DEBUG:SCRIPT: [INFO 16:23:37] EVENT_BUS: libs/event_bus.lua:23: event:STORAGE_SAVED
DEBUG:SCRIPT: [INFO 16:23:37] Storage: world/storage/storage.lua:137: loaded
DEBUG:SCRIPT: [INFO 16:23:37] none: libs/rendercam_camera.lua:382: camera:game recalculate_viewport
DEBUG:SCRIPT: [INFO 16:23:37] none: libs/rendercam_camera.lua:382: camera:game recalculate_viewport
INFO:GRAPHICS: Transcoding: /assets/images/debug/debug.texturec from 21 to 6 (TEXTURE_FORMAT_RGBA_BC7 -> cTFBC7_RGBA)
DEBUG:SCRIPT: [INFO 16:23:37] INIT_CONTROLLER: init_controller.script:66: version:0.0.1
DEBUG:SCRIPT: [INFO 16:23:37] ContextManager: libs/contexts_manager.lua:59: Context register:MAIN
DEBUG:SCRIPT: [INFO 16:23:37] none: init_controller.script:99: init time:0.10093688964844
DEBUG:SCRIPT: [INFO 16:23:37] none: libs/sdk/sdk.lua:143: ads_commercial
DEBUG:SCRIPT: [INFO 16:23:37] ContextManager: libs/contexts_manager.lua:59: Context register:CURTAINS_GUI
WARNING:GAMESYS: Failed to set group gain (-13)
DEBUG:SCRIPT: [INFO 16:23:37] SCENE: libs/sm/scene_loader.lua:22: start load:[main:/game_scene#collectionproxy]
INFO:DLIB: SSDP: Started on address 10.3.172.140
INFO:DLIB: SSDP: Started on address 192.168.1.57
DEBUG:SCRIPT: [INFO 16:23:38] RESIZER: features/resizer/resizer.gui_script:54: change size to:16.0x9.0 960x540 scaled:1440x810
DEBUG:SCRIPT: [INFO 16:23:38] none: debug/view/scene_debug_view.lua:16: enable:false
DEBUG:SCRIPT: [INFO 16:23:38] Render: render/my.render_script:108: screen size changed. from w:1200 h:675 to w:1440 h:810
DEBUG:SCRIPT: [INFO 16:23:38] none: libs/rendercam_camera.lua:382: camera:game recalculate_viewport
DEBUG:SCRIPT: [INFO 16:23:38] EVENT_BUS: libs/event_bus.lua:23: event:WINDOW_RESIZED
DEBUG:SCRIPT: [INFO 16:23:38] SCENE: libs/sm/scene.lua:43: GameScene loaded
DEBUG:SCRIPT: [INFO 16:23:38] SCENE: libs/sm/scene.lua:44: GameScene load time 0.41580009460449
DEBUG:SCRIPT: [INFO 16:23:38] ContextManager: libs/contexts_manager.lua:59: Context register:GAME
DEBUG:SCRIPT: [INFO 16:23:38] ContextManager: libs/contexts_manager.lua:59: Context register:GAME_GUI
DEBUG:SCRIPT: [INFO 16:23:38] LEVELS: scenes/game/game_scene_controller.script:20: total level load:0.0069999694824219
DEBUG:SCRIPT: [INFO 16:23:38] none: world/game/levels/level_creator.lua:225: Location:CITY_1 load data time:0.017017364501953
DEBUG:SCRIPT: [INFO 16:23:38] SCENE: libs/sm/scene.lua:91: GameScene show
DEBUG:SCRIPT: [INFO 16:23:38] none: libs/sdk/sdk.lua:69: gameplay_start
DEBUG:SCRIPT: [INFO 16:23:38] SCENE: libs/sm/scene.lua:111: GameScene resumed
DEBUG:SCRIPT: [INFO 16:23:38] EVENT_BUS: libs/event_bus.lua:23: event:SCENE_CHANGED
Assertion failed: instance->m_FrameCount == mix_buffer_count, file ..\src\sound.cpp, line 1012
INFO:CRASH: Successfully wrote Crashdump to file: C:\Users\user\AppData\Roaming\Defold/_crash
ERROR:CRASH: CALL STACK:


ERROR:CRASH:  0 0x7FF616723CD0 dmCrash::GenerateCallstack D:\a\defold\defold\engine\crash\src\backtrace_win32.cpp:144

ERROR:CRASH:  1 0x7FF616A1CDD0 raise /tmp/job2753162768795877154/minkernel/crts/ucrt/src/appcrt/misc/signal.cpp:547

ERROR:CRASH:  2 0x7FF616A0FE4C abort /tmp/job2753162768795877154/minkernel/crts/ucrt/src/appcrt/startup/abort.cpp:71

ERROR:CRASH:  3 0x7FF616A0F098 common_assert_to_stderr<wchar_t> /tmp/job2753162768795877154/minkernel/crts/ucrt/src/appcrt/startup/assert.cpp:175

ERROR:CRASH:  4 0x7FF616A0EBBC _wassert /tmp/job2753162768795877154/minkernel/crts/ucrt/src/appcrt/startup/assert.cpp:443

ERROR:CRASH:  5 0x7FF616717690 dmSound::MixResampleIdentityStereo<short,0,1> D:\a\defold\defold\engine\sound\src\sound.cpp:1014

ERROR:CRASH:  6 0x7FF6167179E0 dmSound::Mix D:\a\defold\defold\engine\sound\src\sound.cpp:1109

ERROR:CRASH:  7 0x7FF616717D20 dmSound::MixInstance D:\a\defold\defold\engine\sound\src\sound.cpp:1237

ERROR:CRASH:  8 0x7FF616718190 dmSound::MixInstances D:\a\defold\defold\engine\sound\src\sound.cpp:1289

ERROR:CRASH:  9 0x7FF616714B20 dmSound::SoundThread D:\a\defold\defold\engine\sound\src\sound.cpp:1484

ERROR:CRASH: 10 0x7FFF13B57020 BaseThreadInitThunk <unknown>:0

ERROR:CRASH: 11 0x7FFF14542680 RtlUserThreadStart <unknown>:0

ERROR:CRASH:
1 Like

Would it be possible to share the project with us?
We updated our sound system to fix a crash, and it’s possible we messed something else up instead.

I make simple repro case.
Problem with fade_in for music.
Crashed on different frames.

win_sound_crash.zip (58.8 KB)

INFO:DLIB: Log server started on port 51804
INFO:ENGINE: Target listening with name: LAPTOP-K0DFPU0P - fe80::1d3f:20c6:95fb:bc74 - Windows
INFO:ENGINE: Engine service started on port 51805
INFO:GRAPHICS: Initialised graphics device 'opengl'
INFO:ENGINE: Defold Engine 1.4.0 (1dbf756)
INFO:DLIB: Initialized Remotery (ws://127.0.0.1:17815/rmt)
INFO:ENGINE: Loading data from: build/default
INFO:ENGINE: Initialised sound device 'default'
DEBUG:SCRIPT: 0
INFO:DLIB: SSDP: Started on address 10.3.172.140
INFO:DLIB: SSDP: Started on address 192.168.1.57
DEBUG:SCRIPT: 0
Assertion failed: instance->m_FrameCount == mix_buffer_count, file ..\src\sound.cpp, line 1012
DEBUG:SCRIPT: 0.017005000263453
DEBUG:SCRIPT: 0.034016000106931
DEBUG:SCRIPT: 0.051008000969887
DEBUG:SCRIPT: 0.071012001484632
DEBUG:SCRIPT: 0.085014001466334
DEBUG:SCRIPT: 0.10102200228721
DEBUG:SCRIPT: 0.11802500206977
DEBUG:SCRIPT: 0.13403000216931
DEBUG:SCRIPT: 0.1510620014742
DEBUG:SCRIPT: 0.16806300077587
INFO:CRASH: Successfully wrote Crashdump to file: C:\Users\user\AppData\Roaming\Defold/_crash
ERROR:CRASH: CALL STACK:

ERROR:CRASH:  0 0x7FF63A276BA0 dmCrash::GenerateCallstack D:\a\defold\defold\engine\crash\src\backtrace_win32.cpp:144

ERROR:CRASH:  1 0x7FF63A34E95C raise minkernel\crts\ucrt\src\appcrt\misc\signal.cpp:547

ERROR:CRASH:  2 0x7FF63A3370C4 abort minkernel\crts\ucrt\src\appcrt\startup\abort.cpp:71

ERROR:CRASH:  3 0x7FF63A2F42A0 common_assert_to_stderr<wchar_t> minkernel\crts\ucrt\src\appcrt\startup\assert.cpp:186

ERROR:CRASH:  4 0x7FF63A2F4A24 _wassert minkernel\crts\ucrt\src\appcrt\startup\assert.cpp:443

ERROR:CRASH:  5 0x7FF63A2B3850 dmSound::MixResampleIdentityStereo<short,0,1> D:\a\defold\defold\engine\sound\src\sound.cpp:1014

ERROR:CRASH:  6 0x7FF63A2B77C0 dmSound::Mix D:\a\defold\defold\engine\sound\src\sound.cpp:1109

ERROR:CRASH:  7 0x7FF63A2B7A90 dmSound::MixInstance D:\a\defold\defold\engine\sound\src\sound.cpp:1237

ERROR:CRASH:  8 0x7FF63A2B8020 dmSound::MixInstances D:\a\defold\defold\engine\sound\src\sound.cpp:1289

ERROR:CRASH:  9 0x7FF63A2B9530 dmSound::SoundThread D:\a\defold\defold\engine\sound\src\sound.cpp:1484

ERROR:CRASH: 10 0x7FFF13B57020 BaseThreadInitThunk <unknown>:0

ERROR:CRASH: 11 0x7FFF14542680 RtlUserThreadStart <unknown>:0

ERROR:CRASH: 
function init(self)
	...
	sound.play("/music#game")
	sound.set_gain("/music#game", 0)
	self.fade_in_time = 1
end

function update(self,dt)
	local a = 1 - self.fade_in_time / 1
	a = math.max(0,math.min(a,1)) --clamp
	pprint(a)
	sound.set_gain("/music#game", a)
	self.fade_in_time = self.fade_in_time - dt
end

Due to the changes to the dmJson api, we’ve released new versions of these extensions for use with the Defold 1.4.0+:

If we’ve missed an extension please let us know!

4 Likes

Thanks!
I can reproduce the issue.
It seems related to the update to the latest ogg decoder, and I’m looking into it now.

3 Likes

I now have a PR for the fix, and most likely the beta will be updated tomorrow with it:

5 Likes

TBH this is why I use Defold. The beta/feedback/fix loop at every new beta is fantastic!

10 Likes

We really appreciate this process as well. The feedback and help we get to test changes “in the wild” is invaluable!

7 Likes