It has been some time since I last update this blog, but I promise there was a reason.
Since X-Plane 11.10b1 came out, it was the perfect time to start experiment and implement its new features.
After reading the new SDK examples I started testing and building a simple UI.
Very fast I reached the point were I found that the old issues we had prior to 11.10 are still there. Meaning, fonts management is lousy. Fonts has one size which makes it hard to read.
Since few years back I read some info on TTF baking and such, I decided to try my luck.
My first attempt was to load TTF fonts into memory (using stb_fonts library), make a texture out of them and then print to screen.
But not as I expected, * sigh *.
The font did display itself, but it was flipped, as if mirrored in water. I tried playing with the viewing projection but that did not solve the alignments of the characters. Here is an example:
Since I reached a dead end, I had no idea how to re-project the font texture correctly, I moved to plan B. Search the net.
I searched for libraries that will give me a simple 2D UI interface based on OpenGL.
I stumbled upon few interesting libraries, such as "TurboBudger" and "Dear imgui" but then I found "Nuklear". A one file header library that used techniques from "imgui" but store everything in one neat header file. No dependencies to other libraries (all stb_xxx code has been implemented in same header as far as I understand) and you can use your own code/alternatives for certain implementations (like image load).
Overall, I was impressed with this library potential, my only problem was the lack of documentation, well there is some documentation but as detail comments inside the code, it is probably OK for seasoned programmers, but not easy for a casual one like me.
It took me few days to implement Nuklear and many trials and errors until I was able to provide it with the right data it needs to self handle itself. My only bump so far is related to scroll-bars, I have no idea what it needs for scroll-bar to work, so I adapt a no scroll-bar interface, as I sometime say: if you can't win them, workaround them.
My goal is not to have a [complex] UI for Misson-X but a simplified and functional interface were it is easy to read and get a long.
Worse, my "hard work" these past weeks, will probably need to go to the bean, once LR will move to pure Vulkan/Metal.
My expectations, and I wrote Tyler my concerns, is that LR will prepare a cross platform SDK that will give us developers a building blocks to build UI for X-Plane and it should work on all supported OSes.
From [my] point of view, that is the correct approach from day one, but since LR have their own priorities, I can just hope that [they] will listen to reason and won't publish their Vulkan/Metal builds without good UI foundation for their developers.
Here are images from the new Mission-X UI, I borrowed few ideas from FSW to make it simpler.
I hope that all interaction with the plugin will take place through one screen.
The first screen, when there is no running mission, is the mission pick screen. In each screen you can see only 4 supported missions and a thumbnail with few words regarding the mission (like the name). Currently you only see three images, because the 4th is a work in progress that I use for testing and maybe for my document.
(The designer is responsible to prepare that image, I'll prepare a boilerplate).
I used FSW as a guide line to these screens, but in no way it mimics them, FSW has a talented team which push their UI and their sim in interesting directions.
You can see the type of plane, difficulty, recommended setup and the "story" behind the mission.
If you are satisfied, you can press the [LOAD] button.
Pressing [Back] will bring you back to the "Mission picker" screen.
If you want to start the mission then just press [START] and you will be positioned at the starting location of the mission or you can still cancel the mission, by pressing the [Back] button, which will take you back to the "Mission picker" screen.
The Nuklear library really allow me to concentrate on the plugin, it free my time so I'll be able to go back and actually work on the plugin itself.
Currently I'm still finalizing the UI for alpha build, and it might change in the future. I also need to finalize save and load, not sure it will make to first alpha public build.
I hope to share the first public alpha soon but I need to work on documentation and tutorials and I do not have much time, which can push the first publication back for few weeks.
As you all have seen, there are some fundamental changes to the "mission packaging" and file locations. Nothing is set in stone. I'll publish the new changes on later date.
In any case, if you have any questions, suggestions or requests, please do send me an e-mail.
Until next time