More About Scaling

One of the issues that caught me by surprise was a UI scaling problem. This turned out to be more interesting than expected, so I decided to write up a visual diary post about it.

For those who didn’t experience the problem, this is how it looked (1280×960).

ScaleBug1

What’s happening here isn’t technically a scaling problem, it’s a positioning problem. See, Daggerfall has a fixed-size UI of 320×200 pixels. My custom UI system was designed from the ground up to scale Daggerfall’s fixed UI to any resolution while maintaining correct aspect ratio. Depending on the width to height ratio of your resolution, the fixed UI may need to be pillarboxed (black bars down the sides) or letterboxed (black bars top and bottom). The goal is to fit the entire UI into the display without any clipped off edges and keeping that pixel-perfect ratio.

So what’s going in the screenshot above? The answer is that I forgot to turn on vertical alignment in the UI for the parent panel. This means the UI is stuck to the top of the screen instead of letterboxing like it’s supposed to. This is how the above display should look (1280×960).

ScaleBug2

The scaling and aspect ratio are correct in both cases, just the UI wasn’t centering vertically like it should for the letter-box effect at that resolution.

Unfortunately, it really isn’t possible to avoid pillarboxing or letterboxing with a fixed UI, unless you have a resolution that is an exact multiple of 320×200. For example, the screenshot below is a perfect x4 multiple of 320×200 and fits the frame completely at the correct aspect ratio (1280×800).

ScaleBug3

Now it occurs to me that some people simply don’t want letterboxing or pillarboxing. The best solution I can offer is a new option in the INI called “FreeScaling”. When this is enabled, the GUI will scale width and height independently. Here’s an example with FreeScaling enabled (1280×960).

ScaleBug4

The result is the UI is stretched as required to fill entire viewport. This obviously means the aspect ratio is no longer correct, but the chunky pixels still don’t look that bad with a little stretching. I’m willing to bet a lot of people actually play this way in DOSBox without noticing. It’s all down to personal preference anyway. If you want perfect aspect ratio, just leave things at default and the UI will scale and position itself properly now. If you definitely want to get rid of the black bars, then enable FreeScale and enjoy.

It’s also worth noting this does not apply to the game view rendering, which always fills the entire viewport. Only the classic 320×200 UI has this quirk.

I’m just happy my retro UI system is robust enough to handle all these different resolutions, scales, and positions while still working as it should. That’s an accomplishment by itself.

Test Release Fixes Incoming

Thanks to feedback from intrepid testers, I have a solid list of priority items to fix. I will start rolling out fixes in the next 24-48 hours, and may need to spread fixes across multiple test releases.

On the whole, the first compatibility test went very well. Daggerfall Unity ran for most people on a wide variety of systems, and most of the bugs found can be easily resolved. A very positive start to things.

Here’s the list of priority fixes coming in next couple of test builds.

  • UI scaling issue at many resolutions.
  • Alternate save path not used by SaveLoadManager.
  • Linux not loading career data for class selection dialog.
  • Needs Direct3D11 for full deferred shading on Windows. Will add INI options for downlevel rendering paths for all systems. (Note: This may reduce quality of lights and shadows).
  • Game not launching, crashing on video files. Confirmed *.VID files not present in Arena2. Need to fail cleanly and advise users on how to workaround.
  • INI options for tuning mouse weapon swinging.
  • INI options for some cheating, GodMode and ExplorerMode (from demos).
  • Pressing load with nothing to load will hang game.
  • Genders occasionally not read properly from vanilla saves.
  • Reaction setting occasionally not read properly from vanilla saves.
  • Loading some saves will drop you through the world.
  • Vampire characters not read cleanly. Need to at least read these characters back to starting race and appearance. Vampirism won’t be implemented until after quest system is done.
  • Rebindable keys. Will do this in a config file first, then later provide a UI.

Daggerfall Unity Test Build 1

StartingCave

Download

The first test build of Daggerfall Unity is now available for download. Grab your version below.

Invalid download ID. Invalid download ID.

Note: Please see Setting Up below for more information on running build.

Note for Linux users: This build has videos and MIDI audio disabled. This will be fixed in test build 2.

Update

  • Users are reporting UI scaling issues. I have been able to reproduce this and will fix as soon as possible.

Purpose

I plan to drop multiple test builds leading up to first true release. Each test build will open up more features and fix more bugs. By the time the first true release is available, I’m hoping most of the big problems will be resolved.

Thank you to any testers who jump in this early and let me know of problems you encounter. While testing, please keep in mind this build is specifically to test the below key items. At this time, I don’t require any bug reports unless it pertains to the following.

  • Does the build run on your system?
  • Can you start a new game, create a character, and spawn to the bottom of Privateer’s Hold?
  • Can you exit Privateer’s Hold into the outside world?
  • Can you quick-save and quick-load successfully while inside a dungeon and in wilderness?
  • Can you load an existing character from a classic Daggerfall save game?
  • Can you use F5 in-game to view your character sheet, and was your character loaded successfully? (Note: character items are not currently loaded).

Limitations

This build is missing several features planned for the first true release. Following are the main limitations of this build.

  • Only a single quick-save slot is currently available for Daggerfall Unity games. This is pending more work on custom UI windows.
  • Cannot save or load inside buildings.
  • When loading a classic save, the player will not spawn inside buildings or dungeons. If you have a save where your character is inside a building or dungeon your character will instead spawn to an approximate exterior position.
  • No fast travel.
  • Cannot rebind keys.
  • No resting to recoup health.

Setting Up

To play this build of Daggerfall Unity, please follow these steps.

  1. Have a clean install of Daggerfall available (patched to .213). DaggerfallSetup is preferred.
  2. Unzip the download package.
  3. Edit settings.ini inside Daggerfall Unity_Data folder to setup your game. See below section on INI file.
  4. Run the Daggerfall Unity application.

Note: CD-based installs of Daggerfall may not install videos locally, resulting in a crash to black screen. If this happens (and your Daggerfall path is definitely correct), check that you have 17 *.VID folders in your installs arena2 folder. If these are missing, you can copy .VID files from the CD to your local arena2 folder.

INI File

The INI file contains all game settings. Not all settings are currently live. Key settings are.

  • MyDaggerfallPath. This should be set to your top-level Daggerfall folder. This is the folder containing the “arena2” and “SAVE” folders. For example, this path might be C:\ Games\Daggerfall on Windows. On Linux, it will look something like /home/YourName/Games/Daggerfall. Remember that Linux paths are case-sensitive.
  • MyDaggerfallUnitySavePath. When left blank saves will be directed to Daggerfall Unity_Data folder.
  • InvertMouseVertical. If you want to invert your mouse.
  • MouseLookSmoothing. Toggles mouse smoothing.
  • MouseLookSensitivity. Set this value between 0.1 – 4.0 to adjust your mouse look sensitivity.

Controls

General

  • Mouse to look.
  • W, S, A, D to move.
  • SHIFT (hold) to run.
  • SPACE to jump.
  • LEFT-CLICK mouse to open doors, enter dungeons, operate switches, etc.
  • ESC to pause game or go back to previous window.
  • F5 to open Character Sheet.

Weapons

  • Z to toggle weapon.
  • RIGHT-CLICK and drag mouse to swing weapon.

Save/Load

  • F9 to quick-save.
  • F12 to quick-load.

Feedback

Preferred method of feedback is the following thread on the forums.

http://forums.dfworkshop.net/viewtopic.php?f=18&t=141

When reporting bugs, please include the following in your report.

  • A clear description of what went wrong and process to reproduce problem (if possible).
  • Main system specs (OS, CPU, RAM, GPU).
  • If requested, please email output_log.txt file from inside the Daggerfall Unity_Data folder.
  • If requested, please email QuickSave.txt file from inside the Daggerfall Unity_Data/Saves folder (or from wherever your saves are directed).
  • Note that because log and saves are both plain text files, it is also possible to post these to forum thread above.

Thankyou!

And once again, a big thankyou to all contributors, testers, and supporters of this project. You are each helping to create something wonderful.

First Look At Classic Save Importing

Just a quick update today, as I’m right in the thick of it getting the test build ready.

The below GFY shows the current early state of importing classic Daggerfall save games inside Daggerfall Unity. At the moment this is just spawning a character to exact position in world, but I hope to be importing all vital character details eventually. As with everything else, classic save import will become more advanced over time. My ultimate goal is for you to be able to import your Daggerfall characters and pick up the game more-or-less where you left off.

This represents a nice milestone in development so far, one that has required several weeks of planning and engineering just to accomplish this much. Now to put some meat on those bones.

Daggerfall Unity Test Build

Sometime in the next 7-10 days, I will release a test build of Daggerfall Unity as part of my lead-up to first release. Everyone is welcome to try to the test build, but testers should be comfortable with editing INI files as this build will not include a launcher. I’m hoping to get valuable feedback and squash as many bugs as possible prior to first release. Test build will be available for Windows and Linux.

The first release of Daggerfall Unity will carry the moniker “Outer Loop” as this best describes the work so far. The outer loop is that essential framework of game startup, character creation, free roam, save/load, basic combat resolution, resting, and player death. With this framework out of the way, I can start work on individual systems that exist inside of the outer loop. For example, quests, inventory, and loot tables are systems that will be incrementally added over time. Systems with a high number of dependencies (e.g. quests rely on many other systems) will arrive later than more atomic systems with a lower number of dependencies.

Once the first release is available, I’m hoping to set a release schedule of every 4-6 weeks at most. I’m planning out the work in small dependency-aware chunks that should be achievable in those time-frames. This means releases will generally pendulum back and forth between small features and large features.

I have tried my best to create a versioning save/load system so that your saves from older releases can be loaded by newer releases, but it may become necessary at some point to set a minimum supported version for saves. I will mention this in the release notes if and when it happens.

As always, life has a habit of getting in the way despite best intentions. I will let you know whenever there will be delays due to personal issues or scheduled leave time.

Thank you all for your support and encouragement so far. I look forward to hearing your feedback if you decide to play with the upcoming test build.

Twitter Reminder

Just a reminder to anyone hungry for more news, my day-to-day progress is posted to Twitter @gav_clayton. I post small updates and screenshots almost daily (sometimes multiple times a day) whereas this blog is generally for detailed updates and major milestones Even if you aren’t on Twitter yourself and can’t follow me, the feed is visible to everyone.

I’m moving rapidly towards first release of Daggerfall Unity and will have more updates for you soon. Stay tuned!

Character Creation – Part 3

I’ve been so focused on importing Daggerfall’s save games that I forgot to post a video of the character creation as it will be seen in the first release of Daggerfall Unity. So welcome to part 3 of character creation (or part 2 if you’re just following along on YouTube). I really need to think about these titles more.

Players familiar with Daggerfall’s character creation process will notice a couple of things missing from that video. The first release of Daggerfall Unity will not have the “10 question to determine your class”, custom class creator, or biographies. The biographies in particular have to wait for a while as they interface with a few other systems (like inventory and reputation) which still need to be written. As outlined in my mission statement on the forums, I will be building individual parts of Daggerfall in small, incremental stages that give priority to core systems first. My goal is to work towards a minimum viable product sooner rather than later, and keep iterating over the whole until it takes shape as a completed Daggerfall clone.

Personally, I think it’s better to put a work in progress into your hands (along with the source code) than make you wait long stretches between releases. This approach also means that my efforts are battle-tested right from the start, leading to a more robust final product. Think of Daggerfall Unity along the lines of Early Access – except it’s completely free, open source, and you can literally become part of the development. Even if you aren’t a programmer, good testing and feedback is vitally important.

I’m running a bit behind on the first release now, mainly because of the additional work required to import native save games. But we’re getting close to first release of Daggerfall Unity now, so keep an eye on the Workshop over the next few weeks for more information.

Character Creation – Part 2

I have been working through the character creation process screen-by-screen. This has required a few diversions to work on hacking some additional file formats and of course writing new controls for the GUI system.

I nearly have the whole process finished, with the current limitations of not supporting biographies, custom classes, or the questions to select your class. These will be added in a second pass over character creation once more atomic systems are in place. The biographies in particular interface with systems like inventory and reputation, neither of which are implemented yet. All of these systems will come online in their own good time.

One great side-effect of using the existing Daggerfall files as-is will be that existing translation packs by international Daggerfall fans should work flawlessly with Daggerfall Unity. This comes with the other side-effect of having the same text limitations as Daggerfall, but to remedy this I have created a text interface in Daggerfall Tools for Unity called ITextProvider. Programmers are familiar with interfaces as a kind of contract between provider and consumer. Right now, all text you see is being routed through the default ITextProvider, which uses Daggerfall-native string methods. However, it’s possible to swap this out for another ITextProvider implementation using a different source for text. This is still quite early right now, but should pave the way for more advanced translation efforts in the future.

To mix things up a little from this typically English-centric site (it’s the only language I know, I’m sorry everyone) here’s the current state of character creation after applying Le Projet French Daggerfall to my installation. Everything here is running 100% inside Unity using a standard Daggerfall install for data.

Translation1 Translation2 Translation3 Translation4 Translation5 Translation6 Translation7

 

Character Creation – Part 1

I want players to really connect with Daggerfall Unity from the start. Rather than dump you into Privateer’s Hold with a random starting character, my first order of business is to code up character creation and importing existing save games. This means you will be using your characters (new or existing) to experience the project as it grows. The below video shows progress far.

It will take several releases before character creation and importing saves gets to where I want them, but I’m iterating quickly over the problems. Once everything is working, I hope it will help you form a personal connection to the project. The other huge advantage in a save/load system is that you will be able to send me your save games with bug reports. This should cut down on time required to reproduce and resolve any bugs you find.

A lot of work was required just to bring things this far, and that doesn’t even include the big stuff you’ve already seen in action like the streaming world. To give you some idea of what’s happening above, here’s a rundown of new systems packed into that short video. Some of these systems are visible, others are ticking away under the hood.

  • An entirely custom state-driven UI system to render and properly scale Daggerfall’s 320×200 UI at any target resolution. This includes stuff like panels, buttons, outlines, text labels, message boxes, and so on.
  • A custom bitmap font system to render glyphs directly using Daggerfall’s native font files.
  • A messaging and event system for handling opening and closing windows, clicking buttons, etc.
  • ITextProvider interface and support classes to handle extracting native text resources from TEXT.RSC, book files, etc. This also forms the basis of translation features, which can implement ITextProvider in conjunction with a translation asset.
  • Extraction of native video streams and playback in Unity engine with all correct timings.
  • Initial race definitions. This is incredibly basic right now to keep development flowing. The goal is for final race definitions to be read from text files to simplify creation of custom races. Same goes for custom classes when the time comes.
  • Initial entity and effect systems. This covers stuff like player (and monster) resistances, immunity, special abilities, and weaknesses.
  • Real-time export of audio from DAGGER.SND into a Unity AudioClip for playback.
  • Started implementing an importer for importing vanilla Daggerfall save games.
  • Started integrating a serialization system for Daggerfall Unity save/load game.

I hope to have the first release available within 3-4 weeks with at least partial character creation working. New features will just keep being added from there. It’s obviously still early days, but that’s the shape of things to come.

Remastering Daggerfall

Less than 12 months have passed since I began work on Daggerfall Tools for Unity. In that time, my little project has grown substantially and attracted a lot of attention from around the world, including articles on Kotaku AU and Rock Paper Shotgun.

As word about Daggerfall Tools for Unity has spread, a lot of hopeful Daggerfall players have visited looking for word on a remake – only to find a set of development tools not aimed towards players. While everyone seems excited about the potential Daggerfall Tools for Unity offers, there’s a lot of latency between new developers coming on board and getting up to speed before they can offer their contributions. So as a developer community, we may be climbing a steady ladder towards remaking Daggerfall, but there’s very little for non-developers to experience and no clear direction from which a remake will come. I’m contacted by passionate Daggerfall fans almost every week and it breaks my heart that I don’t have more for them.

I want that situation to change. I want the average Daggerfall player to be able to experience progress and have a clear sense of direction that Daggerfall Tools for Unity can be used for remaking Daggerfall, and then some.

What this means is that I can’t just create a toolset. Raw building blocks aren’t enough. I also need to create a scaffold for remastering Daggerfall that includes everyone, developers and players alike.

So let’s get this out of the way. I will shortly release a burgeoning Daggerfall remake, proudly using the Unity engine and Daggerfall Tools for Unity.

For players, this means you will be able to download regular builds to experience the project as it grows. You will become part of the process, able to offer your feedback and constructive criticism to the betterment of the project. Developers win out as well, because you get a functioning Daggerfall remake – completely open source – to build on and change as you desire. For the first time we can all, developers and players alike, come together and contribute.

So where does this leave Daggerfall Tools for Unity? Nothing changes at all. My remake project will be built on the same Daggerfall Tools for Unity that everyone has access to. If anything, this will only improve Daggerfall Tools for Unity by creating a proving-ground for new features and increasing the number of testers.

I will soon release a new web site, solely for distributing the latest playable build of my Daggerfall remake. Daggerfall Workshop will remain as the hub of social activity and development news.

And the best news for players is there’s a swag of new features coming in Daggerfall Tools for Unity 1.4 and 1.5, all aimed at creating playable systems and filling in those blanks between a toolset and a game.

Feel free to leave your comments on this post, or head over the forum post where I’ve kicked off the conversation.