Sign in

Gavin Clayton

@gavinclayton.bsky.social
909 followers 134 following 234 posts

Hello! I'm the creator and lead developer behind Daggerfall Unity. Now working part-time on another game. Devlog: dev.interkarma.net Location: Australia

PostsRepliesMedia
Gavin Clayton @gavinclayton.bsky.social · 22h
Cheers! I really appreciate the shout out. I'm still building hard projects on my own, but it feels less worthwhile every day now
160
Gavin Clayton @gavinclayton.bsky.social · 22h
I built out DFU over 10 years of my life and released everything for free, never asking for financial help even when I really needed it. I totally support people making stuff out of my stuff, but this one is kinda rough on the feels, to be honest
070
Gavin Clayton @gavinclayton.bsky.social · 11/10/2026
This is such a great book
040
Gavin Clayton @gavinclayton.bsky.social · 10/10/2026
CSG modelling and decals.
050
Gavin Clayton @gavinclayton.bsky.social · 09/10/2026
Perishable and renewable
010
Gavin Clayton @gavinclayton.bsky.social · 05/10/2026
Reject modernity, return to constructive solid geometry.
071
Gavin Clayton @gavinclayton.bsky.social · 26/09/2026
Last IK thing using Ozz is foot placement on uneven terrain / static props.
061
Gavin Clayton @gavinclayton.bsky.social · 26/09/2026
Aim target look at attached to head joint. Again, driven by Ozz Animation. The only thing I added was some clamping so my guy doesn't look possessed.
060
Gavin Clayton @gavinclayton.bsky.social · 25/09/2026
Inverse kinematics with hand attach points. I have Ozz Animation to thank for the IK support, it's the animation library that keeps on giving.
080
Gavin Clayton @gavinclayton.bsky.social · 14/09/2026
After porting DFU to my engine, I've caught the bug again for huge streaming terrain that stretches out over the horizon. Working on that with all the tricks I've learned since 2014.
1101
Gavin Clayton @gavinclayton.bsky.social · 31/08/2026
Now I can design each part of the world in isolation and drag it around non-destructively in parent overworld. If I want that roadside diner down the road a bit, I can just drag it there. If I edit the diner kit, the changes are picked up everywhere it appears.
020
Gavin Clayton @gavinclayton.bsky.social · 31/08/2026
What this allows me to do is drop full prefabs with terrain + geometry into the world and everything just blends in together seamlessly. It's similar to what DFU does with RMB city blocks when streaming the overworld, except locations can have their own fully custom layout with full verticality.
110
Gavin Clayton @gavinclayton.bsky.social · 31/08/2026
I've enabled kits (my scene/prefab) to be used as a stamp when nested into a parent kit's terrain. Here the same small terrain kit is nested twice and blended with RadialLog on left for a smooth join and Square on the right to show how it stamps. Foliage rescatters based on layer settings.
190
Gavin Clayton @gavinclayton.bsky.social · 31/08/2026
Environmental story telling
060
Gavin Clayton @gavinclayton.bsky.social · 22/08/2026
If anyone starts a serious port to Godot or similar, ping me. I won't be much direct help because I'm immersed in my own things, but I'd love to hear about it and follow your progress. All the best and good luck!
020
Gavin Clayton @gavinclayton.bsky.social · 22/08/2026
One caveat I'll raise is that I'm the DFU lead dev and also built the engine I tested porting it to. That puts me in a unique position because I already knew both things backwards. But that doesn't change the fact that porting DFU to another engine is now a proven possibility and could be amazing.
110
Gavin Clayton @gavinclayton.bsky.social · 22/08/2026
That's all I've got for now. I'm not sure if I'll go much further on this. I'll be happy if my ports gets to around where DFU was in 2017 and the main quest is playable start to finish. That's a good milestone and the concept is now proven to my satisfaction.
110
Gavin Clayton @gavinclayton.bsky.social · 22/08/2026
When it comes to mod system, I didn't even attempt it as it's almost completely dependent on Unity's stack. Sad as it is, any serious port will need to either accept defeat early (recommended) and do something else, or decide to spend years maintaining even basic mod compatibility to DFU.
110
Gavin Clayton @gavinclayton.bsky.social · 22/08/2026
The quest and magic systems are highly self contained as well. Touch them as little as possible. For quests, DFU attaches components to things in scene (e.g. a quest giver or quest object gets a behaviour). Replace these with your own version of components and the checks work the same.
110
Gavin Clayton @gavinclayton.bsky.social · 22/08/2026
A lot of DF gameplay happens in UIs. All the travel, talk, shop, steal, court, jail, item, spell, quest stuff is all in UI. Port these in whatever order makes sense depending on what you're feeling at the time.
120
Gavin Clayton @gavinclayton.bsky.social · 22/08/2026
Then try to get Class and Career stuff working. This defines real player character and enemy types. Again, it's all largely self contained now. Most of the engine-facing bits are front-loaded. By now, it's mostly porting classes verbatim that don't use MonoBehaviour or anything engine specific.
110
Gavin Clayton @gavinclayton.bsky.social · 22/08/2026
Next comes the faction system. This underpins a whole lot of gameplay. It's largely self contained and game can get crashy when it's wrong. DFU ships a fixed FACTION.TXT file because things go horribly wrong in gameplay when this isn't correct. Use that one.
110
Gavin Clayton @gavinclayton.bsky.social · 22/08/2026
The first gameplay thing to come over should be the Entity system, as much as possible. Everything from combat to quests to magic all need it. An Entity in DFU is just a thing that has stats and moves. The player is an Entity, a mobile enemy is an Entity, etc.
110
Gavin Clayton @gavinclayton.bsky.social · 22/08/2026
The highest value next thing to get running after world is the UI system. It's self contained and mainly uses Unity to draw textures, etc. Fairly easy to port. A lot of gameplay like weapon anims and horse riding actually play through UI system, so it helps to get this running early.
110
Gavin Clayton @gavinclayton.bsky.social · 22/08/2026
Once you've managed to get that working, build shortcuts to fly/teleport around the world to test streaming. Get interior/exterior transitions working. Anything related to actual gameplay at this point is still excluded or ifdef'd out. Try to get the full layouts going with NPC flats in buildings.
110
Gavin Clayton @gavinclayton.bsky.social · 22/08/2026
When it comes to foliage / nature flats, ignore the Burst setup and go back to the older batch shader version. Or whatever. It's fine almost whatever you do, they're just billboards.
110
Gavin Clayton @gavinclayton.bsky.social · 22/08/2026
You might need custom shaders for the flat albedo textures so they don't light weirdly. You'll need a custom shader for the terrain tiling. All DFU's shaders are simple. Once you have these and all the stuff above compiling, you'll be able to get around the world at least.
110
Gavin Clayton @gavinclayton.bsky.social · 22/08/2026
I couldn't get the capsule sweep working properly, so instead the player capsule is a kinematic body riding around on a bunch of ray casts like a Martian walker. Works fine until I hit something just the right way. Every engine is different and will needs its own amount of work and tuning for feel.
110
Gavin Clayton @gavinclayton.bsky.social · 22/08/2026
Expect to spend a lot of time with whatever you replace the CharacterController with. Mobiles walk around real geometry, not physics meshes, and need to navigate stairs, low doorways slopes, single-sided polys sticking through floors, steep ramps. All kinds of problems. Just climbing stairs is hard.
110
Gavin Clayton @gavinclayton.bsky.social · 22/08/2026
Physics is a whole thing. Use the actual meshes for physics (they're tiny). I use Bepu2 which is great, but still hit some specific traps building and tearing down large scenes. You will need ray casts, sphere casts, sweep tests. Helps to keep shapes in memory, they're small and get reused a lot.
110
Gavin Clayton @gavinclayton.bsky.social · 22/08/2026
DFU hands you back terrain elevations for world samplers based on tile coords. It uses Unity terrain, but it's no problem. Just build a terrain mesh at runtime. The terrain resolution in DF is like 1 sample every 6m, it's fast almost no matter what you do these days. I just used a mesh per tile.
110
Gavin Clayton @gavinclayton.bsky.social · 22/08/2026
The scene layout builders need to be refactored for exterior / interior / dungeons. It helps to split your engine's scene work into a set of layout helpers to add models, blocks, etc. and refactor the game code to use these. Ensure you get sign directions right for block layouts.
100
Gavin Clayton @gavinclayton.bsky.social · 22/08/2026
That gets you a long way, then you need to read assets. DFU sits on something called DaggerfallConnect which is super helpful about reading DOS data and handing back intermediate vertex+index arrays for meshes, colour arrays for textures, PCM data for audio, etc. You can use this in any C# engine.
110
Gavin Clayton @gavinclayton.bsky.social · 22/08/2026
The same trick can be used for helpers like Mathf. I created a wrapper that passes through to System.Math. Better than trying to refactor everything. Same for Vector3, Matrix4x4, etc. Rather than trying to refactor the whole codebase, build shims and wrappers everywhere.
110
Gavin Clayton @gavinclayton.bsky.social · 22/08/2026
Next some bad news. There's a LOT of code relying on MonoBehaviour lifecycles (awake / start / update / destroy / etc.). No getting around it and it's hard to untangle. What I did was make my own MonoBehaviour base class and shim the lifecycles back to my engine without rewriting gameplay code.
110
Gavin Clayton @gavinclayton.bsky.social · 22/08/2026
First the good news. The DFU code is pretty self contained and relies on Unity less than a typical project. It reads assets directly from DOS data and other basic types, and builds all of its scenes and gameplay at runtime. There's only a single gameplay scene of mostly manager classes.
110
Gavin Clayton @gavinclayton.bsky.social · 22/08/2026
I've mostly ported Daggerfall Unity to my C# game engine as a fun test, and wanted to brain dump the stickiest problems I've hit so far. This might be useful to someone attempting the same in future. I'll just write these out as I think of them in roughly the order I hit them.
1101
Gavin Clayton @gavinclayton.bsky.social · 21/08/2026
Yeah! There's a real pathway to migrate away from Unity here if someone ever takes the time to do it properly. About 70-80% of DFU's code isn't tied to Unity at all. I've just brute forced this port and chopped out anything I didn't want to deal with, but it's very achievable to do right.
110
Gavin Clayton @gavinclayton.bsky.social · 21/08/2026
There's a "dead body" item in Daggerfall you can carry around
120
Gavin Clayton @gavinclayton.bsky.social · 20/08/2026
Short dungeon run. Still lots missing from port, and not sure if there's a compelling reason to continue with it. But it has been a fun exercise to dive back into DFU again and watch it come to life in my new thing.
280
Gavin Clayton @gavinclayton.bsky.social · 20/08/2026
I've been experimenting with porting Daggerfall Unity to my custom Deep Engine. Challenging but doable, and a good proof that my engine is ready to build with.
1285
Gavin Clayton @gavinclayton.bsky.social · 16/08/2026
Snow is the weakest setup so far, as my basic particle system can't produce nice flutter yet. Still looks OK with a little distance fog and a cloudy sky.
070
Gavin Clayton @gavinclayton.bsky.social · 15/08/2026
Pausing the rain simulation and rotating around model matrix-style.
040
Gavin Clayton @gavinclayton.bsky.social · 15/08/2026
Rain and mist particle systems, volume fog. The mist particles and fog interact with directional lights and a spot light from above.
190
Gavin Clayton @gavinclayton.bsky.social · 15/08/2026
GPU driven particles. Started work on this last year around the same time as foliage imposters. Still very much WIP but it's good enough for a lot of basic effects.
080
Gavin Clayton @gavinclayton.bsky.social · 15/08/2026
GPU driven foliage and hemi-octahedron imposters for select objects like the trees. Terrain shown is 512x512 metres. Uses GPU scattering for foliage with gather and frustum cull. Draw instanced indirect means the buffers never touch the CPU once setup.
080
Gavin Clayton @gavinclayton.bsky.social · 15/08/2026
Mixed deferred and forward materials all lit by the same renderer and clustered lighting. There's IBL, directional, and two spot lights in scene with transparency on a few objects. Sorting transparent objects is still a problem to solve, but this is good enough for standalone objects for now.
090
Gavin Clayton @gavinclayton.bsky.social · 05/08/2026
Buoyancy physics for dynamic objects. Uses four probes around the middle height of each object sampling the Gerstner waves with same math as GPU. Lowering buoyancy causes objects to sink until they settle on underwater terrain surface.
1110
Gavin Clayton @gavinclayton.bsky.social · 27/07/2026
The UI system in my engine is basically the same used in DFU, even if it has come a long way in the last few years. I cut the first code for this UI in 2012. Almost 14 years later it finally has a visual editor haha. Feels great just dragging around layouts with undo/redo, etc.
060
Gavin Clayton @gavinclayton.bsky.social · 27/07/2026
My engine now has a fully lit forward path consuming the same light clusters deferred path uses. This allows me to setup things like semi-transparent windows and other forward objects that still interact with scene lighting. Volume fog and area GI also came out of the same work.
1171