Project Work

I’ve had some project work come up that will keep me busy for 2-3 weeks. I probably won’t have much free time, but will update if I can.

Visual Diary: Building Maps – Part 1

The Cartographer view in Daggerfall Scout is a continuous map interface, allowing you to zoom all the way out to see the whole Illiac Bay at once, or zoom right in to street level to see individual ground detail and buildings. The location browser on the left is for quickly finding a location.

 CartographerDev2

Prototype

The first step was to quickly prototype a dynamic scrolling map. The screenshot to the left renders each world cell using a single texture (from TEXTURE.002, .102, .302, and .402 depending on climate type). Locations are just plotted as red squares.

This fairly basic setup solves most of the early problems, and helps me visually confirm my new ultra-fast world queries are working. Now to throw out the experimental code and write it again properly.

 CartographerDev4

Top-Level Map

There will be several levels of fidelity to the map. To start with we have the whole Illiac Bay on-screen at once. On the left is the first version of this map. Water is blue, land is grey, and locations are just yellow dots. So many locations!

I tried several different approaches here before settling on dynamic textures mapped to quads. The next step is to add some details.

 

 CartographerDev6

Region Coding

This picture colours each region band appropriately. The colours have been averaged from the actual region ground textures. Location dots have been disabled so I can see details.

 CartographerDev7

Height Shading

Next I have modified climate colours based on elevation of the landscape. As you zoom in, this will be replaced by actual deformed terrain and textured ground.

Nothing here is pre-generated, this is all built dynamically by reading data from MAPS.BSA (locations), CLIMATE.PAK (climate), POLITIC.PAK (region) and WOODS.WLD (elevation data). Every “world pixel” is built from a combination of data from these sources.

 CartographerDev8

Zooming In

This screenshot is a slightly zoomed-in version of the above. This is about the limit of the top-level map, once you zoom in much further, 3D elevation maps will start to be paged in. My next post will show the process of this being added.

Updated User Interface

I have been working on a new user interface for Daggerfall Scout. I was often frustrated by the previous UI, due to conflicting requirements between the navigation and exploration components. I wanted to put more detail into the navigation pane (lots more detail), but I also wanted the 3D exploring pane to have as much real estate as possible. After trialling many solutions, a simple tabbed view proved the most elegant.

The free release of Daggerfall also prompted a complete rewrite of how I cache content. My initial design only supported an original Daggerfall CD (i.e. optical media). The new cache is more streamlined, in addition to supporting the free version of Daggerfall.

Note: I am a bit further along than these screenshots show, but future posts will be confusing unless I talk about the new UI first.

 DFScoutUI1

First Run

The first time you open Daggerfall Scout, it prompts you to set your Arena2 path. This is more in line my previous tools. The Arena2 path can be a Daggerfall CD, full installation, or unzip of the free download.

Once set, Daggerfall Scout will automatically attach to your Arena2 folder next time you open it. If you move/delete your Arena2 folder, DF Scout will simply reprompt until it is provided a valid Arena2 folder.

You will notice the two tabs at the top allow you to switch between the Cartographer and Explorer views. More on this below.

 DFScoutUI2

The New Cache

Once your Arena2 path is set, Daggerfall Scout will initialise the cache. Unlike the old cache that required everything to be built ahead of time (which could take several minutes), the new cache simply performs a few essential startup tasks. The whole process takes a few seconds the first time, and less than a second on subsequent opens. Content is then cached as needed.

This means DF Scout is ready to go in a matter of seconds, without burdening the user with a cache builder dialog. Not only is this a huge plus for everyone, it allows me to quickly trial changes to my converters without waiting for a complete build or navigating through several windows.

 DFScoutUI3

Cartographer & Explorer

It doesn’t look like it yet, but the Cartographer view is turning into something special. On the left is the familiar region-name browser you saw in the old UI. On the right, I am developing a complete 3D map of the game world you can zoom and pan around (think Google Earth). This 3D map is constructed from random landscape tiles and populated with all cities and locations. When zoomed out these appear as coloured dots, as you zoom in these progress from a simple 2D map to the actual location itself. This view will be the subject of my next several posts.

The Explorer view is more or less what you’ve already seen in previous screenshots (fly and walk around a town/dungeon), but with one exception. You are placed properly in the world itself, and all random landscape is generated around you. You will be able to fly from one end of the map to the other.

To make the two views as seamless as possible, I will be creating several methods of switching between them based on context. For example, if you are hovering over a location you’d like to explore in the Cartographer view, a quick shortcut will take you directly to that place in the Explorer view where you can explore at ground level.

This has just been an introduction to the new user interface. I will be posting more in the near future and showing off early stages of the Cartographer view.

Visual Diary: Odds & Ends

During the busy period at work, I’ve been tinkering on various odds and ends in Daggerfall Scout. This Visual Diary is a wrap-up of the things I’ve been playing with.

 SkyDev1

Skies

The skies in Daggerfall are not constructed by a sky box, sphere, or infinite plane. Rather they are a backdrop composed by two tiling images, one for the west part of the sky and one for the east part. As the player looks left and right, the images are scrolled left and right. As the player looks up and down (or levitates) the images are scrolled up and down slightly to match the horizon line. This approach made for some dazzling skies back in the day, but has a few technical limitations for modern interpretations.

  • While the sky looks quite decent at 1024×768 (screenshot), it does not scale well to high resolutions. On a widescreen monitor running at 1920×1200, the visible portion of our sky backdrop is being enlarged by over 30 times its original size. No amount of filtering can save it from looking stretched, and this spoils the effect greatly.
  • By using backdrops, the sky does not actually go above the player’s head (or very far below the horizon), which limits the maximum pitch (angle looking up or down) to around 60-70 degrees.. If you’ve played Daggerfall, you might remember not being able to look straight up or down as you can in modern games. This is because there’s nothing up there to see!
  • The sky backdrops are designed to give the illusion of sky to a player standing at ground level, or levitating slightly above it. My goal in Daggerfall Scout is to allow the explorer to walk around towns, or zoom all the way out to view a whole city at once. In the former case, skies would look fine, in the latter any pairing between horizon lines is lost and the illusion fails: the sky is visibly just an image painted behind a tiny floating city.

With the above in mind, I need to make a choice on how best to represent the sky in Daggerfall Scout. Do I turn the sky on when walking around at street level, then off again when the explorer zooms out too far? I would also prefer to be able to look 90 degrees up and down, but Daggerfall’s sky backdrops do not allow for this.

Unfortunately, there is no perfect solution. My options are to either limit mobility and view angle, turn skies on and off as required, or to implement another type of sky (which means losing Daggerfall flavour). I will return to this later.

 

 ShadowDev1

Shadows

This one is easy to turn on in Ogre (screenshot made using basic stencil shadows), and the effect is quite dramatic even with traditional per-face lighting. Shadows can be adjusted for time of day so they are long in the early morning or late afternoon, and short during the middle of the day.

I am not using shadows permanently at this stage, as the final decision on how to handle shadows has not been made. I will probably end up using a unified light and shadow model before the final version, so this particular shadow technique is not final.

Also, If you look to the bottom-right of this screenshot, you will notice a working compass. This should help explorers keep oriented in cities.

 

 LightDev10LightDev9LightDev5LightDev6

LightDev7

Lights

Before illuminating my scenes properly, I wanted to get an idea of where lights are positioned, and how their radius extends to the buildings surrounding them. As a mock-up, I dropped in a red semi-transparent sphere over every light source in Daggerfall city. You might remember from Visual Diary: Bright Ideas that street lights are added wherever a flat using a texture from TEXTURE.210 (Lights) is present. In the first screenshot, you can see the lamp-post at the middle of the red sphere.

In the second screenshot is the entire city of Daggerfall, with all “lights” visible. There are several dozen potential light sources in this scene. This is also a great insight into how the developers positioned lights. They line walkways, surround gardens and flood the wealthy market district. Not all cities are as well lit as Daggerfall. Wayrest only has several in key points, and Sentinel is almost lacking street lights entirely.

In the next three screenshots, I have enabled a simple per-pixel shader that creates a light radius against buildings based on their distance from a light source. I’ve turned off textures so I can get a better idea of how the values look moving from light to shade. If anything, it looks a bit too smooth. I quite liked the rougher bands of the old Daggerfall lights, but this is something that can be implemented after some time playing with shaders.

Keeping in mind that I wish to view cities from street level, or all at once, one of the frustrations I have with lighting is the performance hit on lower-end hardware. To show the whole scene from above with all lights visible, a forward renderer requires a tremendous number of passes. There are several ways to optimise this (LuciusDXL has given me some great pointers), but the absolute best results come from using a different pipeline (deferred rendering, or light indexed deferred rendering).

I have chosen not to write my own engine this time around so I can focus on exploring Daggerfall, and not sink valuable time into engine building. The downside to this is that I’m limited to the features my chosen engine (Ogre) offers. Now, I’m aware Ogre’s compositor framework allows you to build a deferred renderer, but this involves more time than I am willing to invest. So for now at least, I’m limiting myself to forward rendering.

What this means is that I need to optimise lights when at ground level, and turn them off when the explorer zooms out to view the whole city at once. Alternatively when zoomed out, I can just switch off per-pixel materials and add simple point lights to the scene. It’s not like you can see much detail from all the way up there anyway.

Daggerfall For Free!

The wonderfully huggable Bethesda have released Daggerfall as a free download. Announcement on the Bethesda Blog is here. A huge thanks to Bethesda for taking this step and releasing Daggerfall to the community.

This also means my exploring tools are now available to everyone – not just people who already own Daggerfall. I’m assuming Daggerfall Explorer, Jukebox, etc. will work with the free download of Daggerfall. I will test this out over the weekend. I will also update Daggerfall Scout so it no longer requires the original CD, and instead works with the Zip file released by Bethesda.

Happy days!

Back On Board

End of financial is finally over for another year (happy!). I’m almost on top of things, and will be back into regular updates starting this weekend.