First Android Build

This is cool. One of our community members, Eric, successfully created a standalone city build on Android using Daggerfall Tools for Unity.

daggerfallTCC27

There are some issues with the sky and controls (these are bugs on my side), but on the whole everything seems to be working OK. Interior transitions and sounds are all working. Great work Eric!

What’s great about the above screenshot is that it shows Daggerfall could run on tablets without emulation. That’s not a DOSBox build up there, that’s a native Android build. The textures, models, and sounds are all created dynamically from raw Daggerfall binary files at runtime.

I’ve created a new blog category called “Community Spotlight”. Let me know if you make anything with the toolset and I’d be more than happy to feature it here.

Release 1.1 and City Basics Part Two

Daggerfall Tools for Unity 1.1 is now available for Download. This version introduces PlayerGPS and WorldTime components, along with several bug fixes and other enhancements.

There is also a new tutorial following on from City Basics, called City Basics Part Two. You will find this both inside the latest distribution and on the Tutorials & Docs page. This tutorial will help you create a fully automated day/night/season cycle using world time and a variable timescale.

I hope you enjoy this release and new tutorial. As usual, please let me know if you find any bugs or have trouble following the documentation.

Full 1.1 release notes are below.

  • Tutorials are now included with zip distribution.
  • Fixed inconsistent origins between blocks and world space. Imported blocks and locations are now all laid out in a positive X-Z direction with origin at south-west corner.
  • Added WorldTime and PlayerGPS components to core DaggerfallUnity singleton. These manage flow of time and player’s virtual position in world.
  • Added Time & Space options to DaggerfallUnity options. These options automate many time-based changes such as day/night cycles and seasonal changes.
  • Fixed RMB and RMB static assignments not working as they should.
  • Locations now store additional metadata about their world position.
  • Static door enumeration is now performed by API when initially processing model data. Door finding now has minimal overhead compared to previous post-layout method. Doors are also cached along with model data, so zero impact on future calls to GetModelData().
  • Removed individual door triggers for buildings and interiors. Doors are now tracked by a single component attached to building mesh. It stores an array of door positions evaluated used only when user clicks on building.
  • Added support for animated texture on imported Daggerfall models.
  • Added a SunlightManager to control intensity of sunlight rigs (including any number of secondary lights) and simulate time of day using a single key light for the sun.
  • Improved player position and facing when exiting buildings. The player is now positioned above ground using a ray hit and facing is determined by door normal.

Time & Space and More

Daggerfall Tools for Unity has good fundamentals. It can load any texture, model, sound effect, city, dungeon, season, and climate. It has weapons, skies, enemies, combat, building interiors, tons of editor options, and a solid API for reading anything else you need from Daggerfall into Unity.

The big missing piece right now is loading up the right city based on world position and automatically applying things like time of day and seasonal effects. Starting from 1.1, many of these additional extras will be included in the tools. This post talks a little bit about the new features with some technical bits thrown in.

If you’ve already used Daggerfall Tools for Unity, then you know it uses a singleton object called DaggerfallUnity as an interface and broker between Unity and the Arena2 binary data. There are several components attached to DaggerfallUnity for various tasks. In 1.1 you will find a couple of new components in the mix that bring proper time and space handling. These are PlayerGPS and WorldTime. Let’s take a look at PlayerGPS first.

PlayerGPS

 

PlayerGPS is fairly basic on the surface. It exposes two variables to manage a virtual player position anywhere in the Illiac Bay. The world map in Daggerfall is 1000×500 “world pixels”, with each “pixel” being 32768×32768 native units in size. This means the total world size ranges from 0,0 (bottom-left, or south-west corner of map) through to 32768000, 16384000 (top-right, or north-west corner of map) The numbers you see above (6782976, 9371648) are world coordinates for the city of Daggerfall.

At code level, PlayerGPS exposes more functionality. It can provide information about climate and politics, check to see if a location is present, etc. New static methods in the MapsFile class also provide the ability to move between different coordinate systems used by Daggerfall – such as longitude and latitude, world pixel, world coordinate, and location ID. The location ID is actually a special number derived from the longitude and latitude. It allows for any location to be looked up quickly via hash. PlayerGPS exposes this via lookup functions into a Dictionary collection.

To help support all this from editor and code, the internal DaggerfallLocation component (a self-assembling map layout for cities and dungeons) now hold additional metadata with locations.

Location Metadata

Most of what you need to know about a location is either in this metadata, or can be read from the API using this information as a starting point. The good news is that you don’t need to worry about any of this if you don’t want to. The toolset automates all of this for you in different ways. More on this shortly.

Next comes WorldTime. This component is an actual Daggerfall-styled Tamrielic calendar.

WorldTime

When you start a game, WorldTime starts counting the seconds using whatever timescale you have set. You can set timescale at 0.5 to make world time run at half speed, or at 100,000,000 to watch months flip by in moments. To make it easy to use, the individual time units are broken down in a very human-readable format (year, month, day, etc.).

This is far more than just a timer. WorldTime exposes real information about seasons, birth signs, month names, and so on. When coupled with PlayerGPS, it becomes possible to pinpoint the exact climate, season, and time of day for player position and make the world react as expected.

This means everything from rotating the sun through an animated sky, to making it snow, to setting the correct sky by climate and season, to lighting up windows at night, to turning street lights on and off. You’ve probably seen this video already, but here is WorldTime in full effect. You don’t see the seasons change, but that is in and working. If you let the simulation run long enough, seasons will roll by as expected.

You don’t need to do anything special to benefit from any of this. Just tick the new boxes below and the tools do the rest for you.

Time & Space Options

More automation will be added as the feature set expands.

Time and space aren’t the only new feature coming in 1.1. There are huge improvements to import speed and the beginnings of true world streaming, a feature scheduled for version 1.2. My goal for 1.2 is to allow you to walk around a fully streaming, fully time-automated world. For now though, world streaming is still in early testing stages, and looks a bit like this.

WorldStreaming

Each of these tiles represent a single “world pixel”. In this test, locations are streamed in around the player’s world position. As the player moves, new world pixels are read in or disposed as required.

In case you’re wondering, yes that actually is the entire city of Daggerfall on a single tile. All the models are rendered as normal, I just have the camera pointing straight down from a high position. The gray tiles will eventually be replaced by a simple terrain system, also scheduled for version 1.2.

You won’t have long to wait for all this stuff. The 1.1 release should be ready within the next week, and 1.2 (which I’m working on now) will only be a few weeks away. When 1.2 is ready you’ll be able to just drop in a few prefabs (or load a premade scene) and hit Play to explore the entire of Illiac Bay.

I’m very excited to get all this through to you as soon as possible.

City Tutorial and 1.0.2 Update

Daggerfall Tools for Unity 1.0.2 is now available. This version completely overhauls the DaggerfallSky component. Skies are now more flexible, working in both Forward and Deferred paths. Skies will thread-load data and allow for dynamic changes at runtime.

The City Basics tutorial is also available from the Tutorials menu page. Please update to 1.0.2 before running this tutorial.

One more quick item. Below is a preview of the the world time feature scheduled for release 1.1 in a few weeks. I will post more about this soon.

Dungeon Tutorial and 1.0.1 Update

Daggerfall Tools for Unity 1.0.1 is now available for download. This version contains minor bug fixes and improvements to the weapon system.

The first tutorial is now also available. This introductory tutorial steps you through creating a new scene, importing a dungeon, setting up weapons, and more. You will find this and all future tutorials on the Tutorials menu page.

Please be sure to update to 1.0.1 before following the tutorial as it fixes a bug you will encounter otherwise.

Let me know what you think of the tutorial, especially if any parts are too hard to follow. I want the “Basics” series to be generally accessible and will revise if necessary to improve information presented.

Daggerfall Tools for Unity 1.0

Daggerfall Tools for Unity 1.0 is now available for general download. Click here for download page. Change notes are below.

I’ve been working on this like a man possessed the last week or so. I definitely need a short break to clear my head and get some perspective on what comes next. I’ll talk more about this when I can.

I hope you have fun with Daggerfall Tools for Unity! If you have any feedback, bug reports, or feature requests, please feel free to contact me.

v1.0.0

  • Exterior door triggers are now sized appropriately to doors.
  • Added support for exterior dungeon doors.
  • Added enum for static door types.
  • Added DaggerfallInterior component to layout interiors.
  • Hinged action doors are now loaded inside building interiors and dungeons. They can be locked, magically held, bashed open, opened by monsters, and play appropriate sounds.
  • Added example class to transition in and out of interiors.
  • Player controller can click into and out of building interiors using example script.
  • Player controller now has moving platform support and ceiling hit detection.
  • Fixed broken sky hemisphere swap, refined sky scrolling.
  • Sky component can now be attached anywhere, such as to an exterior parent object. It will search for MainCamera if one is not specified.
  • Added default unlit billboard shader to MaterialReader. This will be used by light billboards.
  • Added default unlit texture material to MaterialReader. This will be used by fireplaces and similar textures.
  • Added dungeon action records and examples of activation by player.
  • Add iTween to __ExternalAssets namespace for animating hinged doors and action records. iTween was chosen as it will be familiar to the most Unity developers.
  • Removed QuickSize() and QuickScale() from API as they were incompatible with standalone builds.
  • Added size and scale properties to new method GetCachedMaterial(). The cached method slightly reduces scene building time and is compatible with standalone builds.
  • Palette files can now be loaded in standalone builds.
  • Bug fixes to standalone build startup and loading from Resources.
  • Added exception handling when loading invalid enemy indices.
  • Added exception handling for missing Run and Jump inputs in player controller prefab.
  • Changed Scripts/Other folder to Scripts/Demo. Contents are now in DaggerfallWorkshop.Demo namespace. These classes are not part of core tools but show examples of specific tasks such as loading interiors.
  • Added example weapon loading with variable tinting based on metal type.
  • Added example attack manager for gesture-based attacks.
  • Fixed API bug when getting DFSize for animated weapon records.
  • Enemy mobiles now read in “not hostile” flag where set in game data, and will not attack unless provoked. Examples are guard in castles and liches/vampire the King of Worms court.
  • Added DaggerfallAudioSource component for dynamically loading and playing sound effects from DAGGER.SND.
  • Created sound enumeration to name and group effects.
  • Linked sound definitions to enemy mobiles and action triggers.
  • Added ambient effect player.
  • New flags to import sounds automatically.
  • Added flag to MaterialReader controlling mipmap creation.
  • Lots of fixes and extensions to Demo scripts.