Leather/Chain materials?

Discuss modding questions and implementation details.
User avatar
Ralzar
Posts: 2211
Joined: Mon Oct 07, 2019 4:11 pm
Location: Norway

Re: Leather/Chain materials?

Post by Ralzar »

Yeah, I have been messing around in the source code a lot lately. Some stuff I thought was comlicated is surprisingly simple. And stuff I expected to be simple was surprisingly complicated.
I think the problem here is that DFU uses the Daggerfall files to get some item information like the name and armour value. You can see this if you change the item number in a save file. Dye is completely seperate from the name and item stats it seems. So you would perhaps need to build a set of items from scratch and have itembuilder sometimes use those instead.
But even if you got that to work, would it count as “chain” for the leather/chain/plate disadvantages?

Jeoshua
Posts: 153
Joined: Tue Nov 26, 2019 7:25 am

Re: Leather/Chain materials?

Post by Jeoshua »

I think that the Pareto Principle should be used here. Less is more. Just modify the loot tables to allow material tinting of Leather and Chain, and change the bonuses accordingly. Also a quick hack would be to modify attribute levels as per a magical bonus would capture well the different uses of different types of Armor. I personally feel that for balance the best fit would just be:

Unarmored, +1 SPD, +1 AGI
Leather, +1 AC base, +1 AGI
Chain, +3 AC base, -1 AGI
Plate, Unchanged AC, -1 SPD, -1 AGI

This would be per piece, and all attribute adjustments would work into skills naturally. AGI affects Stealth, SPD Dodging, for example. This would give incentive for Plated characters to wield Axes and Maces, as they are STR based, and allow Unarmored Monk types to be very good at dodging and Hand-to-hand.

The AC base should be changed, as throwing material quality into the mix throws off the balance of Chain vs Plate.

Leather is the biggest change, its armor being almost solely dependent upon the material quality. The bonus to AGI and effective penalty to SPD vs Unarmored would make early use of Leather without material bonuses questionable, but not unthinkable.

Chain, with a penalty to AGI, would affect one's Stealth immediately, as well as fine control of bladed weapons. The extra armor would be welcome, however,and for more martial builds would be a welcome tradeoff.

A full suit of Armor could give +/- 8 points of Attribute mods, which could be very significant in the early game. This would make completely Unarmored characters very much better at survival, early game. All things considered, I feel like that is a feature, rather than a bug.

Thoughts?
Last edited by Jeoshua on Tue Nov 26, 2019 9:00 am, edited 2 times in total.

User avatar
Ralzar
Posts: 2211
Joined: Mon Oct 07, 2019 4:11 pm
Location: Norway

Re: Leather/Chain materials?

Post by Ralzar »

Not sure about attribute buffs/debuffs. Not because it's not the right idea, but because of Daggerfalls funky character system. A lot of skills do not use attributes for calculating success, only for odds of increasing in skill. Having debuff/buffs affect skills directly would problably be safer and give more accurate results as to what it affects or not.

Jeoshua
Posts: 153
Joined: Tue Nov 26, 2019 7:25 am

Re: Leather/Chain materials?

Post by Jeoshua »

I was going off the principle that Daggerfall works like most of the Elder Scrolls games, in that attributes govern initial skill scores, and that modifying them affects those skills tied to them. If that's not the case then this easy system doesn't really work. It would still be an excellent starting point for figuring out how to distribute the bonuses and maladies. Stuff like Jump and Climb wouldn't be a good fit, since that lies outside the armor wheelhouse, and other mods like Roleplay Realism do a fine job linking those to Encumbrance (heavier armor, less jumpy).

The most important skill modifications in my proposal are Dodging and Stealth. The Agility based thief skills are secondary but nice to add, as it is harder for me to imagine a plate mail thief than an armored mage. Hand-to-hand and Bladed weapons skills are nice as well. And one majorly important idea, I feel, is the combination of bonuses to Hand-to-hand and Dodging, allowing Monk type characters to become a viable option.

Any other complexity added would only over-bloat the concept. You can see why I bring up the idea of keeping it simple. Adding material bonuses to Leather and Chain throws off balance, particularly with Chain, and must be addressed. Adding skill or attribute bonuses and penalties in this situation holds to a tradition going as far back as Role Playing games, deffinitely to AD&D 2e. This naturally brings up the question of what happens with no armor. Anything beyond this runs into the issue of bloat and runs the risk of never being built.

I may make this mod, myself. No promises, I still need to figure out Unity. I'm no stranger to C# or Elder Scrolls, and have been making Bethesda mods for years. I don't have the Unity kit on my computer yet tho. My only internet access is my phone and Unity won't let me download over Android.

I will figure this out, eventually, so please keep poking legitimate holes in this idea so that I can have a strong design when I give it a whack. And anyone reading this who does mod don't take this as a claim. Please, if you want it, do it. No harm in multiple competing systems. Keeps us honest and innovative.

User avatar
Ralzar
Posts: 2211
Joined: Mon Oct 07, 2019 4:11 pm
Location: Norway

Re: Leather/Chain materials?

Post by Ralzar »

The eqasiest way would probably be to select a set of skills that were affected by armour. Then you have "no armor" as default and debuff more and more as you move up the armor types. Dye color could then overwrite default armor value, name, weight and max condition.

I'm thinking Stealth, Swimming, Climbing, Dodging, to keep it simple. There are more that COULD be included, but these 4 skills are the most natural.

Jeoshua
Posts: 153
Joined: Tue Nov 26, 2019 7:25 am

Re: Leather/Chain materials?

Post by Jeoshua »

As far as the code, looking at what is available online, it seems like a good starting point would be the assembly file linked to in this thread, already. Adding the material to Leather and Chain actually seems to be mostly trivial. As you point out, however, there is more to Armor than its Material. One would have to look at what calls that function (around line 135) as well. Wherever the rest of the stats are added, that's a second place where the code has to be hooked.

I know that Attribute bonuses can be added as a spell, but I don't remember if skills are similar. If so, then were halfway to a design strategy. If skill buffs can be added as magical enchantments, it should be possible to use that subsystem to get a working prototype. Of course, that means all armor would be magical, which we don't want. But it should be possible to hook a third section of code to override this.

Two possibilities here.
1. Hijack the enchantment system to add "virtual enchantments". These would be normal enchantments but would not make the item "magical", affect its value, or be able to be added or removed from within the game. Other than the "magical" effect, the game would ignore the enchantment. This has benefits that go beyond this idea ("magic" armor that gives better AC, your standard "Magic Item +N" from DnD), but is slightly more complicated.

2. Hijack the equipping and unequipping of Armor and add/remove stats directly from there. This is very simple, but gets into the issue of spaghetti code. It would work, i t would be simple, but it would be ugly. Also there might be edge cases where the item is equipped or removed through non-standard means and the code doesn't run. Maybe summon armor and equip, but when it goes it doesn't technically unequip. Not sure if that's accurate but that's the idea of what kind of problems there are with that idea. Plus it's not modular or extensible.

User avatar
Ralzar
Posts: 2211
Joined: Mon Oct 07, 2019 4:11 pm
Location: Norway

Re: Leather/Chain materials?

Post by Ralzar »

Jeoshua wrote: Tue Nov 26, 2019 11:56 am
2. Hijack the equipping and unequipping of Armor and add/remove stats directly from there. This is very simple, but gets into the issue of spaghetti code. It would work, i t would be simple, but it would be ugly. Also there might be edge cases where the item is equipped or removed through non-standard means and the code doesn't run. Maybe summon armor and equip, but when it goes it doesn't technically unequip. Not sure if that's accurate but that's the idea of what kind of problems there are with that idea. Plus it's not modular or extensible.
This would actually work better as a seperate mod for "armor effects", that could be coupled with the leather/chain mod. Much like the Ironman mod is actually 2 mods: "Ironman" and "Ironman System". This would be "Armor Diversity" and "Armor Effects".

As a seperate "armor effects" mod it could run a check for each body part, add together the values and apply the debuff.
So, if leather is -1, chain is -2 and pplate is -3: The mod would check each body part and do a
"head + lLeg + rLeg + lArm + rArm + chest = debuffsum"
then have one function that takes the debuffsum and applies it to the correct skills/attributes.
(I am doing something similar at the moment with a temperature mod that adds together several temperature modifers and applies the sum to Endurance)

This would not care about wether there was additional leather/chain variants in the game, same as it doesn't care about plate variants.
Then you can do the leather/chain mod as only worrying about making items appear ingame wiht the correct armor value, name, conditionmax, weight and dye.

This would have the added benefit of letting players easily choose if they just want more armors, just armors to work more realistically or both at once.


Edit: Just got an idea. You could actually do different debuffs for different body parts. Like debuffing melee skills and archery for arm armor. Debuffing dodging for legs. Swimming for chest etc. Which could lead to people wanting to keep use lower types of armor for some body parts. Giving a reason to, for example, only wear a chest plate. Or only pauldrons.
I dunno, just and idea that popped into my head. I think it's a bit sad that the optimal option is allways to just wear full plate.

Jeoshua
Posts: 153
Joined: Tue Nov 26, 2019 7:25 am

Re: Leather/Chain materials?

Post by Jeoshua »

Very good point. Adding Material is trivial, making that make sense and balancing it takes only a little more effort, but adding a system where stats are modified based on armor opens a whole new horizon of possibilities, along with challenges.

So let's scale back. An idea isn't perfect until you can remove or simplify nothing else without losing something integral to the concept. Unarmored monks are cool but don't have anything to do with Daedric Leather. This idea is one we've all had in the past: why isn't there more than basic Leather or Chain. Adding material quality is all that is needed to make that happen. The stats and colors are already mostly in there. The game knows how to do this.

All that is needed to be added is for the game to make legitimate Material Leather/Chain. The balance changes would likely be as simple as making base leather and chain less protective, since your basic material types are already adding someone small advantage. +3 Armor is terrible anyways, so what will making it +1 instead with the higher tiers being +15 really hurt? The naive way is best here. Now, Material doesn't just affect the armor, and we need to figure out how much of that is automatically generated at runtime, like AC, and how much of it is grafted on to the item at creation.

Looking through the save dump, it seems many values are stored on the item, itself:
shortName (Just cosmetic)
nativeMaterialValue
dyeColor (Seems to be separate from the mechanical material)
weightInKg
value1 (I'm thinking this is base)
value2 (Added enchantment value)
hits1 (Current condition)
hits2 (Max condition)
hits3 (?)
enchantmentPoints
Various Texture settings
itemGroup (In our case, Armor)
groupIndex and currentVariant (Which body part and type)

Anything there must be accounted for in creating the item. Anything else (that we care about) is auto calculated anyway.

User avatar
Ralzar
Posts: 2211
Joined: Mon Oct 07, 2019 4:11 pm
Location: Norway

Re: Leather/Chain materials?

Post by Ralzar »

I could probably handle a "armor effects" mod as it is allready pretty close to stuff I've allready got working in my temperatures mod: detecting what you are wearing and debuffing you based on it. (This could actually also be used to give buffs. +5% Stealth for wearing only Kahiit suit? +5% Etiguette for wearing a fancy gown? :D)

But the item creation I at a total loss with. I see another guy here has manged to insert an object into the shop inventory, and Hazelnuts Archeologists mod introduces some new items. But no one has created any new armors.

The bit I am really wondering if is possible to get right: Having the class-based armor restrictions work. That if you choose to be unable to wear chain or leater, that includes the new chain and leather armors.

User avatar
Ralzar
Posts: 2211
Joined: Mon Oct 07, 2019 4:11 pm
Location: Norway

Re: Leather/Chain materials?

Post by Ralzar »

Jeoshua wrote: Tue Nov 26, 2019 1:23 pm
nativeMaterialValue
If I remember correctly from trying to edit savedata, this is the value that looks like it will cause problems. It somehow dictates LongName and Armour value. Possibly other values as well.
I assume it refers back to something in the original Daggerfall files?

Post Reply