Streaming World 1.2 Release Demo

I had this buried in the 1.2 release post earlier and forgot to post it to the Demos page, which means a few people might have missed out the latest demo code. Reposting just in case!

WayrestInWinter

 

Features

  • Huge streaming world over 340,000 km/2 created at runtime.
  • Over 15,000 fully explorable locations and dungeons.
  • MIDI synthesis and context song manager.
  • Full day/night cycle, seasons, and weather effects.
  • Enemies in dungeons, including random enemies based on dungeon type.
  • Basic combat system.

Streaming World 1.2 Release Demo

Controls

General

  • Mouse move 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 exit game (standalone).

Weapons

  • Z to toggle weapons.
  • Right-click and drag mouse to swing weapon.

Transport

  • R (while outside) for random location, season, time of day, and weather.
  • R (while in dungeon) to recall back to dungeon start.
  • 1-7 for preset location (keeps current season, weather, etc.).

Music

  • P to toggle songs on/off.
  • [ to play previous song in context playlist.
  • ] to player next song in context playlist.

Timescale

  • – to reduce timescale (0-8 steps).
  • = to increase timescale (0-8 steps).

Other

  • I to toggle mouse invert on/off.
  • H to toggle high speed running on/off.
  • L to toggle debug text on/off.

Text And Localization – First Look

Text, text, text! There’s so much text in Daggerfall – from “Rat just died” all the way up to multi-page books. Before it’s possible to tackle many gameplay elements, something must be done about all this text. All the better if the text engine provides localization features at the same time.

Rather than start from scratch, I have integrated the excellent free Unity asset Smart Localization into Daggerfall Tools for Unity. On this solid foundation, I’m building import tools to convert Daggerfall’s various text sources into a format that can be easily localized and consumed at runtime.

Let’s take a look at the basic workflow. Everything starts with creating a “Localization Workspace” in your project Assets. By the way, it’s possible to work on translations without Unity installed, more on this towards the end.

SmartLocalizationSetup

What you see above is the Smart Localization workspace. I have already created 3 languages for English – en, French – fr, and German – de. There is also a Root Language File, which needs a bit more explanation.

The Root Language is a database of native key/object pairs that can be morphed into other supported languages. In addition to strings, the Root Language also supports images, sounds, and other game objects.

I am writing one-click importers that transfer text data out of Daggerfall’s various files (even the .exe) into their own text namespace. See below for an example after importing the contents of TEXT.RSC.

RootKeyImportFromDaggerfall

There’s a fair bit going on here, so I’ll break down all the parts.

Type is the type of asset being worked with. These are all STRING for now, but GAME_OBJECT, AUDIO, and TEXTURE are also supported.

Key is the unique key for this resource. As we’re importing from Daggerfall, the tool maintains each unique key in its own namespace. RSC means that TEXT.RSC was the source and the following digits are the unique ID for that text record. Each distinct resource will have its own three-letter namespace (BOK, IMG, SND, etc.) and unique ID.

Comment is the actual value, or contents, of that record. Anyone that has worked with Daggerfall’s text data will be familiar with the % codes. What’s a little different are how the control bytes are parsed into text format, for example [0xFD] for end of line. This is done because the control bytes are not valid characters for XML (which is how everything is saved to disk) and they are not generally human readable. The [0x00] format makes it very clear where control bytes are used and simple for a human to edit. It’s also trivial to parse these back into byte format.

A little more on those control bytes for anyone unfamiliar with them. They are basically for TTY-styled formatting. They control things like text position, justification, and font, and are very specific to the native Daggerfall GUI at 320×200 resolution. It’s very likely that future developers will prefer not to use the control bytes for their modern scalable UI. However, I pass through the control bytes exactly as-is and its up to the end developer how they wish to use them. If you would like read more about Daggerfall’s text then this article would be of use.

Once the Root Lanuage is ready, it’s time to create our translations. As the text is already in English – en it’s just a simple matter of opening that language and copying all values from Root.

TranslationEN

Now the great thing about Smart Localization is that it supports CSV import/export. This means you can export out your language data to CSV file to edit in Excel or similar tool.

SpreadsheetEN

Because everything is uniquely keyed, translation teams can build “master” CSV files that implementors can use to quickly add/update languages in their projects. For example, below is the CSV for German – de from their TEXT.RSC file.

SpreadsheetDE

And then imported into Unity ready to use in a game project.

TranslationDE

One issue with existing translations is that localization teams have needed to squeeze more complicated character sets down into Daggerfall’s 8-bit format. The good news is this is no longer necessary – you are no longer limited by Daggerfall’s engine. The bad news is that a lot of text will probably need to be rewritten for true character set translations for modern platforms. I will work with international Daggerfall fans to ensure they can use native character sets in the translation tool chain.

So we can create a giant resource database and spin-off various translations. How does this get used in a game project?

Accessing localized resources is very easy. For example, to retrieve a localized text string above, you would use the following code. Other resources are just as easy.

string textValue = LanguageManager.Instance.GetTextValue("RSC.1004");

As the native IDs are preserved, it will be easy for upstream developers to call for the correct translations as linked from quests and elsewhere. You can also add custom values for your own project, just need to give them a unique key.

Fell free to hit me up in the comments or via email if you have any question.

Daggerfall Tools for Unity 1.2!

The huge 1.2 world update is finally live! The tools have come so far since 1.1 and a big thank you is in order to everyone who tested Developer Preview versions and sent me feedback. You’ve all helped 1.2 become more than it could have been without you.

DaggerfallUnity

What’s New!

Core

  • Now requires Unity 4.6. (and not yet compatible with 5.0).
  • Vast streaming world can be created procedurally at runtime.
  • Blazing-fast billboard system for dense trees.
  • Tilemap shader for retro-style ground textures.
  • Enter any valid building or dungeon.
  • Random encounter tables in dungeons.
  • MIDI synthesizer with custom SoundFont support.
  • Hundreds of bug fixes and small improvements.

Demo

  • Complete streaming world demo scene included with all code.
  • Weather effects with Weather Manager.
  • Helpers to change lighting based on time of day, season, dungeon.
  • Contextual Song Manager to play music appropriate to player.
  • Ambient Effects Player to play sound effects in dungeons, etc.
  • A player compass.
  • Footstep Manager to change footstep sounds in winter.
  • Example enemy and player scripts for basic combat setup.
  • Many more small helpers and one-shot classes to learn from.

Get The Release!

Watch The 1.2 Feature Video!

Play The Demo!

Controls

General

  • Mouse move 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 exit game (standalone).

Weapons

  • Z to toggle weapons.
  • Right-click and drag mouse to swing weapon.

Transport

  • R (while outside) for random location, season, time of day, and weather.
  • R (while in dungeon) to recall back to dungeon start.
  • 1-7 for preset location (keeps current season, weather, etc.).

Music

  • P to toggle songs on/off.
  • [ to play previous song in context playlist.
  • ] to player next song in context playlist.

Timescale

  • – to reduce timescale (0-8 steps).
  • = to increase timescale (0-8 steps).

Other

  • I to toggle mouse invert on/off.
  • H to toggle high speed on/off.
  • L to toggle debug text on/off.

Atlas Editor Window

Just a quick post today. I’ve added a simple editor window for searching locations, to be available in 1.2 release. After selecting a region, you can either filter locations by type (city, dungeon, etc.) or enter a partial string which is matched against all locations in the region. The search string is not case sensitive and will match any part of location name.

I plan to add more features to this later, such as a map preview and setting location to StreamingWorld.

AtlasEditorWindowUpdate

 

LypyL’s Unity Multiplayer Test 2

Good news, everyone! LypyL has created a second multiplayer demo for us to enjoy. It was amazing to share a dungeon run with him earlier.

Incredible to think… This is the first time it’s truly been possible to explore a Daggerfall dungeon with friends. Although still in early stages the potential for this is incredible. Great work LypyL!

Edit: Updated link to later build.

LypyL MP Demo2

Daggerfall Tools for Unity – Streaming World Multiplayer V.2.1 by LypyL

Web Player (Hosted by LypyL. Requires Unity Web Player)

New Stuff

  • Daggerfall, Wayrest, Sentinel & Orsinium Castles are explorable. Use fast travel to leave.
  • (local) enemies in dungeons.
  • Fast travel menu with 35 locations.
  • Music.
  • Player Skin selection.

Controls

  • Click to capture mouse (webplayer).
  • ESC to uncapture mouse (webplayer).
  • Mouse move to look.
  • W, S, A, D to move.
  • SHIFT (hold) to run.
  • SPACE to jump.
  • LEFT-CLICK mouse to open doors, operate switches, etc.
  • Q toggle no clip/fly.
  • E climb mode (when facing wall).
  • Z toggle weapon.
  • Right-click and drag mouse to swing weapon.
  • New: F1 fast travel.
  • New: F2 toggle music.
  • New: F3 previous track.
  • New: F4 next track.

Roadmap Jan-Mar 2015

I wanted to post a quick update of my plans over the next few months. This gives me some goals to meet and ensures any potential developers know where I’m headed next.

  • 1.2.x release with streaming world. This should be out in the next week. I’m currently stomping bugs, updating docs, and testing everything I can.
  • A few weeks break for Real Life work, as discussed a couple posts back.
  • 1.3 begins. This will be another big release with an emphasis on Text & Translations, NPCs, Quest Foundations, Performance Review, and Mixing Custom/Procedural Assets.

Moving forwards, I will try and be more conscientious of other developers. This involves a few changes to how I think about the tools.

  • Move to GitHub. I plan to do this as part of 1.2.x final release.
  • Fewer breaking changes when possible. This involves thinking about the impact of any changes to upstream developers. Where possible, I will avoid sweeping changes and use [Obsolete] rather than simply remove old methods.
  • Thinking about multi-player, multi-camera patterns. As much as possible, I will try to organise tools not to depend on a single-player, single-camera pattern.
  • Improve code practices in general. This will be stuff like using Interfaces where appropriate and trying to make the code easier to understand.

Obviously there will be a changeover period where your upstream code will get clobbered by changes at my end, but I’m hoping that sometime after 1.3 you can start to have more confidence about importing changes into your fork.

As always, I’m open to suggestions and learning from others.

Work/Life Time

Hey everyone. I just wanted to let you know that work is still heavy at the moment. I am also about to start a couple of surprise work projects that require a higher than usual amount of presence and concentration.

Things should go back to normal in around 6-8 weeks. In the meantime, I will work on what I can in Daggerfall Tools for Unity, but expect updates to slow down for a little while.

If you don’t hear from me for a couple of weeks, please do not be concerned. I know that I’ve been very active while getting this project off the ground, but it was inevitable that sooner or later I would need to take a break from my hobbies to concentrate on the business. It sucks, but I’ve got to pay the bills.

Thanks for your understanding. :)

Streaming World Test 2

A new build of the streaming world pre-release demo is now available.

New Features!

  • A MIDI synthesizer has been integrated with Daggerfall Tools for Unity. You can now play music from the game!
  • Control passage of time by adjusting time scale.
  • Improved memory handling and other bug fixes.

See full notes below for new controls.

StreamingTest2

Streaming World Pre-Release Test 1

Linux Note: You may need to set the .x86 or .x86_64 to allow executing as program. The standalone Linux build is still an early test. If you have problems, please contact me with your specs and screenshots of issue if possible.

Controls

  • Click to capture mouse (web player).
  • ESC to uncapture mouse (web player).
  • ESC to exit game (standalone).
  • Mouse move to look.
  • W, S, A, D to move.
  • SHIFT (hold) to run very fast.
  • SPACE to jump.
  • LEFT-CLICK mouse to open doors, operate switches, etc.
  • R to travel to a random location.
  • 1-4 to travel to a preset location (more presets will be added to final build).
  • New: P to replay current song.
  • New: [ to load previous song.
  • New: ] to load next song.
  • New: – to reduce time scale.
  • New: = to increase time scale.

Features

  • Explore the entire Illiac Bay. Any region, any climate, anywhere.
  • Run smoothly between cities over actual Daggerfall terrain read from game data.
  • Full day/night cycle with animated skies and city lights.
  • Control passage of time by adjusting time scale.
  • A MIDI synthesizer has been integrated with Daggerfall Tools for Unity. You can now play music from the game!
  • Enter any building in any town or city.
  • Control an athletic player who can jump onto small buildings and sprint at high speeds through the wilderness.
  • Location beacon helps you find cities in the wilderness.
  • Entire world is built procedurally right inside your web browser.

Known Issues/Limitations

  • Not optimized.
  • May encounter a brief hitch when updating sky animation or streaming in a large location.
  • No bounds checking. Possible to run off extreme edge of world or crash.
  • Running very distant from starting point will cause precision issues. A fix is in progress to resolve this.
  • No compass or map to help you navigate.
  • Cannot enter dungeons at this time.

Note: If you encounter problems with precision or fall through ground, please use R to travel to random location or 1-4 for preset locations. See controls below.

 

LypyL’s Daggerfall Tools for Unity Multiplayer Test

If you’ve been around the DFTFU Subreddit, you may have noticed that community member LypyL has been working on a set of multiplayer extensions for the Daggerfall tools. He has now progressed to the point where he’s ready to show off some progress.

I played a bit of this with LypyL a few hours ago and had great fun exchanging blows and flying (literally flying) around the map taking swipes at each other. He’s done an amazing job so far, and I’m excited to host his achievement here on Daggerfall Workshop.

MultiplayerTest

Daggerfall Tools for Unity – Streaming World Multiplayer Test by LypyL

www.dfworkshop.net/web_demos_other/dftfu_multiplayer/dftfu_multiplayer.html

Note: Requires the Unity Web Player.

Controls

  • Click to capture mouse (webplayer).
  • ESC to uncapture mouse (webplayer).
  • Mouse move to look.
  • W, S, A, D to move.
  • SHIFT (hold) to run.
  • SPACE to jump.
  • LEFT-CLICK mouse to open doors, operate switches, etc.
  • Q no clip/fly.
  • E climb mode.
  • Z toggle weapon.
  • Right-click and drag mouse to swing weapon.

Author Notes

  1. On running, players will try and connect to active games on server if there are any, and if not will start a new one.
  2. Games are capped at 4 players (and currently max concurrent user limit of 20 – so up to full games)
  3. On joining/starting game, player has to set their name (either accept the random name or put in a new one in the input box).
  4. They will spawn outside of Daggerfall. I pretty much left all of the streaming world settings at default.
  5. Added scaled down location markers to make other players easier to find. Player names will also be displayed above their skins w/ 3d text meshes.
  6. Players get randomly chosen skins on joining (which aren’t synced among clients – they’re different for everyone). Attacking & moving is animated (the hurt animations should be working, but I can never get them to play for some reason).
  7. Basically nothing else is synced up – audio, doors etc. are not implemented yet.
  8. I switched to one of the standard asset skyboxes due to the sky rig breaking in the web build for some reason.
  9. There is basic combat implemented for messing around. On being hit, a player will lose health until they reach 0 or less, then their position will be set randomly (to somewhere nearby to where they are), and if they are inside, they will transition outside.