# Defold 1.3.1 has been released

**URL:** <https://forum.defold.com/t/defold-1-3-1-has-been-released/70673>\
**Category:** Release notes\
**Created:** [April 5, 2022, 8:38am UTC](https://forum.defold.com/t/defold-1-3-1-has-been-released/70673 "2022-04-05T08:38:11Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mathias\_Westerdahl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mathias_westerdahl/32/228_2.png) [@Mathias\_Westerdahl](https://forum.defold.com/u/Mathias_Westerdahl)\
**Post date:** [April 5, 2022, 8:38am UTC](https://forum.defold.com/t/defold-1-3-1-has-been-released/70673/1 "2022-04-05T08:38:11Z")

</div>

## Release notes

## Improved timestep support ⚠

The biggest change this release is the improved support for the different timesteps between the game update loop and the physics update loop.

The goal is to have the game using vsync, and use the delta time between the display refreshes as the `dt` for the game loop.  
This will fix the issues we’ve seen with game running on displays with variable frame rates (or rates \> 60hz).

The `display.update_frequency` (default is 0) variable has changed somewhat, and is only limiting the frame rate if it’s lower than the current refresh rate of the display.  
E.g. it can be useful to limit the frequency to something low (like 30) to simulate the behavior of for instance a KaiOS device.

The fixed physics update is off by default, in order to stay compatible with the old behavior.

(More on the settings at the end of this post)

We’ve added a `fixed_update(self, dt)` life cycle function to the game object scripts.  
When using fixed timesteps for the physics, this is where you’ll want to add the forces to your game objects, in order to keep in sync with the physics updates.

⚠ After the requests and comments from the community, we’re confident that the new implementation is a good way forward.  
However, due to the nature of the implementation, it wasn’t possible to keep it 100% backwards compatible.  
We hope that the community can help test their project with this release, and find and report any changes in behavior, so that we may discuss a way forward.

### Frustum culling

We’ve added support for frustum culling. In this initial version of the feature, it’s only used for sprites.  
Expected benefits are reduced vertex buffer sizes (saving GPU bandwidth), and reduced number of draw calls (depending on projects).

Frustum culling is enabled by default in the [default.render\_script](https://github.com/defold/defold/blob/dev/engine/engine/content/builtins/render/default.render_script#L77). If you have a custom render script, you need to create a frustum matrix, and pass it into your `render.draw()` calls.

### Floating point render targets

We’ve added support for floating point render targets on the devices that support them.  
The following constants are set if supported on the device and are otherwise nil if not supported:

```
* render.FORMAT_RGB16F
* render.FORMAT_RGB32F
* render.FORMAT_RGBA16F
* render.FORMAT_RGBA32F
* render.FORMAT_R16F
* render.FORMAT_RG16F
* render.FORMAT_R32F
* render.FORMAT_RG32F

```

# Engine

- [`Issue-6319`](https://github.com/defold/defold/issues/6319) - **Added** : Added support for creating floating point render targets
- [`Issue-6456`](https://github.com/defold/defold/issues/6456) - **Added** : Added frustum culling to default render script
- [`Issue-6460`](https://github.com/defold/defold/issues/6460) - **Added** : Added support for specifying fixed physics time steps
- [`Issue-6336`](https://github.com/defold/defold/issues/6336) - **Fixed** : Ignore focus lost/gain events for detection if app is in background (Android)
- [`Issue-6431`](https://github.com/defold/defold/issues/6431) - **Fixed** : Add all `android:configChanges` with requered API less or equal than 16
- [`Issue-6437`](https://github.com/defold/defold/issues/6437) - **Fixed** : Make sure particle fx duration doesn’t go below 0
- [`Issue-6440`](https://github.com/defold/defold/issues/6440) - **Fixed** : Reset key state when canvas focus is lost (HTML5)
- [`Issue-6445`](https://github.com/defold/defold/issues/6445) - **Fixed** : Add frustum culling support (currently sprites only)
- [`Issue-6447`](https://github.com/defold/defold/issues/6447) - **Fixed** : Correctly scale convex collision shapes in nested factory created game objects
- [`Issue-6452`](https://github.com/defold/defold/issues/6452) - **Fixed** : Improved error handling when using multiple tilemap collision objects in a single game object
- [`Issue-6453`](https://github.com/defold/defold/issues/6453) - **Fixed** : NE: Added dmGraphics api for querying the supported extensions
- [`Issue-6458`](https://github.com/defold/defold/issues/6458) - **Fixed** : Do not create animations for box nodes with one frame flipbook animations during gui scene creation
- [`Issue-6461`](https://github.com/defold/defold/issues/6461) - **Fixed** : Label alpha not always working properly in html5
- [`Issue-6464`](https://github.com/defold/defold/issues/6464) - **Fixed** : Game loop now uses display.update\_frequency to use variable/fixed frame rate
- [`Issue-6467`](https://github.com/defold/defold/issues/6467) - **Fixed** : Changed default value for wasm streaming
- [`Issue-6470`](https://github.com/defold/defold/issues/6470) - **Fixed** : Editor plugin restart message
- [`Issue-6472`](https://github.com/defold/defold/issues/6472) - **Fixed** : Bob doesn’t unpack plugin shared libraries unless they’ve changed
- [`Issue-6473`](https://github.com/defold/defold/issues/6473) - **Fixed** : Improved GUI property API reference
- [`Issue-6474`](https://github.com/defold/defold/issues/6474) - **Fixed** : Speed up building of script files
- [`Issue-6476`](https://github.com/defold/defold/issues/6476) - **Fixed** : Improved Bob exception reports (“resource cannot be null”)
- [`Issue-6478`](https://github.com/defold/defold/issues/6478) - **Fixed** : Editor: Added support for setting constant arrays
- [`Issue-6481`](https://github.com/defold/defold/issues/6481) - **Fixed** : Added support for component timestep

# Settings related to time steps

These are the relevant settings:

- `engine.fixed_update_frequency`

- `physics.use_fixed_timestep`

- `display.update_frequency` (integer)

- `display.swap_interval`

- ~~`display.vsync`~~ (DEPRECATED)

- Use the [sys.set\_update\_frequency(hz)](https://defold.com/ref/stable/sys/?q=set_update_frequency#sys.set_update_frequency:frequency) to control the “display.update\_frequency” at runtime.

---

<div class="post-metadata">

**Author:** ![wkqco33](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/wkqco33/32/27734_2.png) [@wkqco33](https://forum.defold.com/u/wkqco33)\
**Post date:** [April 5, 2022, 10:15pm UTC](https://forum.defold.com/t/defold-1-3-1-has-been-released/70673/2 "2022-04-05T22:15:48Z")

</div>

Thanks! You know what your team makes my dream!!

---

<div class="post-metadata">

**Author:** ![WhiteBoxDev](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/whiteboxdev/32/36080_2.png) [@WhiteBoxDev](https://forum.defold.com/u/WhiteBoxDev)\
**Post date:** [April 5, 2022, 10:48pm UTC](https://forum.defold.com/t/defold-1-3-1-has-been-released/70673/3 "2022-04-05T22:48:02Z")

</div>

This release has lots of great new features. Thank you!

---

<div class="post-metadata">

**Author:** ![AGulev](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/agulev/32/4541_2.png) [@AGulev](https://forum.defold.com/u/AGulev)\
**Post date:** [April 6, 2022, 11:29am UTC](https://forum.defold.com/t/defold-1-3-1-has-been-released/70673/4 "2022-04-06T11:29:11Z")

</div>

Thank you @britzl for this blog post with more info about the release: [Defold release 1.3.1](https://defold.com/2022/04/05/Defold-1-3-1)

---

<div class="post-metadata">

**Author:** ![piXelicidio](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/pixelicidio/32/26074_2.png) [@piXelicidio](https://forum.defold.com/u/piXelicidio)\
**Post date:** [April 7, 2022, 3:59pm UTC](https://forum.defold.com/t/defold-1-3-1-has-been-released/70673/5 "2022-04-07T15:59:04Z")

</div>

Haven’t used Defold since about 2 years, logged in just to celebrate the improvement/fixes for Sync/framerate dependency issues… 🥳 🥳 🥳

---

<div class="post-metadata">

**Author:** ![SkaterDad](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/skaterdad/32/41137_2.png) [@SkaterDad](https://forum.defold.com/u/SkaterDad)\
**Post date:** [April 13, 2022, 4:01am UTC](https://forum.defold.com/t/defold-1-3-1-has-been-released/70673/6 "2022-04-13T04:01:13Z")

</div>

Is there any plausible reason that this release would break `rendercam` in subtle ways?

`rendercam.screen_to_world_2d` seems to be returning incorrect values for the first 0.5 seconds of the game loading. This is happening while debugging, but also with a Windows release build.

That function relies on some projection matrices, which are calculated during the render script’s update. Since this release involved some update frequency changes, maybe this was an unintended side effect? I’ve tried setting the display.update\_frequency to both 0 and 60. Same issue.

Project worked well on 1.3.0. Unfortunately the archive link on [https://d.defold.com/stable/](https://d.defold.com/stable/) is giving me a 404.

---

<div class="post-metadata">

**Author:** ![Mathias\_Westerdahl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mathias_westerdahl/32/228_2.png) [@Mathias\_Westerdahl](https://forum.defold.com/u/Mathias_Westerdahl)\
**Post date:** [April 13, 2022, 7:07am UTC](https://forum.defold.com/t/defold-1-3-1-has-been-released/70673/7 "2022-04-13T07:07:09Z")

</div>

I don’t think so, no.  
Remember that the downloads are served at github:

> **[Releases · defold/defold](https://github.com/defold/defold/releases)**
>
> Defold is a completely free to use game engine for development of desktop, mobile and web games. - defold/defold

---

<div class="post-metadata">

**Author:** ![SkaterDad](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/skaterdad/32/41137_2.png) [@SkaterDad](https://forum.defold.com/u/SkaterDad)\
**Post date:** [April 13, 2022, 1:23pm UTC](https://forum.defold.com/t/defold-1-3-1-has-been-released/70673/8 "2022-04-13T13:23:15Z")

</div>

Thanks for pointing me to Github, I had forgotten. Perhaps the website could be updated to say that as well?

I’ve just downloaded 1.3.0 and the game works as intended again. Rendercam is providing the correct values right at the main collection’s `init()`.

I then deleted the Win32 cache and build folder, and tried 1.3.1 again. The problem is still there.

I will try to make a minimal repro tonight after work.

---

<div class="post-metadata">

**Author:** ![SkaterDad](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/skaterdad/32/41137_2.png) [@SkaterDad](https://forum.defold.com/u/SkaterDad)\
**Post date:** [April 16, 2022, 9:48pm UTC](https://forum.defold.com/t/defold-1-3-1-has-been-released/70673/9 "2022-04-16T21:48:48Z")

</div>

Here is the minimal reproduction I promised. Started with my game and aggressively removed nearly everything.

There’s a screenshots folder showing the results I get on the 2 engine versions, and a few comments in the main.script.

Hope this helps isolate what is happening!  
[camera\_issue.zip](https://forum.defold.com/uploads/short-url/s0w4NrIrUno8Eao6N1DE2PjL1X6.zip) (97.0 KB)

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [April 19, 2022, 11:03am UTC](https://forum.defold.com/t/defold-1-3-1-has-been-released/70673/10 "2022-04-19T11:03:13Z")

</div>

It seems like there’s an issue with the timer. I’m not getting the correct delay.

```lua
	local t = socket.gettime()
	timer.delay(0.2, false, function()
		print(socket.gettime() - t)
	end)

```

This prints 0.00020813941955566. With a delay of 0.5 I get an actual delay of 0.2. We’re looking into it!

---

<div class="post-metadata">

**Author:** ![Pkeod](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/pkeod/32/606_2.png) [@Pkeod](https://forum.defold.com/u/Pkeod)\
**Post date:** [December 29, 2022, 9:24pm UTC](https://forum.defold.com/t/defold-1-3-1-has-been-released/70673/11 "2022-12-29T21:24:55Z")

</div>

> [@Mathias\_Westerdahl](#):
>
> We’ve added a `fixed_update(self, dt)` life cycle function to the game object scripts.  
> When using fixed timesteps for the physics, this is where you’ll want to add the forces to your game objects, in order to keep in sync with the physics updates.

Could you offer guidance on how kinematic walker could adapt to this change?

[https://github.com/astrochili/defold-kinematic-walker/issues/8](https://github.com/astrochili/defold-kinematic-walker/issues/8)

> <https://github.com/astrochili/defold-kinematic-walker/blob/master/walker/walker.script>

You may need a newer GPU on Windows to actually observe the issues. I tested with a 3080 Ti on Windows 11 though someone on Linux reported this issue as well. On older macOS version and hardware it looks fine but it may simply because of differences in speed / whatever weird thing vsync has with newer GPUs that’s interacting with physics update (this seems to still be an issue, I still have to tell people to force enable vsync to have our games run reliably on newer GPUs).

I’m not sure how to make it work right so it’s smooth and reliable. Does the script just need to have the physics checks untangled and moved to fixed\_update, or is something else going on?
