Difference between revisions of "CellSpread"
(→Bugs) |
(Updated with new information obtained by D from the exe after patric noticed inconsistencies.) |
||
Line 1: | Line 1: | ||
{{Flag | {{Flag | ||
− | |name=CellSpread | + | |name={{tt|CellSpread}} |
|files={{Categ|ini=rules}} | |files={{Categ|ini=rules}} | ||
− | |values=float | + | |values={{values|float}}(in practice, {{tt|CellSpread}}s over 11 generate Internal Errors) |
|default=0 | |default=0 | ||
|types={{Categ|Warhead|Warheads}} | |types={{Categ|Warhead|Warheads}} | ||
Line 9: | Line 9: | ||
|rp=yes | |rp=yes | ||
}} | }} | ||
+ | {{HorizontalBar|'''Warning:''' setting this to values over 11 ''will'' cause [[Internal Error]]s when the warhead is supposed to detonate.|image=Cc_alert.png}}{{tocright}} | ||
− | + | '''{{tt|CellSpread}}''' defines the blast radius of a [[warhead]]. | |
+ | Without {{tt|CellSpread}}, a warhead only affects the [[cell]] it impacts on. With {{tt|CellSpread}}, the [[damage]] extends beyond the current cell (it ''spreads''), to the distance set through {{tt|CellSpread}}. | ||
+ | |||
+ | As the damage progresses outwards from the point of impact, {{TTL|PercentAtMax}} 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.{{clr}} | ||
+ | |||
+ | ==Traditional View== | ||
+ | [[Image:CellSpread.png|thumb|right]] | ||
+ | For a quick, simple understanding of {{tt|CellSpread}}, simply view it as follows: The damage will extend beyond the impact cell for as many cells as {{tt|CellSpread}} is set to. e.g. if you set {{tt|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.<br> | ||
+ | The image to the right reflects which cells are affected by which {{tt|CellSpread}} under this simple model of {{tt|CellSpread}}.{{clr}} | ||
+ | |||
+ | ==Reality== | ||
+ | [[Image:CellSpread_order.png|thumb|right]] | ||
+ | In reality, the game's parsing of {{tt|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 {{tt|CellSpread}} or not...{{fnl|1}} | ||
+ | *...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 lower than {{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 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.) | ||
+ | |||
+ | ===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 {{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. | ||
− | |||
== Bugs == | == Bugs == | ||
− | CellSpread=11 is | + | *Due to the fact that {{tt|CellSpread}} works based on a lookup table, its number of possible values is severely restricted: |
+ | **{{tt|CellSpread{{=}}11}} is buggy, it does not extend outwards properly, and it affects one cell twice. | ||
+ | **Everything above {{tt|CellSpread{{=}}11}} leads to Internal Errors. | ||
+ | *{{tt|CellSpread}} is not working on warheads of [[particle]]s. A particle only ever damages the current cell it resides on. | ||
+ | |||
+ | |||
+ | ==Footnotes== | ||
+ | {{fn|1|2=Ambiguous. D later said ''<DCoder> floor({{tt|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 {{tt|CellSpread{{=}}3.5}} warhead, for example. This will be clarified tomorrow.}} | ||
+ | |||
− | + | ==See also== | |
+ | *{{TTL|PercentAtMax}} | ||
− | |||
− | |||
− | |||
− | == | + | == {{tt|CellSpread}} Internal Affected Cells Table == |
− | + | Purely for reference, here's the table used for {{tt|CellSpread}}. | |
+ | {|cellspacing="10" align="center" | ||
− | = | + | |valign="top"| |
− | |||
{| class="table_descrowdesccol" style="text-align: center;" | {| class="table_descrowdesccol" style="text-align: center;" | ||
! rowspan="2" | # of cell | ! rowspan="2" | # of cell | ||
Line 404: | Line 434: | ||
! 122 | ! 122 | ||
| 0 || -7 || 7 | | 0 || -7 || 7 | ||
+ | |- | ||
+ | ! rowspan="2" | # of cell | ||
+ | ! X | ||
+ | ! Y | ||
+ | ! rowspan="2" | Minimum<br>CellSpread | ||
+ | |- | ||
+ | ! colspan="2" | Offset from origin cell | ||
+ | |} | ||
+ | |||
+ | |valign="top"| | ||
+ | {| class="table_descrowdesccol" style="text-align: center;" | ||
+ | ! rowspan="2" | # of cell | ||
+ | ! colspan="2" | Offset from origin cell | ||
+ | ! rowspan="2" | Minimum<br>CellSpread | ||
+ | |- | ||
+ | ! X | ||
+ | ! Y | ||
|- | |- | ||
! 123 | ! 123 | ||
Line 773: | Line 820: | ||
! 245 | ! 245 | ||
| 5 || 7 || 9 | | 5 || 7 || 9 | ||
+ | |- | ||
+ | ! rowspan="2" | # of cell | ||
+ | ! X | ||
+ | ! Y | ||
+ | ! rowspan="2" | Minimum<br>CellSpread | ||
+ | |- | ||
+ | ! colspan="2" | Offset from origin cell | ||
+ | |} | ||
+ | |||
+ | |valign="top"| | ||
+ | {| class="table_descrowdesccol" style="text-align: center;" | ||
+ | ! rowspan="2" | # of cell | ||
+ | ! colspan="2" | Offset from origin cell | ||
+ | ! rowspan="2" | Minimum<br>CellSpread | ||
+ | |- | ||
+ | ! X | ||
+ | ! Y | ||
|- | |- | ||
! 246 | ! 246 | ||
Line 1,142: | Line 1,206: | ||
! 368 | ! 368 | ||
| -11 || 0 || 11 | | -11 || 0 || 11 | ||
+ | |- | ||
+ | ! rowspan="2" | # of cell | ||
+ | ! X | ||
+ | ! Y | ||
+ | ! rowspan="2" | Minimum<br>CellSpread | ||
+ | |- | ||
+ | ! colspan="2" | Offset from origin cell | ||
+ | |} | ||
+ | |||
|} | |} |
Revision as of 00:43, 24 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.
Contents
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 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.
|
|
|