Daggerfall Unity Update

I’ve completed the first pass at porting code over to Unity. I now have textured models, city blocks, dungeon blocks, and flat objects working. I could lay out complete cities and dungeons at this stage, but want to do some code tidy-up first. Overall, I’m very happy with progress considering I only started work on this a few days ago.

There is a lot of Unity-specific work to go. I need to flesh out editor scripts and add options controlling how scene data is spawned. In case you’re wondering, everything is created procedurally from game files directly within the editor with a single click. After that it just works like a normal scene. The same could be done directly from code as well. Check out the new screens below.

dfunity-rdb dfunity-rdb2 dfunity-rmb dfunity-rmb2

 

In the last screenshot, you can see realtime shadows acting on the scene. Even the flats are casting and receiving shadows. This is using a standard cutout shader, which works in both forward & deferred.

Right now the scenes are built very atomically (from very small pieces). This is perfect for seeing how everything is put together and mucking about with the individual pieces. However it won’t be optimal for real-time uses. One of the options I’m planning will combine meshes and textures sensibly to minimise draw calls and state changes.

Check back in a few days for another update. The next update will include the first release for you to play with.

Daggerfall Tools For Unity

Since leaving the Workshop, I’ve been using Unity a good bit for other projects. It occurred to me the other day it should be trivial to drop my Daggerfall library (Daggerfall Connect) into Unity as everything was written in very portable C#. A few hours later, I had Daggerfall models firing up in Unity.

Scourg Barrow exterior in Unity

Scourg Barrow exterior in Unity.

It’s only a small step from here to spawning entire game-ready cities and dungeons in Unity. For the most part, this can be done using layout code I’ve already written for Daggerfall Modelling. I’d just need to refactor for Unity and build some editor scripts to hold it all together.

Based on this, I’ve decided to repackage the useful parts of Daggerfall Connect and Daggerfall Modelling into a small suite of scripts for Unity developers. As usual, this will be free and open source for everyone.

This doesn’t mean I’m returning to the Workshop full-time. I’ll only be allocating a few months of spare time for this project. I just think it would be great to see all the code I’ve written over the years being put to use by someone, and what better way to wrap up my years with Daggerfall than making one final tool available for a game engine anyone can use?

Let me know what you think! Is there something particular you’d like to see in Daggerfall Unity? If you’re a Unity developer and want to contribute, I would be more than happy to share access to the SVN (will be setting this up soon) to people with the right skillset.

SVN Updated

The SVN repository has been updated to VS2010/XNA4.0 solution & code. If you are building DaggerfallModelling from source please ensure you have the latest version of the .NET Framework 4.0 and XNA Game Studio 4.0. You will also need to be using Visual Studio 2010 (or Express 2010) to load the new project.

A few bugs remain after porting to XNA 4.0. These will be ironed out over the next few weeks.

Building From Source and Other Issues

I’ve received a few emails from programmers trying to build Daggerfall Modelling from source and experiencing problems. The reason for their frustrations is that Daggerfall Modelling is built as a VS2008/XNA3.1 project. This means it will only build with Visual Studio (Express) 2008 with XNA Game Studio 3.1 installed. Attempting to build with VS2010/XNA4.0 will fail due to breaking changes in the latest version of XNA.

I also get the occasional email from Windows XP users with an older version of the .NET Framework 2.0 (pre-SP2) that experience a crash when opening a dungeon. This problem is caused by a bug in the .NET Framework 2.0 that was resolved in Service Pack 2, and can be fixed by upgrading/patching .NET.

The reason I stuck to older versions was to ensure my tools remained accessible to more people. On the flip side, not everyone wants to install an older version of Visual Studio and XNA just to compile my code. I’m also running the risk that Windows XP users will come across that crash without having read my getting started page for Daggerfall Modelling.

After serious thought, I have decided to make some changes to my source code:

  • Solution format upgraded to Visual Studio 2010 / Visual C# 2010 Express.
  • Daggerfall Modelling and XNALibrary will be refactored for XNA Game Studio 4.0.

The DaggerfallConnect class library and Daggerfall Imaging 2 will remain based on .NET 2.0 for now, but I might bring these forward at a later date.

The SVN will be updated in the next few days with these changes. The next release of Daggerfall Modelling (Beta 2) will require the latest versions of .NET and XNA Frameworks to run.

Incoming!

I push against the Workshop’s iron-banded door. It sticks for a moment then creaks open as if welcoming me home. Dry air blows past my cheeks. With a final look to the outside world, I descend a thousand steps into darkness, stopping only to light torches along the way. Far above the heavy door slams closed, sealing me in the depths. I look around, satisfied everything is how I left it, and sit down to work. It’s great to be back.

As you can probably guess, I’ve had to step away from the Workshop for real life reasons and other projects. I’m deeply sorry for not posting at all during this time. Thankfully, Lucius has continued working his usual magic with DaggerXL. If you’ve been living under a rock like me for the last several months, make sure you go check it out. It’s way more interesting than anything going on around here (not counting that escaped Imp I can hear scratching around inside the walls).

The good news for anyone following Daggerfall Connect is that I’m going to be active again for a while. First order of business is to get my subversion repository at Google Code populated. This has been done now, with the main trunk currently versioned at 0.4.9.

The main changes in 0.4.9 are:

  • Several bugfixes and other minor improvements to the core DaggerfallConnect library and DaggerfallImaging2.
  • Map support for outdoor locations and dungeons. This is nearly complete, but needs a bit of work to finish up and get some bugs under control. If you want to play with this, please don’t be disheartened that not all maps load properly (or just throw exceptions). I’m working on fixing this now and updates will be committed to the 0.5.0 branch before long.
  • XNA support. There is now an XNALibrary project demonstrating the basics of using DaggerfallConnect to load Daggerfall’s textures, 3D objects, blocks, and maps into XNA. There are also a few XNA tutorials underway that call this library.  Disclaimer: This is exactly how I left it when I had to walk away from the Workshop last year. The XNA stuff is very rough and unfinished. I’ll be fixing all this up and posting to the 0.5.0 branch over the next week or two. All XNA code is currently based on XNA Framework 3.1.

The next full release will be 0.5.0. I also need to get all the written tutorials and other stuff moved over to my Google Code project wiki.

That’s it for now. If you’ve been interested in Daggerfall Connect in the past, but lost interest due to my infrequent updates, now is a good time to have another look. Things are finally coming together enough to be interesting.

A Few Quick Things

Just a quick post to outline the next round of updates coming when I return to the Workshop.

  • The Daggerfall Connect project format has been changed back to Visual Studio 2008 / C# Express 2008. This decision was made to support a wider range of people. Naturally, you can still upgrade the project to a 2010 version after you download.
  • Daggerfall Connect project has been created on Google Code. SVN access will be ready as soon as I can shift over at my end. All online documentation and tutorials will be moved to the project wiki.
  • I am retiring the “Workshop Demo Engine” (based on Ogre) as the standard 3D engine for Daggerfall Connect. All future Daggerfall Connect tools and demos using 3D graphics will be based on XNA.
  • The next release of Daggerfall Connect will introduce an XNA tutorial series covering how to render individual models and blocks, through to entire cities and dungeons.
  • Map support will be finalised in the next release of Daggerfall Connect.

I am also pleased to announce that I have re-started Daggerfall Scout as my next project. I have a new vision of this tool as an Atlas-like explorer covering the major points of interest in Daggerfall. I will post more details on this project as soon as I can.