Live data from Hacker News

Making Advanced GUI Applications with Godot

medium.com

241–250 of 259 posts

Re: Making Advanced GUI Applications with Godot

#241

Not familiar with godot, but the GUI reminds me a lot of the blender GUI. I always wondered if the devs would ever spin out that GUI so that it became a library, because it always felt blazingly fast compared to e.g. Qt or GTK

there's this project

https://github.com/julianeisel/bWidgets

Re: Making Advanced GUI Applications with Godot

#242

Does anyone know if Godot can play a live video stream with graphics drawn on top?

I think that's possible.

From a quick search there's this: https://docs.godotengine.org/en/stable/classes/class_videopl...

(But that may not be a live stream, necessarily, I guess.)

Also there's this that may be relevant: https://docs.godotengine.org/en/stable/classes/class_spatial...

The latter is documented as:

"""

[...] enables the "shadow to opacity" render mode where lighting modifies the alpha so shadowed areas are opaque and non-shadowed areas are transparent. Useful for overlaying shadows onto a camera feed in AR.

"""

Re: Making Advanced GUI Applications with Godot

#243

Earlier quoted context omitted.

> designing UIs anywhere outside the code will eventually bite you. With Godot it is possible to design the UI in code--the editor itself uses that approach, e.g.: https://github.com/godotengine/godot/blob/27d12092821df77a61... > you can practically throw your version control system out of the window for UI files. While not "perfect" with VCS (there's a bit of automatic-generated file content churn at times), Godot s…

I see what appears to be hard-coded widget positions (margin_left = 202.0). I find that hard-coding positions in desktop applications prevents layouts from adapting to different languages, font sizes and window dimensions. (Like how many Windows dialog boxes won't resize). Is this how Godot works, and is it a problem?

Godot encourages use of "Containers" for layout, which adapt to sizing/content on the fly: https://docs.godotengine.org/en/stable/getting_started/step_...

While it is possible to hard-code widget positions, with the Container-based layout method the values in that file actually get completely ignored & recalculated on the fly.

The fact that the values end up in the file at all is something I consider a bug/implementation flaw.

In Godot a UI Control has an "anchor" setting for each of left/right/top/down margin which affects where the margin value is measured from in relation to the bounding box. So (hand-waving a bit here), e.g. for, say a margin value of 10px, for the left margin an anchor value of 0 means "inset 10px from the left margin of bounding box" and with anchor value of 0.5 means "move left 10px from center of bounding box" and with anchor value of 1 it calculates relative to the right-most margin. (But for right margin an anchor value of 0 means "calculate relative to right margin of bounding box, and, somewhat confusingly, I think requires the value to be negative to "inset".)

What this means in practice, is that if you use an anchor value of 0 for all margins, even when you resize an element you don't need to adjust any of the margin values.

Unfortunately Godot (and Containers--even though they re-calculate all the margins themselves) default to an anchor value of 0 for left margin and 1 for right margin which means the right margin is a non-zero value & gets re-calculated & updated/save every time you adjust the layout.

In general the layout system works pretty well & is flexible but it does have some slightly confusing aspects (and in the past at least some implementation bugs) and is somewhat difficult to explain in text. :) (And it would definitely benefit from even more detailed documentation--than what it currently has--in terms of the "sizing flags" that determine how multiple Controls occupy/share the space available.)

So, in short: Once set up correctly, Godot UI layouts generally adapt well to different text-widths, font sizes and window dimensions.

Re: Making Advanced GUI Applications with Godot

#244
post #41
post #34

How well does godot support dynamic/programmatic layout (w.r.t odd aspect ratios and resizing), localization, and accessibility? I'd also take issue with the notion that 2D UI frameworks based on game engines are more performant than their alternatives, because game engines are optimized for 3D graphics and often struggle with performance once your UI state becomes reasonable large.

> How well does godot support dynamic/programmatic layout (w.r.t odd aspect ratios and resizing), Very well (it's a game engine) > localization, and accessibility? Poorly and not at all. Godot has a student adding PO files: https://godotengine.org/article/gsoc-2020-progress-report-1#...

I'm not sure that "poorly" is an entirely accurate description of Godot's localization abilities.

The GSOC project you linked to is about enhancing the existing .po based feature: "In Godot, we [already] have two ways of importing translation - by using CSV or PO files."

Here's a blog post about someone's experience doing a translation for a Godot game: https://sites.miis.edu/vprolow/2019/12/15/godot-game-localiz...

And here's an official tutorial: https://docs.godotengine.org/en/stable/tutorials/i18n/intern...

Re: Making Advanced GUI Applications with Godot

#245
post #34

How well does godot support dynamic/programmatic layout (w.r.t odd aspect ratios and resizing), localization, and accessibility? I'd also take issue with the notion that 2D UI frameworks based on game engines are more performant than their alternatives, because game engines are optimized for 3D graphics and often struggle with performance once your UI state becomes reasonable large.

> How well does godot support dynamic/programmatic layout

It supports this through use of its "Container" UI Controls--which have a bit of a steep learning curve but works pretty well.

> I'd also take issue with the notion that 2D UI frameworks based on game engines are more performant than their alternatives, because game engines are optimized for 3D graphics

One aspect of Godot that is a bit different in this regard is that pre-3.0 the focus was very much more on the 2D side of things, so the 2D support isn't just "a flat 2D plane in a 3D world" unlike some other engines.

Re: Making Advanced GUI Applications with Godot

#246
post #11

JUCE is another option one could explore for cross platform non-web UI. It's generally used to make audio apps and plugins, but these require UIs are after all. I'm fairly certain the first versions of Ableton Live were made with JUCE, I'm not so sure about the later ones. MaxMSP is also made with JUCE. https://juce.com/

I looked into JUCE a while back when I was keen to find a good cross-platform UI solution but was put off by the licensing aspects that seemed more complex/onerous than even Qt's. YMMV.

Re: Making Advanced GUI Applications with Godot

#247
This is an area I've been actively exploring and think has real potential.

For context, my interest is in:

* Cross-platform support.

* Ease of distribution.

* Ease of construction.

* Platform stability.

* "Licensing"/business issues.

* Accessibility.

In the past I've used Qt w/ C++, Qt w/ Python, web w/Python backend, Python w/embedded web server and dabbled/looked into things like wx etc. (Oh, and, MS Access with VBA. :D )

# Platform Native UI

If you want/need Platform Native UI, then Godot is not going to work for you, period. But neither are most of the other cross-platform options because if they're only 95% they're not native. My impression is that if you want platform native and cross-platform then per-platform clients w/shared backend implementation is pretty much required.

But I also think that platform native (as much as I might like it) is not necessarily mandatory for successful product, see, e.g. Slack.

I think the key around this is once you've chosen to not be platform native don't pretend to be platform native. Lean into making the UI tailored for your application.

And with a game engine there's a whole lot of space to lean into in this regard--particularly in relation to visualisation.

If you're happy with 95% and don't care about any other aspect then likely Qt will be a contender for you.

# Ease of Distribution

Trying to distribute a Qt + Python app as a single binary (within the last 2 years) was how I ended up ditching Qt & using an embedded web server instead. Despite all the effort & projects trying to make this work, IMO it still doesn't.

With the small initial Godot download and, a (admittedly half gig) "templates" download containing the cross-platform app "shells", it's possible to export to Windows, Mac, Linux, iOS, Android & HTML5. Depending on the platform the output might be a single binary, a disk image, zip file or binary + support files but where required traditional packaging tools can also be used.

This is really powerful for me (as both a developer & user) when the platforms I use (primarily Mac/Linux) are not in the majority & frequently get left out of releases.

# Ease of Construction

In relation to games, the highest praise I have for Godot is:

* Since I downloaded Godot I've actually made and released games.

I've found the integrated nature of the IDE really supports iterative development.

Game-making is often a very collaborative effort and because Godot has been developed (in part) to enable non-developers to not have developers be the bottle-neck it has visual-based tools & a node/component based architecture which also can make it a powerful tool for other technical but "non-developer" people.

# Why not use web technologies?

If your project makes sense as a web site then, make it a web site.

If you want to have a standalone app, you have experience with web technologies and memory/performance aspects aren't an issue, then, sure build it on Electron.

But if you can do those things, you can almost certainly use GDScript and gain the benefit of an integrated IDE and comparatively tiny downloads. (And still export it to HTML5/WebAssembly--admittedly currently probably with a slower initial page load time--but it's still an option.)

Additionally, currently Godot runs on older OS (e.g. even back as far as Mac OS 10.9) than Electron does which keeps getting dragged along to newer versions by Chrome's requirements which seem to place little emphasis on supporting older machines/OS.

# Why not Qt?

Ah, Qt, I really want to like you.

If Qt works for you, then use it.

But my experience with Qt has been one of a business that continually seems to struggle with how to survive; tries to stretch their license compliance in terms of LGPL & contract with KDE to breaking pointing (because, really, they wish they didn't have that constraint at all); and, a continual churn of the underlying technology that results in apps that only support newer & newer OS/Qt versions even if they don't require anything more than, say, Qt 5.2.

If you're a big corporate and/or if a 95% cross-platform solution is enough, then I think there's still situations where Qt probably makes sense but in terms of my niche desktop application development needs it's just too much hassle.

# Is Godot ready for applications now?

Somewhat. Obviously if your application is a game & the required feature set matches Godot's, then yes. :)

Based on my own experience using Godot to develop non-game applications tends to run into some areas of its feature-set which have seen less attention & so have bugs, lack features and/or lack documentation. (e.g. complex Tree controls, more sophisticated font rendering (e.g. kerning), very complex layouts.)

Overall, I think Godot is at a stage where a bunch of people (including OP) have realised it has potential around non-game application development but also has some rough edges in that regard that still needs to be improved.

Given the size & focus of the development team up to this point that's not surprising but I'm excited to see where it may go in future.

# A Note on Accessibility

As mentioned elsewhere in the comments, Godot also unfortunately doesn't currently have a great accessibility story.

There is at least at least one project that I know of that is working on improving that: https://github.com/lightsoutgames/godot-accessibility/

In addition, Godot's node-based UI system in particular I think lends itself to retro-fitting better accessibility support more than a different architecture might.

But if you need your app to be accessible today then Godot probably won't meet your needs.

# Bonus: Are InfoSec tools a potential niche for Godot-based apps?

I think that's a strong...maybe. :)

To explore the potential of Godot for non-game apps I've been working on developing a Godot-based hex viewer/editor with a focus on binary/format reverse-engineering & visualisation motivated in part by a talk where someone complained that hex editors hadn't done much new for years.

Early in development I realised that InfoSec has a combination of aspects that might make it particularly well suited for Godot-based apps:

* Many people who are technically skilled but consider themselves "non-developers".

* Has problems to solve that benefit from new forms of visualisation (often with large amounts of data) not met by standard UI.

* Has an affinity for flashy visuals. :)

* Need tools that don't only run in the cloud.

(In InfoSec and want to make this happen? I'm available for hire. ;) )

Re: Making Advanced GUI Applications with Godot

#248
post #215

Earlier quoted context omitted.

> Qt is the best I've seen, but it has the normal c++ FUD Not sure what you mean exactly; C++ is complex, but why the fear and doubt? Also - Qt is based on veeery old C++ - a 22-year-old standard. The language has changed significantly since then, while Qt's fundamental design (in terms of programming) - not really, or not much. So, Qt is not "normal C++" these days.

Simply add https://github.com/woboq/verdigris so you can use C++ ≥ 14.

The moc is not the issue. The biggest design problem with Qt is that it predates move semantics. That history affects the design of almost every class.

It feels like a beautiful old walking path that detours around a wall that's long since been torn out. It's still fine... but... it's not how you'd design it if you were to start from scratch.

Re: Making Advanced GUI Applications with Godot

#250

If you want to use this in a business, either for an internal tool or for an application you sell, this is a horrible idea. Godot doesn't display native widgets, so it has no support for accessibility, for example to screen readers and blind users. Some people think blind people bring too little profit to care, but this is wrong for one single reason. There are some laws mandating accessibility, and more laws are bei…

It's fair to identify accessibility as an area where Godot is currently lacking.

In addition to the tracking issue mentioned elsewhere, I'm also aware of this project which has the goal of improving accessibility within Godot--both for playing games made with Godot and also for making games in Godot (which is one benefit of the editor being built with the engine itself):

* https://github.com/lightsoutgames/godot-accessibility

* https://github.com/lightsoutgames/godot-tts

Post reply on HN