Defold 1.2.183 BETA

Defold 1.2.183 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 Defold Downloads

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

Release notes

In this release we’ve added controller support for Android.

We’ve also updated the texture compression with some optimizations, that will allow for better compression using the different compression levels.

We have also done some good improvements on the archive building. Although it varies between projects, our medium sized test project took many minutes less to build and the resulting bundle was several megabytes smaller.

Work in progress

We’re continuing our work with the Rive.app support (sneak peek).

At the same time we’re also extending our C++ api’s in the Defold SDK, to allow us to create extensions that provide components, resources, pipeline and editor plugins. (current progress)

Engine

  • Issue-5798 - Added: Add support for Android controllers
  • Issue-5762 - Fixed: Update dmloader.js to invoke callbacks on retry
  • Issue-5763 - Fixed: Fixed sound Lua callback
  • Issue-5773 - Fixed: Fixed crash at shutdown on an uninitialized sound system
  • Issue-5776 - Fixed: iOS: Fixed crash when user shuts down app while engine is rebooting
  • Issue-5782 - Fixed: Updated sound property docs
  • Issue-5786 - Fixed: Updated documentation for tilemap.set_tile()
  • Issue-5787 - Fixed: Updated Basis Universal to v1.15 with rdo optimizations
  • Issue-5796 - Fixed: Removed render constants as default for Sprite + Label
  • Issue-5800 - Fixed: Optimize the ManifestBuilder lookups
  • Issue-5802 - Fixed: Optimized resource lookups when creating archives
  • Issue-5804 - Fixed: Optimized manifest file size
  • Issue-5817 - Fixed: Fixed issue with for 3d convex shape
16 Likes

HTML5 building takes a long time to build - 3 minutes.
Change in HTML5 release size compared to version 182:

zipped:
5,12 mb → 4.34 mb

unpacked:
9,39 mb → 8,52 mb

1 Like

Unclear which numbers correspond to which version here?
The archive should (most likely) have been smaller. Are they not?
What files changed size?

2 Likes

:tada:

4 Likes

Hi!
I’ve tried this version.
And my game crashes on Android now. Same code is working with build on 1.2.181
Logcat is here DuoVikings crash on 1.2.183-beta, android - Pastebin.com
Could you please help me to understand what causes the crash?

2 Likes

Thanks for the report!
Yes, from your log, there is a callstack:

2021-05-18 19:55:30.808 26043-26043/? A/DEBUG: pid: 25979, tid: 26010, name: NativeThread  >>> com.sevenspotgames.duovikings <<<
2021-05-18 19:55:30.823 26043-26043/? A/DEBUG:     #00 pc 000000000018f2a0  /data/app/com.sevenspotgames.duovikings-V6Cs6Yq5fINjvgohC1Xz8Q==/lib/arm64/libsbervikings.so (glfwAndroidDiscoverJoysticks+1140)
2021-05-18 19:55:30.823 26043-26043/? A/DEBUG:     #01 pc 0000000000192f80  /data/app/com.sevenspotgames.duovikings-V6Cs6Yq5fINjvgohC1Xz8Q==/lib/arm64/libsbervikings.so (_glfwPlatformPollEvents+52)
2021-05-18 19:55:30.823 26043-26043/? A/DEBUG:     #02 pc 00000000000b6b30  /data/app/com.sevenspotgames.duovikings-V6Cs6Yq5fINjvgohC1Xz8Q==/lib/arm64/libsbervikings.so (_ZN10dmGraphicsL10OpenGLFlipEPNS_7ContextE+96)
2021-05-18 19:55:30.823 26043-26043/? A/DEBUG:     #03 pc 0000000000045e68  /data/app/com.sevenspotgames.duovikings-V6Cs6Yq5fINjvgohC1Xz8Q==/lib/arm64/libsbervikings.so (_ZN8dmEngine4InitEPNS_6EngineEiPPc+6600)
2021-05-18 19:55:30.823 26043-26043/? A/DEBUG:     #04 pc 0000000000047b80  /data/app/com.sevenspotgames.duovikings-V6Cs6Yq5fINjvgohC1Xz8Q==/lib/arm64/libsbervikings.so (_Z14dmEngineCreateiPPc+68)
2021-05-18 19:55:30.823 26043-26043/? A/DEBUG:     #05 pc 0000000000043d64  /data/app/com.sevenspotgames.duovikings-V6Cs6Yq5fINjvgohC1Xz8Q==/lib/arm64/libsbervikings.so (_ZN8dmEngine7RunLoopEPKNS_13RunLoopParamsE+72)
2021-05-18 19:55:30.823 26043-26043/? A/DEBUG:     #06 pc 0000000000043cfc  /data/app/com.sevenspotgames.duovikings-V6Cs6Yq5fINjvgohC1Xz8Q==/lib/arm64/libsbervikings.so (_ZL16EngineMainThreadPv+124)
2021-05-18 19:55:30.823 26043-26043/? A/DEBUG:     #07 pc 000000000016ed94  /data/app/com.sevenspotgames.duovikings-V6Cs6Yq5fINjvgohC1Xz8Q==/lib/arm64/libsbervikings.so (_ZN8dmThreadL16ThreadStartProxyEPv+32)
2021-05-18 19:55:31.037 3206-3206/? D/SurfaceFlinger:   Display[0] configurations (* current):
...

The callstack looks ok, and since glfwAndroidDiscoverJoysticks is at the top of it, I suspect the new feature of adding joystick support to Android.

@britzl perhaps you can take a look at it?

1 Like

Yes. Will do!

Hello,
there is some wrong with 183beta and GitHub - Dragosha/slasher-prototype: Defold. Lua. Game prototype. 2.5D perspective view. Levels, the hero controller, monsters and base logic. (sources are available for tests).
I noticed that:

  1. The hero is stuck after end some spine animation. And console has not any error messages :confused: (Also tested in 1.2.181, here works correct)
  2. Gamepad deadzone was changed and input from xbox360 gamepad now sticks. (tested also in 1.2.181, but with beta-stage server, the same result, sticks)

Screencast:

4 Likes

Same problem in 1.2.182? Ah, @JCash is investigating this

Hmm, we changed this is 1.2.180 (Improve gamepad axis pressed/released behavior · Issue #5511 · defold/defold · GitHub). Does this only happen in the HTML5 build or on desktop as well?

I’ve tested in 182 now. Works ok.

Both, as I see. Latest bundle what I made for this demo was in 1.2.172 (October 2020), so I just missed this changes. (other projects have not using the gamepad).

A fix for the spine callback is in review now, and I expect a new beta to be out some time after lunch.

3 Likes

The fix has been merged. A new beta will be available in about 30 minutes.

Is there an example how to use a stick properly now? I’m trying to fix the demo and a bit stuck.
I fixed sticking , but now can’t catch left/right and up/down event simultaneously, i.e diagonal move. (it works with pad and arrow keys, but not for analog stick). I use x-box 360 gamepad for tests.

function on_input(self, action_id, action)
	local mapped_action_id = mapper.on_input(action_id, self.hero_id)
	self.input.on_input(mapped_action_id, action)
	if  action_id == triggers.GAMEPAD_LSTICK_LEFT then
		self.input.on_input(param.LEFT, action)
	elseif  action_id == triggers.GAMEPAD_LSTICK_RIGHT then
		self.input.on_input(param.RIGHT, action)
	elseif  action_id == triggers.GAMEPAD_LSTICK_UP then
	    self.input.on_input(param.UP, action)
	elseif  action_id == triggers.GAMEPAD_LSTICK_DOWN then
	    self.input.on_input(param.DOWN,action)

^ this code turning on only one thing: up, down, left or right.

UPD. Seems, for diagonal move I should calculate a stick position by using action.value cause an old example works correct (it dosen’t use action.pressed/released) : publicexamples/examples/gamepad_tester at master · britzl/publicexamples · GitHub

UPD2: solved:

local threshold = 0.45

	if  action_id == triggers.GAMEPAD_LSTICK_LEFT then
		action.pressed = action.value > threshold
		action.released = not action.pressed
		self.input.on_input(param.LEFT, action)

	elseif  action_id == triggers.GAMEPAD_LSTICK_RIGHT then
		action.pressed = action.value > threshold
		action.released = not action.pressed
		self.input.on_input(param.RIGHT, action)

	elseif  action_id == triggers.GAMEPAD_LSTICK_UP then
		action.pressed = action.value > threshold
		action.released = not action.pressed
		self.input.on_input(param.UP, action)

	elseif  action_id == triggers.GAMEPAD_LSTICK_DOWN then
		action.pressed = action.value > threshold
		action.released = not action.pressed
		self.input.on_input(param.DOWN,action)
	end
3 Likes

Tested, works correct!

3 Likes

Hi! I don’t know why but gamepad on Android doesn’t work for me.

  1. I’ve connected xbox x/s gamepad to mac and tested in editor. It works great in gamepad_tester and Dragosha’s slasher-prototype projects. (except L/R triggers) Love it!
  2. Then I’ve built these projects to android. And they don’t work with my gamepad. I press buttons - but nothing happens.
  3. But in the android os system I can use sticks for moving between apps and start them with A button. So it seems that gamepad works fine on my phone. But gamepad_tester doesn’t react on any gamepad buttons and sticks.
  4. Here you can find the gamepad_tester apk demo built by me on Defold 1.2.183 (2021-05-19)
    tested on Samsung Galaxy S7 (android 8), Xiaomi Mi9 SE (android 10)

My guess is it’s because it doesn’t have an Android mapping in the default.gamepads?

I’m not sure what Android reports as the name for that controller, but if you can figure it out, you should be able to make a new entry in that file (make a copy from the builtins/ folder). If you look at the file (it’s text), you’ll figure out how it works.

Once tested and verified, we’ll happily integrate it back into the repo.

And now info here on how the mappings work on Android:

I found an old example I used for html5 gamepad tests and modified it a bit. Now you can connect up to 4 gamepads and test it.
So, I tested 1.2.183 using this test project on android (it’s easier to test using /gamepad_example/gamepad.collection as the bootstrap collection in game.project).

I added PS4 (dualshock4) and XBox gamepads to bindings it works but there are a couple of issues:

  1. Triggers on dualshock4 work only as buttons. Usually it’s not a button but Axis with normilised value in range 0…1. But for some reason I can’t setup it this way.
    1.1Ttriggers on xbox controller don’t work.
  2. LPAD doesn’t work
  3. GUIDE button doesn’t work.

DefoldExamples.apk.zip (1.8 MB)

2 Likes

This could have something to do with how Android maps these. As you can see here the triggers can map as both axis and buttons:

Yes, this is really strange. I got NO input from these on the two controllers I tested with (and I logged all incoming input events on a low level in the engine (in glfw).

Same. I didn’t get input on this either.

Perhaps test your controller with this gamepad tester app on Google Play and report back what input events you got:

3 Likes

Sure, these are the screenshots for triggers + GUIDE buttons (BUTTON_MODE)

Dualshock4:

Xbox:

And these are LPAD (AXIS HAT_X and HAT_Y - the same on both):

2 Likes