CellSpread: Difference between revisions
Patric20878 (talk | contribs) |
Removing this for the moment, see here: http://forums.renegadeprojects.com/showthread.php?tid=1399&pid=14985#pid14985 |
||
Line 27: | Line 27: | ||
*It makes a list of all units found in those cells, regardless of whether they will be affected by the current {{tt|CellSpread}} or not...{{fnl|1}} | *It makes a list of all units found in those cells, regardless of whether they will be affected by the current {{tt|CellSpread}} or not...{{fnl|1}} | ||
*...and calculates the distance in [[lepton]]s of each unit to the point of impact. | *...and calculates the distance in [[lepton]]s of each unit to the point of impact. | ||
*It then runs over the list, and only deals damage to those units whose calculated distance to the point of impact is equal to | *It then runs over the list, and only deals damage to those units whose calculated distance to the point of impact is lower than or equal to {{tt|CellSpread}} * 256 (leptons). | ||
The practical difference to the traditional view of {{tt|CellSpread}} is mostly the handling of "diagonal" damage. As visible in the image in the section above, the traditional model assumes the corner cells to belong to the next-higher cell spread, when, in reality, the map's cells are irrelevant in the distance calculation. That means that damage does indeed spread in a perfect sphere radius, making working with it a lot easier. | The practical difference to the traditional view of {{tt|CellSpread}} is mostly the handling of "diagonal" damage. As visible in the image in the section above, the traditional model assumes the corner cells to belong to the next-higher cell spread, when, in reality, the map's cells are irrelevant in the distance calculation. That means that damage does indeed spread in a perfect sphere radius, making working with it a lot easier. | ||
The distance is calculated in all three dimensions, meaning a flying unit ''can'' be affected by {{tt|CellSpread}} in the same way all other units can. (See [[#Aircraft|note below]], though.) | The distance is calculated in all three dimensions, meaning a flying unit ''can'' be affected by {{tt|CellSpread}} in the same way all other units can. (See [[#Aircraft|note below]], though.) | ||
Line 38: | Line 36: | ||
When the game calculates the distance of flying AircraftTypes to the point of impact, it cuts the calculated distance value in half, effectively making a given warhead's {{tt|CellSpread}} radius twice as large against airborne aircraft.<br> | When the game calculates the distance of flying AircraftTypes to the point of impact, it cuts the calculated distance value in half, effectively making a given warhead's {{tt|CellSpread}} radius twice as large against airborne aircraft.<br> | ||
For example, that means an aircraft flying 1536 leptons (6 cells) away from the point of impact of a {{tt|CellSpread{{=}}4}} (1024 leptons) warhead will still get affected by it, because the game only counts the aircraft as being 768 leptons (3 cells) away. | For example, that means an aircraft flying 1536 leptons (6 cells) away from the point of impact of a {{tt|CellSpread{{=}}4}} (1024 leptons) warhead will still get affected by it, because the game only counts the aircraft as being 768 leptons (3 cells) away. | ||
== Bugs == | == Bugs == |
Revision as of 00:32, 25 November 2009
Flag: | CellSpread |
File(s): | rules(md).ini |
Values: | Floating point values: Any decimal number (clearer range should be added in Template:Values).
(in practice, CellSpreads over 11 generate Internal Errors) |
Default: | 0 |
Applicable to: | Warheads |
CellSpread defines the blast radius of a warhead. Without CellSpread, a warhead only affects the cell it impacts on. With CellSpread, the damage extends beyond the current cell (it spreads), to the distance set through CellSpread.
As the damage progresses outwards from the point of impact, Template:TTL determines how quickly the blast wave loses power, that is, how much of the initial damage a unit at a certain distance from the point of impact receives.
Traditional View
For a quick, simple understanding of CellSpread, simply view it as follows: The damage will extend beyond the impact cell for as many cells as CellSpread is set to. e.g. if you set CellSpread to 3, the warhead will damage the current cell, and 3 cells further into all directions. A circle around the impact cell with a radius of 3, for a diameter of 6.
The image to the right reflects which cells are affected by which CellSpread under this simple model of CellSpread.
Reality
In reality, the game's parsing of CellSpread is performed slightly differently:
- The game runs through all the cells in the image to the right.
- It makes a list of all units found in those cells, regardless of whether they will be affected by the current CellSpread or not...1
- ...and calculates the distance in leptons of each unit to the point of impact.
- It then runs over the list, and only deals damage to those units whose calculated distance to the point of impact is lower than or equal to CellSpread * 256 (leptons).
The practical difference to the traditional view of CellSpread is mostly the handling of "diagonal" damage. As visible in the image in the section above, the traditional model assumes the corner cells to belong to the next-higher cell spread, when, in reality, the map's cells are irrelevant in the distance calculation. That means that damage does indeed spread in a perfect sphere radius, making working with it a lot easier.
The distance is calculated in all three dimensions, meaning a flying unit can be affected by CellSpread in the same way all other units can. (See note below, though.)
Aircraft
When the game calculates the distance of flying AircraftTypes to the point of impact, it cuts the calculated distance value in half, effectively making a given warhead's CellSpread radius twice as large against airborne aircraft.
For example, that means an aircraft flying 1536 leptons (6 cells) away from the point of impact of a CellSpread=4 (1024 leptons) warhead will still get affected by it, because the game only counts the aircraft as being 768 leptons (3 cells) away.
Bugs
- Due to the fact that CellSpread works based on a lookup table, its number of possible values is severely restricted:
- CellSpread=11 is buggy, it does not extend outwards properly, and it affects one cell twice.
- Everything above CellSpread=11 leads to Internal Errors.
- CellSpread is not working on warheads of particles. A particle only ever damages the current cell it resides on.
Footnotes
1 ↑ Ambiguous. D later said <DCoder> floor(CellSpread + 0.99) is the radius it uses when looking into the graphic, so it's possible it only looks into a radius of 4 for a CellSpread=3.5 warhead, for example. This will be clarified tomorrow.
See also
CellSpread Internal Affected Cells Table
Purely for reference, here's the table used for CellSpread.
|
|
|