May Builds – Lycanthropy

It’s almost the end of the month, which means a fresh round of Daggerfall Unity Live Builds. May comes bearing the full lycanthropy feature from curse through to cure. If you’re the kind of Daggerfall player who just loves to wolf out (or tusk out if you dig more on wereboars) then this update is for you! Note that some spoilers are below for how lycanthropy operates and the paths to curing or managing it.


If you tangle with a stray werewolf or wereboar while out adventuring, there’s a small chance (0.6%) that you will become inflicted by their same curse. Unlike other infections, this one will bypass your normal disease resistance unless you happen to already be a vampire or lycanthrope. On the first evening after infection, you will have a dream about a “man who is less than a man”.

If you see this dream, you have just three days to find a temple healer or cure yourself through magical means. If you let the disease run its course, you’ll be cursed to hunt the innocent once per month and will be forced to shapechange when either moon is full.


Attributes & Skills

It’s not all bad news though! As a lycanthrope, you receive a whopping +40 to your Strength, Agility, Endurance, and Speed. You also get a +30 increase to Swimming, Running, Stealth, Critical Strike, Climbing, and Hand-to-Hand combat. If your character was already an above-average fighter with their fists and feet, they are going to make a fearsome lycanthrope.

Let’s meet Koro, he’s a level 2 Nord Warrior who loves using his fists on everything. He just had the misfortune to encounter a werewolf not long after Privateer’s Hold and was lucky to escape with only a scrape or two. He had no idea what to make of that dream a few nights back, and now finds himself mysteriously stronger and faster than ever with some unusual cravings. In that last bar fight, he just about tore the pore sod in half. He chalks all this up to a healthy diet of Ale and Fowl at the Black Wolf tavern where he currently resides in Daggerfall city. Unfortunately, having only a 48 Intelligence, Koro is unable to appreciate the irony of his new situation.

Something else Koro doesn’t know is that he can’t get sick ever again. No disease can touch him now, although poisons are still a concern.


Full Moons

Two moons hang over Tamriel: Massar and Secunda. These have alternating cycles where a full moon rises once every couple of weeks. Unfortunately for Koro, and even moreso for the innocents of the Illiac Bay, his first full moon is several nights after developing full-blown lycanthropy. By this stage, he has started to suspect it wasn’t just the tavern food behind all of this. His suspicions are confirmed the night after meeting with Lady Brisienna elsewhere in Daggerfall, when he wakes up in the early morning hours with a whole new set of problems.


Koro flees into the night past some some very startled patrons. He won’t be returning to the Bat and Scorpion anytime soon. What’s worse is he’s hungry. Hungrier than he’s ever felt before. Fortunately, it’s late at night and nobody else is around. He makes a run for the woods beyond the edge of this small one-tavern town. After running wild for the next day, he’s able to return back to his normal self.


Urge to Kill

For the next few weeks, Koro manages his curse by staying away from populated areas during full moons. He even discovers he can bring on the change once per day using some innate magic he now possesses. To his amazement, his body is healed fully each time he shapechanges between forms. Perhaps this won’t be so bad after all. It just needs to be managed properly.

On the month anniversary of becoming cursed, Koro finds himself hungry again. So hungry it hurts. So hungry it feels like he’s about to die. Without having hunted the innocent even once, his curse has left him with only 4 health remaining. A giant rat would probably be enough to knock him over for good.


After battling his urges for weeks, Koro can bear it no longer. He has to hunt, every cell in his body demands it. He watches the innocent civilians going about their business for a while, then finally gives in to the hunt. It’s the only way to make himself whole again.

direct link to gfy

While fighting as a werewolf, Koro discovers that not only can he rip the city watch to shreds in moments, he’s completely immune their basic iron and steel weapons. Finally sated, he runs back into the wilderness again to rest and recover his lost health.


Accessing Inventory

Several weeks later, Koro is exploring a local dungeon when the change is forced upon him by a full moon. Bafflingly, he can’t reach his pockets. How has he never noticed this before?


After a bit of squinting and whimpering, he discovers that he can will himself back into humanoid form for a few moments before the moon forces him to change back into a wolf again. Just enough time to loot the body of that unlucky orc.


The Cure

Almost a year has passed since Koro found himself cursed to be a werewolf. In that time, he’s found an uneasy peace with his life. He enjoys being relentlessly powerful, but still feels guilt when he must hunt the innocent. He dreams of ending his curse. Then one day, he finds a letter in his pack that offers redemption or death. It seems word of his monstrous life has reached the ear of a lycanthrope hunter.


He seeks out the Order of Arkay in Burgmont where Koro is told that to cure his lycanthropy, he must pass the disease on to another.


Wanting an end to the bloodshed, Koro rejects that choice. What if the one he inflicts is even more blood-thirsty than himself? Gondywyr Hawkwing is relieved and offers him another, albeit a less likely, path.


The Witches of Glenmoril Coven

After a series of adventures, Koro finally locates the secretive witches of Glenmoril Coven in Ilessan Hills. They’re amused by his affliction, but not immediately helpful. They put him to work with some quests to further their own goals. Without many options left, Koro does his best to make them happy.


Path of Hircine

Koro discovers the Glenmoril witches can summon the Daedra Hircine on any day of the year. Hircine is known to be a patron of wild things, perhaps he can offer some solution? After gathering the exorbitant summoning fee, Koro watches as the crones perform the ritual. And he is blessed!


Koro follows the wishes of Hircine and comes into possession of the Hircine Ring. A powerful artifact that allows him to take control of his lycanthropy.


So long as the ring remains on his hand, Koro is no longer forced to change on each full moon and his hunger is suppressed. He can shapechange any time at will. He has all the benfits of his curse and none of the disadvantages. Not a bad outcome for one adventurer.


Path of Water

If Koro failed to summon Hircine, or could not afford the ritual, there is still another path. After running several quests for the witches, he is one day given a vial of Pure Water to transport to a regional Mages Guild. Did one of those crones wink when handing him that water?


While in transit with the Pure Water, Koro is beset upon by vampires, werewolves, and wereboars in great numbers. Why are they all so desperate for this vial? Thinking of his own affliction and that wink earlier, Koro takes a sip of the water. After a moment of dizziness, he finds his mind finally clear and to be mercifully cured of his lycanthropy.


Path of Blood

And what if Koro was a different kind of Nord? Right at the start, if he had taken the offer to pass on his curse for a cure. What would have become of him? If that road had been taken, it leads to a sickly child and a horrible choice. Perhaps even now, its not too late for him to turn away and find another way.



New Enchantments


Strengthens Armor / Weakens Armor

Strengthens Armor adds +5 to your armour class across all item slots. Does not stack with enchantments of this type on other items, or with Weakens Armor.

Weakens Armor reduces your armour class by -5 across all item slots. Does not stack with enchantments of this type on other items, or with Strengthens Armor.


Improves Talents

If you already have a special talent like Acute Hearing, Athleticism, or Adrenaline Rush, this enchantment will buff those gifts even further. Has no effect if you are not so gifted to start with.


Health Leech

This side-effect will cause you damage depending on the type:

  • Whenever used – You will be damaged every time you strike with a weapon or cast from an item so enchanted by this malady.
  • Unless used daily – You must strike with a weapon or cast from an item so enchanted once per day, or you will start taking damage every few minutes. This damage will occur even while trying to rest.
  • Unless used weekly – You must strike with a weapon or cast from an item so enchanted once per week, or you will start taking damage every few minutes. This damage will occur even while trying to rest.


Loan Improvements (Pango)

Any long-time Daggerfall player knows how to exploit loans from banks. You can go to any bank, ask for a huge amount of gold, then simply never pay it back. Incredibly, there are almost no consequences for doing this. We all know banks aren’t that friendly. Pango has taken the time to flesh out this feature somewhat to make it a bit easier to use and offer some minor consequences for defaulting on a loan.

First up, your loans can now be tracked at any time by clicking on your gold total on the Character Sheet (F5). This will show both your active bank accounts across regions in addition to any open loans.


You will also get quick reminders as the due date approaches.


If you default on your loan, the bank will first try to recover whatever is in your account. If they’re able to pay the loan back this way, then no other action is taken. But if you can’t repay your loan, the bank will never do business with you again and you will lose some reputation in the eyes of the law, you scoundrel.


There is also some talk of one day bounty hunters coming to recover your gold on behalf of the bank. While this remains mercifully unimplemented, it might be time to repay your loans before the banks start sending out heavily armed thugs.


General Fixes & Improvements

Thanks to everyone involved, we also have the usual round of bugs fixes and incremental refinements.

  • Fix issues with WallPropPositioner and ObjectPositioner (TheLacus)
  • Fixed scale of MASK04I0 (TheLacus)
  • Fixes to UV unpack algorithm (Ferital)
  • Exclude ship from UV processing (Ferital)
  • Fix escape navigation in custom character creator (Numidium)
  • Implement Skull of Corruption (Numidium)
  • Implement Ring of Namira (Numidium)
  • Weaken shadows under scattered light (Pango)
  • Banking improvements (Pango)
  • Fix head-dipping from projectiles (Pango)
  • Spell missiles hit sounds spatialization (Pango)
  • Fix argument out of range exception (Pango)
  • Fix unhandled map items (Hazelnut)
  • Handle %kno macro for quests (Hazelnut)
  • Implement holiday effect for Sun’s Rest (Hazelnut)
  • Implement holiday effects for free and half-price curing (Hazelnut)
  • Implement holiday effects for half price sales (Hazelnut)
  • Fix random spymaster NPCs to behave like non-guild (Hazelnut)
  • Vampire / lycanthrope spells now removed after cure (Interkarma)
  • Vampire / lycanthrope quests now terminated after cure (Interkarma)
  • MessageBox will wrap words rather than characters in most cases (Interkarma)
  • Remove black panel when buying spells (Interkarma)
  • Fix crash when trying to spawn guards before location loaded (Interkarma)
  • Fix dye handling for hand-to-hand weapon images (Interkarma)
  • Fix city watch having weapons above iron or steel (Interkarma)
  • NPCs are now more knowing and helpful when asked for directions, provided player is not a criminal and or scum (Interkarma)
  • Implement Hircine Ring (Interkarma)
  • Fix null exception in PlayerMotor (Interkarma)
  • Fix importing classic characters in a weakened state, e.g. saved while lycanthrope needs to kill (Interkarma)
  • Implement “were_sateme” console command (Interkarma)
  • Implement “were_cureme” console command (Interkarma)
  • Supposedly secret Thieves Guild and Dark Brotherhood buildings are no longer used for random quests (Interkarma)
  • Quest system will no longer use a building if already involved in another quest (Interkarma)
  • Quest system will no longer use a dungeon if already involved in another quest (Interkarma)
  • Quest system will now use a random fallback dungeon if desired type (e.g. “dungeon4”) is not found in region (Interkarma)
  • Custom magic enchantment data now serialized (Interkarma)
  • Fix comment handling in QRC block to allow dash “-” character in text blocks (Interkarma)
  • HideNpc now supports both “hide anNPC” and “hide npc anNPC” variants (Interkarma)
  • DestroyNpc now supports both “destroy anNPC” and “destroy npc anNPC” variants (Interkarma)
  • Overlapping action door in dungeons are now disabled, including action door overlapping exit position (Interkarma)
  • Fix HideNpc/DestroyNpc from being ignored when assigned at same time quest ends (Interkarma)
  • Holding down run key while standing still will no longer drain stamina (Interkarma)


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

Get Ready For Diseases

Unlike later games in the series, diseases in Daggerfall are more than a mere annoyance. They mean serious business and could spell a permanent end to your adventures if left untreated. Diseases will sap your attributes to nothing and even kill you in a matter of days if you don’t manage to get cured.

So good news everyone! Starting with latest Live Builds you can become infected with diseases in Daggerfall Unity thanks to dirty creatures like bats, rats, and mummies.

Diseases actually began development a while back. Most of the research and back-end framework was built out by two rockstar contributors you should already be familiar with: Allofich and Hazelnut. Diseases have just been waiting for me to implement effect system to handle their payload and support their curing by spell effects. This is another great example of a successful collaborative effort for Daggerfall Unity.

Rather than roll out a dry article about implementation details, I’ve decided to use the Visual Diary format to tell a bit of a story and show all the different parts of the disease system in the context of normal play. I’ve decided to create a fictional day in the life of your average character to show how he might catch a disease and find his way to a cure. This is also great opportunity to show just how far gameplay has come, as everything that follows is something that could play out in Daggerfall Unity right now.

Let’s begin.


Continue reading

Spells: Front-End Graphics

It’s finally time for spells to get the treatment and become a regular feature in Daggerfall Unity. I have decided to approach this feature-set in a more visual way than I did the quest system, which involved several months of back-end work before I could even show a single screenshot. This time around, I want the process to follow the visual diary approach from day one to make it more interesting to watch things unfold. This also helps me stay motivated as it’s a lot more fun to hurl around glowing balls of magical death than build a runtime compiler for the quest system.

There will be some more code-oriented articles later in the series, but for now let’s take a look at the front-end graphics of spell-casting animations and missiles.



Before I can do anything else, I have to implement the basic cast/recast loop. Thanks to Lypyl, a baseline spellbook interface is already in the game. It doesn’t have any actual spells yet, just some temp line items, but that’s all we need right now.

I wired up the spellbook to the “cast” key (default is Backspace) so player can select a spell from their collection. It doesn’t matter which “spell” you choose at this point. Just double-click any item to let the game know you’ve selected something.

Continue reading

Taverns, Custom Loot, Climbing, Languages, Mod Features

A new round of Live Builds are now available with some great new gameplay and mod features to enjoy.

Tavern Rooms, Food & Drink

Thanks to Hazelnut, it’s now possible to rent a room in taverns. And thanks to Allofich, you can also purchase food & drink for RP purposes. During your tenancy, you’ll be allocated a bed and can use that tavern as a home base. Just talk to any friendly bartender across the Illiac Bay.

Rooms are saved with your character, so if you leave town and return later before your tenancy expires, your room will still be available. This all ties in perfectly with Hazelnut’s world persistence. You can leave loot piles in your room and return later to retrieve them. Just don’t forget to pick up your loot before your room expires or those items become property of the house. No refunds!

Continue reading

New Builds For 2018

Welcome to 2018 everyone! What a great few months we’ve had in Daggerfall Unity. Despite my general absence in November through December last year, work still continued on the project at an excellent pace. I owe a debt of thanks to everyone that continued adding features while I was out of the scene for several weeks. I want to make this post all about these contributions, and mention the people who contributed during that time.

We’re close to a stable “Quests 0.4” build now before officially moving on to 0.5 and spells. “Stable” in this case doesn’t mean everything is complete or bug free – just that quests should be relatively steady and playable based on our current position in the Roadmap at the end of 0.4. Work will continue on improving and tightening up quest system all the way to 1.0, but now it’s time to move onto something new. This often means exciting new bugs to fix so the stable build stands as good fallback point if anyone is experiencing too many troubles with latest versions.

You’ll find the latest downloads on the Live Builds page as usual. If you’d like the very latest code, you can check it out directly from our GitHub page. And if you’d like a full blow-by-blow account of all changes up to now, the Commits page has what you’re after. This post mainly covers featured highlights and the people who added them. In alphabetical order, they are:

Continue reading

Town Populations

I’ve had my head in the quest system for several months and really needed a short break. I also happened to need a solution for spawning enemies outdoors in cities (for example, the ghosts and wraiths in Daggerfall at night) and noted there was a good amount of overlap between spawning enemies and NPCs in town environments because they all need to avoid placement inside building geometry. And whatever solution I use for placement could probably be used for navigation as well. I had scheduled wandering NPCs for 0.5 cycle, but decided to make an early start on this while solving town placement and navigation. And what better way to test this solution than to actually watch NPCs walk around?

The first problem I had was how to find an appropriate placement position. My initial idea was to use the foliage placement array in exterior data. This formed a nice grid over each block, but it also marched over water and under buildings. That would not be suitable. I considered just dropping in mobiles and using a combination of rays and colliders to refine their position until they found open space, but that approach seemed way too messy and inefficient.

That’s when I had a eureka moment thinking about how perfectly automap image data lined up with the game world. Take the below screenshot as an example. In game, I’m standing outside the Odd Blades looking at the entrance door. On the automap, once unit conversions are done, I’m in exactly the same place.


So Daggerfall’s automap perfectly skins building footprints. This should mean I can take the inverse of automap data to work out which parts of the environment are open. I quickly prototype by placing white cubes on open environment and avoiding the building footprints. Take a look at the results.


This is beyond perfect. The automap doesn’t just contain data for building footprints, but for flat placement and decorative geometry as well. I have a strong suspicion Daggerfall also uses the automap data in this manner, it’s just too precise and detailed to be a coincidence.

With a solution in mind, I now have to execute the idea. I create a new class called CityNavigation which is added to the location GameObject at scene layout time by StreamingWorld. This constructs a navigation grid at the same time location and automap data is read so only a small amount of additional processing is done per location. With the inverse of automap blocked out, we get the following:

This is good – the white areas can be used for placement and navigation, but it’s not perfect. It also needs to account for tilemap under location. We can’t place NPCs on water tiles, and they should try to avoid those tiles when walking around. Rather than just block out unwalkable tiles, I take this one step further and allocate each tile a specific weight, where a higher weight means the tile is more favourable. Here’s the final navgrid where black areas are “no-go” and brighter areas are preferred over darker areas. You can probably see right away this creates a strong preference for the road network:


What you can’t see in the above image is that each weight occupies the upper 4 bits of a single byte. The lower 4 bits are reserved for a flag system, giving me up to 4 bits to control NPC behaviours. This will be important later in this article.

Now that I have a nice procedurally generated map of any exterior location, the next problem is converting between all the different coordinate systems. If you’ve ever tried to make a big world in Unity, you’ll know that precision problems kick in after a few thousand scene units or so from origin (position 0,0,0 in world). This manifests itself through jittery movement and shadows, imprecise feeling of control, and issues with physics system. The game map in Daggerfall rocks in over 819,000 x 409,000 scene units, way beyond what Unity can handle with fine floating-point precision. I overcame this challenge very early on by using a fixed point coordinate system for the world (Daggerfall units) and normal floating point units for the scene (Unity units). The world is built around the player in chunks close to origin, and when player runs too far in one direction, the whole world is brought back towards origin. To the player it feels like they are running continuously through a huge open world, when in fact the world is being constructed around them one chunk at a time. The player never moves more than 1000 units from origin in the X-Z plane.

What does all of this have to do with the navgrid above? Well, now I have yet another coordinate system to glue together. I have not only the Daggerfall units and Unity units, but the X,Y position inside the navgrid array where any virtual mobile objects have to move around. So the next thing I do is write some helpers in CityNavigation to convert from navgrids to world space, world space to scene space, and back again, and so on. This chewed up a solid chunk of Sunday to get working properly, and there’s still a few precision issues due to the large differences in scale. Something to refine down the track.

With all the math out of the way, I can now start placing mobile NPCs into the world. One problem though, I hadn’t written any code to render wandering NPCs yet. So I started with these guys just to confirm the navgrid through scene conversions were working. Sometimes in game development, you have to bust out some programmer art to get the job done.


With placement working, next came the process of building the mobile NPC billboard properly – including that stop-and-stare thing they do when you get too close to them.

Town NPC Billboards

With rendering done, I can start moving them around the navgrid using a simple motor. They will generally follow roads when encountered (because roads have a higher weight), but there’s enough randomness to let them change directions and wander around elsewhere on the grid.

And do you remember me mentioning the navgrid can store flags in the lower 4 bits? The first flag I created is an “occupied” bit that lets a mobile claim a navgrid tile before walking into it. This prevents two or more NPCs trying to occupy the same tile at a time. The next clip shows the mobile movement, path following, and dynamic avoidance of each other. I’ve cranked up the spawn count and movement speeds because it helps me observe the behaviour (and it’s kind of fun to watch).

Mobile Pathing and Dynamic Avoidance

Despite everything accomplished, I still have more to do. The next step is working out which races are placed in which towns. I put my travelling boots on and tracked around classic Daggerfall’s world until I found which races appeared in which climate zones. I built this into the helper which returns climate data for texture swaps, etc. and now the correct NPC races (either Redguard, Nord, or Breton) will appear across the game world.


The final step was to build a PopulationManager class. This code handles spawning/despawning of NPCs around player as you move through town environments so the location feels populated. After a bit of experimentation, I used a population index per 16 RMB blocks so that small towns feel like they have a smaller overall population than large cities. One of my challenges here is the draw distances in Daggerfall Unity are huge compared to classic Daggerfall. While classic can place NPCs safely in the fog out of sight, in Daggerfall Unity you can see two full city sizes distant across the map. This means that hiding pop-in and pop-out of NPCs is a little trickier. For now, I mitigate this by trying to only show or hide NPCs when player is not looking directly at them (as Daggerfall does) and only allow them to pop-in when a certain distance from player.

There’s still a few bugs to iron out. You can still catch them pop-in nearby if you happen to look in the right direction at the right time, and they sometimes glide slightly in the wrong direction on spawn due to precision issues as they align to the grid. And of course you can’t talk to them yet, because the “talk” system won’t be introduced until 0.5 sometime. But overall, the feeling of crowds is quite satisfactory and Daggerfall-ish, and it’s wonderful to finally see these sprite people bustling around cities.

I hope you enjoyed reading about some of the work that goes into creating even a small feature like this one. If you’d like to read more, I try to post regular micro-updates to my Twitter feed @gav_clayton.