Commit 06744fff

– Add basic scenario list to main menu (WiP)
– Make the scroll button ratio for the dynamic row container .. dynamic as well
– Fix container-in-container case in the dynamic row container
– Always re-calculate the visible child indices when clearing and adding child elements
– Enforce a 16:9 ratio to make UI elements draw more predictably

Relates to #86

Hi! It has been quite some time since the last commit/post, this is mostly due to two factors: I was quite a bit distracted in my free time and, as always, working on UI code tends to get somewhat messy.

While the first factor was definitely a big one, it was worth noting that I stumbled over quite a few issues, which can be seen by the sheer number of separate issues addressed in this commit. The biggest ones of these were definitely certain shortcomings in the DynamicRowContainer class, so far mostly used in the very specific use case in the main content area on the right hand side .

While that in itself is no problem, it also made me do some assumptions about how to scale some things – also it was not the most dynamic (there is a certain irony given the name of the class) use case. The biggest and by far most frustrating problem was the missing support for having containers as child elements in the dynamic containers.
This was no issue when a simple non-container element was used (like the buttons when buying an object), however when a container was used instead, the reported number of active widgets and the amount of model data did no longer match, as fetching the actual model data in fact did work as expected.

The fact that these two numbers much however is one of the assumptions made by the renderer to determine if it can already draw the UI or if it has to wait until the synchronisation from the main thread (which will modify the UI data) to the render thread (which takes the provided data and turns it into something that can be shown on screen using Vulkan) is done. In this case, the synchronisation was already done, it simply didn’t return all the element it should have, leaving the renderer to draw no UI.
To make this extra frustrating, while in menu mode, there is nothing but UI, leaving me with a blank black screen. The issue it self once identified was fixed withing minutes, tracking it down however lead me on a wild goose chase of dead ends. Oh well.

This very bare bones list is the result of all that, please also note that OLives now enforces a 16:9 screen ratio, as the number of UI issues arising from this being freely changeable were simply too many.

The selection is not done yet, I’m not quite sure how much information about each scenario to show here (besides simply the title, as it is the case now). It is also still very much work in progress as there are some remaining issues that need to be ironed out. Feels good to finally have something worth committing again.

So until next time, definitely not with such a big gap in between. Byeeee 🙂

Commit f3973a85

– Add support for object-in-object logic in snapshots
– Fix visual glitch when deactivating light sources inside rooms
– Fix order in which to reset some data structures when starting the simulation
– Add support for setting the active state (of objects that are togglable)

Resolves #83, #84

Hello! This commit wraps up the snapshot format, at least for now, as the upcoming (TBD) saving mechanics may need some further work on it. However, I’m pretty pleased with how things turned out for the time being. For example take this screenshot of the current version of house1.json:

The astute observer will notice the two agents currently sitting on the couch (leveraging the object-in-object mechanics) as well as the lamp being in the inactive state. Both of which can be defines as follows now:

Unexpectedly there were also some issues which needed urgent fixes, that was luckily a lot easier than I had originally thought. One of them was introduced recently as part of the object support in the snapshot format, the other one was a bit more weird, as there were rather ugly artefacts when turning off a light source while it is inside a room. This bug had to have been around for quite some time, but apparently somehow went unnoticed.

Next up will be the ability to actually select the scenario from the menu. Byeee 🙂