# Build when game window is opened takes more time

**URL:** <https://forum.defold.com/t/build-when-game-window-is-opened-takes-more-time/78327>\
**Category:** Bugs\
**Created:** [October 2, 2024, 3:17pm UTC](https://forum.defold.com/t/build-when-game-window-is-opened-takes-more-time/78327 "2024-10-02T15:17:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![partypooper](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/partypooper/32/37111_2.png) [@partypooper](https://forum.defold.com/u/partypooper)\
**Post date:** [October 2, 2024, 3:17pm UTC](https://forum.defold.com/t/build-when-game-window-is-opened-takes-more-time/78327/1 "2024-10-02T15:17:28Z")

</div>

Not sure what is the reason, but when the game window is opened and instead of hot reload you use build or rebuild it takes more time to show game content in the window, meanwhile at this time window is black. Without opened game window it started much faster.

Not sure if it is related, but I have persistent warning `WARNING:INPUT: No gamepad map found for gamepad 0 (keyd virtual pointer). The raw gamepad map will be used.`in the console window. I’m using [GitHub - rvaiya/keyd: A key remapping daemon for linux. · GitHub](https://github.com/rvaiya/keyd) remapping daemon and it seems like defold detects it as some kind of connected gamepad? This black screen is always happening right before this warning. But when I build without opened game window even though this warning is still present window started without this black screen.

Is it possible to not increase debug build time with black screen? (Can you confirm that it doesn’t happen for you?)  
How I can fix mentioned warning?

---

<div class="post-metadata">

**Author:** ![partypooper](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/partypooper/32/37111_2.png) [@partypooper](https://forum.defold.com/u/partypooper)\
**Post date:** [October 2, 2024, 3:21pm UTC](https://forum.defold.com/t/build-when-game-window-is-opened-takes-more-time/78327/2 "2024-10-02T15:21:33Z")

</div>

Also seldom there is error when trying to debug build, when using camera in the collection

```lua
ERROR:SCRIPT: builtins/render/default.render_script:71: bad argument #1 to '__mul' (matrix4 expected, got nil)
stack traceback:
  [C]:-1: in function __mul
  builtins/render/default.render_script:71: in function update_camera
  builtins/render/default.render_script:90: in function update_state
  builtins/render/default.render_script:218: in function <builtins/render/default.render_script:212>

```

---

<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:** [October 3, 2024, 6:54am UTC](https://forum.defold.com/t/build-when-game-window-is-opened-takes-more-time/78327/3 "2024-10-03T06:54:13Z")

</div>

> [@partypooper](#):
>
> Also seldom there is error when trying to debug build, when using camera in the collection

Could you please explain a bit more what you are doing when it happens? You mentioned trying to debug a build. Is it when you hit a breakpoint? Or when you resume again?

> [@partypooper](#):
>
> but when the game window is opened and instead of hot reload you use build or rebuild it takes more time to show game content in the window, meanwhile at this time window is black. Without opened game window it started much faster.

This is the issue: [Loading resources is slow if engine is restarted via editor · Issue #4116 · defold/defold · GitHub](https://github.com/defold/defold/issues/4116)

@jhonny.goransson was recently investigating this issue and there is a draft PR to fix some issues: [Http cache improvements by Jhonnyg · Pull Request #9475 · defold/defold · GitHub](https://github.com/defold/defold/pull/9475)

---

<div class="post-metadata">

**Author:** ![partypooper](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/partypooper/32/37111_2.png) [@partypooper](https://forum.defold.com/u/partypooper)\
**Post date:** [October 4, 2024, 12:07pm UTC](https://forum.defold.com/t/build-when-game-window-is-opened-takes-more-time/78327/4 "2024-10-04T12:07:21Z")

</div>

> [@britzl](#):
>
> Could you please explain a bit more what you are doing when it happens? You mentioned trying to debug a build. Is it when you hit a breakpoint? Or when you resume again?

Sorry, I’m mixing some terms here. Just when building with `Ctrl-B`. It happens more often when you fast close a game window, and then build again. It doesn’t happen too often to be a problem, but can get it few times in a session.

---

<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:** [October 4, 2024, 2:07pm UTC](https://forum.defold.com/t/build-when-game-window-is-opened-takes-more-time/78327/5 "2024-10-04T14:07:33Z")

</div>

> [@partypooper](#):
>
> It happens more often when you fast close a game window, and then build again. It doesn’t happen too often to be a problem, but can get it few times in a session.

Ok, thanks. It seems like there’s an issue when rebooting the engine and perhaps rendering a frame inbetween shutdown and restart when the camera has no view or something… 🤔 If it starts happening more often or if it becomes a problem in some other way please report it on GitHub!
