Can These Things Be Fixed? <Long>

Users who are viewing this thread

Well... any one you walk away from. This is, at best, a partial victory. I'd forgotten just how !*#!*@! hard it is to do multimesh rigs, lol. I had problems when I fixed up Dthehun's original rig for the dress mesh, too, but nothing like this bad.

Essentially, this was done by taking the MC Amazon body, which was the closest thing I could find to Native's body in FBX, and using it as the template for making the dress work, once the mesh was exported from OpenBRF.

Surprisingly, that went really well, including the UVs not getting totally borked. Once I got that part done, I first tried importing the dress and rigging alone, letting the Taleworlds body be beneath it. That didn't work at all; lots of clipping through my geometry. After wrestling with that for waaaaay too long, I eventually circled back to the MC Amazon mesh, deleting everything that was covered by the dress, then rigged both of them to the Bannerlord skeleton, and did a few little edits to weights where geometry met up.

Because we don't have the original FBX files, rigging weights aren't perfectly matching up at the neck seam and wrists. The neck's major; the wrists are minor. I can probably cover that up with a brooch and some bracelets, though.

Taleworlds, release the full FBX files for bodies, heads, hands and feet, please.

This process was ridiculous; I totally see why most of what's been done thus far is custom races with entirely custom bodies and heads. As it is, this is basically a one-woman "race", but it's really just a piece of equipment. That's best approach for this kind of clothing... well, unless the body shader doesn't get the correct color value- I won't know that until I test in-game, because there's no way to test that in the "editor", naturally.

But... ideally, there'd be a reference FBX, and some sort of Blender script for getting the rigs close to matching.

At least now, I have a valid approach, and now that I've done this the hard way, maybe next time I won't have to spend quite as much time pushing triangles- the new model is quite a bit thicker in the waist than the old one was, among other details.

pose_matching_smd_animation_frames6.png

I should probably say that this was really very much the worst-case, absolute-hardest-possible export. This was old, low-low poly, and multi-mesh... as well as including a !*@!@*#!@*+ skirt.

Making the exporter animation alone took quite a lot of messing around, but mainly because I had to remember stuff about SMD animation that was ancient the first time I learned it, lol.

But, with that in hand... I should be actually able to port over just about any armor I want, because there's just one human skeleton, and it's tuned to be "close enough" for most purposes. I'll need to find a FBX of the Taleworlds male body to use as a reference at some point. Right now, I'm thinking I may as well get through the pain and do the other Dthehun meshes while I still have any desire to look at them again, lol.
 
Last edited:
So, it's done. Got the texture variant in, too. These both use 3 512s, and are smaller, even with the body meshes, than most Native armors for Bannerlord by a country mile. I've built minimalist LOD2's that I should probably make LOD3's, given this, but whatever.

Lessons learned:

1. The lack of a good reference body FBX is crippling. The only ones available all have problems with neck seams. I looked around on Nexus, and the only choices were all bad. There doesn't appear to be a single whole-body replacer mod that's actually, well, good, in the sense of Skyrim / Fallout's famous body mods.

Here, for example, in the final edits I fixed up the hip-waist ratio to feel a bit less thick in the midsection and a little closer to the heroically-slim profile of the Warband female mesh (scant as it was). I don't like the ridiculous E-cup boobs on the MC Amazon mesh, but it's the only one with actual cleavage that I can match up with the existing armors, which were designed for that.

2. Doing armors like this, mixing in the Taleworlds body, is pretty annoying, but doable. Now that I've figured out the basics, the rest should go more smoothly. The key here is to start with a body mesh, then cut out everything that's hidden, then rig. The amount of time I had to mess with the body because I was learning as I went was really annoying.

I thought rigging was basically done when I wrote the last post, but it wasn't nearly there yet. There are still small issues, but honestly, I suspect they're present in Native's mesh as well. For example, wrist and ankle geometry doesn't quite meet up, even if the final vertices are all rigged to the appropriate bone 100%. This must mean Native's mesh isn't rigged quite right, either. It's off by such a small amount that it's barely seen, but it's there.

The head / neck mesh is a whole other story, however. I'm wondering if Native's "bra" mesh is really just there to hide neck-seam issues. Why on Earth the head / neck mesh goes so far into the body is a total mystery. It's like somebody in the art department said, "hey, let's make it as difficult as possible to rig". There's no reason why the heads can't end about halfway down the neck, with nice clean rigging all the way to the joint. How it was done is bizarre, and I couldn't ever get it quite matched up, so I gave up.

3. I hate the lack of gloves that are just gloves. Not, "fits over the armor in a giant, bulky way" things, but you know, just gloves. As it is, I have no idea whether that's even feasible, given that apparently anything that hides the hands does Bad Things. I have no idea whether these armors will crash the game due to lacking a _slim variation (I'm guessing not, since not every armor has a male / female variant).

4. There's something about the current Editor that kicks my GPU into high gear for long periods of time. I can't even imagine what's causing that, when it's rendering basically nothing. But it's turned my office into a bit of an oven this evening, lol.

pose_matching_smd_animation_frames7.png


pose_matching_smd_animation_frames8.png
 
Last edited:
It's hard, but it's not a flash in the pan. Specular still needs some love, but you get the basic idea. The pauldrons were a surprise; I thought they'd be hard to get working.

Nope, the hard part was the metal bra and a few dozen minor details, lol. The biggest issue is that any armors with wrist guards and skin showing like this need the end verts to be controlled by the hand bones, rather than the forearm. There were various other points of madness. I think the next one, I'm going to pick something that doesn't show any skin, just to get relief from that problem, lol.
pose_matching_smd_animation_frames9.png
 
Last edited:
OK...

So I fired up TPACTool, just to see what we're really dealing with here.

Good news? I can port the heads out, rigged! Yay rah!

Bad news? That neck seam looks like it's in the TW rigged mesh, it's just not quite as bad, lol.

That said, maybe I'll port out the female body mesh, do minor mesh edits, use the Amazon skin, have a closer match?
 
Just some friendly advice. These forums are a wasteland. Nothing ever happens here, that's why you might feel the modding scene has died out. It's because the scene is on Discord instead.
The modding server is usually lively and there are a lot of helpful people.
 
I'll check it out.

The problem I generally have with Discord communities is that... it's rather difficult share useful information as you find it, for others to discover weeks or months away in time. A thread like this literally cannot exist there; it's just a series of posts that get lost in a flood of chatter.

Modding's fuel is reliable information. TW dropped the ball, by not providing good import / export tools, meshes people needed to model clothing, or much decent explanation about workflow and "gotchas".

For example, after a bit more messing about, here's something more like what I wanted for a base female model- a little closer to ideal proportions, things like the belly / hips fixed and the breasts positioned for clothing restraint, rather than laying flat against the chest. It is also properly rigged to the neck.

Yes, that little seam's there on Native meshes as well, lol. I'll release this as a mini-mod as soon as I am sure I'm not doing any further touchup work.
nude_mesh_rework01.jpg
nude_mesh_rework02.jpg

nude_mesh_rework03.jpg

I'm a bit depressed, though, because this means I'll probably have to either re-rig the first two armors from scratch, or just ignore their flaws. I should've started here, lol. Oh well, it's a learning process.
 
Last edited:
I've hit a wall. Despite being promised by TW devs a decade ago that this would be addressed in the Bannerlord engine... submeshes using the Native body Material do not, in fact, get the vertex color assignment sent to the shader in-game.

I'm going to get the Wheene stuff done, release it and call it a day. This engine is so... un-worth the trouble, lol.

This is a five-minute code-fix, Taleworlds. Before rendering sub-mesh, just do a binary-comparison operation on the Material name:

if(submesh.material_name.equals("female_body_a")) --> do vertex color assignment of Body Color in the shader. I just... can't, lol.

mesh_after_testing_ingame_no_vert_color.jpg
 
Last edited:
A. The cost of weapons and armor isn't in the relevant XML files; it's being calculated somewhere in the code, under the hood. Why? Because of the build-a-weapon forging system, which I instantly disliked, is why. Apparently each part in a forged weapon magically increases costs based on <some formula> that's tied to the stats, rather than the parts. It's absolutely insane from a game-design POV; you'll see random-rolled weapons that suck, but cost huge amounts, etc. I want to get rid of it. Can I just stick a value into the XML entries for a flat cost and reference that in code?

B. I want to just flat-out get rid of Forging entirely. Like, lock-stock-and-barrel. No forged stuff, no UI for it, no Tutorial pointing at it, nothing. I don't think I've ever seen a major mechanic in a video game I've reacted to with so much visceral loathing before, lol. Is that even remotely possible?
The weapon crafting system is definitely a huge enemy when wanting to do any game design, precise balancing of weapons is impossible. To tweak something simple like swing speed of a weapon there are a plethora of attributes and weapon parts that contribute and you have to play a guessing game hoping to get what you want.
We have a system where weapons use the crafting system as a base but any attribute you want to update can be entered into the xml to overwrite the calculated stats. We actually replace all of the stats for all of the weapons, but its nice to have the option.

As far as I know, the same is possible for item values, just more harmony :razz:
 
Yeah, I was thinking w/ the weapon crafting system, I'd either abolish it (remove all references in troops, set them to unbuyable) or simply use that value XML tag I found to set them to something reasonable and call it a day, for their cost. Money isn't a good balance tool, anyhow; at the end of the day, the player's going to get the power tools, and it's largely down to whether that's unbalanced, in the sense of making the game too easy, or not. In Blood And Steel, there were plenty of seriously powerful weapons that could one-hit many troops in the game, but it was balanced by the way that combat worked, where ultimately a player, by themselves, wasn't going to win anything much.
 
<casts resurrection spell>
Welcome back at modding :grin:
Only a bazillion left to go. Talk to me, people.
I only noticed today at the discord that you are around again, I rarely look up the Bannerlord modding section (sticking to Warband modding as Swyter does).
That hasn't been my experience thus far. The content we made back in the day could probably all be ported forward. I presume you haven't looked at the weapons in-engine yet... trust me, they look great.
Many Bannerlord modders are ignoring Warband assets as they regard them too old and so on.
The problem I generally have with Discord communities is that... it's rather difficult share useful information as you find it, for others to discover weeks or months away in time. A thread like this literally cannot exist there; it's just a series of posts that get lost in a flood of chatter.
This is an issue which we found at Warband modding too lately. It's more difficult to bundle the informations now since people rarely use the search option at Discord. Documenting all the useful information bits is tedious work but we try our best at Warband. For Bannerlord it seems like there are no people collecting informations in a structured way, perhaps also because some parts are getting reworked with game updates and one would need to update the informations all again.

Otherwise I have nothing constructive to say at your thread except that I am happy that you slowly find your way through at Bannerlord modding. Don't get burned out by modding it though, at the end you should still have fun at it :grin:
 
Well, I was hoping it'd be fun. Or at least, productive, lol. Honestly, it's been more like... work?

However! I've finally achieved some success.

It all started with this "armor", to get around the skin-color issue. And yes, that elbow bork is in the Native mesh. Whoever decided to use four bones for arms... please, never do that again, lol. The amount of expense and time consumed trying to make that work must have been incredible, and to be really honest, it didn't improve the animation quality of the game much, while making modding considerably less easy.
dthehun_success_01.jpg

Now, equipped with a body that has good seams and proper weights (because it's just the nude female body mesh and rigging with a different Material, essentially) I went back to figuring out how to cut, paste and rig up one of the old armors. The big problem with the old armors is the arms; the new armors all use 4 bones for arms, and these were designed for 2 bones, and their topology isn't working well. Sooo I did a few things to cut them up into manageable pieces, and what do ya know, it can be done.

dthehun_success_02.jpg

It's a long, long road from here to having all my femmes fatales working. I suspect that the full suits are going to be impossible to port correctly, or they'll need massive changes to the topology to function. This doesn't bode well for most of the male armors I want to salvage, either. But one step at a time.
 
Last edited:
Many Bannerlord modders are ignoring Warband assets as they regard them too old and so on.
I just want to say that while the armors are, well... you can see how much fun they've been to port, compared to the weapons... but the weapons, shields, etc. are totally fine, and that they're getting skipped for conversion is a huge mistake.

I've also noticed that a surprisingly-large number of people grabbed Mackie's stuff, so there's some level of interest in this.

Bannerlord's weapons are... interesting. They're higher poly, but most of that's wasted, imo, because of the atlases they used to get massive numbers of parts done with their build-a-weapon system. The more I've looked at that, the more I think it was a massive waste of company time and resources. The art department could have been building things that actually added real value to the game rather than trying to get all the little parts working as required, etc.- that must have taken months. That whole system just feels like a wasted opportunity cost, and it's terrible game design, to boot.


[EDIT]Oh, but some really good news. Making boots convert turns out to be trivial.
 
Last edited:
Turned out, fixing up the mesh that I spent so much time on was a snap, with this new method. Now for the fun part, where I get to mix and match parts.

dthehun_success_03.jpg
dthehun_success_04.jpg
 
Last edited:
Soooooo... I've got good news, for once. Monolithic armors with better topology? They actually work; like, minimal-rework, just straight to rig, and rigging's pretty easy (well, for rigging, lol). I'd really forgotten just how hard Dthehun's meshes were to rig, back in the day; this was a piece of cake. I have high hopes that this means I can rescue a lot of the old male armors, too.

dthehun_success_05.jpg
 
Last edited:
Today, I learned a few hard lessons.

1. Thou Shalt Not Move Content Directories. Why? Because the Editor makes some sort of meta-data that's explicitly tied to a directory structure, and it doesn't search to re-validate. I'll write that up as a feature request. Anyhow, if you change folder names or their nesting order, everything gets borked. It sucks.

2. My previous approach to additive objects just didn't work correctly. It turns out that there's some weird stuff going on with the post-FX systems involving light addition to the scene, and while it worked just fine in the Editor, it didn't work in-game. Taleworlds, if you're reading this... that needs to get fixed; the Editor needs WYSIWIG rendering that behaves exactly like the game world.

I was using a Material based on one of the few additive exemplars, that's on some scenery objects in villages, etc. When taken into a combat environment, it blooooooooooooomed into giant blobs of pure white!

However, there was a solution. There's a Shader that uses "contrast correction" that actually works properly. Problem there being, it's all-or-nothing; there's no way to control it through a texture variable, like the other one. So I had to laboriously port out the Wheene stuff with additive and separate the glowing bitz and re-import, using a second Material (which will have a minor hit on performance due to switching contexts, but these days, it's probably fine).

So besides the usual lesson of "test small, then go big", I think mainly I got reminded of why I eventually built custom shaders for Warband; IIRC I started off wanting to get rid of vertex lighting and then rapidly decided to get rid of most of the bloom, too. Not a big fan of bloom systems that don't have a two-part path for additive and specular results; you want bloom that doesn't wash out color values for the former, and you want to avoid big washed-out bright spots with the latter.

3. Mixing and matching armor pieces has allowed me to build a bunch of "looks" quickly. Once I got that process figured out (essentially, have a small catalog of armor bitz sitting in the right positions in OBJ, bring in what you want, mount to a bone, done) it worked quite nicely. Between that and swapping Materials, you can get a bunch of looks done fast.

When I eventually get around to making more than one female body armor material, I can do that, too, for even more customization (although I must say that if you're just stuck with one under-armor, that maille is a nice neutral base).

However! When you're doing assembly, you need to watch out. If your armor pieces have any Materials assigned in Blender, you need to zap them before export. Having more than one Material on any given piece (which can happen really easily, if porting from one rig to another, for example) will cause the Editor to choke, because it reads each Material in the FBX as belonging to a distinct sub-mesh, rather than stopping at the first one per piece. That issue cost me 20 minutes of head-scratching last night, lol.

dthehun_success_06.jpg
 
Last edited:
I've figured out how to manipulate spawned Party sizes. No longer are Looters, Sea Raiders, etc. capped at tiny sizes.

This took forever, it's about five lines of actual code, and it's a mess!

The problem here is that:

A. The method that performs this MobileParty.FillPartyStacks() is private, so not only are we doing reflection, we're doing it with a reference to the calling instance.

C#:
        [HarmonyPatch(typeof(MobileParty))]
        [HarmonyPatch("FillPartyStacks")]
        private class newFillPartyStacks
        {
            private static Boolean Prefix(MobileParty __instance, PartyTemplateObject pt, int troopNumberLimit = -1)
            {
                for (int i = 0; i < pt.Stacks.Count; i++)
                {
                    int numberToAdd = pt.Stacks[i].MinValue;
                    if (numberToAdd > 0 && pt.Stacks[i].MaxValue > numberToAdd)
                    {
                        numberToAdd = MBRandom.RandomInt(pt.Stacks[i].MinValue, pt.Stacks[i].MaxValue);
                    }
                    InformationManager.DisplayMessage(new InformationMessage("Running the party patch!", TaleWorlds.Library.Color.White));
                    CharacterObject character = pt.Stacks[i].Character;
                    __instance.AddElementToMemberRoster(character, numberToAdd, false);
                }
                return true;
            }
        }

This... this is why using reflection is bad, Taleworlds. All this semantic sugar, surrounding black-box, third-party code performing injections... and whatever else, raising the difficulty of entry and generally making your product worse for modding.

For goodness sakes, just let us override your methods or classes, lol. But no, we can't do that, because MobileParty is a sealed class, for no reason that makes sense from here.

B. I don't like this solution, because all I've really done here is forced that little method to utilize the full range of the min_value / max_value variables derived from partyTemplates.xml. It's not "smart". Oh well, it works.

C. While this does work, I still don't have a general-purpose bit of code to iterate all the MobileParties and <do stuff> with yet. It appears that MobileParty.All is probably the right way to do that. Yay, we're making a little progress here. Sadly, I'm about to be busy IRL for a bit; I should see whether I can wrap up Wheene's stuff rather than mess with this further.
 
OK, more code.

Do you want to get rid of Companion limits?

C#:
        [HarmonyPatch(typeof(DefaultClanTierModel))]
        [HarmonyPatch("GetCompanionLimit")]
        private class newGetCompanionLimit
        {
            private static void Postfix(ref int __result)
            {
                __result = 999;
            }
        }

Do you want to implement a heal-over-time (easily extended for other Damage Over Time systems by throwing Agents into a List) system for characters (i.e., the way Heroic Health worked in Blood and Steel)? This is called from Submodule.cs in OnApplicationTick(dt), which is the only area where we're allowed pretty direct access to the sim (well, if you're willing to wade through decompiled DLLs, lol).

C#:
        private float timeUntilHealthUpdate = 0f;
        private void selfHeal()
        {
            timeUntilHealthUpdate += dt;

            //InformationManager.DisplayMessage(new InformationMessage("Delta Time " + dt, Color.White));
            if (timeUntilHealthUpdate >= 5.0f)
            {
                foreach (Agent agent in Mission.Current.AllAgents)
                {
                    if (agent.IsHuman)
                    {
                        if (agent.IsActive() && agent.Health > 0.01f && agent.Health < agent.HealthLimit)
                        {
                            float healthToAdd = 5f + ((float)agent.Character.GetSkillValue(DefaultSkills.Medicine) * 0.005f);

                            if (agent.Health + healthToAdd <= agent.HealthLimit)
                            {
                                agent.Health += healthToAdd;
                            }
                            else
                            {
                                agent.Health = agent.HealthLimit;
                                for (int i = 0; i < 3; i++)
                                {
                                    int theCount = agent.GetAttachedWeaponsCount();
                                    if (theCount > 0)
                                    {
                                        agent.DeleteAttachedWeapon(0);
                                    }
                                }
                            }
                        }
                    }
                    else
                    {
                        if (agent.IsActive() && agent.Health > 0.01f && agent.Health < agent.HealthLimit)
                        {
                            float healthToAdd = 10f;
                            if (agent.RiderAgent != null)
                            {
                                healthToAdd += agent.RiderAgent.Character.GetSkillValue(DefaultSkills.Riding) * 0.005f;
                            }

                            if (agent.Health + healthToAdd <= agent.HealthLimit)
                            {
                                agent.Health += healthToAdd;
                            }
                            else
                            {
                                agent.Health = agent.HealthLimit;
                                for (int i = 0; i < 3; i++)
                                {
                                    int theCount = agent.GetAttachedWeaponsCount();
                                    if (theCount > 0)
                                    {
                                        agent.DeleteAttachedWeapon(0);
                                    }
                                }
                            }
                        }
                    }
                }
                timeUntilHealthUpdate = 0f;
            }
        }

Still working on doing the other major features of Blood and Steel over here. Damage system's 99% working as intended, but I'm still working out a few things w/ horse trample mechanics and shield damage.

As for the build-a-weapon system... that's simply going to require a lot of data-entry, but it can be gotten rid of.

That's going bye-bye the minute I have enough old weapons converted over and can replace 1:1 everything that's deployed to Troops in the game. I'll simply mark them as no-drop, no-sell items, remove them from all inventories, and that should cover it; they'll simply quit showing up, other than items players forged themselves. If not, I can use C# to strip them from shop inventories, etc., the hard way. The only show-stopper there is replacing the existing content, i.e. the weapons. Gosh... it's almost like having all those weapons just lying around is going to be useful, lol.
 
Last edited:
Want a way to cull the MobileParty objects, seach for nearby ones quickly, or generate all-new Bandit parties of whatever template you want? Here's a code example. Has to use Reflection to get access to WeeklyTick because, well... because.
C#:
[HarmonyPatch(typeof(CampaignEventReceiver))]
        [HarmonyPatch("WeeklyTick")]
        private static class newWeeklyTick
        {
            private static Boolean Prefix()
            {
                Vec2 location = Campaign.Current.MainParty.Position2D;
                List<MobileParty> stuffToKill = new List<MobileParty>();
                foreach (MobileParty mp in MobileParty.AllBanditParties)
                {
                    if (mp != null)
                    {
                        //Uses a square-search method for speed.
                        Vec2 distance = location - mp.GetPosition2D;
                        float absX = MathF.Abs(distance.X);
                        float absY = MathF.Abs(distance.Y);
                        if(absX > 100f &&  absY > 100f)
                        {
                            stuffToKill.Add(mp);
                            InformationManager.DisplayMessage(new InformationMessage("Culling party! " + mp.Name.ToString(), new Color(0f,1f,0.25f)));
                        }
                    }
                }

                foreach (MobileParty mp in stuffToKill)
                {
                    if (MobileParty.AllBanditParties.Contains(mp))
                    {
                        mp.RemoveParty();
                    }
                }

                for (int i = 0; i < 5; i++) {
                    Clan randClan = Clan.BanditFactions.GetRandomElementInefficiently();
                    CreateBanditPartyAlt(location, randClan, randClan.Name.ToString());
                }

          
                return true;
            }
        }


        //BANDIT CREATION SCRIPT
        public static void CreateBanditPartyAlt(Vec2 location, Clan clan, string partyName)
        {
            float shortestDistance = 50f;//I think this is kilometers... maybe?
            List<Settlement> finalSet = new List<Settlement>();
            Vec2 finalDest;
            foreach (Settlement set in Settlement.All)
            {
                if (set.IsVillage)
                {
                    //Uses a square-search method for speed.
                    float absX = MathF.Abs(location.x - set.GetPosition2D.x);
                    float absY = MathF.Abs(location.y - set.GetPosition2D.y);

                    //If we're in the square, do the thing.
                    if (absX <= shortestDistance && absY <= shortestDistance)
                    {
                        finalSet.Add(set);
                    }
                }
            }
            if(finalSet.Count == 0)
            {
                InformationManager.DisplayMessage(new InformationMessage("Could not create new MobileParty, no valid destination was found!!!", new Color(1f, 0f, 0f)));
                return;//Abort!
            }

            Settlement setToSpawnAt = finalSet[rnd.Next(0, finalSet.Count)];
            finalDest = setToSpawnAt.Position2D;

            //InformationManager.DisplayMessage(new InformationMessage("Creating new party: " + clan.Name + " at " + finalSet.Name, TaleWorlds.Library.Color.White));
            MobileParty theParty = BanditPartyComponent.CreateLooterParty(clan.StringId, clan, setToSpawnAt, false);
            InformationManager.DisplayMessage(new InformationMessage("Building new party via random system! Clan: " + clan.StringId + " Location: " + setToSpawnAt.GetName().ToString(), TaleWorlds.Library.Color.White));

        
      
            PartyTemplateObject pt = clan.DefaultPartyTemplate;
      
            //InformationManager.DisplayMessage(new InformationMessage("PT stringID: " + pt.StringId, TaleWorlds.Library.Color.White));
            //InformationManager.DisplayMessage(new InformationMessage("Clan stringID: " + clan.StringId, TaleWorlds.Library.Color.White));
            InitializeMobilePartyWithPartyTemplate(theParty, pt);
            theParty.Position2D = finalDest;
            theParty.Party.UpdateVisibilityAndInspected();
            theParty.Party.Visuals.IsVisibleOrFadingOut();
            theParty.Party.Visuals.SetMapIconAsDirty();
            theParty.Party.Visuals.ValidateIsDirty(theParty.Party, 0f, 0f);
      
        }

        private static void InitializeMobilePartyWithPartyTemplate(MobileParty theParty, PartyTemplateObject pt)
        {
            FillPartyStacks(theParty, pt);
            theParty.Party.Visuals.OnStartup(theParty.Party);
        }

        private static void FillPartyStacks(MobileParty thisParty, PartyTemplateObject pt)
        {
            for (int i = 0; i < pt.Stacks.Count; i++)
            {
                int numberToAdd = pt.Stacks[i].MaxValue;
                if (numberToAdd > 0 && pt.Stacks[i].MaxValue > pt.Stacks[i].MinValue)
                {
                    float playerProgress = Campaign.Current.PlayerProgress;
                    int RandStack = rnd.Next(pt.Stacks[i].MinValue, pt.Stacks[i].MaxValue);
                    //InformationManager.DisplayMessage(new InformationMessage("Warmup: Player Progress = " + playerProgress, TaleWorlds.Library.Color.White));
                    if (playerProgress < 0.1f)
                    {
                        //Lowers spawn sizes quite a lot at lower levels.
                        numberToAdd = MathF.Round(0.25f * RandStack);
                        //Makes sure that the first slot is always populated!
                        numberToAdd = Math.Max(1, numberToAdd);
                    }
                    if (playerProgress >= 0.1f && playerProgress < 0.5f)
                    {
                        numberToAdd = MathF.Round(0.5f * RandStack);
                        //Makes sure all slots are always populated!
                        numberToAdd = Math.Max(2, numberToAdd);
                    }
                    if (playerProgress >= 0.5f && playerProgress < 0.75f)
                    {
                        numberToAdd = RandStack;
                        //Makes sure all slots are always populated!
                        numberToAdd = Math.Max(4, numberToAdd);
                    }
                    if (playerProgress >= 0.75f)
                    {
                        numberToAdd = MathF.Round(1.5f * RandStack);
                        //Makes sure all slots are always populated!
                        numberToAdd = Math.Max(8, numberToAdd);
                    }
                }

                CharacterObject character = pt.Stacks[i].Character;
                thisParty.AddElementToMemberRoster(character, numberToAdd, false);
            }
        }

Generally, this code does:

1. Looks for, and deletes, Bandit parties that are too far away from the player to practically matter to the game, and might cause simulation problems.
2. Makes Bandit parties of a random type near the Player Party's location, based on nearby Villages. Eventually I'll clear that up and use Hideout locations instead, and make it non-random, but this basic version is intended for people to learn from.
3. Provides an example of exactly what needs to be initialized when creating MobileParty objects and filling their slots with the Troop types defined in their XML.
4. CreateLooterParty(), which is basically where we're creating the MobileParty for the first time using Native code, refers to clan.StringId - this is the string value in spclans.xml for the given Clan.
5. If you want to use any Party Template that's not the DefaultTemplate, there are several others available, such as BanditBossPartyTemplate, etc. I have yet to test whether that can work. As for making any brand-new Party Templates... I have no idea. But the code above can be extended to allow users to do whatever they want, in terms of spawning Bandits; just use unique "clans" for each type, like Taleworlds did.

Each Bandit group is its own "clan", and this handles that. Creating Lord parties is a bit more complicated, because they need a Hero, etc. beforehand- this code doesn't provide an example of that functionality. But there's no reason this can't be used for, say, a Clan's self-defense forces, a special MobileParty the modder needs to manipulate for a scenario, etc., etc.
 
Last edited:
Still moving along. This was the last really tricky one to rig, I think. It just kept getting easier, once I had a system.

System, if anybody wants to try this:

1. Use that BRF animation to export the old armor in roughly the right position.
2. Scale up the armors by 103%; this gets them really close.
3. Import into Wings or Blender for final touchups, fitting to the body.
4. Pair with the rigged body mesh.

In this case, I actually tried out Blender's mesh Boolean operation to cut out unnecessary geometry, to see if it would maintain rigging, and it kind of does. It screws up the rigging weights at the new geometry that's made right where old stuff gets cut, but that's easily dealt with, since it's (generally) being cut at things like the arm-guards, which are rigged entirely to one bone, so I merely rigged those triangles to the same bone and it's fine.

5. Rig and test and adjust and so forth.

I want to work on some variations of the armored body-gloves, now that the basics are in place. On this one, I kind of wish I'd kept the original legs and just slapped a new texture on them, but this leaves open the possibility that I can use the human body Material there in the future.
dthehun_success_07.jpg

Meanwhile, the damage system code is about final; I'll prepare it for a proper release soon. It was an interesting adventure to sort that out.
 
Getting this working was genuinely painful, lol. This armor was originally something I threw together as a makeshift but ended up liking enough to keep around, largely because I liked having something that was pretty easy to reskin. However, I've learned an unpleasant fact from this one that I didn't from the previous suit of plate; this one has a low neck, and the positions and proportions of a bunch of things weren't getting along with the TW head mesh. That neck base! I hate it with a passion; it makes this so much more difficult. I'm sure it's also going to wreak havoc with the best of the male suits, too.

These look pretty good in motion at this point and clip less than the original rigging did, but the pauldrons were really not fun and various small details, like getting the back and hips to follow the motions without much distortion, was really painful. This more-or-less concludes bringing in all of the old female armors, though, and, like the earlier ones, I can now use mix-and-match with these if I want- removing these pauldrons for Dthehun's, etc.

In Blood and Steel, I had four variations of this set, just to string things out a bit more for players who wanted more variety; that gave 20 potential suits of armor from this one mesh alone, but it wasn't terribly interesting. I've done two here; that gives 8 suits that actually have different parts and materials, and demonstrates how we can use multimesh / multimaterial to do variations easily.
dthehun_success_08.jpg
 
Last edited:
Back
Top Bottom