From OpenSCAD to Godot

There was a question on Bluesky how the import works, so here’s a bit of an explanation. But if you’re going to do this, have Claude Code or the like set it up for you. It will save you a good portion of your life.


So far, every vehicle in the tool starts life as a parametric OpenSCAD model.

– Droopy
– Cargo mover
– Landing Barge
– Utility Vehicle
– “A Really Big Tank”

The CAD file is the master. I scripted-reimport the openSCAD when I change things Getting there takes one command per vehicle and Claude Code does a whole bunch of checking if turrets clear and whatnot.

  • Each vehicle has a JSON manifest in the game’s pack. It names the source file and its includes, the units (the CAD is in millimetres or centimetres, the game in metres) and which way is up and forward. Then it lists the parts: the hull, the ramp, turrets, wheels, etc.A part is a SCAD expression the source’s own modules draw, rearramp() or turret(), plus a colour group and, for anything that moves, a joint: the pivot, the axis, the range, and named states like down and stowed. Where a number is needed, a pivot or an angle, it’s written as an expression in the source’s own variables.
  • The importer pulls the source over the network from the manuscript’s mirror.
  • Export part by part. OpenSCAD’s CGAL unions are slow: a whole model takes close to a minute, its individual parts seconds. So the tool generates a driver per part that uses the source, repeats its top-level assignments so expressions can name them, and exports each part on its own. A part placed by a transform (the turrets’ translate/rotate/mirror) has that transform measured off four marker cubes exported through it, so pivots and axes can be given in the module’s own frame.
  • Proof. This is the step where Claude Code earns its keep. Every joint state that has its own SCAD, e.g. the ramp drawn “down”, is checked against the rest mesh turned about the pivot by the state’s angle. A wrong pivot or a wrong sign fails the import. Then the parts, posed as the composition poses them, are compared against the model exported whole.
  • Clean up in Blender. The same script runs headless in Blender: the CGAL facets are welded into a mesh with its normals checked outward, the frame turned to glTF’s conventions, the scale set to metres, smooth shading split at 30 degrees. UVs are a box projection in metres across the whole vehicle at rest, so a texture, or a camouflage pattern, lands at true scale and continues across parts. Each colour group becomes a material; each part becomes a named node, a moving part’s origin on its pivot.
  • Write the asset and its sidecar. Out comes a .glb and a sidecar JSON: every node, its joint in the glTF frame, the named states, the materials and their roles, markers such as where the EM drives sit, the gun mounts with their limits, the proofs’ numbers and the source’s hash. Plus a provenance entry in the pack, so a check can later tell whether the asset still matches its source. The whole thing is deterministic: the same source and manifest write the same bytes, and a –check mode rebuilds to scratch and compares.
  • Godot reads the sidecar. On the engine side there is one class for every imported vehicle. It never names the barge or the Droopy; what a model has, what moves, about what and how far, is all its sidecar’s. Each part becomes a mesh at its place; a joint becomes a node on its pivot that hinges, steers or spins. A material whose role is “paint” gets the hull shader, which paints camouflage in the asset’s own frame at true scale, and a moving part carries its paint with it. Each part’s own triangles become collision, on a body that moves with the joint, so a lowered ramp can be walked up and a hold stood in. Gun mounts become turrets that traverse and elevate within the set limits that were computed from the CAD so a gun never passes through its own hull and its bullets can’t hit itself.
  • A physics stand-in takes the parts as convex hulls, with the mass, centre of mass and inertia the vehicle’s record gives. That way a laden truck settles on its springs and the barge flies like a dead elephant.
The v1 Utility Vehicle model
The v1 Utility Vehicle model

Obviously, this one hasn’t had much detail work done on the OpenSCAD, but you get the idea.

Worldbuilding Total War #1

This is a general update on the efforts to make a system that I can easily create visual material to promote the Total War Setting with. For anyone who has missed the past few weeks, I’ve always wanted to bring as much of the world as I can into a 3D game engine. If it’s only ever good for screenshots, that’s fine, but obviously I have fever dreams of a game one day when I grow up.

RFS, New Shawbury, loading landing barges
Autotrucks loading at New Shawbury on Athena

The autotrucks are the EUAF’s do it all cargo movers. Five axles, hub motors, four steered, hydro-pneumatics suspension, emdrives and pressure sealed crew comparments for shelter though they’re mainly intended to be remote driven or slaved to something like a utility vehicle.

Autotrucks into landing barges at New Shawbury
Loading operations on Athena
Loading operations at New Shawbury
Loading operations on Athena
A landing barge climbing to orbit
A landing barge climbing to orbit

A landing barge can carry up to 12,000 tonnes at a pinch. It takes forever to climb to orbit with that load, but fortunately, the plan is that it’s the way down where you’re taking fire. Just hope you never have to evacuate a planet.

A landing barge coming in for touchdown
A landing barge coming in for touchdown
Flight line at New Shawbury
A flight line on Athena
Flight line at New Shawbury
Flight line
Dusk at RFS New Shawbury
Dusk on Athena
Landing barges at New Shawbury
Landing barges on Athena
Landing Barges somewhere on Athena
A small exercise strip on Athena

All sorts of things happen at training fields. Not sure if this Droopy pilot ever got his wings.

An unsanctioned low pass by a training Droopy at New Shawbury
An unsanctioned low pass by a training Droopy at an Athena training strip

These are the first baby steps into the 3D world, but I’m already very happy with it as a means to give a sense of the feel I want. Proper fidelity might be nice, but even with Claude Code’s help I don’t think I have the time budget to bring it where I’d want it. But I will keep developing it and see how far I can get. In any case, this one page has more imagery than I’ve had in total until two weeks ago.

I’ve also made a few animations, including a 20 second announcement video for Dropship Down. Coming soon ™.

Finally, Relief

Since I was already using OGIS height information, the step to rendering those height differences wasn’t huge. Getting editing tools working the way I want, was somewhat more complex. Still work-in-progress, but we’re making headway.

This is an overview shot, with the relief exagerated by something like 15 times to make it visible on a global scale. You can change the exageration on the fly.

The Thetwick area (features prominently in The Half Elven Orphan), with map overlays turned on. You can see my new snow feature lays over the top of it for currently unknown reasons.

Exact same shot with map overlays off. As you can see, I’m still working on refining the brushes to be able to get natural heights. Keeping rivers flowing downhill is an interesting thing for the tool to have to accomodate.

As I’m working on this, I’m beginning to think that maybe I will be able to place buildings and plots with this eventually. Mainly I’m wondering if I can keep it usable. This now already has a two-step system where it shows the changes made immediately, then bakes it in in a background process.

EUSS Vittorio Veneto (v1 OpenSCAD)

In my efforts to make efforts I always knew I was going to need at least a few of the spacecraft humanity uses in its voyages from system to system for the Total War setting. It makes sense to start with a ship that plays a substantial part in Dropship Down, the EUSS Vittorio Veneto which is a Littorio Class Star Carrier of the EUN (EU Navy). As usual, I’m using OpenSCAD because I despise mouse drawing.

This is a rather early version that’s still missing a lot of details like several of the bay doors, missile racks and emergency chemical thrusters, but it’s a start. I’ve added a Droopy and a Landing Barge for scale. The two cylinders are for habitation, they counter-rotate at 2.93rpm. I’ll spare everyone the rest of the technical mumbo jumbo about why everything is the way it is.

I’m going to have to go through the text and the stats page since things always become clearer when you draw them. Need some small changes so the text is consistent with the model everywhere. I’m going to add details and then import it into Godot soon(tm).

More RFS

A refinement of the ‘Really Big Tank’, though I don’t think I’m finished with it yet. The ammo box on the rear of the turret is too exposes, which is going to need some work. I think I’ve settled on four or five camo styles for now, and the objective is to get them all working on all the vehicles and also to make the vehicles movable in a rudimentary way so I can make screenshots and animations.

The really big tank with the giun stowed.
‘A Really Big Tank’

Then some shots to show the articulated gun. The idea is that the range of motion for the gun is so large that the vehicle can fullfill AA and Artillery roles to a far greater extent than a more conventional design. Of course, this thing is also 12m long and 5m wide, weights 300 tonnes and can fly (see emdrives SPOILERS).

A Relly Big Tank with elevated gun
Elevation example
A really big tank, gun depressed
Depression example I
A really big tank, depression example II
Depression example II

I think this vehicle only really starts featuring in book III, so I’ll publish the name and specs when that is out. I’m still struggling with the edit of book one, so don’t hold your breath.

For those who missed the last few posts, this is a screenshot taken with the photomode in my Godot tool. The model was drawn in OpenSCAD and then imported into Godot through Blender, using Claude Code for the drudge work.

Richthofen Flight Station (first pass)

I’ve been slowly making some more assets as I envisage them to exist in my science fiction setting, Total War. In that setting there is a dusty hell-hole of planet called Athena, and there is a military town on it called New Shawbury. There, you can find Richthofen Flight Station, a very large training installation. I’ve chosen it to line up all the assets I make. This is the first impression.

The utility vehicle in the foreground is an extremely rudimentary model, I still haven’t decided whether it should have windows (read the book to find out why it doesn’t really need them). The tank actually features in a later book, and we’ll just call it the ‘really big tank’ for now. Behind that is the the Droopy Dropship, which features heavily in the first book and beyond that is a landing barge which may still be too small, and it may still need big fins on the back, making its shape a little more like the experimental NASA lifting bodies.

All these vehicles are drawn in OpenSCAD then imported into Godot 4 through Blender with all of it being sped along by Claude Code. Still have a lot more vehicles to do for some of the scenes I want to make, and also some more props. It’s going to be a while.

Photomode Distractions

My new Godot tool, other than the mapping functions, has a photomode for use with the (so far rudimentary) scenes I’ve generated. Still, it’s already usable to produce some imagery that I think is getting to capturing the ‘feel’ of the tales of Vatan setting.

Alagariel, the protagonist of The Half Elven Orphan practicing sword forms (I.33 sword and buckler) near Maiden's Tower.

Alagariel practicing sword forms (I.33 again) at night, with Maiden’s Tower in the background.

The Fire Wraith (pass 3)

Another incremental improvement to a Godot 4.7 photomode render of the Fire Wraith scene out of The Half Elven Orphan. I like grounde settings so the tower is an amalgamation of historical ruins from the period 850-1050. Planet curvature, moonlight etc all derived from the moon and the star system also modelled in Godot. The Wraith herself is Makehuman and Blender, with a historical kirtle-and-chemise outfit. The sword-form pose is from the I.33 manuscript.

I’m doing this because I’m finding it’s very hard for an author to generate promotional material. Walls of text don’t draw people in to a post, pictures and video does. So, this is my solution. Get assets into Godot, make compositions and make stills or animations with them. I’ve used Claude Code to help me make the tools for this (I would never have had the time for it otherwise), but the creative input is my own or the artists I hire. Besides the widespread irrational hatred for generative AI, it’s also just very poor at making the image you want. I’ve experimented with it, but I’d say generating 10,000 images per usable one is about the hit rate. It’s a waste of time, quite aside from the fact that you never know how closely what it flops out is plagiarising someone’s work.

I have more ideas what I might want to do with these 3D assets in the longer term, but I’m a very long way from getting any of that done.

Temptations while mapping

I couldn’t resist the urge to use Godot, Blender, Claude Code and my shiny new OGIS height maps together with my written text to try and generate some 3D scenes. Getting this to where I want it is going to be a long process, but I do have something to show already. There’s a scene in my first book (out now) that gives Maiden Tower, a ruined keep, its name. Since I’m building places in 3D and I have pretty good idea what I want the place and the surrounding geography to look like, I decided I’d try generating it in order to make promotional screenshots.

Maiden's Tower, near Thetwick with a Fire Wraith dancing around its base
Maiden’s Tower, near Thetwick with a Fire Wraith dancing around its base

Those who have read the book should recognise this scene (The Fire Wraith). This is a Godot 4 level, with the geography informed by the OGIS map and the moon position informed by the system view. I did have to fudge the geography and add hills of specific heights in specific spots in order to make everything work with the descriptions in the book, but it’s a scene that can exist in Vatan without having to fudge the possible reality. That sort of result, things that work systemically, are always nice.

This was the second pass, obviously it’s going to need more detail, so it’s an ongoing project. I’m going to use this approach with the Droopy model as well. For promotional purposes I often find myself limited by the fact that writing doesn’t produce much eyecandy. By having my world (partially) described in Godot, I’m hoping it’s going to be far easier to generate promotional screenshots for use on social media and the like. I love Daria’s art but she both doesn’t have the time and I could never afford enough art to promote as much as I need to to sell any books. If sales go up, I’ll happily contract more artists, but even then, these 3D tools will help them create imagery that is plausible.