Importing and Exporting

Contents

Importing Meshes
Exporting Meshes
Importing Animations
Exporting Animations
Poly Counts

Importing Meshes

Back to top

To import a mesh, navigate to File/import/Kenshi OGRE mesh.

You’ll only need to enable the “import normals” checkbox for non-skinned meshes.

  • Keep XML creates new XML files in the folder where the mesh was imported from. They can be useful for debugging and list mesh and skeleton data (e.g. the exact position of each vertex) in the XML file.
  • Import Shape Keys is needed for characters with shape keys assigned, like humans and hivers – but only if you intend to use them.
  • You can select a skeleton in the viewport and check Use Selected Skeleton on importing to parent a mesh to that skeleton. It’s most useful when you’re having trouble importing armour with its vanilla skeleton.
  • You only need to Import Animation on male/female skeleton files if you intend to edit or make new ones, and animals if you intend to edit and re-export an animal mesh. Avoid on the human skeletons if you’re only using the skeleton files to weight clothing and attachments to as it takes a long time to import.

Where To Find Kenshi Meshes

Navigate to your Kenshi folder. You’ll find all game objects in the following folders:

  • Animals: data/animal/meshes
  • Animation Files: data/character/meshes/male_skeleton; data/character/meshes/female_skeleton
  • Armour and Clothing: data/items/armour
  • Buildings: data/buildings
  • Characters: data/character/meshes
  • Crossbows: data/items/weapons/crossbow
  • Foliage and Features: data/foliage; data/newland/assets
  • Generic Items: data/items/meshes; data/items/misc
  • Swords: data/items/weapons/mesh

Batch Importing

Kindrad’s I/O plugin can import multiple meshes at the same time. Simply Ctrl + click to highlight multiple items or Shift + click to select all items between a starting point and an end point.

When Clothing Doesn’t Import With a Skeleton

Some clothing items don’t import properly with their parent skeleton files, which can cause a headache if you want to import with weights.

When this happens, try one or all of the following:

  • Import the male skeleton or female skeleton file (depending on mesh) and check “use selected skeleton” when importing.
  • Make a new folder somewhere. Move the male (or female) skeleton files (mesh and skeleton) to it, then move the skinned mesh (and skeleton) file to the same folder. Try importing from there.
  • Move the skinned mesh (and skeleton) files to the vanilla male/female skeleton folder and import from there.

Unfortunately, sometimes it still doesn’t work for some objects.

Un-triangulating Meshes

Imported Ogre meshes are triangulated. That makes them hella annoying to work with.

Hit Alt + J to revert to quads. It’s not perfect and if you want to use edge loops you might have to dissolve some edges (X > dissolve edge), but it’s better than nothing.

Exporting Meshes

Back to top

When exporting meshes, you’ll need to enable separate checkboxes depending on what you’re exporting. A non-skinned mesh like a building, generic item, or sword, only needs to have the “export tangents” box enabled. Buildings may use vertex colours, so many sure to check the “export colours” box if you have used them.

Skinned meshes (armour, clothing, hair, humans, and animals) need to have the “export binormals” and “export skeleton” checkboxes enabled, as well as being parented to a skeleton.

Armour, clothing, and hair should be parented to the male or female skeleton respectively and you’ll need a separate mesh for each. Make sure to differentiate the names when exporting, such as by adding an “F” to mark a female mesh. Otherwise you’ll confuse Kenshi when it tries to load files of the same name. Skeleton files are loaded automatically alongside their child meshes, except for animation files. You’ll need to reference those separately inside the FCS.

It’s good practice to use rigid naming structures when making your own files. Don’t simply call your shiny new set of armour “armour1.mesh”. You’ll forget what it is and create compatibility issues with other mods. For reference, all armour items in LitA are prefaced with “_LITA_” to eliminate compatibility issues.

Batch Exporting

Kindrad’s I/O plugin can batch export as well as importing.

To do so, highlight multiple objects in the viewport and select “batch export” upon exporting.

Importing Animations

Back to top

Enable the “import animation” checkbox to import animation files along with a mesh.

Animation files are stored in the skeleton a mesh is parented to. For animals, it’s linked to the animal mesh. For all humanoid characters, it’s linked to the meshes found in the “male_skeleton” and “female_skeleton” folders respectively. While animals may have unique animations assigned to them, all humanoid characters share the same animation set.

You’ll find more about animation files and working with the Dope Sheet and NLA track in the animation chapter.

Importing human characters with their animations will take a while as there are a lot of them.

Exporting Animations

Back to top

As with skinned meshes, make sure to check the “export binormals”, “export skeleton”, and “export animations” boxes. Once again, your exported mesh needs to be parented to a skeleton to export.

Poly Counts

Back to top

Alright, get your thinking cap on.

Why Are Poly Counts Important?

No matter how powerful hardware is, there’s always an upper limit to how many polygons can be displayed at once. Is there a golden rule?

Well, yeah. If you care about performance. Sit back down if you want to hark on about UE5 and Nanite. That’s tomorrow’s tech.

The “golden rule” is to go for as many polygons as you need – and as few as you can get away with. The silhouette is what’s most important and the textures (and normal maps) handle the rest.

Bear the context in mind, as well. In Kenshi, 5,000 polygons is reasonable for a suit of armour – but it can quickly add up. A vanilla human dude wearing full Crab Armour, for instance, adds up to more than 27,000 tris – and that’s without a weapon. Three of these dudes moseying about the wasteland together equate to a greater poly count than Kratos from God of War 4.

Anything that appears on screen a lot – hair, humanoid characters, armour, swords, props, and crossbows – can hurt performance if you go overboard. Crab Armour is arguably too complicated given that Kenshi habitually has groups of dozens of characters on-screen at once. Those groups of Holy Nation patrols you see wandering about Bast would equate to a million polygons each if they were kitted out like the crabfolk.

It’s not a huge problem in isolation. So-called “hero” pieces, be they buildings, features, or fucken whatever, are fine now and then and if you want a giant-ass building that’s 100k tris then go for it.

But try and keep the counts low: Ogre is already a withered, single-threaded engine. Don’t beat it with a hammer.

Here’s a great video from a niche creator about poly counts. Check out his other stuff, too!

A Rough Guide To Reasonable Poly Targets

It’s hard to come up with a rule of thumb because every need is different.

Even so, here’s a very rough set of guidelines. You should always aim for the lowest tri count possible, within reason. Don’t spend hours optimising a mesh to remove 100 tris – but do reduce your meshes down to reasonable levels or design them from the ground-up with performance in mind.

The listed vanilla references are rough guides that should be taken with a grain of salt.

Armours

Simle boots (sandals): 500 tris
Complex boots (samurai boots, plated longboots): 1,000 tris
Pants: 1,500 tris
Simple torso (heart protector): 1,000 tris
Complex torso (armoured rags): 5,000 tris
Simple hats (straw hat): 500 tris
Complex hats (samurai helmet): 1,500 tris

Full armour set (simple): 5,000 tris
Full armour set (complex): 15,000 tris

Vanilla Armours Reference

Heart Protector: 900 tris
Plate Jacket: 4,800 tris
Plated Longboots: 2,200 tris
Samurai Armour: 3,700 tris
Samurai Clothpants: 1,500 tris
Samurai Helmet: 1,050 tris

Buildings

Simple furniture (tables, beds, bookshelves, item chests, street lights, campfires): 250 tris
Prop buildings that fill out the environment or act as storage (water towers, large containers, machinery): 1,000 tris
Complex functionality buildings that won’t appear too often (generators, crafting stations): 5,000 tris

Buildings with interiors: 2,500 tris per floor
Hero buildings with interiors (HQs, rare special buildings): 25,000 tris per floor

Vanilla Buildings Reference

Bookshelf: 600 tris
Campfire: 200 tris
Street Lamp: 750 tris
Generator: 10,300 tris
Windmill: 14,200 tris

Storm House: 5,000 tris
Swamp Dome: 23,200 tris
Ancient Citadel: 40,000 to 50,000 tris

Swords

Basic swords: 250 tris
Sheath: 250 tris
Elaborate swords: 1,000 tris

Vanilla Swords Reference

Katana (sword + sheath): 400 tris
Naginata Katana: 330 tris
Fragment Axe: 320 tris
Ringed Sabre (sword + sheath): 1230 tris

How To Optimise a Mesh

Deformation Matters

For skinned meshes, you’ll need more accurate topology around the areas that deform. That’s around the shoulders, elbow, spine, knees, ankles. A common strategy is to add a couple of edge loops just after and before a deformation point that minimises the squash and stretch of a mesh, like this:

Note how the rest of the arm isn’t too complicated. Even so, humans could (arguably) be optimised by ~1,500 tris (~30%) without losing any detail, resulting in up to 300k fewer tris on-screen in big battles, but eh. 5k for characters isn’t that bad.

The Silhouette Is Important

You’ll hear this any time poly counts come up, but it holds true: The silhouette is most important. Consider the following factors:

  • How close can the camera get to the object?
  • How often will the camera get close to the object?
  • In what context is the object in the player’s field of view?

Remember that stuff looks markedly different when it’s a lifeless, untextured object inside 3D software to when it’s textured, lit, and surrounded by ambient fog in a game engine. Don’t base your opinion solely on what you see in your 3D software.

Delete Unimportant Junk

This applies more to props than anything else. The vanilla Swamp Dome is an example: It’s 23k tris but could probably be reduced by 15-20% by deleting some unimportant details, like machinery and piping.

Think about it: How often do you gawk at the non-interactable background props in your favorite games? Players, by and large, look for shiny stuff that has a function. It doesn’t matter if it’s a health pickup, a loot chest, an NPC with an obnoxious arrow above their head, a glistening beacon on a faraway hill.

We tend to filter out the background noise pretty damn quick.

No, this doesn’t mean you have to remove all the pretty bells and whistles. Instead, try and focus on core details and crucial parts of a mesh than convey an idea. If it’s covered in wiring and piping, try removing half of it and seeing what it looks like. Make one part more pronounced and scrap the stuff that doesn’t stand out unless it’s near and dear to your heart.

Does the mesh convey the same idea? Do you really need a control panel with 50 buttons when 10 would do the trick?

Cool.

Do that.

Quick and Hacky Optimisation

Non-skinned meshes can be optimised with Blender’s “decimate” modifier. You’ll get ugly-ass topology but it’s quick, simple, and will preserve your UV unwrap. It’s best to keep a backup of your mesh handy in case you want to work on it more with clean topology or make edits later on.

To decimate a mesh, add a decimation modifier, set it to “collapse” and play around with the ratio. “Unsubdivide” works on non-triangulated meshes and can be useful if you’ve used a subdivision surface modifier* or otherwise subdivided your mesh. “Planar” decimation can be useful but tends to break your UVs, so it’s only useful before an unwrap unless you want to pull your hair out.

*Don’t over-rely on subdiv surfaces. Seriously. Stahp.

Here’s a direct comparison of a Storm Building’s walls using decimation. As you can see, the resulting mesh silhouette is almost identical. You may have to fix some face normals after decimation so be sure to look at your model from each angle.

Edge Sliding

Edge sliding is an easy way of removing unnecessary topology that’s clean to begin with. Usually this preveres UVs, though check before and after. It’s best to work with seams when using edge slides. Here’s a quick example with some rope:

Retopologise

Retopology is a massive subject and I won’t go into great detail about it. Suffice it to say that you might want to consider retopologising if your mesh is far too complicated – or if you’re working with a sculpt.

Retopoflow is a great Blender addon if you’re serious about retopology. It’s free for students and, while kinda pricey for indiviuals, it pays for itself in hours saved if you need to retopologise a lot of stuff. Here’s a retopo video from the creators that covers the basics of how to approach retopology with the tool.

Speedretopo and Draw Xray are alternative options if you want to save some cash. Speedretopo costs $5, while Draw Xray is free with an optional $6 version with extra features – though consider tossing the developer a few bucks for their work if you like the free verison.