Defold 1.9.5 BETA

Defold 1.9.5 Beta

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 GitHub: Release v1.9.5 - beta · defold/defold · GitHub

Summary

  • NEW: (#9636) Remove unused world constant from tile_map in builtins (by FlexYourBrain)
  • NEW: (#9644) Automatically calculate the maximum number of game objects required for a runtime collection (by AGulev)
  • NEW: (#9649) Add the engine-setup script tag to the HTML5 template (by aglitchman)
  • NEW: (#9659) Misc platform fixes for extensions (by Jhonnyg)
  • NEW: (#9562) Add a read-only property for the Current Node in the GUI. (by AGulev)
  • NEW: (#9475) Http cache improvements (by Jhonnyg)
  • NEW: (#9610) Add support for pivot points for atlases (by JCash)
  • FIX: (#9671) Added new property in game.project to specify minimum log level project.minimum_log_level (by AGulev)
  • FIX: (#9566) Add alpha blending before rendering profiler (by Jhonnyg)
  • FIX: (#9499) Added Switch Pro Controller for Windows (by wistpotion)
  • FIX: (#9550) Fix multi-materials in one skinning model (by jixingcn)
  • FIX: (#9563) Only split combined samplers when needed (by Jhonnyg)
  • FIX: (#9643) Fix crash when MaxDynamicTextures == 0. (by ekharkunov)
  • FIX: (#9559) Fixed issue where the horizontal scroll bar was covering the last line in the console or the code editor (by AGulev)
  • FIX: (#9637) Proper engine shutdown (by AGulev)

Engine

NEW: (#9636) ‘Remove unused world constant from tile_map in builtins’ by FlexYourBrain
The unused world constant has been removed from the tile_map material from builtins.

NEW: (#9644) ‘Automatically calculate the maximum number of game objects required for a runtime collection’ by AGulev
Bob calculates how many game objects are used by each collection. If the collection has no factory or collectionfactory component, this value is used to allocate the exact number of GameObjects for the world (collection proxy). Otherwise, collection.max_instances is used.

This helps save memory, especially in cases where the game has a world that requires a large max_instances value for the main game scene, but smaller and static extra scenes (such as popups, menus, etc.).

NEW: (#9649) ‘Add the engine-setup script tag to the HTML5 template’ by aglitchman
This change brings back the engine-setup section to the HTML5 template. Developers can use it and native extensions can inject code here to add game startup parameters via the CUSTOM_PARAMETERS object, setup loading progress listeners, override the dmloader.js functions.

NEW: (#9659) ‘Misc platform fixes for extensions’ by Jhonnyg
A new DMSDK function has been added that can get the OpenGL id from a rendertarget: OpenGLGetRenderTargetId. Also, Vulkan support for iOS is working correctly again after recent GLFW changes.

FIX: (#9671) 'Added new property in game.project to specify minimum log level project.minimum_log_level by AGulev
Using the new game.project property project.minimum_log_level, it is possible to specify the minimum log level for the logging system. Only logs at the minimum level or higher will be shown.

FIX: (#9566) ‘Add alpha blending before rendering profiler’ by Jhonnyg
Forced the in-game profiler to always be rendered with alpha blending.

FIX: (#9499) ‘Added Switch Pro Controller for Windows’ by wistpotion
Added Switch Pro Controller for Windows.

FIX: (#9550) ‘Fix multi-materials in one skinning model’ by jixingcn
Fixed an issue where custom vertex attributes are applied only from the first material in a situation where the same material is used across multiple material slots in a model file, but where each sub-material has overridden attributes.

In the .model file, the order of materials must be the same as in the original model file(.glb). (Notice: the defold editor will reorder all materials by name when you edit and save the model.)

FIX: (#9563) ‘Only split combined samplers when needed’ by Jhonnyg
Partial fix for #9533, the issue will still persist when building with WebGPU.

FIX: (#9643) ‘Fix crash when MaxDynamicTextures == 0.’ by ekharkunov
Setting dynamic textures to zero in GUIs no longer crashes the engine when running.

Editor

NEW: (#9562) ‘Add a read-only property for the Current Node in the GUI.’ by AGulev
Added a new read-only property Current Nodes for GUI to display the number of nodes currently being used in the GUI.

NEW: (#9475) ‘Http cache improvements’ by Jhonnyg
Several improvements to the HTTP support in the engine has been made:

  • Restarting a project from the editor should be significantly faster for large projects
  • HTTP requests via the http.request function for large files should also be significantly faster
  • HEAD requests in the engine should be working correctly now - you can use a HEAD request to get the size of a remote file

NEW: (#9610) ‘Add support for pivot points for atlases’ by JCash
The images in an atlas now have support for a setting pivot point.
The pivot is defined in units, where (0,0) is top left corner of the image, and (1,1) is bottom right of the image.
The pivot is allowed to be outside of the [0, 1] range.
Default is (0.5, 0.5), which is the middle of the image.

FIX: (#9559) ‘Fixed issue where the horizontal scroll bar was covering the last line in the console or the code editor’ by AGulev
Fixed an issue where the horizontal scrollbar made it impossible to interact with the last line in the console or the code editor.

FIX: (#9637) ‘Proper engine shutdown’ by AGulev
Engine side fix for Setting the game object max count too high causes a crash · Issue #9606 · defold/defold · GitHub

The engine shouldn’t crash on De-init if error happened during initialization

20 Likes

Great release! Love seeing the contributors listed.

I seem to have an issue in that prints (DEBUG:SCRIPT: specifically) aren’t displaying in the console anymore in 1.9.5.

2 Likes

The default minimum log level appears to be 2. Debug message levels are 0 and 1, so they are hidden by default.

Have you tried setting minimum_log_level to 0 or 1? Apologies if you’ve already tried and I missed it.

3 Likes

That was precisely the issue, thank you!

I wonder if this default is appropriate? It adds a relatively obscure step to “Hello world!”, and I foresee us having to coach newbies on this frequently.

Thanks, I’ll take a look

1 Like

Super! And it works.
The only issue I found was a small bug in displaying the bounding box frame in the editor when the pivot of the sprite is shifted. I.e. frames are still shown as if the pivot remained in the centre of the sprite. Clicking on sprites and selecting objects works correctly.

And also a bit frustrating to set the pivot in case the sprite in the atlas was rotated when packing. I think visual marker will solve this situation.

How it works :

11 Likes

Could you please open issues for these? Thanks!

Default value should be USER DEBUG = 1, I’ll fix it in beta tomorrow

4 Likes

Thank you @AGulev for this fix! :smiley:

2 Likes

Testing the latest beta with the rive extension.
Just downloaded the project from github and tried to build. I’m getting this error:

Thanks. I updated the description. Please try again.

1 Like

All working, and it’s awesome!

This issue fixed (with a couple more related issues) and merged into beta. It will be available in ~1h

6 Likes

Just a reminder that this version still in beta, please test your projects with it to make sure everything works fine. Thank you!

3 Likes

Something wrong with pivots and resource.set_atlas(self.atlas_empty, atlas)

In my game i use liveupdate for skins.atlas. I have empty atlas in main collectuibn then i replaced it with liveupdate version.

1.9.4


1.9.5 (8625c758fac8ce21fdadedaf394baf7651cf2bb2)

local atlas = resource.get_atlas(self.atlas)
		for idx, geometry in ipairs(atlas.geometries) do
			local anim = atlas.animations[idx]
			local data = {
				id = anim.id,
			}
			COMMON.skins_atlas.animations[anim.id] = data
			COMMON.skins_atlas.animations[hash(anim.id)] = data
			--hotfix for rotated images
			if geometry.uvs[1] ~= geometry.uvs[3] then
				data.need_rotate = true
				local tc = geometry.vertices
				--add rotation to geometry
				local new_vertices = {
					tc[3], tc[4],
					tc[5], tc[6],
					tc[7], tc[8],
					tc[1], tc[2],
				}

				geometry.vertices = new_vertices--]]
				--now rotate uv and vertices to by 90
			end
		end
		resource.set_atlas(self.atlas_empty, atlas)

Pivot is on left top corner not in center by default.

1)i don’t set width and height for geometry. get_atlas not give me that value:(

You calculate pivot but width and height is 0

when i add width and height it fixed

	local w,h = 0,0
			for vi =1,#geometry.vertices, 2 do
				w  = math.max(w, geometry.vertices[vi]);
				h = math.max(h, geometry.vertices[vi+1]);
			end
			geometry.width = w
			geometry.height = h

4 Likes
  1. I think you need to add pivot_x, pivot_y, width, height in geometry in resource.get_atlas.
DEBUG:SCRIPT: 
{ --[[00000280536F3B10]]
  uvs = { --[[0000028054068220]]
    1 = 785,
    2 = 2,
    3 = 913,
    4 = 2,
    5 = 913,
    6 = 99,
    7 = 785,
    8 = 99
  },
  vertices = { --[[00000280536F3B60]]
    1 = 0,
    2 = 128,
    3 = 0,
    4 = 0,
    5 = 97,
    6 = 0,
    7 = 97,
    8 = 128
  },
  indices = { --[[00000280540682C0]]
    1 = 0,
    2 = 1,
    3 = 2,
    4 = 0,
    5 = 2,
    6 = 3
  }
}
3 Likes

I have a PR up for review now: Changed resource.create_atlas() pivot to unit space (from texels), to simplfy calculations by JCash · Pull Request #9775 · defold/defold · GitHub
The big difference here is that you’ll now specify the pivot in image unit space (0,0), (1,1), as opposed to image texel space. THis way there is no need to have the width/height available.

I also added the pivot + size to the output from get_atlas().

5 Likes