Author Topic: Support for additional damage types in rules file.  (Read 3558 times)

Offline Talonos

  • Sergeant
  • **
  • Posts: 11
    • View Profile
Support for additional damage types in rules file.
« on: January 22, 2014, 07:18:38 pm »
It would be nice if the rules files let you define additional damage types, much like you can currently define additional sprites or sounds.

If I understand correctly, damage types currently go from 0-9, though additional damage types are supported but currently "blank", affecting only terrain. Would it be possible to add new damage types, even if only by defining them with a string?

You could define resistance to these new damage types by extending the arrays of the respective armor and alien entries. For example, defining a custom damage type 11 would require that you add an additional two entries to the resistance arrays of armor, aliens, etc. If a damage type is missing, it is assumed to be -0%, or perhaps the average of the defined types. This means it's possible for your new damage types to conflict with the damage types added by somebody else's mod, but unless I am mistaken, this is already the case with sprites, so we don't mind, correct?

Even without the ability to assign resistances to these damage types, just being able to name new damage types would be nice, and allow for all sorts of new guns. (Sonic disruptors, graviton guns, grasers, raw psionic energy guns, etc.)

If I'm dreaming of pie in the sky, I might as well suggest new damage features for rules files, all of which would be applied to a damage type:
 - Damage needed to cause fatal wounds (default 10)
 - Maximum fatal wounds per hit (default 3)
 - Armor damage multiple (default .1, could be higher for custom "armor rending" weapons)
 - Proportion of penetrating damage dealt to health (default 1.0, would be 0.0 for stun weapons)
 - Proportion of penetrating damage dealt as stun damage (default 0.0, would be 1.0 for stun weapons)
 - Proportion of penetrating damage dealt as morale damage (default 0.0, could be useful for psionic bullets or "really scary" weapons. Psi-bombs, anyone?)
 - Proportion of penetrating damage dealt as energy damage (default 0.0, could be useful for tranquilizers or something.)
 - Maximum possible deviation from base damage (default 1.0, meaning +- 100%, would be 0.5 for High Explosive or Terror From The Deep weapons)

Any other ideas? I love how flexible your rules files are so far. This seems like it supports your goal of easy, accessible Xcom modding. Would this be likely to be included?

Thanks for your consideration.

Offline yrizoud

  • Commander
  • *****
  • Posts: 1014
    • View Profile
Re: Support for additional damage types in rules file.
« Reply #1 on: January 22, 2014, 09:36:31 pm »
I looked at the code, there are a lot of specific behaviors that are really not easy to generalize into ruleset data.
For example:
- HE and incendiary explosions don't have the same geometric shape and radius behavior  (damage at edge of explosion)
- Melee weapon uses damage type to determine if the action should be called "Stun" or "Hit"
- Some things create damage of specific types, so these types HAVE to be in the ruleset : Exploding scenery produces HE, standing in clouds of smoke produces STUN
- HE and IN projectiles are "thicker" ? (some offset in projectile trajectory code)
- At the moment the game is not ready to support multiple kinds of different "things" that grow on land (in case you need living acid, corroding moss...)

Offline Talonos

  • Sergeant
  • **
  • Posts: 11
    • View Profile
Re: Support for additional damage types in rules file.
« Reply #2 on: January 23, 2014, 12:32:24 am »
Cool. That's helpful to know about.

Perhaps, then, some string in the weapon themselves that can override the listed string depicting damage type? If I want to make a graviton gun, I can accept having to decide if the damage is better represented as plasma or laser, but it looks kludgy to have those listed as the damage type in the UFOpaedia. If you could override the string that represents damage type with one of your own construction, then your graviton guns can deal (for instance) plasma damage and nobody would be the wiser.

I still think rule-support for generalized damage would be helpful and important, but I understand how something could be valuable and still not high-priority, so I take no offense to a "not now, check back later" type of response.

Offline yrizoud

  • Commander
  • *****
  • Posts: 1014
    • View Profile
Re: Support for additional damage types in rules file.
« Reply #3 on: February 03, 2014, 12:46:55 pm »
Quote
- Proportion of penetrating damage dealt as stun damage (default 0.0, would be 1.0 for stun weapons)
This one is especially interesting.
The current "stun" damage type is actually electricity, it could damage non-sentient species, though having no chance of stunning them.
And it would be nice to have armors that transform part of the deflected damage into stun damage : Soldiers would be actually knocked out from a HE blast. Idon't know how people play, but when I have one man temporarily KO I keep playing, if he gets 30+ damage (one month recovery) I reload.