Daggerfall Unity September 2018

New Builds For September 2018

First builds of the month are now ready on Live Builds page. There are some great new features this time around, so let’s take our time unpacking them.

 

SDF Font Rendering

One common feature request is to improve quality of fonts in the game. This isn’t a trivial problem to solve as Daggerfall’s text formatting is hard-coded in books, quests, popups, etc. to line-wrap at certain points. There’s a very tight relationship between Daggerfall’s regular pixel font widths and how many characters appear per row. For any font upgrade to fit seamlessly within classic user interface, it must take this into account.

My solution was to completely overhaul the way UI renders text and support Signed Distance Field (SDF) fonts in addition to classic pixel fonts. This works by first performing a virtual layout for text elements then rendering either a standard pixel-font character or SDF-font character into the layout using a fast GPU shader. The end result is smooth high-resolution fonts at any resolution that follow the same layout rules.

You can toggle SDF font rendering in the startup UI or at any time in game with shortcut Shift+F11. SDF fonts are modable by dropping replacements into the StreamingAssets/Fonts folder. I will post an article dedicated to creating an SDF font atlas suitable for Daggerfall Unity soon. SDF fonts will be visible wherever text appears in the game – with the exception of text that’s “baked in” to UI elements. This needs to be modded out a different way and is unrelated to text rendering.

Below are some examples of book text at 4k resolution (click for full size).

 

 

Continue reading