Author Topic: Armor Classes  (Read 1711 times)

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Armor Classes
« on: January 04, 2008, 09:27:18 PM »
Here's a list of how the Armor values get turned into the strings for the armor classes.


Buildings
----------
256 - x  "No Armor"
180 - 255  "Very Light Armor"
130 - 179  "Light Armor"
90 - 129  "Medium-Light Armor"
60 - 89  "Medium Armor"
x - 59  "Heavy Armor"


Vehicles
---------
256 - x  "No Armor"
180 - 255  "Light Armor"
130 - 179  "Medium Armor"
90 - 129  "Heavy Armor"
60 - 89  "Very Heavy Armor"
x - 59  "Adamantium Armor"

 

Offline Hidiot

  • Hero Member
  • *****
  • Posts: 1018
Armor Classes
« Reply #1 on: January 05, 2008, 04:54:51 AM »
So... Does this mean that if I have a unit with 100 armor and another unit of the same type with 110 armor, the 2nd one will be more powerful?
"Nothing from nowhere, I'm no one at all"

Offline BlackBox

  • Administrator
  • Hero Member
  • *****
  • Posts: 3093
Armor Classes
« Reply #2 on: January 05, 2008, 09:22:28 AM »
Quote
So... Does this mean that if I have a unit with 100 armor and another unit of the same type with 110 armor, the 2nd one will be more powerful?
Well, if you mean power as in weapons damage or anything like that, it wouldn't make any difference since the armor is just affecting how quickly a unit takes damage. The unit with 100 armor would have heavier armor (since a smaller number means heavier armor).

My guess / explanation for this system is that the game is probably using the armor value as some sort of multiplier when giving damage to a unit. (i.e. higher number (lower armor) * base damage = higher damage).

Offline Sirbomber

  • Hero Member
  • *****
  • Posts: 3238
Armor Classes
« Reply #3 on: January 05, 2008, 12:00:05 PM »
So, if your theory is correct, there could be varying degrees of what we call "Light Armor"?

But if that's true, how does the game convert the values used in the sheets and techtrees (0 through 5) into these more diverse values?
"As usual, colonist opinion is split between those who think the plague is a good idea, and those who are dying from it." - Outpost Evening Star

Outpost 2 Coding 101 Tutorials

Offline BlackBox

  • Administrator
  • Hero Member
  • *****
  • Posts: 3093
Armor Classes
« Reply #4 on: January 05, 2008, 12:03:54 PM »
Quote
So, if your theory is correct, there could be varying degrees of what we call "Light Armor"?

But if that's true, how does the game convert the values used in the sheets and techtrees (0 through 5) into these more diverse values?
Well, as far as the sheets are concerned there are only 6 classes of armor, and you can't have intermediate values. There is a lookup table it uses to convert the numbers into real armor values.

Code: [Select]
Armor class ->	Armor in game
0  0x100 (No)
1  0xB4 (Very Light)
2  0x82 (Light)
3  0x5A (Medium-Light)
4  0x3C (Medium)
5  0x28 (Heavy)

Some notes I took a long time ago. The text strings apply to buildings there, the levels are the same for vehicles.

The only way you could get intermediate armor levels is by directly editing memory (with a DLL or memory editor or whatnot). It's not possible to do it through the sheets (though you may be able to do it from a tech tree UNIT_PROP line, I'm not sure).
« Last Edit: January 05, 2008, 12:04:16 PM by BlackBox »

Offline Hidiot

  • Hero Member
  • *****
  • Posts: 1018
Armor Classes
« Reply #5 on: January 05, 2008, 12:16:13 PM »
I meant stronger... misuse of word... my bad :/

So you can use these things to make some nice researches with variety in results... The same result could give you a bit less armor than it gave you last time you tried.

The sheets however have some slight differences (0x<hexnumber>)... Could that be used?
"Nothing from nowhere, I'm no one at all"

Offline BlackBox

  • Administrator
  • Hero Member
  • *****
  • Posts: 3093
Armor Classes
« Reply #6 on: January 05, 2008, 12:56:00 PM »
Quote
The sheets however have some slight differences (0x<hexnumber>)... Could that be used?
If I remember correctly OP2 uses the atoi() C run time function to convert the text string to an integer value. Assuming this is true, then the only numbers that would work would be base 10 (in other words, the 0x-- notation for base 16, or the 0-- notation for octal, etc. wouldn't produce correct results).

And I should probably try to make myself clearer on this point. In the sheets like building.txt and vehicles.txt, "Armor Class" has to be from 0-6 (well, really, it can be outside of this range, but weird things will happen. This number is actually an index into an array of pre-defined armor values, and there is no bounds checking... so if you go off the end of the array you will get garbage values, from what I remember there is ASCII data right after this array). So, in short, you cannot do something like "10" for a better form of Adamantium Armor on vehicles than that list permits.

I'm not sure if the UNIT_PROP in the techtree files has this limitation, but I tend to think not because of the way unit properties work (they are defined in a list that contains the property name alongside the offset into the unit info structure to point at an integer to be modified, and the raw armor values are stored there), so you should be able to modify the armor values to any intermediate value you want using a techtree.

As far as giving such armor at the beginning of the game, there are various tricks you can do with a techtree to make the UNIT_PROP take effect immediately. (Such as setting the COST to 0 and not having any REQUIRES lines, which makes it a free technology given to the player immediately).
« Last Edit: January 05, 2008, 12:57:04 PM by BlackBox »