Author Topic: Walls  (Read 1584 times)

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Walls
« on: May 23, 2007, 02:34:42 AM »
First of all, only normal walls can get damaged. Lava walls and Microbe walls just get plain destroyed. You'll notice there is no damaged version of these walls in the graphics files.

Walls are not implemented as Units in game, and have no associate hit point value. They proceed to the next stage of damage (or are destroyed if they are already at the last stage) based on some probability determined by the damage done to them, and the max hitpoints for that wall type set in the sheets file.

Weapons Fire
If weapons fire hits a wall, the usual damage value is calculated just like it hit any other object. If the weapon was a Laser or Microwave, this damage is further increased by 2.5x  (damage * 5 / 2, rounding down when dividing). This value is then used to determine if the wall proceeds to the next stage of damage (or is destroyed if it's already at the last stage).

Blight and Lava
Blight and Lava expansion is similar, except that the damage is hardcoded to 15 for each attempt at blight or lava expansion.


Probability of Destruction
A random number is generated in the range 0 to "hitpoints"-1, and if the damage is greater than or equal to the random number then the wall proceeds to the next stage of damage. For Lava walls and Microbe wall, the value for "hitpoints" is exactly the maxHitpoint value in the sheets file. For normal walls the value for "hitpoints" is the maxHitpoint value in the sheets file divided by 3 (and rounded down). This is because the normal walls go through 3 stages of damage before getting destroyed, so they will proceed to the next stage of damage about 1/3 of the way to being completely destroyed.



Note that the above implies a normal wall must sustain at least 3 hits before getting completely destroyed, where as a Lava or Microbe wall can be destroyed in 1 hit. For weak weapons fire, the expected amount of damage the wall will sustain is probably fairly close, but normal walls should be more useful in combat situations, particularly with strong weapons.

If a weapon can hit for about the same as the max hitpoints of the wall, then there is a very high probability of destroying the wall. (Guaranteed destruction if the damage done is at least as much as the max hitpoints). But for a normal wall, this will only bring it to the next stage of damage and so will take at elast 3 hits, but a Lava or Microbe wall will be completely destroyed in that one hit.

On the other hand, if a weaker weapon hits for 1/3 the max hitpoints of a normal wall, then each hit will bring a normal wall to the next stage of destruction, and so will kill the wall in exactly three hits. For a lava or microbe wall, it might kill it in one hit, or it might take many more than three. The expected number of hits though, will be three, so in this case you're probably no better off.




As a side note, the MicrobeSpreadSpeed, is the number of tiles to check on each game cycle for microbe expansion. The tiles checked for blight expansion are not necessarily anywhere near the blight, or even next to one another. Rather, the tiles are check for expansion in some order that spreads the checking around over the map, in some fixed order which is dependent on the map dimensions. This ordering is not so easy to describe in a high level manner, but is quite simple in terms of a few bit bashing assembler instructions. It's close to doubling both the x and y coordinates, and possibly adding 1 to x every so often, where the values are wrapped around to stay within the map, and the carry out of x is taken as a carry in to the y.

It may be interesting to note that the only random numbers I saw in the blight expansion dealt with the microbe walls. Which means that blight expansion appears to be quite deterministic, and hence also quite "fair". (You can design a map so blight should hit two players at the same time, unless they do something to prevent it, such as building walls, or relocating their base).

 

Offline evecolonycamander

  • Hero Member
  • *****
  • Posts: 602
Walls
« Reply #1 on: May 26, 2010, 04:13:07 PM »
yes i know it is a 3 year old topic but i had an interesting question and it was unlocked
would it be possible to make a code for giving blight/lava walls the same properties of a normal wall(so it can look damaged) or make the normal wall capable of stopping lava/blight
''The blight cant get us up here!''
-famous last words
--------------o0o--------------
Outpost 2: EoM project status: Re-planning

Offline Sirbomber

  • Hero Member
  • *****
  • Posts: 3238
Walls
« Reply #2 on: May 26, 2010, 07:17:33 PM »
Nope.  Not without extensive EXE hacks, tileset modifications, and updating the terrain transition table for each and every map ever made.

Oh, and apologizing in advance for a 3-year-old necro doesn't excuse you for doing it, especially when what you wanted to discuss really has nothing to do with the original post.
« Last Edit: May 26, 2010, 07:18:21 PM by Sirbomber »
"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 Kayedon

  • Sr. Member
  • ****
  • Posts: 378
Walls
« Reply #3 on: May 26, 2010, 08:07:13 PM »
On the plus side, I had no idea this topic existed before he necro'd it. Interesting read.  
"Trust me, I'm crazy."