GUI Overhaul

Anything related to PR, release planning and any other non-technical idea how to move the project forward should be discussed here.
PerryHugh
Posts: 6
Joined: 03 Oct 2019, 19:31

GUI Overhaul

Post by PerryHugh » 03 Oct 2019, 19:58

I want to open discussion on the prospect of redesigning the GUI sub-system.

Reading through the Post 1.0 plans Zinni created gives a good guidance to some higher level concepts like message box design and some lower level parts like the use of records for skinning. I am willing to put in the leg work to make an overhaul happen but I would like input on an overall design to implement.

Overall the Morrowind GUI is actually quite simple, framed windows contain almost everything, raw containers are invisible but used for alignment and structure, everything else is practically skin, position, and some base elements like text or progress bars. The way this is handled now is decent, it allowed the creation of the current GUI but it does not lend itself well to expansion or enhancement (for instance, implementing the XBOX GUI is looking to be a feat of hacking on top of an already existing keyboard navigation hack).

I agree with the idea of using records as a storage for variables related to skinning or content, though positioning I disagree with. We have layout files in MyGUI and they aren't that hard to craft if the system handled them better. I think having types of tags for layout files that offer structures with deterministic properties for layout creation (like an inline list, or a block style list which arranges elements vertically or horizontally respectively) would work well.

I think a console GUI first approach works best, as the PC GUI can be implemented as a simplification of it quite easily. Also, sticking with MyGUI but updating to the latest version would be nice, so many hacks are in place I've seen with comments relating to the current version.

I'm just rambling some minor thoughts, but the goal is I want to hear from more experienced programmers with ideas on how to go about re-crafting the GUI system. It would be great if I can get some feedback with a bit of direction on how I should approach this.

User avatar
Capostrophic
Posts: 676
Joined: 22 Feb 2016, 20:32

Re: GUI Overhaul

Post by Capostrophic » 03 Oct 2019, 21:46

The latest version of MyGUI is still 3.2.2, indefinitely.

PerryHugh
Posts: 6
Joined: 03 Oct 2019, 19:31

Re: GUI Overhaul

Post by PerryHugh » 03 Oct 2019, 22:42

Right, must be old comments or a plea for a new official release. It is still being worked on, but very infrequently. Someone recommended ImGui as well.

User avatar
AnyOldName3
Posts: 1580
Joined: 26 Nov 2015, 03:25

Re: GUI Overhaul

Post by AnyOldName3 » 04 Oct 2019, 00:02

It was me who said Dear ImGui (although I initially spelled it wrong and left our the Dear part because no one ever includes the Dear part), but I no longer think it's suitable - I don't think it can do things like clicking and dragging a component around like the inventory needs, and xyz said the performance isn't great. To be fair, I don't think MyGUI's performance is great, either.

Requirements for a new library are:
  • It's fast(ish).
  • It's easy enough to use.
  • It can actually reproduce Morrowind's GUI.
  • It's flexible enough that we can expect to reproduce the GUIs of later games, too.
  • Ideally it's flexible enough that GUI reworks can be mods instead of built into the engine, but this isn't a hard requirement.
  • It can work exclusively with modern OpenGL (i.e. no deprecated stuff).
  • It can ideally work exclusively with old-ish OpenGL (e.g. no shaders or VAOs).
I think that list is fairly exhaustive, but some points, like it being 'easy enough to use' are pretty vague.
AnyOldName3, Master of Shadows

User avatar
Greendogo
Posts: 1410
Joined: 26 Aug 2011, 02:04

Re: GUI Overhaul

Post by Greendogo » 04 Oct 2019, 08:29

PerryHugh wrote:
03 Oct 2019, 19:58
I want to open discussion on the prospect of redesigning the GUI sub-system.
...
it does not lend itself well to expansion or enhancement (for instance, implementing the XBOX GUI is looking to be a feat of hacking on top of an already existing keyboard navigation hack).
...
I think a console GUI first approach works best, as the PC GUI can be implemented as a simplification of it quite easily.
:D :D :D
Yes, please!

I don't know who here has a copy of Morrowind on an original Xbox, but I've done some research over the years to document the additional GUI elements needed for the original Xbox console interface. I can help you get that information.

User avatar
kust
Posts: 10
Joined: 10 Jan 2019, 14:06

Re: GUI Overhaul

Post by kust » 05 Oct 2019, 23:42

AnyOldName3 wrote:
04 Oct 2019, 00:02
It was me who said Dear ImGui (although I initially spelled it wrong and left our the Dear part because no one ever includes the Dear part), but I no longer think it's suitable - I don't think it can do things like clicking and dragging a component around like the inventory needs, and xyz said the performance isn't great. To be fair, I don't think MyGUI's performance is great, either.

Requirements for a new library are:
  • It's fast(ish).
  • It's easy enough to use.
  • It can actually reproduce Morrowind's GUI.
  • It's flexible enough that we can expect to reproduce the GUIs of later games, too.
  • Ideally it's flexible enough that GUI reworks can be mods instead of built into the engine, but this isn't a hard requirement.
  • It can work exclusively with modern OpenGL (i.e. no deprecated stuff).
  • It can ideally work exclusively with old-ish OpenGL (e.g. no shaders or VAOs).
I think that list is fairly exhaustive, but some points, like it being 'easy enough to use' are pretty vague.
Is it really necessary to move to another GUI library? MyGUI is fine (that's what also scrawl said when asked about possible GUI library change). If there are any concerns about MyGUI's development, you can always make an OpenMW-tailored fork of it (see: openmw/osg). It's MIT-licenced by the way.
Followin' OpenMW's progress everyday since 2011.

PerryHugh
Posts: 6
Joined: 03 Oct 2019, 19:31

Re: GUI Overhaul

Post by PerryHugh » 06 Oct 2019, 03:33

I spent hours scouring for a library that would match the needs and closest that came up was CEGUI.

I have two thoughts:
  • There is a ludicrously scarce supply of GUI libraries
  • MyGUI will suit our uses if the right foundation is laid for it
I agree any problems that come up can be solved by a fork as kust said. Does anyone here have experience designing these kinds of subsystems that could give an idea of what all needs to be available to higher level clients? Kind of looking for a structure to implement.

PerryHugh
Posts: 6
Joined: 03 Oct 2019, 19:31

Re: GUI Overhaul

Post by PerryHugh » 07 Oct 2019, 05:04

Greendogo wrote:
04 Oct 2019, 08:29
I don't know who here has a copy of Morrowind on an original Xbox, but I've done some research over the years to document the additional GUI elements needed for the original Xbox console interface. I can help you get that information.
Your zip file with pictures of the interface just helped me a ton, was about to go ages looking for a picture of the Xbox rest menu then I remembered your post here and browsed to see if you've uploaded them already.

Double post, but had to drop a thank you.

User avatar
kust
Posts: 10
Joined: 10 Jan 2019, 14:06

Re: GUI Overhaul

Post by kust » 07 Oct 2019, 21:15

BlueCop also tried to implement Xbox UI, but there are no updates since his last post.
Here's the topic.
Followin' OpenMW's progress everyday since 2011.

PerryHugh
Posts: 6
Joined: 03 Oct 2019, 19:31

Re: GUI Overhaul

Post by PerryHugh » 08 Oct 2019, 04:47

I've been working with the GUI in a different way today and it is working marvelously. The current system has a keyboard navigation implementation which runs through layouts and gathers a list of all the buttons, then sets one to be a focus point to move from. Selecting is done via faux mouse clicks. In the past I expanded it to include "support" for a special widget used in many places called MWList. This allowed for some poor dialogue navigation and some other menus to start working, but building it out this way (adding widget support over time) is very messy by nature of the system's design itself.

I think keeping this keyboard navigation system intact as a backup may be a good idea, kind of a rudimentary dynamic layout support system. At the same time, I wouldn't mind dismantling it if this new method becomes normal. In essence, instead of dealing with each individual element being marked okay for navigation, each menu itself dictates the gamepad (keyboard) controls to it and manages the highlight state.

Using this method, handling different circumstances of the same kinds of widgets becomes trivial as each menu contains the information needed. Whereas adding support for MWList in the keyboard navigation system allowed for selecting items within the dialogue topics pane, it didn't allow for the more dynamic nature of gracefully handling adding/removing topics or even scrolling. Implementing the topic pane navigation in the dialogue menu itself took only a couple hours and is easy to expand on for handling choices, gamepad input like analogue or triggers for scrolling, etc.

I'm not suggesting this way of building GUI navigation is ideal, honestly I don't think listening for key presses in the menu and responding accordingly is. However, I think this method will allow for a smooth enough transition to a functional controller GUI experience relatively quickly. From there, switching libraries or rebuilding the GUI infrastructure itself would be a target.

If you are interested in reviewing what this looks like, the shortest example is the rest/wait menu control in commit 0e159a2b
kust wrote:
07 Oct 2019, 21:15
BlueCop also tried to implement Xbox UI, but there are no updates since his last post.
Here's the topic.
I've seen that, I found him on a homebrew forum for the Nintendo Switch. It seems he was trying to get the GUI layout to work but ran into issues with keyboard navigation (the very reason I am so focused on getting that to work in the current GUI before I start the XBOX layout).

I didn't contact him there because I really don't like making accounts on websites. Though his layout files would surely be appreciated if he ever comes back, shame he didn't push them.

Post Reply