So I have been talking about the possibility of switching GUI libraries, again (sorry). Mainly because of a few really hard to fix issues (that no one has offered to solve, so I would have to spend a lot more time on them):
This is the same issue as above:
There are some problems with HTML and/or CEF:
So while making GUIs with HTML and CSS is more approachable than CEGUI where there is really no up to date information about it anywhere and there are really arcane properties you just have to know to do some thing, there are some technical problems with it. And of course there is the performance aspect as it takes about a second to startup the GUI and it takes a few hundred megabytes of extra memory and probably cause more CPU load than other GUI solutions. And the release is 100 megabytes bigger because of including it.
So I’d like to hear some opinions about what is the best way forward. For now until this is solved I also suggest that we refrain from doing a lot of work on the GUI as if we change the GUI library the GUI needs to be redone anyway and that is a good opportunity to redesign it completely.
Here’s my thoughts about the situation:
I feel like the issues with CEF are really, really hard to solve and once the game is stable enough that many players would reach multi-hour gaming sessions, it will (almost) be an absolute show stopper that the GUI just stops working completely after an hour. And I’ve already had very arcane problems with it in the past (https://magpcss.org/ceforum/viewtopic.php?f=6&t=16313). And from having experience with CEGUI it isn’t much better in terms of weird font height issues, crashes due to bugs in their font implementation and the overall large amount of different configuration files needed to make it work. And CEGUI development has been recently pretty much on hold.
I haven’t used MyGUI, which is probably the only other as portable GUI library that might suit our use.
And then there are a few random unknown GUI libraries but I don’t think they have a very good chance at being overall better than what I have tried. But feel free to suggest good ones if you know of any.
Finally we get to what I think is the solution: writing a GUI library myself. This is in many ways not optimal and has some issues that I need to resolve before I can get working, namely per object clipping with Ogre 2.1, proper z-ordering, and a good approach to text rendering (I’ll probably have to use FreeType and atlas textures). But if I get around those then the only problem left is that it is just very time consuming to make a good GUI library. It would be heavily integrated to Leviathan so I can save a lot of time compared to writing a really general library.
So here would be the main design points for the new GUI library, which should make it the easiest it can be for artists to make prototype GUIs in engine instead of just drawing impossible things (I’m kidding about the impossible part):
- Well integrated editor right in the engine. So at any point you could just hit F10 and enter GUI editing mode allowing you to directly just drag the GUI elements around, hopefully making it very easy for non-programmers to make GUIs
- Powerful resizing modes for the GUI elements to automatically fit almost any screen size
- Composable widgets (so making new widget types from existing ones with ease)
- All GUI scripting would be with AngelScript and the GUI objects would have simple exposed methods to make scripting the logic easy. And we can reuse the existing GUI updating logic with event listening support in the GUI
I’m not going to start on any of this (other than the basic research, I’ve already read many hours about font rendering) right now, but hopefully soon. I think it would also be possible to have a period where some GUI views could use CEF and some could use my new system to reduce the amount of initial problems.
This got pretty long but I hope at least someone reads this.