GUI system for in-game menus

Problems building or running the engine, queries about how to use features etc.
slapin
Bronze Sponsor
Bronze Sponsor
Posts: 250
Joined: Fri May 23, 2025 5:04 pm
x 16

GUI system for in-game menus

Post by slapin »

Hi, all!

I need end-user GUI system for basic dungeon crawler RPG (like TES:Arena or Daggerfall) i.e. inventories, stat menus, dialogue system.
I was using Ogre's bundled Dear ImGUI for that all and it mostly works but needs too much manual control for more complicated cases like
different display sizes/resolutions, so I'd like to find some GUI system which will save me from manual tracking of screen coordinates.
I'm not an artist so I'd like to see things not too complicated. When I tried MyGUI I found it overcomplicated to use lacking documentation and general quickstart options which ended up as major road block for me. (i.e. I was not able to even start with it).

So I wonder is there some experience with taming Dear ImGUI into end-user UI for games and/or is there some non-frustrating way to start with MyGUI + OgreBites in cross-platform way?

paroj
OGRE Team Member
OGRE Team Member
Posts: 2238
Joined: Sun Mar 30, 2014 2:51 pm
x 1217

Re: GUI system for in-game menus

Post by paroj »

I guess anything but imgui is going to be infuriating to work with - however it will be a hassle to get imgui pretty.

Its not impossible though. See e.g.:
https://github.com/ocornut/imgui/issues ... 2841577387

As for other options, both Torchlight and OpenDungeons used CEGUI:
https://opendungeons.github.io/

slapin
Bronze Sponsor
Bronze Sponsor
Posts: 250
Joined: Fri May 23, 2025 5:04 pm
x 16

Re: GUI system for in-game menus

Post by slapin »

Tried CEGUI and was unable to compile it for current Ogre 1.x it looks like Ogre support there is either outdated or 2.x or 3.x-only...

paroj
OGRE Team Member
OGRE Team Member
Posts: 2238
Joined: Sun Mar 30, 2014 2:51 pm
x 1217

Re: GUI system for in-game menus

Post by paroj »

Use the v0 branch

slapin
Bronze Sponsor
Bronze Sponsor
Posts: 250
Joined: Fri May 23, 2025 5:04 pm
x 16

Re: GUI system for in-game menus

Post by slapin »

paroj wrote: Thu Sep 04, 2025 1:37 pm

I guess anything but imgui is going to be infuriating to work with - however it will be a hassle to get imgui pretty.

Its not impossible though. See e.g.:
https://github.com/ocornut/imgui/issues ... 2841577387

As for other options, both Torchlight and OpenDungeons used CEGUI:
https://opendungeons.github.io/

You convinced me to try with Dear ImGUI some more...

User avatar
sercero
Bronze Sponsor
Bronze Sponsor
Posts: 535
Joined: Sun Jan 18, 2015 4:20 pm
Location: Buenos Aires, Argentina
x 198

Re: GUI system for in-game menus

Post by sercero »

I'm suprised you had trouble setting up MyGUI.

The Wiki has a good explanation.

Anyway, from what you said MyGUI won't be a good fit since it does not have automatic scale.

You have to create different layouts for the possible screen sizes.

slapin
Bronze Sponsor
Bronze Sponsor
Posts: 250
Joined: Fri May 23, 2025 5:04 pm
x 16

Re: GUI system for in-game menus

Post by slapin »

It is less about scale but more about support for anchors/relative layouting where you can say "this panel goes up, this one goes to side and this one is centered" and the ability to understand that this much elements won't fit so display less, wrap a bit or add a scrollbar... These pixel-based GUIs are so hard to manage... ImGUI does not support the proper layouting too but it has the in-widget support for that as long as top-level things are handled, which is good.
I think MyGUI should support at least some of these features, but it is so complicated to use it is hard to get that far...

slapin
Bronze Sponsor
Bronze Sponsor
Posts: 250
Joined: Fri May 23, 2025 5:04 pm
x 16

Re: GUI system for in-game menus

Post by slapin »

sercero wrote: Sat Sep 06, 2025 1:31 pm

I'm suprised you had trouble setting up MyGUI.

The Wiki has a good explanation.

Anyway, from what you said MyGUI won't be a good fit since it does not have automatic scale.

You have to create different layouts for the possible screen sizes.

Do you have any suggestions for GUI system? I will need to make UIs similar to Arena/Daggerfall, common RPG menus (text notes, stats, invemtory, dialogue, etc., nothing fancy but should work on different screens, even ones I can't test myself).

rpgplayerrobin
Orc Shaman
Posts: 788
Joined: Wed Mar 18, 2009 3:03 am
x 447

Re: GUI system for in-game menus

Post by rpgplayerrobin »

For my game I made my own from the Gorilla UI version.

I had to make an atlas combiner (to get all UI into one single texture in order to get as few batches as possible with Gorilla).

Then I basically made all widgets I wanted (text, image, button, slider, combobox, color selector, etc, which took a long time, but I learned a lot about UI).

Then I made an importer of the UI elements, one file per screen using simple xaml code, since a xaml UI editor is included with Visual Studio, it makes it much easier to not have to use a separate program for it.

With full control, I made it so UI elements or section of UI elements could anchor towards certain directions (center, left, right), which makes them work in any resolution (easily controlled by just resizing the window, since that also reloads all the UI for my game).
The funny thing is that the anchoring is not needed to be at the top or bottom, only center, left, right is enough actually.

I also chose to make the UI look exactly the same on any resolution with the same aspect ratio.
For example, if you use 2160p in Windows compared to 1080p, your icons and start menu bar will be extremely small on 2160p, since all elements are "pixel-perfect" and will not scale up.
That is also what a lot of games do, like Age of Empires 2 DE, which makes the UI very, very small on higher resolutions, which is in my opinion pretty bad.
So I skipped that completely and just scale the UI to look exactly the same on any resolution instead, but that does require some more testing with the UI texture elements, since you can then no longer have pixel-perfect UI.
But for my game, it works perfectly even with that limitation.

slapin
Bronze Sponsor
Bronze Sponsor
Posts: 250
Joined: Fri May 23, 2025 5:04 pm
x 16

Re: GUI system for in-game menus

Post by slapin »

I really don't want to be so much dedicated to GUIs yet, will do something ad-hoc first and then extend form that...
I just want to avoid major road blocks in future like inability to display images, etc.

slapin
Bronze Sponsor
Bronze Sponsor
Posts: 250
Joined: Fri May 23, 2025 5:04 pm
x 16

Re: GUI system for in-game menus

Post by slapin »

Looks like Dear ImGUI supports dynamic fonts only since 1.92 which is not integrated into Ogre yet, so it looks like I'm back to start point of looking for game GUI...

slapin
Bronze Sponsor
Bronze Sponsor
Posts: 250
Joined: Fri May 23, 2025 5:04 pm
x 16

Re: GUI system for in-game menus

Post by slapin »

After debugging through hundreds of crashes and reading through misleading AI-generated docs I finally made multiple fonts work. So now ImGUI does all I need from it for now...

slapin
Bronze Sponsor
Bronze Sponsor
Posts: 250
Joined: Fri May 23, 2025 5:04 pm
x 16

Re: GUI system for in-game menus

Post by slapin »

But there is still a question of displaying images in ImGUI. I know it can be done but the question is how? I know that it should magically work if I provide proper ID to the function but I found no way to get that ID yet...