Tuesday, 30 September 2025

Wearables

How it started

How it's going

Wearables are a thing. Technically we always had wearables ... but it was just a box that fitted on the head, now we have an array of helmets and various armour types.

And needless to say, all of these variations have ended up causing problems themselves ...

After making vast quantities of helmets, helmet variations for differing warbands, I discovered that mesh reskin was borked. Everytime I set a new skin on the mesh ... other skins would reset. After going through the shapeInstance code, I finally got it to agree with me that it didn't need to reset to base skin for all other meshes ... except it still did ... and this is when printf comes into play.


 And it was a lot of printf, but it did let me back-trace through the code to discover the well of embuggeration that was causing the issue ... the shapeInstance appeared to be reinstanced when changing the skin. I must admit, I was not expecting to recreate the human DNA sequence from scratch every time I wanted to change into clean underpants ...

This threw a somewhat annoying spanner of arseholeness into my previously anticipated slick engineering. The main annoyance of course being that I had already made a huge number of helmet materials base on reskinning, but now I had to save the reskinning function for a singular mesh, which would naturally be the main armoured body.

So a minor annoyance in the end, as I would be fearful of breaking MANY THINGS if I tried to change how the meshInstancing code worked. I can still use reskin for the main body, but headgear will now have to be individually exported, and I think the variations of colour schemes for cloth aventails and coifs will have to be reduced somewhat.

Did I mention lots of helmets? Well here they are ... prior to me discovering the resking instancing issue.

Saxons

Norse 

Lombards but could be the Franks

Avars 

Normans 

KievRus

Magyars 

Now obviously not everybody is going to start off in their love heart patterned boxer shorts ... well, except the player who actually is. The Ai warbands are obviously going to start off equipped with their customized armour meshes, all based on rank and faction.

As I have started off with the first half of the warbands, chronologically there are more to come in time periods up to around the 16th Century ... when war gets really boring due to the preponderonce of boomsticks. The current warband factions do not much get passed the 12th Century, so armour is somewhat reduced to the primaries of cloth, chain and lamellar. Technically there is some brigandine in their but only as a defence class rating for superior helmets, so now I'm just getting pedantic. And who doesn't like to get pedantic? I mean why would you even bother with doing indie game dev if you weren't pedantic? It would take all the suffering fun out of it.

Assert dominance over the battlefield by T-posing, it is sure to crush the enemy's fighting spirit

 I had also started to update my Collada format mesh files to FBX. Collada has always worked nicely but it's support is no longer being updated (thanks Sony), so changing to FBX seemed like the logical solution ... except that I had some errors with animations, like baffling errors, like it insisting on contracting the whole animation into the reduced key frames which it I had set, so that's going to require some more testing.

But, in the meantime, here's a video of wearables in action - cue Sabaton. 


 So, next up, is updating my wearable code to remove the skinning references to the helmets and use pre-exported headgear variants, and leave reskinning just for the main body armour meshes. Some sort of special effects for combat, most noteably sound and particles would certainly help too, and then it should be on to making a gameplay world which isn't a flat grey box.

 October is here.

Sunday, 31 August 2025

Warband Revolution

 

To the victor, the spoils - all 3125 of it
 

Work on Warbands and their strategies has progressed well during August, a month were the weather couldn't decide whether it wanted to be the height of summer or mid-November, leading me to keep both the Big Summer Fan and Autumn duvet at hand.

Warbands now traverse the game world - which is still a completely flat and open test area - in search of "Points of Interest" - which are currently tall blue cones to make them visible. Holding an area allows healing of wounded troops, and looting for good old fashioned cash/points.

Warband can now decide that maybe their battered team of a few survivors don't really fancy taking on the huge opposing warband which they have just encountered, and may evade battle by fleeing. Eventually, once I have bows and crossbows working, warbands will have more options for battle than just fight or flee.

Combat now ends with one group deciding that it's time to leave pronto, with unit cohesion breaking down and a total rout breaking out. Pursuers will attempt to block off routed enemies and hack them to bits - it's good for individual XP which can be used to upgrade stats whilst healing at a "Point of Interest", and also for looting loot from the defeated corpses. A routed warband automatically drops half of it's loot in panic.

 

So there is the battle, which the top pick is the final result of. I didn't video all the battle because much of it was just surviving warbands moving from lootable position to new lootable position, so here is just the action.

I also upgraded the weapons, filling out most of the planned classes. This meant modeling some new meshes, and requiring new animations for attack and movement, because a spear obviously does not work like a broadsword. The new attack animations are based off the old ones so look a bit rough at the moment, and will do until I get chance to rotoscope myself cocking around with pole weapons.


 All fine for one handed weapons, but a Viking Long Axe kinda needs it's own moveset where BOTH hands stay on the pole, and so I cried; "once more unto the breach!" and had another look at Inverse Kinetic tutorials.

How IK tutorials are supposed to look - it doesn't work of course

 Now there has been a long running issue with IKs for ... oh about 18 years. Mainly that I never got them to work way back then and ignored them ever since. To be fair, the number of tutorials and easy of use idiot proofing of them has grown exponentially since I first picked up Blender3D in 2007. The idea is, you give the pole an armature with a hand bones high and low, and a central root bone. When you want to move the arms you move the pole's root bone.

And how it looks in game - busted
 

Naturally this doesn't work, because life would be easy if it did. In the above image, Left Side: the lower hand is offset from it's target in the game engine, and in Blender; Right Side: a second pole (selected orange) shows what the actual mountPoint angle is, just as it looks in game. Even though the mountPoint is parenting to the weapon pole armature. No matter what I did, the rotation was always wrong.

So I came up with a solution. 

MountPoint parented but not connected to hand bone

 Now I have previously noticed that Blender and Torque3D open source game engine, like to think that the origin of a bone is at opposite ends, which caused a bit of trouble when parenting hitBoxes to the character previously. So I extended the tips of the hand bones to be level with the mountPoints. 

Hand bone tip level with mountPoint

 The mountPoints themselves will go all over the place if IK'ed - because they are not connected directly to the other bones - so I used the hand bones for the IKs. The weapon had 2 bones now, the top hand point bone was now IK'd to the character's own right hand bone, and then the character's left hand bone was IK'd to the weapon low hand point bone. Dem bones, dem bones, dem ... dry bones!

Weapon IK'd to the right hand, left hand IK'd to the weapon low bone

Now both hands remain in place on the pole because the pole itself is IK parented to the character, and the character is IK parented to the pole. They are no longer ... poles apart! Thank you, thank you, I'll be here all night!

I have since cleaned up the twisting in the left bicep

 So, with IKs finally understood, and working in game I set about animating for two handed pole weapons ... and immediately hit another snag. The weapons themselves needed animating for different states of their ShapeBaseImageData FSMs, otherwise they would be held in the wrong places at the wrong times, holding a pole close when moving had to different from slinging it out to maximum reach in battle. 

After that I had to synchronize the speed of the animations to keep pace with the changes in animation speed of the character's actions, because everything speeds up or slows down depending on making a light or heavy attack for prepAnim or attackAnim. Because attacks use the same button with release time being the deciding factor between light and heavy attacks, light attack for the weapon FSM was being called faster than the prepAnim was ending, so I took the transition to fire out of the FSM and moved it into Player Class animation code for when the prepAnim ends. If it's interrupted there is already a fallback in the FSM for that.

Long Axe is Long!

 I also changed how shields worked. Previously I had them as StaticShape objects, but now I moved them into the ShapeBaseImageData with weapons for easier mounting/unmounting. They share the same parry values as weapons but are seperated by a simple isShield flag. As weapon "images" are not real objects they should also be easier on network load than mounted StaticShape objects, especially with lots and lots of heavily armed warriors running about.

 

  August is over, summer ends - though to be honest my little patch of God's Own County didn't get much of that, when everyone else was going hysterical about "heatwaves" I was shivering under sea fog.

Next month, the cunning development plan is to start actually modeling the armour of the characters, and develop a system were different warbands equip unique looking items. A lamellar helmet and early spengenhelm may be the same class in game but there is a big difference between what an Avar or Lombard helmet looks like and a Saxon Sutton Hoo helm.

Autumn is here! 

 

Thursday, 31 July 2025

Shields, Spears, Seaxes and Warbands

Saxon Warband - you can tell they're Saxon because of that one guy with a Seaxe and the bad teeth

So after getting parrying work last month, it was time to work on shield guarding. Shield Guarding is the easier version of parrying, were you hold up a shield and let the other guy hit you, and the shield absorbs the damage but the defender loses Stamina. If the attack does more damage than the shield's defence rating, then the defender will lose even more Stamina, and if their Stamina reaches zero, their guard is broken and they are staggered - cue free hits. Shield Guarding also slows the player's movement speed.


 With shield guard added to dodge and parrying, the basics of combat are pretty much finished. I did some tinkering with the Ai and they now hunt their opponents on actual sight rather than the previous positioning system I had in place. This makes combat a lot more fluid, and here's a video to prove it, including a brief "look the Ai can now Shield Guard" at the beginning.


 I also noted that the Player themselves could only lock on and off of a target. The camera would then revert to whatever direction it had  before the lockOn occured, and this could be rather disorientating if the Player had done a lot of moving around. Now the Player can cycle through targets left and right by line of sight, and when they end lockOn, the camera stays where it is and just gives input control back to the Player.


 Next up is the crux of my game concept ... warbands!

Warbands are basically teams - and I've got 16 of them with full equipment lists -  that will trudge around the game world, looking for loot and combat. Whilst the main theme is warbands wandering around fighting each other and the Player scavenging equipment/coin/XP from the dead and dying, I am planning on letting the Player eventually being able to join or ally with one, probably for a Danegeld or something. So they'll be a friend/foe system based on previous encounters and the warbands won't always be in a rush to spill each others - or the Player's - blood until something kicks off and vendettas occur.

Norse warband - you can tell their Norse because of their armour stats which I don't currently have models for ...

 I am testing the warband system with just two teams at the moment, Saxon and Norse. This has meant a sudden influx of modelling, as for testing equipment I have needed, axe, longAxe, spears, seaxe and a variety of shields, Targe, Rond and Kite. And then there is the armour, cloth, leather, lamellar, chain, brigandine and plate. The armour is equipped fine and the defensive stats get set, it's just that I don't yet have any armour models so to show that the armour has been successfully equipped everyone has taken to wearing a box on their head.

I also only really have one handed sword animations at the moment, which tends to look a little odd when someone is holding a two handed Long Axe, and combat with a spear involves more thwacking than poking at the moment.

 Each warband has a list of ranks which, apart from equipment, basically detail the attributes and available XP for upgrading that character. Ranks are based on warband type, so the Saxon Fyrd is heavy on low quality levies for the shieldwall with a single Thegn (elite/Knight) and a couple of Huscrals (Men-At-Arms/Heavy Infantry) and no standard Soldiers, whilst the Norse are a more professional outfit of raiders, which make them much more expensive. Both side have few archers and I the datablocks and animations for projectile weapons are still very much on the todo list. For the moment I am concentrating purely on melee, and getting the warbands to move from one location to another as a vaguely cohesive force.

Rather like good old Warhammer, each warband will get the same amount of army build points, set to whoever is the most expensive for a basic force of 10 troops. All other warbands will then get the opportunity to deploy more men, so the largely peasant Saxon army will field 19 troops for every 10 Norse. Whilst the Fyrd's levies may have poor armour, and no bonuses to physical attributes, that is still a lot more spears to be sticking out of a shieldwall. 

Eventually I will get round to battle tactics, such as shieldwalls, but for the moment it's just charge at the enemy and start swinging like a madman.

Next up is getting the warbands to move around to certain points of interest which are just markers placed in the editor. Once I have an actual terrain map these points of interest will be a lot more interesting.

Once the warbands are fully up and running I will start on modelling armour so they finally begin to look the part. 

July is over and it's already August in Space Year 2025. Stop the world I want to get off!