DF Modelling – Crash On Startup

Just a quick post for anyone experiencing a crash on startup in Daggerfall Modelling 0.8. To run this application, you will need the following prerequisites installed:

1. Microsoft .NET Framework 2.0
Note: Only required for Windows XP.
http://www.microsoft.com/en-au/download/details.aspx?id=1639

2. Microsoft XNA Framework Redistributable 3.1
Note: This version is always required even if you have a later version of XNA installed.
http://www.microsoft.com/en-au/download/details.aspx?id=15163

I hope that is helpful for anyone trying to use Daggerfall Modelling and have not been able to get started.

Daggerfall Modelling Beta 2 Roadmap

I’m in the process of bringing everything together for Beta 2 now. This is the largest update yet and will be the final test version before 1.0. Following is a roadmap of Beta 2 with a few details on each item. Some of this is a recap of previous posts.

XNA 4.0

Daggerfall Modelling is now a Visual Studio 2010/.NET4/XNA4 project targeting the “HiDef” profile and Shader Model 3.0. I realise this will exclude some users with very old or integrated GPUs, however most cards from 2008 onwards should support this without any problems. This has been done in line with the new engine which is using some SM3.0 features like MRT and VTF.

Deep Engine

This is the game engine I’m developing for Ruins of Hill Deep. The reason this is part of the Daggerfall Modelling roadmap is that I will be using the same engine for both projects. Deep Engine is replacing ”XNA Library” as the renderer for Daggerfall Modelling. The main benefit for me is that any work on this engine progresses both projects. This engine is designed around a world/entity/component pattern, deferred shading, primitive rendering, and has a fully integrated physics engine. There are many more features to come as development continues.

Player Physics

You will be capable of exploring maps on foot with full player physics. This is delivered using the physics middleware in Deep Engine, not the simplistic camera physics I previewed earlier.

Full Day/Night Support

Change the time of day along with the direction and brightness of sunlight. Night-time cities and dungeons are now lit by atmospheric flickering lights.

Enter Buildings

You will finally be able to enter buildings in exterior locations and export their models.

Thumbnails View

The thumbnails view is getting a nice update. Identical models are collapsed by default into a “folder” thumbnail. This will help reduce clutter when browsing thumbnails and better display model “families”. The thumbnail view is also getting a scrollbar for faster navigation.

Model View

You will be able to cycle through models similar to Daggerfall Explorer, using increments to either model index or model id. It will also be possible to use the free camera to explore models.

Location View

The top-down camera will be more useful, with cutaway when zooming and improved camera sensitivity.

Exporting

You will finally be able to export a full city/dungeon/block/interior to a single Collada file.

Improved Dungeons

Dungeons will display the correct textures based on region. You can optionally render monsters and treasure piles in place of the default “editor flats”.

Animated Sprites

Flat NPCs/animals/lights/etc/ with idle animations will now play, bringing a little life to the scenes.

Bug Fixes

Contains several bug fixes, including a fix to the nasty texture alignment bug that crept into Beta 1.

Lighting Up #3

I’ve restored billboards (trees, rocks, etc.) to scenes and they generally light up correctly from surrounding point lights and the player’s personal light source. There is a simple light animation playing that changes the scale of the light volume +/- a small amount. Light attenuation means this effect is more obvious at the edge of the light radius than near the source.

The lighting system still needs a tidy-up, and a few bugs remain (such as the emissive wood textures you see in a few spots). I will continue to polish this leading up to Beta 2 release. Still, I’m happy overall with how the lighting is shaping up and posted a video preview.

Lighting Up

After moving everything to XNA 4.0, I decided to build a lighting system into Daggerfall Modelling Beta 2. I’ve always wanted to play with deferred rendering and it seemed like a good fit for Daggerfall’s many point lights.

If you’re unfamiliar with this technique, the gist is that different information about the scene is rendered into different buffers (collectively called a GBuffer) and combined together to make the final image. You can see three of these buffers in the debug screenshots below. From top to bottom are the color, normal, and light buffers. These get combined with a depth buffer to create our fully lit scene. The results are very fast, even on a mid-range GPU. The heaviest scene below is “Daggerfall from Above”, with almost every building and light visible. Total render time is about 12ms, and most of that is spent rendering the geometry. The lighting itself takes almost no time at all.

This is only the first of several visual enhancements intended for Daggerfall Modelling Beta 2. Don’t worry if you have an older computer and just want to export the models. You will be able to turn off or scale back these rendering features using options.

Daggerfall Castle Privateer’s Hold Throne Room
Daggerfall from Above Scourg Barrow Entrance

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.

Daggerfall Modelling Collision and Gravity Preview

I’ve completed the first pass at collision and gravity systems in Daggerfall Modelling. This still needs a few passes to fix some bugs, but is largely completed.

I’m not implementing a full physics simulation, just camera-scene collision and simple velocity for gravity. This is a looong way from a real game system, but it’s more than acceptable for a fancy model viewer. If you’d like to see an early preview of this feature check out the YouTube video below. This was recorded while using an XBOX360 controller, which is why you see a crosshair in the middle of the screen.

Daggerfall Modelling Beta 1 Released!

The first beta release of Daggerfall Modelling is now up for download. I have decided not to enable gravity and collision in this release because I am not happy with the state they are in. They will be enabled in the next release. Following are the final release notes for this version.

  • Added a Quick Search feature to search pane.
  • Search pane can be collapsed.
  • Region accurate billboards (rocks, trees, etc.) now decorate the scene.
  • Region accurate sky in exterior free camera views.
  • Adjust sky appearance with time of day slider.
  • A compass is now shown in free camera mode (bottom-right of view).
  • Play with interactive objects in dungeons (levers, doors, lifts, etc.).
  • Explore using an XBOX360 or compatible controller.
  • Invert mouse-look and controller-look.
  • Updated engine. Many improvements to scene management and versatility.
  • Overall performance improvements to search and load times.

If you are installing Daggerfall Modelling for the first time, make sure you read this first!

The controls have changed in some places. Any view rotations on the left mouse button have been moved to the right mouse button.  This has been done to free up the left-mouse button for new features down the road. For updated information on controls in the views, check the appropriate page in the Daggerfall Modelling Wiki.

I hope you enjoy this release of Daggerfall Modelling.

Daggerfall Modelling Beta 1 Almost Here

Just a quick update to let you know the Beta 1 release for Daggerfall Modelling will be up in the next few days (hopefully this weekend). I’m in the process of fixing bugs and rounding off some rough edges now. In case you need a reminder, the main features of this release will be:

  • Improved searching. Added a Quick Search drop-down to the search pane for quickly finding common resources.
  • Updated engine. Scene management and rendering have been totally rewritten for more speed and versatility.
  • Skies, trees, rocks, etc. now decorate the free camera view in cities and dungeons.
  • Change time of day while exploring outdoor scenes.
  • Play with actions in dungeons (doors, levers, platforms, wheels, etc.).
  • Turn on collision, gravity, and compass for a more game-like exploring experience.
  • Explore using an XBOX360 or compatible controller.
  • Overall improved performance and stability.

Visual Diary: XNALibrary Update

After a hectic mid-year rush things are finally settling back to normal. I will have more time to dedicate to my Daggerfall tools for another few months before the silly season begins. I am now working on getting Beta 1 of Daggerfall Modelling ready for release.

When I started Daggerfall Modelling the goal was to make a quick and easy Collada exporter for Daggerfall’s 3D assets. It didn’t take long before I realised an opportunity to revive Daggerfall Scout in a more useful form. Like all projects, escalating the scope after most of the code has been written is a recipe for trouble. While trying to wedge in action records to my scenes (levers, switches, etc.), I came to the realisation my code had become as messy as hell. To accomplish what I had in mind a total rewrite of the scene manager was needed.

As an adjunct to Daggerfall Connect, I have also been developing an XNA class library that makes using Daggerfall assets with XNA a snap (creatively called XNALibrary). This code base is something I wish reuse for other projects, so it made sense to get all the scene management and rendering out of Daggerfall Modelling and build it properly into XNALibrary. The end result is a small XNA 3D engine designed specifically for rendering Daggerfall scenes. I then had to rip out all the old code from Daggerfall Modelling and port it over to XNALibrary as the primary engine. It was a lot of work just to end up back where I started, but internally the code is much improved. Following is a quick tour of what’s new in XNALibrary, as seen from Daggerfall Modelling Beta 1.

 

Scene Graph

Previously, Daggerfall Modelling used a one-dimensional array of objects and looped through them to draw scenes. This is fine for small environments but doesn’t scale up very well.  It also makes visibility testing and render batching harder than it needs to be. When it came time to link up the levers and switches, I realised it was time to put in a scene graph.

I decided to use a simple Bounding Volume Hierarchy based around spheres. The beauty of bounding spheres is that you don’t have to worry about axis alignment as you do with boxes. Spheres may not wrap objects quite as tightly, but they’re a lot easier to handle when transformed (rotated, translated, scaled, etc.) as the volume is always the same shape and alignment in 3D space.

On the left are a couple of screen-shots of the bounding volumes, rendered as wireframe spheres. The root node is red, general models are white, and sprites are green. Resources are added to the scene from the top down, with renderable objects like models and sprites in the leaves of the tree. This hierarchy makes it easy to cull non-visible groups – if a node isn’t visible, then none of its children can be visible either. It also simplifies mouse picking and collision as these tests are only performed where necessary. Batching visible polygons by texture becomes easier, which greatly improves rendering times. And finally, linking up chained action records becomes simplified thanks to each scene node being a discrete class aware of its own state.

Action Chains

Certain objects in Daggerfall have action records that describe how this object can move, rotate, etc. An example every Daggerfall player will be familiar with is the throne room in Privateer’s Hold (pictured left). When you throw the switch an action record makes the lever rotate, which chains to another action record to make the platform rise, which finally chains to the throne to make it rise also. The end result is you throw the switch and the platform rises (along with the throne and the player).

If you open up the screenshot to the left, you will see a red line going from switch, to platform, to throne. This is the action chain linking the objects together. The next screenshot shows the same linkage in Mantellan Crux – from the axe on the floating island, to the crossbow, to the giant sword. At some point, I will number the nodes so it becomes easier to visualise where action chains begin and end.

In Daggerfall Modelling Beta 1 it will be possible to trigger action chains and watch the animations run. There are other actions, such as teleporting the player or casting spells, but I am only going to support action that cause things to move around the scene.

Once gravity and collision are implemented, you will be able to explore dungeons from a first-person perspective with the ability to operate doors and platforms. You can also just turn off collision and gravity to fly around the scene with total freedom.

Add-In Components

The renderer in XNALibrary can plug in components that add functionality. This is quite basic at the moment, but will be extended down the road as needed.

Currently, the add-ins are a billboard manager for rendering sprites like trees, animals, NPCs, and a sky manager for drawing the background sky in location exteriors. You can see these components in action to the left.

The next release of Daggerfall Modelling should be ready in 3-4 weeks. This will coincide with an update to the Daggerfall Connect library download with XNALibrary updates included. All of this is in the SVN now, if you want to download the code as it’s being written. Just keep in mind not everything may be in a stable state in the latest SVN version.