April Builds – Enchantment System

New live builds are now available for the month of April. This release brings a completed item maker UI along with an Enchantment system to drive it all behind the scenes. In this post, I’ll break down some of the new features around enchanting without going too deep into the technical side of things. If you’d like a more technical primer on magic in Daggerfall Unity check out the Magic & Effects Back-End post from last year.

If you have an existing character with “on equip” type enchantments, I recommend unequipping then equipping those magical items again after upgrading to latest version. This will ensure any of the old intermediate effects are deactivated and the new effects are activated correctly.

Item Maker UI

This is the front-end we’re all familiar with. It is here, through the magical power of menus, that new enchanted items are forged. Select your item, add some powers, balance them out with a few side-effects, and give the item a cool name. Then provided you have the gold, a new magic item with all your custom settings will be added to your inventory.

 

There’s not much more to say about the item maker. While it’s the main feature of this release, everything is fairly utilitarian and most of you are probably familiar with this UI from classic. I’ve just made a few tweaks like adding scroll bars and proper text clipping, and fixed a few minor bugs from classic. The really interesting stuff is what’s happening behind the item maker UI with the Enchantment system offering all these powers and side-effects for use.

I also want to thank Hazelnut for his earlier work on the item maker UI layout. I could just get stuck in to wiring everything up without the rather manual process of mapping out buttons and list boxes. It was great to skip that this time, so thank you Hazelnut!

Available Powers & Side Effects

You can use the Effect System Status roadmap page to see which effects have been implemented to date (enchantment powers and side-effects are listed about half-way down page). At time of writing, I’ve implemented 18 of 26 classic enchantments in time for April builds and I plan to complete these before end of May if possible.

Following are the power enchantments (positive effects) available at the item maker:

  • Cast When Used (related spells)
  • Cast When Held (related spells)
  • Cast When Strikes (related spells)
  • Extra Spell Points (during winter, spring, summer, fall, full moon, half moon, new moon, near undead, daedra, humanoids, animals)
  • Potent Vs (undead, daedra, humanoids, animals)
  • Regenerate Health (always, in sunlight, in darkness)
  • Vampiric Effect (at range, when strikes)
  • Increased Weight Allowance (25% additional, 50% additional)
  • Enhances Skills (related skills)
  • Repairs Objects
  • Absorbs Spells
  • Feather Weight
  • Good Rep With (commoners, merchants, scholars, nobility, underworld, all)

And the side-effect enchantments (negative effects) available are:

  • Item Deteriorates (all the time, in sunlight, in darkness)
  • User Takes Damage (in sunlight, in holy places)
  • Low Damage Vs (undead, daedra, humanoids, animals)
  • Extra Weight
  • Bad Rep With (commoners, merchants, scholars, nobility, underworld, all)

A lot of work and testing went into implementing these effects exactly like classic. In a few cases not enough information was available (e.g. Potent Vs / Low Damage Vs formulas) so a “best effort” was made to give these enchantments solid functionality based on their descriptions. These can easily be tuned later once correct formulas are known.

I have also matched classic in configuring enchantment properties. This covers adding the same effect more than once (some can, others cannot) and which effects exclude others (e.g. Potent Vs parameters exclude opposing Low Damage Vs).

 

Going Custom

As with other parts of Daggerfall Unity, the Enchantment system is flexible and extensible. Its not enough just to reproduce all the classic Daggerfall enchantments, the design must allow for creating new experiences via mods that could never exist in classic. This has been a key design of Magic & Effects from the start, and the Enchantment system is no different.

For those of you who like to play with the code and build code-driven mods, I’ve included a sample custom effect called “Mage Light” with this release. I won’t spend too many words on this now, because adding custom effects is still a work in progress. This crosses multiple systems and I still have some bugs to iron out. But if you’re interested in creating mods with new spell effects in the future, keep an eye on the following areas in code for an example to start from.

  • EntityEffectBroker.OnRegisterCustomEffects event – capture this event in your mod to register custom effects.
  • EntityEffectBroker.RegisterCustomEffectDemo() – shows the broad steps of registering a new effect with the magic system and exposing it to different services.
  • MageLight.cs – a sample effect designed to be non-trivial without being overly complex.

The Mage Light effect itself is nothing special. It just drops a coloured light around player based on which variant of the effect is used. It exposes five variants: Inferno, Rime, Venom, Storm, Arcane. The interesting part is how the code exposes the effect to the Spell Maker UI.

 

And a custom spell bundle to the spell merchant UI:

And to the item maker UI:

I almost have everything setup for custom effects to operate across all magic crafting stations and systems, but still have more to do. Custom spells don’t currently trigger from the enchantment system, and they don’t display their name correctly when using Info to examine an item. I’ll keep rounding this out as I can. If you’re interested in building custom effects, keep an eye on the above as it develops. Playing with the existing enchantment effects is also a great way to learn how the system operates behind the scenes.

There’s a lot more to the enchantment system than I can cover here, so let’s take a look at a couple of other changes this release.

 

Stuck Handling

You might have encountered a particular cave block with a sticky floor that traps the player. The problem here is bad geometry in the classic game data. A single-sided polygon is poking through the floor, and due to a quirk in Unity’s controller physics the player will become hopelessly trapped. This release now includes handling to automatically detect when player is stuck on this kind of low geometry and teleport them past it. Here’s an example of this in action after the handler determines player is stuck and kicks in to resolve. You’ll notice movement is not smooth while the handler teleports player forwards in small steps until they become unstuck, but it’s still better than the indignity of being welded to the floor.

[gfycat data_id=”DisfiguredMediocreCalf”]

 

Head Dipping

There are a few tight spots where the player capsule can’t move forwards because surrounding geometry is too low for capsule to pass. This doesn’t happen in classic Daggerfall as it doesn’t use modern physics, but it’s a problem in Daggerfall Unity. One example is the exit ramp in Sentinel Castle where player must crouch to get through the door. Taking inspiration from watching very tall people duck through doorways, the player capsule will now detect these kinds of spaces and dip lower for a moment to pass. This isn’t a crouch, only the player height is slightly lowered then restored to normal. There’s a momentary camera bounce as handler resolves between heights, but overall player can now smoothly pass this doorway and others like it.

[gfycat data_id=”HonestVagueLemming”]

 

General Fixes & Improvements

Every release has a good number of fixes and small improves to the game. Here’s what you’ll find in the April release.

  • Gold is now deducted when buying spells at spellmaker (Pango/Goodbadbugs)
  • Spellmaker checks for spellbook before purchasing spell (Pango)
  • HUD message scrolling speed adjusted when buffer very full (Pango)
  • Fix bug where animated vital changes continue after reload (Pango)
  • Can now sell horses and carts (Pango)
  • Fix modded wagon button reset (Pango)
  • Fix city gates not closing at night regression (Pango)
  • Fix mobile NPCs spawning in front of player (Pango)
  • Fix for building-to-building teleport into void (Pango)
  • Several improvements and fixes to AI pathfinding, combat, movement, and spellcasting (Allofich)
  • Code cleanup for classic update loop and talk manager (Allofich)
  • Improvements and cleanup to FaceWall (TheLacus)
  • Allow read-only flag for billboards (TheLacus)
  • Travel map support for custom overlays (TheLacus)
  • Support for mouse cursor override (TheLacus)
  • Make texture arrays with CopyTexture for improved performance (TheLacus)
  • Fixed scale of TELE00I0.IMG (TheLacus)
  • Ensure DaggerfallBillboard can still be found on modded loot piles (TheLacus)
  • More model UV fixes (Ferital)
  • Townsfolk NPC names now match classic (Ferital)
  • Use faction data for vampire clans (Ferital)
  • Fix ruler name generation (Ferital)
  • Can now set custom bonusPool on level-up using formula override (Interkarma)
  • Added “showitemmaker” console command to launch enchanting UI (Interkarma)
  • Broker can now register custom spell bundles for sale (Interkarma)
  • Added example custom effect MageLight and related spell bundle for future mod developers (Interkarma)
  • Increase radius of player capsule to prevent slipping through narrow openings (Interkarma)
  • Fix crouching capsule height and position camera inside crouched capsule to fix many clipping issues (Interkarma)
  • Don’t climb enemies or mobile action objects (Interkarma)
  • Reduce distance from door when exiting dungeons to fix sticking to angled geometry in some cases (Interkarma)
  • Interior transition now uses closest door, not just enter marker (Interkarma)
  • Spell missiles are now correctly parented and will not persist after reload (Interkarma)
  • Fix light/darkness powered magery conditional (Interkarma)
  • Migrated all intermediary enchantment and artifact effects to new enchantment system (Interkarma)
  • Fix “fastest” quality setting resulting in startup crash (Interkarma)

Update 6 May – Updated builds are now available with additional bug fixes for April release.

  • TextureReplacement: Emission maps for mobile billboards (TheLacus)
  • Custom render mode for static and mobile billboards (TheLacus)
  • Fix animated billboard materials (TheLacus)
  • Minor settings UI improvements (TheLacus)
  • More cleanup and fixes to enemy movement and AI (Allofich)
  • Match GoodRepWith/BadRepWith enchantment modifiers to classic (Allofich)
  • Randomize book quest rewards (Allofich)
  • Improve HUD text acceleration when buffer full (Pango)
  • Fix negative repair times when removing other repaired items (Pango)
  • Special infections (vampirism/lycanthropy) now bypass disease resistance correctly (Interkarma)
  • Fix NPC talk crash in Ilessan Hills (Interkarma)
  • Bonus to “where is” chance for town NPCs in smaller towns (Interkarma)
  • Fix accessory item not clearing magic animation (Interkarma)
  • Store shelves now stock magic items when appropriate, which also fixes non-stacking ruby bug (Interkarma)
  • Don’t use unsticking handling when player is paralyzed (Interkarma)
  • Fix checking for static geometry (Interkarma)

 

That’s it for April! The next system I’m building out is lycanthropy, so hopefully you’ll be chasing villagers with your werewolf or wereboar in a few weeks time. I’ll also keep working on enchantment system to complete remaining classic effects and wire up more support for custom enchantments.

 

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

Posted in Daggerfall Unity, Releases.