Jump to content

Weapon/Armor/Damage Calculation Idea


Recommended Posts

As i played and modded x-1 and openxcom for a long time, i wanted to share my ideas about how to handle all the numbers about damage/armor.

1. Damage Types:

If we compare the X-1 system, there was some problems both at damage types and understanding them how they work. I think there should be no secondary damage types at all. It's confusing and makes you mad when you calculate all that resistances. Every damage type should be primary and got different ones for all real damage types used at the game.. 

At X-1 we got; kinetic, energy, incendiary, chemical as primary and stun, EMP as secondary. This worked at X-1 base game because the resistances did not used at the game mostly and enemies got "energy" damage type mostly as plasma weapons. For that reason, the calculations did not create much problem. BUT it became a problem when you tried to use all this damage types and resistances with a multi-weapon used battlefield. Because we got ballistic and mag weapons as kinetic damage (no problem here), laser and plasma as energy (here we got a problem because laser could be energy but plasma is something more complex and when you try to use the resistances, you need to put them into the same category), all explosives were incendiary and some gasses as chemical AND addition to that we got stun and EMP without a resistance dedicated to them, you can't plan what armor or enemy should have what resistance at all..

For that reason, we should go for Fallout/xcom method. All damage types got their same named damage types.. so for x1 we need to have; ballistic, laser, plasma, incendiary, chemical (for real chemical gasses), stun, emp. Then at weapon code we need to able to give more then one damage type.. 

Damage: Ballistic, 100/20; Incendiary, 20/50; Stun, 10/100. This means that this weapon got 100 ballistic damage with %20 armor penetration (ignoring resistance), 20 incendiary with %50 AP and 10 stun with %100 AP.

With this options, it becomes more logical and useful to have more then one type of ammo per weapon. As you see here, you can easily read and calculate all the damage types.

Note: For modders, there should be able to add totally new damage types into the game. At least there could be some reserved damage types like DT1, DT2, DT3...

2. Armor:

I want to say something here about "health". Modern games like fraxis xcom and phoenix point uses armor+health as one stat at battlefield. I find this more logical, because even a commando or a sebillian can't survive after 1-2 plasma/laser/mag bullets if they don't have an armor. There is no need to calculate specially health when 2 shot can kill you. BUT we use STUN as an important damage type so the health bar is useful for this. Again for those reasons armor should have a solid HP over health. Xe-1 got a problem here as there is only resistances as armor.

At Xe-1, if you got an armor of 200 energy resistance and 10 incendiary resistance, you could survive many plasma shots but a grenade could kill you even you did not get shot before.. so it's like you got different armor layers against different damage types and you can die easily if a damage layer of that type is low. You can shoot an alien for 100 ballistic bullets or just hit with one laser.. this does not make sense.. It's nearly impossible to balance if you try to use damage types.

For that reason, every armor needs to have a HP and it needs to have resistances as percentage and solid numbers against every possible damage types. So we got 200 HP armor/50 hp health and %50 ballistic resistance with solid 10, and %20 laser resistance with no solid numbers.. lets hit it with bullets with 40 ballistic damage.

200 - ((40*%50)-10)) = 190, after 10 shots it will become 100...

lets shoot a 30 damage laser..  100 - ((30*%20)-0)) = 100 - 24 = 76.. after 5 laser shots, he will lose all armor. 100 - 24 - 24 - 24 - 24 = 4 (four laser shot) then health comes, 50 - (24 - 4 (left armor)) = 30 wounded... one more shot and you are dead..

As you see, it's much more simple, easy to calculate and logical. If you add STUN damage to this weapon damages, then you can capture it before it dies...

You can add the "degrading" code to every armor.. at this calculation it's %100 as you see, but if you lower it, the armor can survive more but it makes the balancing calculations much more complex then needed for developer or player.. but it's good to have every possible option.. the important part here, every stat should be unique for every armor.. Xe-1 got many global stats for everything and it made impossible to create unique things. So if you make degrading same for all armors with a global stats, then you can't create unique armors with their own degrading.. this is same for everything in the game.. there should be as less global stats as it could be.. i hate global things..

3. Weapon Stats:

Every weapon should have their own editable stats for everything.. You should able to code every "fire mod" as it's own.. for example a rifle should able to fire "3" bullet at single shot fire, "8" at burst and "1" at sniping.. so a rifle is a burst weapon rather then single one. Another example is a heavy weapon single fire could have "6" bullet and more acc and burst shot could fire "20" bullet.. a sniper should have more critical damage chance at aimed like "%100 to %400" damage output but single fire mod it would drop to "%100 to %200"... 

Every weapon should have it's min (for snipers short range penalty) and max range (after that hit chance goes 0 or disappear). Weapons can have damage modifier for their range, like a plasma weapon could damage much more at shorter range, ballistic can lose its damage at longer range and lasers would be stable..

4. Crouch: 

Kneeling should be something tactical. Every weapon should get special + aim for kneeling.. so some weapons can be used without kneeling easily but some (heavy/sniper) would need it for proper aim. Even there should be an "AIMING STANCE" like kneeling but prepared firing position.. this could add much more aim (different per weapon as i said before) and bonus to reaction fire (more overwatch like).. i say this as a different stance because kneeling would take only few TU's and could give huge bonuses to weapons.. so everybody uses that before firing.. to make it special, you need to have a stance, different then kneeling.. i know that, it's hard to implement now and maybe not necessary but i always think that it's a nice tactical addition to battlefield.

I just remembered those for now.. i will add more if i release something more..

Edited by drages
  • Like 1
Link to comment
Share on other sites

Please forgive me, but some of your arguments appear to be less than clear. 

Damage Types. Are you arguing that having each weapon restricted to one damage type is a bad thing? That weapons should have the capacity for multiple damage types?

Armour. Are you arguing that because it is possible for an armour set (for a Xenonauts solider) or an armour configuration (for an alien) to be overspecialised against a specific damage type (e.g. overspecialized verses a ballistic damage type) that all armour resistances should degrade over time, they should express resistance against damage types as a percentage, and should have a set value verses all damage types? (FYI, Chris has already talked in other threads about armour resistances being expressed as a percentage).

 

 

Link to comment
Share on other sites

4 hours ago, Max_Caine said:

Please forgive me, but some of your arguments appear to be less than clear. 

Damage Types. Are you arguing that having each weapon restricted to one damage type is a bad thing? That weapons should have the capacity for multiple damage types?

Armour. Are you arguing that because it is possible for an armour set (for a Xenonauts solider) or an armour configuration (for an alien) to be overspecialised against a specific damage type (e.g. overspecialized verses a ballistic damage type) that all armour resistances should degrade over time, they should express resistance against damage types as a percentage, and should have a set value verses all damage types? (FYI, Chris has already talked in other threads about armour resistances being expressed as a percentage).

 

 

Damage Types: Yes. As you make all the damage types primary, you should able to add different damage type to a weapon. So you can have explosive ballistic rounds with some ballistic and incendiary damages. If you want stun and EMP damage, you can add this to the weapons too. Like a shotgun shell with ballistic and stun damage or a special laser weapon with laser and EMP damage together.

Armour: Yes again. An armour will have a hit point and it will have a percentage for every damage type in the game. That percentage could be over %100, so it means the unit who got that armour got a big weakness against it and takes much more damage.. 

Link to comment
Share on other sites

Thanks - I'll read this in full later today but it looks like a useful post.

Just to add a point of my own to the discussion - stun damage is a real pain because it's not a type of damage so much as a modifier to all the others. For example the stun damage applied by a stun baton is very different to the stun damage applied by stun gas. This is problematic because adding something like a rebreather would set units to be 100% gas resistant ... but then what stun resistance do you set? Setting that to 100% would also make the unit with the gas mask immune to stun batons.

I kinda think we're going to have to treat stun damage differently this time around.

Link to comment
Share on other sites

7 hours ago, Chris said:

Thanks - I'll read this in full later today but it looks like a useful post.

Just to add a point of my own to the discussion - stun damage is a real pain because it's not a type of damage so much as a modifier to all the others. For example the stun damage applied by a stun baton is very different to the stun damage applied by stun gas. This is problematic because adding something like a rebreather would set units to be 100% gas resistant ... but then what stun resistance do you set? Setting that to 100% would also make the unit with the gas mask immune to stun batons.

I kinda think we're going to have to treat stun damage differently this time around.

I got a solution about the stun problem. It's from openxcom extended..

Lets look to this code at the "ammo":

damageType: 10 ( a new damage type you create at openxcom )

damageAlter:
      RandomType: 2 
(this is the random damage percentage limits like %100 to %200.. openxcom got about 6 type of randomization, we should have it freely rather then fixed ones..
      ArmorEffectiveness: 0.0 (this is armor penetration, here at 0, armor penetration is %100 as the armor does not effect the damage at all)
      ToHealth: 0.0   (damage to health, if the damage goes to health, here you see the percentage. Here, the damage does not make any harm to target HP)
      ToArmor: 0.0   (damage to armor, again 0)
      ToStun: 1.0    (here is the solution, even the damage type is not "stun", this damage dealt directly to the stun bar of the target.)
      ToTile: 0.0   (damage to tiles, map objects)

Here you see that, this weapon makes a pure stun damage to target with a full %100 AP.. Do not forget that, this ammo could have any damage type.. maybe a ballistic maybe a chemical.. but the damage will go for stun.. If the target got damage resistance for this type of damage, then it will take less stun damage.. 

Let me give you an example:

We got a reaper which immunes to chemical damage. We got stun grenades and throwing it to the reaper. If the reaper got %100 chemical resistance, he would not take any damage and won't stun. Now we got our batons.. Batons got ballistic damage as they are blunt weapons and give it another damage type as electrical damage.. Alter electrical damage type with "toStun: 1.0". Reaper got a ballistic resistance to but does not have any resistance to electrical damage. Our baton hits  ballistic damage and electrical damage. That electrical damage will go for stun bar and reaper will get stun damage per attack..

With this idea, you can create different damage types to able to stun different units.. so you can even stun or disable androns with this electrical damage. I did not say "EMP" because that damage would not harm a living thing and will kill any robots.. 

With "To****" code, you can create armor destroying weapons or some biological weapons which will only harm the things without armor.. Just you should not stuck at fixed damage types. You can erase the "stun damage type" and use it at "toStun" only.. I think it's a very clear method.

 

Link to comment
Share on other sites

If I understand correctly, you're proposing to decouple ammunition from the weapon and have ammunition describe how a weapon does damage so the weapon becomes an ammunition delivery system. As each weapon would be expected to do a different amount of damage, each weapon requires a unique ammunition class (although I could imagine that some of the work could be done by children of type groups), so I'd envisage a fair amount of work involved. It would also appear that the thrust of this argument is about making different types of ammunition possible for a single weapon. How would this benefit any weapons technology other than the basic, start-of-game ballistic weapon system?  

Link to comment
Share on other sites

Chris said there will be multi ammo system already. 

Yes, we need to have an ammo code for sure which is about magazine and damage code. Weapon will have only weapon stats. Even if possible, an ammo should be able to use by different weapons. 

Multi ammo could be used everywhere. 

1. Multiple purposes, explosive, stun, acid bullets for non energy weapons. Grenade and rocket launchers could be created. 

2. Energy weapons can have updates without making a whole new weapon. Like a new laser battery updated with alenium. So you can have a laser branch with more firepower to use it against enemies with laser weakness. 

3. Weapons can have bullets for spesific tactics. You can have a special plasma ammo which makes huge damage only for armor. If we add power shields (we should have it, xcom apocalypse style), you can make ammo which destroys that. 

I can count you many more, but those are the first possibilities. I suffered so badly at xe 1 for this reason. I needed to make a whole new weapon for every purpose and every update there. We could not add any launcher.. Could not have tactical choices. 

So different ammo for weapon is a must. 

  • Like 1
Link to comment
Share on other sites

3 hours ago, drages said:

Chris said there will be multi ammo system already.

I know I linked to that in another post but I'm not so sure, actually.  It's not a topic that I've seen discussed much.  And I am pretty certain I didn't see it in the kickstarter video's loadout screen.

Link to comment
Share on other sites

5 minutes ago, Sheepy said:

I know I linked to that in another post but I'm not so sure, actually.  It's not a topic that I've seen discussed much.  And I am pretty certain I didn't see it in the kickstarter video's loadout screen.

I read somewhere, it's just in game and he tries to figure out the UI part..

At Xe-1, multi ammo used only for rocket launcher as a special hardcode script.. so you already need to have that code if you want that kind of weapons. It would be logical to have it for all weapons. Chris wants to have a rich research tree with side projects. So, multiple ammo with multiple damage types could help that idea so much.

Link to comment
Share on other sites

Drages is right that we will be supporting multiple ammo types this time around; it's not something I think we'll make much use of beyond the grenade launcher and tazer rounds for the shotgun, but modders should be able to make more use of it. But I think the overall damage type (e.g. kinetic, laser, chemical, etc) is set on the weapon rather than the ammo at the moment; maybe we can add an override for it or something later in development.

That openXCom solution for the ammo seems sensible, yeah - it's essentially what I was already planning to do, which is to make stun damage a property of the existing damage type rather than a damage type in its own right.

To give a brief response to the original post you made:

  • I'm not sure we're going to support multiple damage types for weapons out of the box; we don't have any real use for it and it might make the UI rather more complex. Possibly something to note down for the "extra modder support" feature wishlist though.
  • For the armour stuff, I think you'll need to explain that in a bit more detail because I'm not quite following the numbers you posted. At the moment armour can be set to provide a flat HP bonus and also a % resistance against specific damage types, but it can't be set to give a flat damage reduction. Again, I think it's going to be tough to display five or six damage types and have a % reduction AND flat reduction for each. Probably not something to put in the base game but could be something we do to as part of the extra modder support.
    • At the moment there's no support for armour degradation, because I didn't figure out a good way of handling the degradation across the different damage types. But we can just have a master condition % for the armour that gets reduced whatever type of damage you shoot the target with, so if your armour normally has 80% Ballistic and 60% Chemical resistance, at 50% condition it has only 40% Ballistic and 30% Chemical resistance. We can easily display the condition % for the armour on the ground combat inventory panel too.
  • Regarding the weapons, you already can do pretty much all of that except for giving weapons a damage boost / drop over distance.
  • Regarding crouching / aiming - yeah, this isn't something you can customise and I'm not sure I consider it as important as the other stuff. We can talk about it later in development but it seems more niche than the other points you've raised.
  • Like 1
Link to comment
Share on other sites

16 hours ago, Chris said:

 

I want to put a weapon-ammo code here from openxcom:

  - type: STR_PLASMA_RIFLE
    size: 0.2
    costSell: 140000
    weight: 9
    bigSprite: 167                 : visual files
    floorSprite: 167               : visual files
    handSprite: 352              : visual files 
    armor: 35                      : HP of the weapon
    compatibleAmmo:          : usable ammo (an ammo could be used by more then one weapon)
      - STR_PLASMA_RIFLE_CLIP_EL
      - STR_PLASMA_RIFLE_CLIP_PC
      - STR_PLASMA_RIFLE_CLIP_SS
    maxRange: 25               : After 25 tile, you can't shoot
    minRange: 5                 : Under 5 tile, the acc got penalty as worst at 1. tile..
    aimRange: 20                : After 20 tile, the hit chance will be 0 for aimed shot
    snapRange: 17              : After 17 tile, the hit chance will be 0 for auto shot
    autoRange: 12               : After 12 tile, the hit chance will be 0 for snap shot
    accuracyAimed: 90         : hit chance is %90 of soldier acc for aimed shot
    accuracySnap: 75           : .... 
    accuracyAuto: 60           : ....
    tuAimed: 45                  : % TU needed for aimed shot
    tuSnap: 30                    : ....
    tuAuto: 40                    : ....

    confSnap:                     : you can configure snap (single) shot here. You can "conf" auto and aimed shot too.
        shots: 3                    : single shot shoots 3 bullet per fire, like autoshot.
        name: STR_CON_BURST_SHOT   : new name for single shot for UI
    autoShots: 5                 : autoshot bullets
    kneelBonus: 135            : kneeling bonus for this weapon
    dropoff: 8                     : after 8 tile, the acc starts to dropoff
    oneHandedPenalty: 35   : if soldier got another thing at left hand, the hit chance drops by %35
    twoHanded: true           : this is a two handed weapon so oneHandedPenalty will be calculated.
    tuLoad: 26                   : Reload TU
    tuUnload: 5                  : Unload TU
    battleType: 1                : it's a normal gun.
    invWidth: 1                   : inv sizes
    invHeight: 3
      
  - type: STR_PLASMA_RIFLE_CLIP_EL
    bigSprite: 168
    floorSprite: 168
    bulletSprite: 21
    fireSound: 11
    hitSound: 19
    hitAnimation: 96
    power: 90                            : Damage 
    clipSize: 12                          : Ammo per clip
    powerRangeReduction: 3      : Damage will be reduced "3" per tile
    powerRangeThreshold: 15    : Damage reduction will start after 15 tile.
    damageType: 5                   : damage type, plasma here.
    damageAlter:
      RandomType: 3                 : Random damage like (%100-%200)
      ArmorEffectiveness: 1.5      : Resistances effects this weapon 1.5 more (if the armor got %30 plasma resistance, it acts like %45 here so this ammo is bad against armor). If this is 0.0, the damage bypasses
                                                armor and goes directly to health and stun.
      ToHealth: 1.0                    : It hits health by %100 damage, after by armor is gone.
      ToArmorPre: 0.5                : Half of the damage directly damages armor ( without calculating resistances) with %50 of it's damage. So if it hits for 90 damage, it hits to the armor 45 damage even that armor
                                                got %100 plasma resistance. You use this when you want to dealt pure damage to armor.

      ToArmor: 0.2                    : After "ToArmorPre", %20 of the damage hits to armor with resistance calculation. You use this when you want normal damage calculation.
      ToStun: 0.0                      :  Stun damage after armor.    
      ToTile: 0.5                        : Tile damage.
    size: 0.1                             
    weight: 5        
    invWidth: 1
    invHeight: 1
    costSell: 3000
    tags:
      ITEM_COLORSWAP_FINAL_ROW_1: 3
      
  - type: STR_PLASMA_RIFLE_CLIP_PC
...............
 

I want to show how they manage to code the weapon and ammo separately. Even it has tons of stuff there, you can understand it easily after some time.

For armor, you don't need to degrade armor at it's own code. Degrading will be done by weapon at it's ammo code. The resistances will stay but the weapon will able to hit more or less to it. Armor code will be very simple.. everything will be about the ammo.. Some weapons will hit armor harder, some weapons will bypass the resistances. Some of them will kill the armor, some of them will only hit the health..

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...