Putting the 'role' back in role-playing games since 2002.
Donate to Codex
Good Old Games
  • Welcome to rpgcodex.net, a site dedicated to discussing computer based role-playing games in a free and open fashion. We're less strict than other forums, but please refer to the rules.

    "This message is awaiting moderator approval": All new users must pass through our moderation queue before they will be able to post normally. Until your account has "passed" your posts will only be visible to yourself (and moderators) until they are approved. Give us a week to get around to approving / deleting / ignoring your mundane opinion on crap before hassling us about it. Once you have passed the moderation period (think of it as a test), you will be able to post normally, just like all the other retards.

Vapourware Daggerfall Unity isnt Vaporware

Miles Davis or John Coltrane?

  • Miles Davis

    Votes: 48 29.3%
  • John Coltrane

    Votes: 48 29.3%
  • Kenny G (kc response)

    Votes: 68 41.5%

  • Total voters
    164

Luzur

Good Sir
Joined
Feb 12, 2009
Messages
41,501
Location
Swedish Empire
Creating SDF Fonts For Daggerfall Unity
Posted on December 5, 2018 by Interkarma
Introduction

All the way back in September, I upgraded font rendering in Daggerfall Unity to support Signed Distance Field (SDF) fonts. This enabled smooth high-resolution font replacements which can operate under the same “layout rules” as classic Daggerfall’s pixel fonts, with a substantial improvement to reading comfort as this comparison screenshot demonstrates.





Rather than storing individual display pixels of a text glpyh, SDF fonts store a distance value that can be turned into display pixels later at any resolution using a custom graphics shader. Unlike regular pixel fonts that become quite pixelated at high resolutions, SDF text can use those distance values to generate sharp detail even at UHD resolutions and beyond. If you’re interested in the inner workings of Signed Distance Fields, there are loads of great resources out on the web. This tutorial doesn’t look very deeply at SDF concepts, only the process of creating new SDF fonts for Daggerfall Unity.



Resources
There are a few resources you will need to work through this tutorial.

You can use whatever font or tools you like to generate your SDF font atlas. This is just the process I’m using that will generate known-good output for Daggerfall Unity. If you do use a different toolchain, the only thing that matters is the output image is a proper SDF texture and the glyphs are laid out in a specific way.



Font Layout Technical
The first step in creating a new font for Daggerfall Unity is to select a good font. This isn’t as easy at it might sound due to how fonts work in classic Daggerfall itself. Following is a technical primer to help understand the font layout process and why some fonts will look better than others.

Every book, text resource, quest, and popup in Daggerfall uses hardcoded formatting similar to old-school teletext where formatting bytes are injected into a signal later parsed by a decoder and formatted on-the-fly at the same time signal is being read. The formatting data is literally in the byte-stream for these text resources and was hand-placed when text was written. This setup is wildly inflexible compared to modern standards like HTML markup. The end result is there’s a very tight coupling between classic’s screen resolution and pixel font dimensions, and where formatting characters such as line breaks are placed in the stream. We can’t just replace fonts wholesale or the resultant formatting will no longer be correct. And because Daggerfall Unity connects to a classic Daggerfall installation for default game data, we inherit these same limitations.

To work around this, font technology in Daggerfall Unity takes a two-stage hybrid approach for classic UI emulation with custom fonts. The first stage is to create a layout based entirely on classic font dimensions. This ensures the layout rules are respected as per the text resource byte-stream. To visualise this, here’s a sampling of classic UI text with the layout areas highlighted. The background image is just for reference, the actual layout information stored is just the red squares. Note there’s also a “single pixel” spacing gap between each character in layout data (it’s actually several pixels because Daggerfall Unity is always rendering at high resolutions, but more on that in a moment).





Once the layout has been generated as per classic requirements, this information is used by second stage: text rendering. If you have classic font rendering enabled then text is drawn as above using a simple blit shader. But if SDF fonts are enabled then a different shader is used to render SDF text. The output looks like below.





The actual layout areas are exactly the same in both cases, and each character is scaled to fit within that same rectangle. SDF fonts also overdraw into their adjacent “single pixel” spacing area, as these spaces look huge and unnecessary once you have high-resolution text. It also allows the SDF font to have a few pixels more for detail. At runtime, the only difference is the shader used to render text. The final output process is so basic that it’s possible to switch seamlessly between classic and SDF text at any time (shift+F11 in-game).

This two-stage layout process exposes a limitation of Daggerfall Unity’s SDF rendering. Because it’s necessary to maintain classic formatting streams, each SDF character may be slightly stretched or squashed to occupy the space their classic equivalent would otherwise fill. You will notice this most when glyphs in your replacement font have very different aspect ratios to the glyph in the classic font they are forced to match. In the screenshots above, the most obvious is the lower-case L character. This is just a single pixel vertical line in classic, but has serifs in replacement glyph. The result is the lower-case L is a bit squished when replacement font is rendered.

But provided you select a font with similarly shaped characters overall, this effect is minimal and most users probably won’t notice or care.



Creating A Font Atlas
Once we’ve selected a good replacement font, the first step is to generate a source font atlas for our SDF texture. In this case, we’ll be using the MorrisRomanBlack.ttf font and Codehead’s Bitmap Font Generator to build the atlas.

First install MorrisRomanBlack.ttf to your system. This is done by right-clicking the .ttf file and selecting Install from popup menu.

Then open Codehead’s Bitmap Font Generator (called CBFG moving forwards) and configure settings as shown below. Please double-check you don’t miss anything, every setting is important in some way.





Depending on your font, you might need to clean up a little to ensure there’s no overlap at top or bottom of each cell. Keep in mind the SDF process will dilate the area around each character by a few pixels, which could cause stray pixels to be sampled at runtime. Accented characters are the worst offenders as they often have details very close to top or bottom of cell. I recommend setting zoom to 200% and looking through atlas one glyph at a time and adjust position of individual characters up or down if they are too close to cell floor or ceiling. This is the reason we set the “Font Height” to 62, to ensure there’s a couple of pixels free already built into the 64×64 cell. Note that I’ve also adjusted all glyphs 4 pixels to the right so there’s also some empty space around them on left and right. This will help Daggerfall Unity work out glyph dimensions when texture is read at runtime.

To adjust an individual character, select that cell in CBFG and ensure “adjust selection only” is selected. Then use up, down, left, right arrows to adjust vertical position inside cell. You might need to work through this process a few times until you have a source atlas you’re happy with. You can save your settings in CBFG and return to tune them later.

Once you’re happy with atlas, click File > Export > Targa32 (TGA) and save the atlas somewhere you can find it later. This will create a 1024×1024 output image with white on transparent pixels and nicely anti-aliased glpyhs. The anti-aliasing is important so the texture will convert nicely to SDF later. I saved this image as “MorrisRomanBlack-Atlas.tga”.

The full technical requirements of this texture are:

  • Start character must be ASCII 33.
  • Image size must be a nice square POW2 size like 1024×1024.
  • There must be exactly 16×16 cells in the final image. For a 1024×1024 atlas this means 1024/16 = 64×64 pixels per cell.
  • The glyphs must be nicely anti-aliased for best results from SDF conversion.
  • Each glyph needs a few pixels of empty space all around them inside cell, especially on left-hand side of cell or glyph may appear truncated in game.
  • Atlas must be exported with transparency intact, which is why we used TGA32 in CBFG.


Setting Up SDF Texture Generator
In this tutorial, I’ll be using a free Unity asset to generate the final SDF texture asset. If you’re comfortable with using Unity, you can just skim this part. If you’re using a different SDF generator then you can skip it altogether. You’ll just need to ensure the output image matches technical requirements above.

If you haven’t already, install the Unity editor. You can use any 2018.x version, but I’m using 2018.2.11f1 as this the current baseline for Daggerfall Unity itself. Then we want to start a new project called something like “SDF Texture Generator”.





Once your project opens, go to the Unity Asset Store (Ctrl+9 shortcut) and search for the “SDF Toolkit Free”. Download and install this asset into your project.





Once this tool is installed, we can use it to create our SDF texture. But first we need to drag and drop our source texture atlas into the Unity project. I simply dragged and dropped my “MorrisRomanBlack-Atlas.tga” created earlier directly into the Assets panel. Don’t worry about the imported texture settings, the tool will take care of that for us.





Now open the tool using Window > SDF Texture Generator. If the source atlas texture isn’t selected already, then click select and choose your texture from the list of available assets. Ensure settings are configured as below then click Generate.





This will output the final atlas texture pre-processed for SDF rendering. Click Save PNG File to export the texture. I saved this as “MorrisRomanBlack-SDF.png”. All we need to do now is rename this image appropriately and it’s ready to be used in Daggerfall Unity.





Using SDF Font In Daggerfall Unity
If you’ve followed the steps above, or used an alternate process, you will have a final SDF texture like below. I’ve just edited in a black background here to make it more visible in article. Normally it’s white on transparent, and you don’t want to change that.





Finally, to use this texture in Daggerfall Unity, we just need to rename it appropriately so the game knows which classic font it’s supposed to replace. In this tutorial, I’m replacing the default text font used almost everywhere which is FONT0003. To get this into the game:

  1. Rename final SDF texture to FONT0003-SDF.png.
  2. Copy into your Daggerfall Unity installation fonts directory in StreamingAssets/Fonts, overwriting the existing font file (keep a backup if you want to change back later).
Next time you start Daggerfall Unity, the new font should be visible everywhere FONT0003 is used, which is most places.







Conclusion
I hope this article helps those of you interested in creating new fonts for the game. Once the new SDF atlas texture has been created, you can distribute it directly to end users and they just need to drop it into their StreamingAssets/Fonts folder.

If you run into any problems with the tutorial, please create a topic in Help & Support forum and I will try to assist.

Good luck!



For more frequent updates on Daggerfall Unity, follow me on Twitter @gav_clayton.
 

Luzur

Good Sir
Joined
Feb 12, 2009
Messages
41,501
Location
Swedish Empire
some new mods is being worked on:

I was bored, got some free to use models online and proceeded to create some minor original accessories myself based on the sprites and to try and recreate one of the Daggerfall enemies through Blender. I like them. What do you think? I got the idea after thinking what I could do more with Villager immersion Overhaul. Not sure if this will go anywhere but I thought I'd share.

I'll officially start work work on this. I really like the results so far. This is how they look in game. I think they look great so, after the next Warm Ashes version is out I'll focus my work on this.

Oh-fug.png

file.php

file.php

file.php

file.php


Daggerfall: Music To Travel By
Post by Helegad » Fri Oct 12, 2018 12:32 pm

I've finally completed my unofficial soundtrack for Daggerfall! My goal was to make the three-hour listen a journey through towns and dungeons, sequencing the tracks to keep things spicy while preventing any jarring changes in mood. I've also dealt with the looping nature of this music in various ways, from adding simple fadeouts to rewriting the last few notes to add a sense of finality. There are no duplicates, all unique tracks from Arena and the Daggerfall promotional download are included in appropriate areas, and I've properly mixed the whole thing from track to track.

I've also created some art in case you want to burn a set of CDs!

front.jpg


rear.jpg


I'm really happy with how this has turned out. Enjoy! All composition credits go to Eric Heberling

Download
 

ADL

Prophet
Joined
Oct 23, 2017
Messages
3,749
Location
Nantucket
Damn, I'm really happy with those models. My only concern is going forward as people mod in more and more shit, models will have to be created for those too for the sake of consistency.
 
Joined
Oct 15, 2018
Messages
862
Location
Ali Ghaylān
Those look great and I'm happy they're going with the original simplistic art style. It's really good since most TES modders think more detail and clutter = better, most of the time totally missing the artistic direction.
 

Goi~Yaas~Dinn

Savant
Joined
Nov 25, 2018
Messages
786
Location
A derelict.
Sooo glad this dude stepped up to the plate and rescued Daggerfall from the inept fumbling of DaggerXL. I've always thought Daggerfall and Arena had a certain special something about them, and I look forward to eventually playing updated "ports" of both.
 

ADL

Prophet
Joined
Oct 23, 2017
Messages
3,749
Location
Nantucket
some new mods is being worked on:

I was bored, got some free to use models online and proceeded to create some minor original accessories myself based on the sprites and to try and recreate one of the Daggerfall enemies through Blender. I like them. What do you think? I got the idea after thinking what I could do more with Villager immersion Overhaul. Not sure if this will go anywhere but I thought I'd share.

I'll officially start work work on this. I really like the results so far. This is how they look in game. I think they look great so, after the next Warm Ashes version is out I'll focus my work on this.

Oh-fug.png

The creator of this Unity asset store-inbound project posted this and it looks really fucking impressive. Might be the ideal route for visual consistency if people take the moddability as far as I think they will long-term.
 

Luzur

Good Sir
Joined
Feb 12, 2009
Messages
41,501
Location
Swedish Empire
he also released the Asset in a demo:

Spriter: Real-Time Sprite Imposter System
Post by MasonFace » Sun Dec 16, 2018 5:49 am

I've been working on a Unity Asset for a little while now that can emulate the aesthetics of a sprite from a 3D model in-game. I believe with some high quality 3D models to replace the original NPCs, creatures, etc., this utility's flexibility and level of customization can create the look to suite nearly any user's preferred taste.

For now, it's called "Spriter" (I could really use some suggestions for a better name!
icon_e_biggrin.gif
).

It may be more easily explained by the video: [youtube]https://www.youtube.com/watch?v=RwndXT2 ... nxw03c010c[/youtube]

If you want to give it a try and play around with all the settings, you can download the brand new demo here: https://drive.google.com/file/d/1Y-xv6s ... sp=sharing (Sorry, Windows only at the moment).

Also, if any of you are working on any 3D models for DFU and you're willing to share, I can create a custom demo for you to play around with your model in the scene if you want.

Anyhow, let me know what you think.

the rest of the thread:
https://forums.dfworkshop.net/viewtopic.php?f=22&t=1613

also, new Mods and updates:

[MOD] Court of Anticlere
Post by Ferital » Thu Dec 13, 2018 3:56 pm

Hi all,

Just a proof of concept here, I wanted to provide an actual use to all those unique NPCs not available in the original game. I mean Lady Doryana Flyte, Sylch Greenwood, The Squid...

So as I wanted to use this in classic as well, I started to dig into BSA files and came with a little mod.

I replaced a unused RMB block (the last one in BLOCKS.BSA) with a block almost entirely similar to PALAAA02.RMB. With the exception that this new block, named PALAAA03.RMB, is inhabited by Lady Doryana Flyte, Lord Auberon Flyte, Lord Perwright and Farrington. Also, the only original guard I left was assigned the Knights of the Flame faction id.

Of course, I had to do a single byte change in MAPS.BSA to make the Anticlere location use this new block instead of the former generic one.

This works in classic and even better in DFU, as in classic, faction reputation from building unique NPCs is not taken correctly into account.

Here are some screenshots:
file.php

Court of Anticlere.png (1.22 MiB) Viewed 111 times
The modified bsa files can be downloaded here: https://ufile.io/tmi5g

Warm Ashes: Dangerous Dungeon Exteriors

To give an update on how things are, I have the Ruins dungeon type exteriors basically done and work and ready for more variables if I want. At the moment I am working on random encounters in the Wilderness. I don't want them to be too eventful for the most part as I'd like destinations to be where bigger events take place. It's more of a immersion setter for me.

So, while traveling in the wilderness:
-Every hour a random event could occur though with how often it checks, it should be a very low chance of an encounter.
-Players with good stealth skills and attempt to avoid dangerous events such as bandits
-Neutral events can also happen where the player runs into other travelers and there is no sight of conflict (at least till I implement something or we geta feature to check legal repute)
-Players can try their chance robbing neutral npc's on their travels
-Players with good weapon skills, or a good streetwise skill have a good chance at being successful

As well as the ruins:
-Good stealth/streetwise skill can help players avoid encounters
-A player with good reputations with certain factions (or a player with good language skills EXAMPLE: Orcish) can help them make friends with enemies and avoid dangerous encounters.

Spoiler!
Player with a good streetwise skill talks a Highwayman out of robbery.
there.png


Player runs into a group of travelers while out in the wilderness.
Example-1.png


Player attempts to rob a traveler.
Example-2.png


Player runs into a Dark Brotherhood member, but has a good reputation with the guild.
Example-5.png


Player passes the stealth skill check and can attempt to sneak into some ruins.
Example-4.png
 

Molina

Savant
Joined
Apr 27, 2018
Messages
363

"You miss the point of Daggerfall".
Well, I see.
 

As an Amazon Associate, rpgcodex.net earns from qualifying purchases.
Back
Top Bottom