Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add reactive, reflective and hardened armor #45

Closed
CptMoore opened this issue Jun 20, 2018 · 20 comments
Closed

add reactive, reflective and hardened armor #45

CptMoore opened this issue Jun 20, 2018 · 20 comments
Labels
roguetech has something to do with roguetech

Comments

@CptMoore
Copy link
Member

reactive, reflective and hardened armor have properties that have to be coded in, but the actual problem is that they don't use up slots, so you can't detect them being enabled.

the idea is to add a special slot to all mech locations that can only be used for armor selection.

  • standard
  • ff
  • reactive
  • reflective
  • hardened

either make sure to add and filter those things properly (and ignore crits like endo-steel slots), or make it more like regular components you have to scavenge for.

@LadyAlekto
Copy link
Member

BTW if you are interested the game has working damagetakenmultipliers (toyed a bit with them while trying to make my variant of reactive/reflective/blueshield early on)

They are in DesignMaskDef

@Aliencreature
Copy link
Contributor

Additional armor and structure types from Advanced and Experimental Rules that require the above code changes:

Ferro-Lamellor Armor: occupies 12 slots, reduces all incoming damage by 1 for every 5 points per hit. For example, a Medium Laser in game that does 25 damage will only do 20 damage against a mech equipped with Ferro-Lamellor.

Reinforced Structure: takes only 50% damage from all types, weighs twice as much as standard structure. Requires no slots.

Composite Structure: takes 200% damage from all types, weighs 50% (like endosteel), occupies no slots.

@Aliencreature
Copy link
Contributor

I am looking at Tactical Operations right now, and according to it, the following armor should not need extra coding:

Reactive (occupies 14 slots, 7 for Clans)
Reflective (occupies 10 slots, 5 for Clans)
Ferro-Lamellor (occupies 14 slots)

The issue is Hardened armor, which does not occupy any slots. I think we could get away with having it occupy a single slot.

@CptMoore
Copy link
Member Author

Laser Reflective Armor dissipates energy weapon attacks 50% more efficiently than other armor types
'Mech is physically attacked, the armor is half as effective as standard or Ferro-Fibrous armor
The total damage taken by the armor from energy weapon attacks is rounded down.

case Energy: dmg/2
case Melee: dmg*2

Reactive Armor protecting the area, the damage is reduced by 50%. Missle Weapons.
In addition there have been several cases where lucky weapon fire has initiated an armor explosion, stripping the Reactive Armor away from the protected location, leaving the unit extremely vulnerable.

case Missle: dmg/2
crit chance 1 % self dmg armor

Ferro-Lamellor

dmg - dmg/5

Reinforced Structure

dmg/2

where to look to patch:

designMaskDef.ballisticDamageTakenMultiplier
AbstractActor.GetAdjustedDamage
if AbstractActor as Mech && Mech.MechDef.Inventory hasReactive

@Denadan
Copy link
Contributor

Denadan commented Jun 26, 2018

additional one only armor slot (on ct for example) cose you cannot mix armor types(is it possible to add armor hardpoint, or need additional script check like engine?)
armor - independended module, add all bonuses. must be equiped in this slot and salvaged as usual.
armor crits - "free" module, no bonuses itself, need to fill armor crit slot requirements, cannot be salvaged.

ps. same rule for endosteel. even can use same crit filler module.

@Aliencreature
Copy link
Contributor

Aliencreature commented Jun 26, 2018

Ferro-Lamellor

I'd like to add something else here, due to how Tactical Operations handles it. Ferro-Lamellor doesn't reduce damage by 1/5th exactly. It subtracts 1 damage for every 5 damage taken, or for every fraction of 5. This is best explained by LBX autocannons in the manual:

An LB-10-X in cluster mode shoots 10 projectiles, each of which does 1 damage. Because the damage is between 0 and 5, Ferro-Lamellor removes 1 damage for every projectile. Thus a mech equipped with Ferro-Lamellor armor is immune to LB-10-X cluster munitions.

Using the 5x damage scaling of BattleTech, the damage done by Ferro-Lamellor would be:

finaldmg = dmg - 5xROUNDUP(dmg/25)

So a medium laser that does 25 damage would do:

MLdmg = 25 - 5xROUNDUP(1) = 20

But a medium pulse laser that does 32 damage would be:

MPLdmg = 32 - 5xROUNDUP(32/25) = 32 - 5x2 = 22

This makes Ferro-Lamellor very good at dealing with many small weapons, but gets diminishing returns at higher damages like an AC20:

AC20dmg = 100 - 5xROUNDUP(100/25) = 100 - 20 = 80

The best use-case for Ferro-Lamellor at the moment is machinegun fire. Each burst does 5 damage:

MGdmg = 5 - 5xROUNDUP(5/25) = 5 - 5x1 = 0

So regular machineguns are useless against ferro-lamellor armor.

additional one only armor slot (on ct for example) cose you cannot mix armor types(is it possible to add armor hardpoint, or need additional script check like engine?)

There is already a system in place that checks if more than one armor types are equipped, they just have to be defined as weightSavingTypes with a weight saving value of 0 so the code treats them as armor.

@Denadan
Copy link
Contributor

Denadan commented Jun 26, 2018

There is already a system in place that checks if more than one armor types are equipped, they just have to be defined as weightSavingTypes with a weight saving value of 0 so the code treats them as armor.

ok, good, digging now in source code.

main point we have separete slot for armor and structure and filler module(like engine side torso parts) for their criticals if need any. this remove "how to upgrade structure/armor if they dont have criticals" problem

as additional feature - structure can be split for weight (i.e. 20t standart, 55t endosteel...) and restricted to same weight mech. this remove all weightSaving logic from it replace with plain weight and make things more logical(you cannot use endosteel components from lighter/hevier mech - they just dont fit)

@Aliencreature
Copy link
Contributor

main point we have separete slot for armor and structure and filler module(like engine side torso parts) for their criticals if need any. this remove "how to upgrade structure/armor if they dont have criticals" problem

The only equipment that would suffer under the no criticals issue is hardened armor and composite structure, but it is much easier to implement them as one-slot items than it is to write an entirely new logic.

Side torso engines are already implemented for all engine types that require them and consist of a XXX Engine LT and XXX Engine RT part. I know destruction of a side-torso on an XL mech is treated as an engine kill, but I still want to do more tests on how LFE and/or cXL engines are treated.

as additional feature - structure can be split for weight (i.e. 20t standart, 55t endosteel...) and restricted to same weight mech. this remove all weightSaving logic from it replace with plain weight and make things more logical(you cannot use endosteel components from lighter/hevier mech - they just dont fit)

Mechanically difficult. As far as I know, the only type of equipment that is limited by weight class are jump jets, so by your system endosteel would have to be a type of jumpjet, occupy jumpjet slots, etc.

@Denadan
Copy link
Contributor

Denadan commented Jun 26, 2018

anyway i fork and try implement this.
first results:
https://i.imgur.com/SGNrhyR.png
it allow put only one structure module in ct and generate apropriate message on wrong fitting(no structure, more then one structure, weight missmatch and filller missmatch)

@CptMoore
Copy link
Member Author

in the future i want a patchwork like behavior on each location. So one filler per location needed. Which actually means a special extra slot per location. The current implementation of whats in the mod is just temporary until proper patchwork can be implemented.

i also have more requirements for that special slot, like no dragging only replace. Autoreplace on repair with default item. Always on top.

What I dont yet understand is why no tonnge calculation? We need those again to support partial weight savings. (This mod supports patchwork structure..)

Having items that match weight classes is nice, we specifically want to avoid having multiple items thought to keep the mechlab performance up ond cluttering down.

Sorry if i sound too negativ, maybe i didnt understood fully what you are trying to achieve.

@Denadan
Copy link
Contributor

Denadan commented Jun 26, 2018

i just try to make things simple. using tt rules armor(except modular, but it use different rule) and structure is not component itself it is chasis characteristic, criticals slots for them dont do anything - they just take place, and some of armor or structure types dont have criticals at all. in games usually they represented with simple selector and reserved slots auto align and rearange on demand.

i trying to achieve the same - cose by code limitation armor and structure should be components - add two special slots for them. with same onlyreplace on refit and repair behaviour as you want. critical slots are just fillers and dont have any logic(in current iterration they even dont present in inventory, validation logic just check if enough free total space so they dont cluter equip and salvage, i search the way to display it, for examlpe by color/sprite change for free slot, so they will rearange by adding new items in equip).

As armor and structure cannot be split, they dont requre patchwork logic, their tonnage calculation become much simpler (structure - plain component tonnage from def file in case weight class based, or tonage / 10 * mod otherwise, armor = total armor/armor weight mod)
default
default

@CptMoore
Copy link
Member Author

auto align and rearange

I would like that stuff to be part of this mod too, also for the engine side torso slots. however that is ALOT of work, fixing it for all the corner cases (destroy, repair etc..) + would require a lot of patching of component dragn/drops + workorder ignore and not ignore, workorder install / remove / repair. I wouldn't do this. until we get more support through a DLC or so.

add two special slots for them

official rules don't allow structure to be split, but since we have the code due to armor slots, we also allow it for structure. I wouldn't mind returning structure back to a mech-wide setting through a center torso special slot.

by color/sprite change

that makes sense to have it that way

As armor and structure cannot be split

armor can be split due to an optional rule: http://www.sarna.net/wiki/Patchwork_Armor

the rule itself is not strictly implemented, we do allow non-uniform distribution of critical slots right now.

also we support fractional accounting due to this.

but once you implement your stuff for one location (CT) it should be simple to apply that stuff to each location right?

@CptMoore
Copy link
Member Author

I'm giving you this ticket Denadan, just do what you think is best and we can clean up and see whats missing once you think its ready

@Denadan
Copy link
Contributor

Denadan commented Jun 28, 2018

https://imgur.com/a/44htUuc
done

  • filtering structure by tonnage
  • reserved slot count check
  • auto place and rearrange filler for reserved slots
  • auto fix current dessigns by adding standart armor and apopreate structure

to do

  • validation check for placing items if not enought free space(now it just error message on exit lab)
  • max armor(now max it using standart armor weight)
  • "only replace" behaviour and linked repair stuff

ideas about patchwork armor

  1. "allow patchwork armor" setting, if not allowed - all stay as is
  2. if allowed - add additional armor slot for each location, each armor slot has its own armor weight calculation based on location armor
  3. "patchworked" flag for mechdef = have mixed armor
  4. critical slots. home rule - fixed 1/7 slots for location(so for example you cannot place ff on head, cose it requre 14/7 = 2 free criticals) if patchworked flag set. we have 8 locations so it is auto penalty + 1/7 slots for patchwork
  5. standart dynamic criticals distribuition if not patchworked

@CptMoore
Copy link
Member Author

ok I havent looked at the code so I just go by your list here and what I see on the screenshots.

filtering structure by tonnage

I still say you should not have several endo-steel component types, we still have limitations because of #38 (performance) and #3 (reduce json count) . if you want to fix the issue with logic/cbills/item count/lore you should chime into #66, so we can fix it for everything.

reserved slot count check
auto place and rearrange filler for reserved slots
auto fix current designs by adding standart armor and apopreate structure

The reserved stuff with filler etc.. gets along very nicely. I like the use of colors so you know whats armor and whats structure!

The side torso engine parts however are another beast as those are actual items, so we can keep them as separate entities for now. Having them auto-added and removed would be cool tough. If the enforcement works we can even kick out the LT and RT part and just dynamically add Engine Reserved Slots based on the center engine installed. those have to be actual slots though, or we loose the compatibility with DamageComponent + critical hits.

validation check for placing items if not enought free space(now it just error message on exit lab)

I actually think that its ok that you can place stuff even though you don't have enough space. just make sure you can't actually save the mech in skirmish AND campaign. in campaign, inventory slots are allowed to be invalid and the mech can still start installing. (it just can't be deployed).

max armor(now max it using standart armor weight)

I was planning on staying compatible with Pansar. There you already have several armor patches. If you actually want to change max armor you probably have to start integrating Pansar into this mod first.

ideas about patchwork armor

Sounds about right, but have an option to allow an auto-switch from patchwork to normal when all patchwork slots are added. That would be the most gamer friendly approach.

Issue however is space now.. I don't we can fit in 2 additional slots per location, don't forget we even have actuators to add too! I think we need to resort to some form of state saving as we do with the heatsinks for the engines. Maybe we should just have a fake component called "mech settings" in the CT and there we save the state of a mech that concerns Armor, Structure and other stuff.

Important

can you think of maybe splitting up your changes so you can create small contained feature PRs that you can upstream one at a time?

@CptMoore
Copy link
Member Author

@Denadan I created the issue #79 for your slots feature, as this here is about additional armor types and those can be done e.g. after your feature. can you move your slots comment in this ticket to #79 ?

@LadyAlekto
Copy link
Member

LadyAlekto commented Jul 21, 2018

internals.zip

2 dirty hacks for composite and hardened as well as reflective and reactive

Id love if thered be a way to simply define their effects through a multiplier in the custom tags

I use the statcollections from abstractactor.mech

edit fixed the composite error

@CptMoore
Copy link
Member Author

added component ArmorStructureChanges that allow to manipulate the armor and structure points when combat starts

several issues here:

  • max is shown wrong in combat
  • shows them as damaged in combat if factor < 1.0
  • max and current in mechbay / mechlab don't show any item manipulations

fixing those issues seems complicated, like 20 patches or so for fixing them everywhere. display only fixes in mechlab might only require like 5 patches.

@CptMoore
Copy link
Member Author

CptMoore commented Aug 3, 2018

RT seems to have reflective and reactive already, so everything can already be backported

@CptMoore CptMoore added the roguetech has something to do with roguetech label Aug 3, 2018
@CptMoore
Copy link
Member Author

closing since RT has it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
roguetech has something to do with roguetech
Projects
None yet
Development

No branches or pull requests

4 participants