Adventures with Defold and the desktop

Hi! I’ll start by saying that I love Defold, yet this will be a compounded rant about desktop support. Most of the bugs mentioned in this post are already reported, but I think it’s valuable to index them in one place along with my suggestions for better desktop support.

While working on our game, which is mostly desktop-first, we’ve found that there are several things that are blocking (or worsening the experience of) an eventual desktop release of a Defold game:

Fullscreen

Fullscreen support on desktop builds simply put, doesn’t work. Any attempt of entering full screen kills the mouse (DEF-1619).

Furthermore, even where there’s supported, it’s not done with the right UX.

Ideally, we should be able to enter / leave fullscreen at runtime or at startup based on user preferences. The only place where this somehow works is on macOS, where you have a full screen option in the app menu bar. A game.project setting is fine for the time being, though, considering that most of the time you want the final build to be full screen anyway.

What I’m a bit against, though, is changing the resolution of the screen for the sake of the game. This generally causes issues on both Windows and macOS. I’m not saying for that option to be removed, but a lot of games use “Fullscreen (Windowed)” now, which basically means creating a borderless window at the native resolution of the screen, then rendering the game to a smaller render target and upscaling it to fill the screen. Having that option (especially on macOS, where capturing and changing the resolution of the display results in not being able to Cmd-Tab out of the game anymore), would be amazing.

Windows and touch

A coworker has a Lenovo convertible laptop with touch. Many Windows computers are like that nowadays. Unfortunately, the windows build doesn’t support touch (DEF-1705) and doesn’t fallback properly to emulating a mouse.

Fortunately, on the web version touch works (haven’t tried multi-touch, as we’re just handling MOUSE_BUTTON_1), but even there we had to do all sorts of CSS tricks to disable selection and all the other default touch gestures. The only way this fully worked was with Electron:

Electron

Of course, we initially had some small issues, but this proved to be the only reliable way to get both decent full screen support and a playable build with touch on Windows in a self-contained offline app. It’s a bit funny, but this is how we’re showing off our game at conferences now, where internet access is scarce and fullscreen is required.

6 Likes

I agree fully with all the points you bring up!

Both “modern” fullscreen alternatives and of course fully functioning input on Windows is a must for desktop games. As you said, they have been reported previously so we are aware of them, they are in our backlog. :thumbsup: The upcoming sprints/releases don’t appear to have them prioritised, but we need to start giving our desktop builds some extra love soon.

One consolation could be that our native extension support is coming along nicely, and if I’m not mistaken at least the fullscreen feature is something that could be solved in an extension. :slight_smile: Regarding touch input on Windows, which I would say is a bug on our side, should be given a higher prio as soon as we are done with native ext.

5 Likes