This is a quick YouTube video in which I talk about Dorian, my second-generation graphics engine that will power Sojour 2.
Work is still underway, but I wanted to discuss how Dorian fits into Sojour 2’s development roadmap and showcase some of its features when compared with Ionian, Sojour’s current graphics engine.
I’ve posted this video on my other YouTube channel, as I suspect most visitors to the Sojour channel are there to learn about the VTT rather than the inner workings of a home-made graphics engine.
This will likely be my approach going forward until development of Sojour 2 begins in earnest.
To clarify things with regard to Sojour 2, every Sojour customer will get it for free when it’s done.
Dorian now supports PBR (Physical Based Rendering)!
The graphics engine for Sojour 2 has had two quite large enhancements made to it.
Firstly the lighting and materials rendering system now uses Physical Based Rendering (PBR). This is a rendering technique that uses approximations of actual lighting physics to produce more natural lighting.
The other advantage of PBR is that it can simulate practically any material that you can think of with the correct textures and setup.
For example, the sphere shown above is actually a smooth sphere, but looks rocky thanks to the textures below combined in magical mathematical PBR ways:
Dorian now accepts many texture types to support its material modelling.
Here is the same sphere with different textures and materials applied, as you can see, it’s totally smooth!:
Applying different materials to anything is a doddle!
Even where a model has no textures, like the TIE Fighter for example, you can easily change its look on the fly:
I’d like a TIE fighter please Sir! But in Chrome!
The next huge undertaking was removing DirectX from the engine and keeping it completely separate:
DirectX-11 has now been separated from the Engine!
It was a huge job, but it is necessary to allow the engine to support other backend renderers such as DirectX-12 or Vulkan.
This was a huge undertaking as all aspects of the system got altered to support a more abstracted means of rendering.
What makes writing a graphics engine difficult – apart from the complexity – is ensuring performance is not compromised by code changes such as the refactor above.
The amount of code changed to separate DirectX-11 was staggering and the initial performance results were not too good (all graphs measure the scene you see above):
Whilst the new one held 120 FPS (my TV’s refresh rate) – it took a noticeable dip in performance for 1% and 0.2% lows.These are frame times. Lower is better and you can see that the newer version’s performance really falls away compared to the pre-DirectX separated version. It also has a ton of random spikes in frame time. (Frame time is a better measure for performance)This graph really brings home how much worse the newer system was in terms of performance.
Detailed performance measurements when creating a graphics engine are critical. It’s almost impossible to see the above differences by eye – so you must take the measurements before and after each change.
In this case I traced the problem to the fact that material caching had been broken by the refactor. After around a day of coding, everything is now back where it should be (and in fact a little better than it was!):
Much better! In fact we are now performing a little better than the original system!The new version produces lower frame times across the board! The only thing left to investigate are the occasional big spikes.For smooth frame times the newer Direct-X system is way better than the old one! Quite amazing given how much more complex the new version is!
This is one of the reasons why engine development takes so long. You aren’t just writing code that works, you are also writing code that’s highly performant!
I’ll leave you with a You-Tube video showing everything in motion. As usual, the smooth framerates never seem to translate well on You-Tube. If you look carefully, you’ll see me toggling the TIE Fighter to chrome and back!
Dorian in action!
Still a long way to go, but we are getting there.
I know writing Dorian seems like a diversion, but Ionian which is the engine used in Sojour cannot be used in conjunction with the latest technologies hence the re-write. (To be fair, Ionian lasted over twenty years, so it has had a great run for its money!)
Today I wrote the shaders that model the way glass behaves.
Dorian is already coded as a PBR sorted, multi-pass renderer, so incorporating the new glass system was pretty trivial.
In previous videos, the TIE Fighter’s “glass” was simply represented by non-rendered gaps in the geometry. Now those panels are rendered as actual glass.
The glass calculations include almost everything except refraction which is a rendering feature rather than a shader feature.
Fresnel and environmental reflections!
The effects of the glass shader are quite subtle in a still image, but if you look carefully, you can see them.
The video below shows the TIE Fighter moving around, which helps demonstrate the glass modelling in the external views. Alas, the internal view has no glass modelling because the author of the model did not include any internal glass geometry.
Concentrate on the left and top panes, and specifically on the TIE Fighter’s glass panels, both on the canopy roof and on the front windows.
I took a month off to pursue other hobbies and have now returned to continue work on Dorian, Sojour 2’s new graphics engine.
Dorian is needed because Sojour 2 will use Microsoft’s latest .NET framework, and that framework comes with a development environment that can only compile 64-bit applications. Alas, Ionian, the graphics engine used in Sojour 1, is only 32-bit, hence the need for a new engine.
On the plus side, Dorian can render to multiple windows simultaneously, which has huge implications for Sojour 2, including the ability to project a DM-only view of a map during in-person games.
During this development tranche, the ECS engine received a major overhaul. I now have a much deeper understanding of the ECS architecture, which enabled me to make some significant performance improvements.
I’ve also added the ability to import external 3D models, giving the engine feature parity with Ionian.
Finally, the lighting engine has been improved, although there is still a long way to go.
Here is a video showing the current version being put through its paces. The measured frame rate is accurate, as verified using NVIDIA’s FrameView tool.
I’m running Dorian with VSync disabled and letting it run flat out, which explains the rather high frame rate.
Unfortunately, game engine videos on YouTube never look quite as smooth as they do in person, but the engine itself is ultra-smooth. You can watch the video here:
There is still a great deal more to do, but once Dorian is complete, I can turn my attention to developing Sojour 2 itself, which will incorporate this graphics engine.
As noted in previous posts, Sojour 2 will be free for all existing Sojour customers.
This release focuses on giving users the ability to change the language Sojour uses when spell‑checking journals and documents.
Until now, Sojour has always defaulted to Windows 11’s system language — and there was no way for you to change it. Now you can!
There is one caveat: you can only choose from languages that are already installed on your operating system. For example, I currently have English (United Kingdom) and English (United States) installed:
My installed languages
Most Windows 11 installations allow you to add as many additional language packs as you need.
If you open Sojour’s Settings, you’ll now see a new option:
We can now override the default spelling language!
A new setting called “Spelling Language Override” has been added. It defaults to using the operating system’s language, and it will tell you which one that is — in my case, EN‑GB (English – Great Britain).
If you want to change the language, simply tick the checkbox:
Override ticked! – We can now type in the language we want to use.
Once enabled, you can type in the shorthand name of the language you want to use.
Unfortunately, .NET provides no reliable way to detect which language packs are installed, so the best I can do is give you a text field. To help, Sojour will tell you whether the language you typed is recognised.
In the screenshot above, EN‑GB is recognised. If I type “DE-DE” (German), it fails on my machine:
Sojour does not recognise the language!
This isn’t because the name is wrong — it’s because I don’t have German installed. Windows reports that the language isn’t available, and Sojour highlights the field in red to let you know.
If you select a language that isn’t recognised, spell checking will be disabled. You’ll see this when viewing a journal:
No valid spell check language! – this is represented by NA (Not applicable) in the lower pane.
Once a valid language is selected, the indicator at the bottom of all RTF panes will update to show the chosen language:
I have now selected English US.
If you untick the override checkbox, Sojour will revert to the operating system’s default language.
Other small changes
A spelling fix in the helper windows
Updated to the latest version of WebView2 (used for PDF viewing)
Working on a graphics engine seems like a diversion but it is critical for Sojour as the latest Visual Studio will not build 32 bit apps. Alas, Sojour’s current graphics engine, Ionian, is 32 bit only – hence the re-write.
On the plus side, Dorian is way more powerful 🙂
Dorian strutting its stuff! (Best viewed on You-Tube in 4K)
The ECS system in Dorian makes all the animations and camera movements completely trivial. It really is a joy to work with!
This is a video of the first version of it’s shadow system. It has one more iteration which is to make it use Cascading Shadow Maps then we are done with shadows and can then work on the next features!
This release is primarily about making Sojour play nicely with Cloud Drives.
I think it would be fair to say that file loading and saving just got a lot more complicated!
It’s one of those releases where a huge amount of work has gone into it, but if I have done my job correctly, you won’t notice much of a difference between this version and the previous one.
Only 161 files changed and that was just for this story!
I won’t go into too much detail as to how the new filing system works – that’s the video’s job which you can view at the end of this post.
What I will say is that this is the first iteration of this new and complex filing system. It has had around 2 weeks of testing, but alas, the hardware and cloud systems that I have access to is somewhat limited, which might impact the efficacy of the testing.
Before installing this update, I highly recommend that all customers backup their data first.
I’m hoping there won’t be any issues, but given the nature of what has been done, it wouldn’t surprise me.
If you do find issues, please contact me using the email at the front of the manual and we will work together to get it resolved!
Other changes included the incorporation of a new enterprise level logging system:
We now have logging!
Logging got added to facilitate the testing of the new filing system. It’s needed because so much now happens behind the scenes that this is the only reliable way to see what’s going on.
These log files are rolling log files, so they will never grow out of control. Once they reach their maximum size, the oldest entries are removed to create enough space for the new ones.
The above log is the standard log, but the system also outputs a much more detailed developers log for when Sojour is run from Visual Studio.
These logs are now included in Sojour’s exception windows if, heaven forbid, Sojour crashes:
The logs covering the day of the crash are now appended to any exception information!
This should enable me to more easily fault find customer issues.
With the inclusion of the robust filing system and logging, I’m starting to feel that Sojour has crossed that boundary from a bedroom project to a full-on enterprise application!
What else got changed?
There is now a new splash screen:
The new splash screen
This was added because the new filing system is now asynchronous. This results in the user interface loading up its various elements in real-time, which is somewhat disconcerting. The splash screen was added to hide this behaviour.
The rendering loop of Ionian – Sojour’s graphics engine also got re-written to take into account the fact that asynchronous file operations can make Sojour look less busy than it actually is. This can result in the graphics engine unintentionally hogging all the resources as it thinks Sojour is idling.
Various additional bugs were also fixed with the character health bars. These were all extreme corner cases. I only found these issues thanks to the new automated integration tests I wrote for this sub-system:
We now have new automated integration tests!
These tests should help prevent a re-occurrence of the emergency fixes that plagued the 1.5 releases.
The other big fix that got included in this release, was in and around how Sojour remembers its windows positions in a multi-monitor environment. There was a bug that prevented the windows being restored to the correct monitors. This should now be fixed – I say should, because the most monitors I could test this on was just two.
The video below provides a much more in depth explanation with regard to the new filing system. I’d encourage all customers to watch it!
This is the first release from my new build and release system (I migrated from JIRA/Confluence/TeamCity to Azure DevOps earlier in the year). Hopefully, there will be no issues, but this is something to be aware of!
The new Azure Devops System scaring the willies out of me! Is that really how much time I have left?
Before we get to the list of changes, I’d like to point out that I’m now working in iterative sprints where the stories are a lot smaller than they used to be. The upshot is that it is no longer worth publishing the story numbers like I used to do with the old RPG-XXX format.
The reason for this is that the number of stories per release has increased dramatically. This release alone as over 30 of them. I’m pretty sure you don’t want to know about all the details!
What are the changes?
At a high level, they can be broken down as follows:
Added support to add external web pages to Sojour as either a tab within Sojour’s main window or as a separate standalone window.
Added a dice rolling trigger to enable web pages to trigger rolls on Sojour’s tables. Note, this is an early version, in that right now it only works by inspecting network traffic. I do have an upgrade in the pipeline which will also analyse the web page itself. Until then, JavaScript only apps might not work with this system.
Sojour’s tokens and maps now support three additional image formats: GIF, WEBP and AVIF.
Sojour’s map can now be panned by left clicking and dragging the mouse directly on the map – you would not believe how hard this was to do – especially in 3d!
Trackable Characteristics now support as many characteristics as you want to add! This used to be limited to four, but I have now lifted the limitation. However, the health-bars displayed on the maps and toolbars can only show these characteristics in groups of four at a time. You can switch between groups by using the left and right keyboard arrows when hovered over the health bar for a token.
Fixed an issue where computers with touch pads or touch screens could force Sojour’s maps into an infinite zoom.
Campaign Assets are now always rendered underneath other tokens with Static Campaign assets being at the lowest level. This is because these tend to represent map features, so other tokens should appear above them.
The File Manager now performs a ‘Save All’ prior to performing some of its operations. (A necessity after Sojour’s file system got changed in the previous release.) The File Manager has also been updated to aggressively close down and free all memory allocated by WebView2 – this is to prevent crashing when restoring from a backup due to WebView’s cache being locked.
Fixed a bug where changing External Characteristics on a player character didn’t propagate to all maps.
Opening Characters, Campaign Assets or Tokens and then shutting them now returns focus back to Sojour properly. This is a WebView2 message queue and threading bug!
All external components used by Sojour have been upgraded to latest – if I have done this right, you won’t notice any changes!
That’s it for this release. Please do get in touch if there are any issues (email is in the front of the manual). I have done a lot of testing, but I’m a little on edge as this is my new development environment’s first real public release!
This is post to give you a preview for what’s coming to Sojour.
The screenshots and video are from a very early build and there is still much more to do, but, hopefully you good folk will see some value in it.
Firstly, what do I mean by external resource?
An external resource is any web based resource.
Right now the system is coded to deal with just web pages, but in the future it will support direct API communications for the more advanced users here.
I guess the next question is, what can I do with external resources?
At their most basic level you will be able to embed web pages into Sojour as an asset:
External resources have several advantages over using a web browser.
Firstly, the resource is easier to find and you don’t need yet-another-window open to use that resource.
Secondly, if the resource tab is left open and Sojour is closed down and restarted, it will reload that resource from exactly where you left off. In the above example it would remember your last map position.
Ok, we have established that we can embedded external resources into Sojour, but can it do anything else?
Yes. Yes it can!
Sojour’s external resources can have one or more triggers added to them. These triggers allow functionality within Sojour to be triggered based on various criteria from the external resource.
For example, if I wanted to integrate a third party dice roller, say DDDice, I could add a trigger to look out for when a dice is rolled in DDDice:
The trigger editor for external resources. This is DDDice being wired into Sojour!
More triggers can be added or the existing ones edited by using the assets browser:
The updated tree view.
Now that DDDice is wired in, I can roll dice in it and have them trigger table rolls in Sojour automatically!
DDDice fully integrated! Make the roll and see the result in Sojour!
Sojour will initially support two types of trigger: A table roll trigger and a journal injection trigger. There are plans for a further 6 trigger types, but the implementation of these is further off.
Obviously, DDDice is just an example. This system can be used to integrate any web resource that uses HTTP/S! 😎
You can see external resources in action by watching the You-Tube video below:
That’s it for this post!
Please bear in mind that it’s an early preview of a very early iteration of brand new functionality. This will only get better as we go down the road!