Developer Preview Now Available

The DFTFU Developer Preview 1.2.11 is now available. This includes all the terrain code shown recently.

I have decided to make a Developer Preview build available after major milestones, but before code is quite ready for general release. Please keep in mind that preview features may change substantially before release.

I am also preparing a playable world demo for everyone else. This should be available today or tomorrow.

First Terrain Video

Below is the first video of the open world system in action. There are still a few bugs to fix, such as tree alignment with ground, LOD cracking, and the occasional skip. But overall it’s coming together quite nicely.

Featured Posts From 2014

For anyone new to Daggerfall Tools for Unity, here are some featured posts from 2014. If you are introducing the project to a new community, feel free to link these articles (or just link back to this one).

Time & Space and More

Looks at world time and day/night cycles, along with player GPS and beginnings of world streaming.
http://www.dfworkshop.net/?p=1388

Direnni Tower – Full Demo

Fully playable demo inside your web browser, or standalone for Windows. Introduces sound system, ambient sound effects player, sky effects, combat, dual wielding, enemy AI, building interiors, and a lot more.
http://www.dfworkshop.net/?p=1325

Streaming World – Part 3

Shows off the early streaming world system, along with some details about setting terrain tiles with marching squares.
http://www.dfworkshop.net/?p=1515

First Android Build

Community member Eric creates a native build of Daggerfall city on Android (i.e. not using emulation).
http://www.dfworkshop.net/?p=1425

Release 1.1 and City Basics Part Two

The current release at end of 2014. Also provides updated tutorials showing just how easy it is to create basic gameplay.
http://www.dfworkshop.net/?p=1419

Terrain Overhaul

Happy New Year everyone! I hope you’re all looking forward to another great year in 2015.

Over the break, I’ve been tinkering with my streaming world terrain system. Up until recently, terrains were created as mesh data with mesh colliders. This worked fairly well, but had some real disadvantages.

  1. Creating and updating mesh colliders is fairly slow (much less so in Unity 5, but that isn’t officially released yet).
  2. Lots of extra code to handle meshing of terrain chunks and lots more code to write for LOD support.
  3. System was based on the earlier requirement of UV tiling, which is no longer required thanks to the awesome tiling atlas shader discussed in previous post.
  4. Could be used for streaming world only, no editor design-time support.
  5. Code became bloated and unclear due to handling everything myself. This runs contrary to the spirit of using a commercial game engine in the first place.

I decided that everything should be clearer and run with as little code as possible. That means using Unity’s own terrain system, but how will a splat-based terrain operate with my tile-based shader? Well, turns out it works perfectly with a few tweaks and a custom terrain shader. Below is a standard Unity Terrain object with a random tilemap assigned from custom shader.

UnityTerrainTilemap

Awesome! Now I can throw out around 90% of my clunky terrain system and start fresh using Unity’s terrain. This comes with a bunch of other benefits as well.

  1. Smaller, clearer code when using Unity’s documented terrain system.
  2. Efficient TerrainCollider with complete physics integration.
  3. All meshing and LOD handled by Unity.
  4. Any lighting model and setup handled by surface shader.
  5. Full editor support for painting terrain heights for custom scenes (i.e. not streaming).
  6. Everything can be serialized normally into scene.
  7. Fast preview of streaming world in editor, not just at runtime.
  8. Set your own heightmaps using standard Unity workflow.
  9. Can potentially combine my tilemap shader with splat painting for higher detail.
  10. Can add details like grass and rocks using the standard detail settings.
  11. Can use Unity’s own tree system (or SpeedTree with Unity5) for truly amazing forest scenes.

Those last two items just rock my socks. This really is the best of all worlds. Daggerfall’s terrain is merged seamlessly with Unity and all the extra power it provides. This was the entire reason I chose Unity in the first place, and I’m kicking myself for wasting so much time on my own terrain system beforehand. Oh well, live and learn.

Below is a screenshot where I’ve quickly painted heights around the outside of a custom town using the standard terrain tools. The town ground tiles are seamlessly painted on terrain where required. Note how the continuous LOD does not impact the tilemap, which is totally decoupled from mesh vertices.

CustomTerrain

My next job is to get everything working in the streaming world once again. It’s been a much longer journey than expected, but I’m much happier with the direction things are going now.