Author Topic: Different armor values depending on direction/hitpoint of attack  (Read 1057 times)

jda

  • Guest
From Hectate's Eaglestone mod thread:
I wasn't actually suggesting that we allow "top" and "bottom" armor values. For Eaglestone, which is what originally I had in mind, everything is on the same plane of attack and there aren't any "high" or "low" attacks.

I was thinking you could easily have a set of XML definitions along the lines of...

Code: [Select]
<armor> (existing armor code?)
<directional armor>
<armor type> (for multipliers)
<start angle 315>
<end angle 45>
</directional armor>
[additional directional armors as needed]

It is important to note that this code applies to the angle that a successful attack strikes from - and does not apply to explosive damage. Obviously this is assuming the unit is facing "North" and the internal code will need to calculate any translations (unit orientation) into the mix prior to determining if the armor benefit applies or not. With the above settings, it gives the unit a 90 degree (-45 to +45) arc of a different armor type. Of course, if there aren't any additional directional armors, this particular code would mean the standard armor for the unit would apply from degrees 46 to 314 instead. That way it's not required to apply directional armors to the whole unit.

Here is an example sketch from MSPaint :D Green is the custom directional armor that overrides the standard (yellow) armor type.



Note that of course, since attacks go toward the center of the unit (as noted above) this system would work despite the first thing everyone thinks of - that being "What about side-moving attacks that hit close to the FRONT?". It wouldn't matter because it's the angle of the attack, not the location of the strike.

Feel free to quote this in a new topic if desired. It'd probably be best but I don't know which forum would be appropriate.
That is actually much much much better than I was thinking of! ;)  :thumbup:

One comment though: for general purpose implementation, the <directionional armor> tag should contemplate both an y/z axis like you described and an x/z one too. ;)

EDIT: Updated ticket #54 to point at this thread too.
« Last Edit: 28 April 2010, 19:57:51 by jda »

Hectate

  • Guest
Similar techniques (start and end angles) could be used to limit turret angles as well - should they ever exist. You wouldn't want a shoulder turret to shoot through the "head" of a mech. Of course that would complicate targetting AI.

silnarm

  • Local Moderator
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
EDIT: Updated ticket #54 to point at this thread too.
Similar techniques (start and end angles) could be used to limit turret angles as well - should they ever exist. You wouldn't want a shoulder turret to shoot through the "head" of a mech. Of course that would complicate targetting AI.

This will be something to keep in mind for ticket 84 [Symbiotic pets] too, which will eventually give you turrets :)
Glest Advanced Engine - Code Monkey

Timeline | Downloads

jda

  • Guest
Similar techniques (start and end angles) could be used to limit turret angles as well - should they ever exist. You wouldn't want a shoulder turret to shoot through the "head" of a mech. Of course that would complicate targetting AI.
Not a full sollution but... supposing the main unit has its own attack... its target would get priority.
The symbiotic pet (turret) would just shoot at whatever it could, i.e. NOT have an influence on the main unit's movement.
On the other hand... on your mod, with ships who's only weapons would be side cannons (assuming they'd be implemented as symbiotic pets)... that would not work. :(
Unless... if the symbiotic pets implementation goes through the main unit's xml (I have no idea), you could add a property tag such as <priority attack /> to the concerning attack/pet. Only one allowed per main unit of course. :P

Thanks for the update, silnarm. :)