Vision

Discussion in 'Advanced Mechanics Guides' started by Lordshinjo, Dec 2, 2010.

  1. Lordshinjo

    Lordshinjo Well-Known Member

    Vision

    This is a guide about vision in Warcraft III and DotA in particular, and it has nothing to do with Pacman.
    Or does it ?
    [​IMG]

    The DotA section of this guide is up to date with the 6.77c version.

    [TAB]Introduction|General Concepts|DotA Specifics|X
    If you've ever started a game in Warcraft III, using any map, you'll have remarked this : you can see stuff. This is the basis of this game, if you didn't see anything, you simply couldn't play.
    You'll also have realized that some heroes/units see farther than others, depending on whether it's night or day, and that you usually can't see past a tree.

    The goal of the first section is to explain what vision is in Warcraft III, and how it works, in greater details.
    The second section shows some particular cases of vision in DotA.
    {|}
    [TAB]Map Grid|Fog Update Time|Sight Radius|Day and Night|Dying Units|Occlusion|Height|Flying Units|Fog Modifiers
    To understand how vision works, the most important thing to understand is that a map is composed of a big grid.
    Every square in this grid is called Cell, its dimensions are 128x128 (in Warcraft III distance units).

    [​IMG]
    {|}
    The fog of war is updated every 0.4s since the start of the map.

    This means that every 0.4s, the position of every unit, their sight range, and any sight that should be blocked or not are computed.
    Then, the fogged or visible status of each grid cell is decided for each player.

    You can then see a visual delay when the fog goes away or comes back on some cells, but this is only visual : as soon as the fog of war begins to appear or disappear, the vision has already been completely lost or gained on a particular zone.

    Whether a unit is visible or not can however be changed outside of this update time, as a unit leaving a visible cell for a fogged cell will immediately cause this unit to be fogged, without waiting for the next update.
    {|}
    Every unit in Warcraft III has 2 fields defining how far it can see : one for the day, and one for the night. These values are capped at 1800.

    [​IMG]

    But these values aren't directly used.
    Instead, they can be classified in 15 different Sight Levels, defining how many cells away the unit can see.

    [TABLE="Sight levels"]Sight level|Min. sight radius|Max. sight radius|Picture||Sight level|Min. sight radius|Max. sight radius|Picture
    0|0|63|None||8|960|1087|[​IMG]
    1|64|191|[​IMG]||9|1088|1215|[​IMG]
    2|192|319|[​IMG]||10|1216|1343|[​IMG]
    3|320|447|[​IMG]||11|1344|1471|[​IMG]
    4|448|575|[​IMG]||12|1472|1599|[​IMG]
    5|576|703|[​IMG]||13|1600|1727|[​IMG]
    6|704|831|[​IMG]||14|1728|1800|[​IMG]
    7|832|959|[​IMG]|||||
    [/TABLE]​
    {|}
    Every unit having a day field and a night field, you can easily understand that its vision differ depending on whether it is night or day.

    But a particular case is the transition between day and night : this is the only moment when a unit's sight radius can be different from these 2 values, as the game makes it transition smoothly from one value to the other.
    This transition usually lasts 3.2s (less when the transition lasts 1 or 2 levels), with the vision gaining 1 or 2 levels of sight range at short intervals of time, usually 0.4s. (and more generally always a multiple of 0.2s)

    The most usual transition for heroes, from 800 (level 6) to 1800 (level 14), is the perfect example, as the unit gains 1 sight level every 0.4s during 3.2s.
    This particular transition is also symmetrical, as it is exactly the same from 1800 to 800, even though this is usually not the case.
    {|}
    A dying unit still has vision during a time equal to its death time, but its sight range is capped by the Gameplay Constant "Fog Reveal Radius - Dying Unit".
    In DotA, this constant is set to 500. This means that units with more than 500 sight range will have their sight range reduced to 500 (level 4) while dying. Units with less than 500 will not have their vision changed at all.

    Note that due to an engine bug, only units having gone through at least one day->night (or night->day) transition will have their vision reduced this way.
    {|}
    Some objects, like trees or cliffs, can block vision.
    These objects are called Occluders.

    An occluder must cover the bottom right corner of a cell to be considered as covering the entire cell.

    The first thing to know how vision is blocked is how the unit is placed around the blocker. There are 4 possibilities :

    [TABLE="Occlusions"]Position|Occlusion mask
    In a straight line|[​IMG]
    In a diagonal line|[​IMG]
    Between a straight and a diagonal line|[​IMG]
    On the same cell|[​IMG][/TABLE]​

    When surrounded by multiple occluders, the resulting occlusion mask is the superposition of the occlusion masks of each occluder.
    The minimum number of vision blockers to completely block a unit's vision is 8, one in each cell around the unit.
    {|}
    You surely know that sometimes, being higher than a tree can make your vision go over it.
    This is because all trees have an Occluder Height.
    This value is usually 230 for a tree of medium size (called Tree Wall in World Editor), and 300 for a bigger tree (called Canopy Tree).
    But like sight range, these exact values aren't used. Instead, they are converted in Cliff Levels.
    A cliff level corresponds to 128 height, but also to the height of a cliff.

    [TABLE="Cliff levels"]Cliff level|Min. height|Max. height
    0|0|0
    1|1|128
    2|129|256
    3|257|384
    4|385|512
    ...|...|...[/TABLE]​

    With their 230 occluder height, medium trees can be said to be occluder level 2. This means that you need to be at least on a cliff level 2 to see over them.

    In this example, the north tree is level 3, the west tree level 2, and the unit is placed on a cliff level 2 :

    [​IMG]

    Note that a unit can change height only by going on a cliff, or an elevated object (like a platform).
    The "Apply Height" tool in World Editor, used to create smooth hills, will not change the height of the terrain.

    [​IMG]

    When going up a ramp, the cliff level increases at a particular point : the middle of the second cell.

    [​IMG]
    {|}
    For the purpose of determining whether a unit's vision is blocked or not, flying units can be considered as being always at an infinite cliff level.
    This means that their vision can never be blocked by anything.
    {|}
    Some spells can create Fog Modifiers, via the CreateFogModifierRadius function.
    Some hardcoded spells, Mirror Image and Storm, Earth and Fire (more known as Primal Split in DotA), also create a fog modifier.
    For Mirror Image, the radius is specified by the area of effect field (this field has no other purpose), and the fog modifier is destroyed when the unit casting Mirror Image appears.
    Storm, Earth and Fire creates fog modifier with a radius equal to the casting unit's sight range, and the fog modifier is destroyed after 3s.

    These fog modifiers have a center and a radius, but as before, the radius isn't directly used, it is instead converted into a size, each size corresponding to the approximate radius in cells.
    Fog modifiers obviously ignore any occluders.

    [TABLE="Fog modifier"]Fog modifier size|Min. radius|Max. radius|Result||Fog modifier size|Min. radius|Max. radius|Result
    0|0|127|Nothing||5|640|767|[​IMG]
    1|128|255|[​IMG]||6|768|895|[​IMG]
    2|256|383|[​IMG]||7|896|1023|[​IMG]
    3|384|511|[​IMG]||8|1024|1151|[​IMG]
    4|512|639|[​IMG]||...|...|...|...
    [/TABLE]​

    There is a second way for fog modifiers to be created : whenever a unit is attacked or targeted by a spell of a second unit, a fog modifier is created around the second unit.
    This fog modifier has a radius equal to the "Fog Reveal Radius - Attacking Unit" Gameplay Constant, and it will disappear either after a number of seconds equal to "Decay Time (Sec) - Fog of War Flash", or when the second unit creates another fog modifier this way.
    [/TAB]
    {|}
    [TAB]Hero Vision|Spells Providing Vision|Roshan Area
    Most heroes in Dota have a 1800/800 vision (which is short for 1800 sight range during the day and 800 during the night).

    The following heroes have a different vision :
    • Night Stalker: 1200/1800
    • Tormented Soul: 1800/900
    • Bounty Hunter: 1800/1000
    • Sniper: 1800/1000
    • Faerie Dragon: 1800/1200
    • Priestess of the Moon: 1800/1200
    • Treant Protector: 1800/1200
    • Ancient Apparition: 1800/1400
    • Alchemist: 1800/1400
    • Drow Ranger: 1800/1700
    • Enchantress: 1800/1800
    • Geomancer: 1800/1800
    • Nightcrawler: 1800/1800
    • Lycanthrope (under Lycanthropy): 1800/1800
    • Moon Rider (with Lunar Blessing): 1800/1800

    The visions of other units in DotA are listed there.
    {|}
    Some spells in DotA provide vision where they are cast.
    The mechanics behind this vision can be of multiple origin.

    The first and most common source of vision is a unit.
    This unit is created either to cast a spell, or to exist as a visual.
    The unit is very often flying, so the vision it provides is unobstructed, but it happens that some spells create ground units.
    For some of these spells, the unit stays at a fixed position during its death. (this is the red duration in the table)
    Short list of examples : Mirana's arrow, Wave of Terror.

    The second source of vision is a fog modifier, centered on where the spell was cast, and with a radius specified in the spell. (through triggered or hardcoded means)
    Short list of examples : Sticky Napalm, Mirror Image.

    Another source of vision is the Faerie Fire spell: this spell gives you the vision of the affected unit, and allows to see it even if it is invisible.
    Track and Amplify Damage are directly based on Faerie Fire.

    The last one is done by giving a unit's vision to a player.
    This allows this player to see what the unit sees
    If the unit turns invisible, it will still be invisible to the player, but units will still be able to attack it (even though you can't directly click on it).

    Here is the entire list of spells creating vision, with the type of vision they provide :
    [Table="Spell Vision"]Skill|Type|Radius|Location|Duration|Note
    Torrent|Fog modifier|400|Torrent|4s|
    X Marks the Spot|Flying|1000/1000|X|5.94s|
    Ghost Ship|Flying|400/400|Boat|Boat travel (3s) + 0.1s|
    Wild Axes|Ground|500/500|Axes|Axes travel|
    Primal Split|Fog modifier|1800/800|Panda's location|3s|
    Storm Bolt|Flying|225/225|Projectile|Projectile travel + 0.1s|
    Echo Stomp|Flying|600/600|Spirit, if he's not already summoned|Channeling duration|
    Ancestral Spirit|Flying|600/600|Spirit|While the Spirit exists|
    Earth Splitter|Fog modifier|500|Every 200 distance along the split|4s each|
    Overgrowth|Flying|350/350|Position of every affected unit|Flash|
    Spirits|Flying|400/400|Spirits|While the Spirit orbits, then 3.34s after explosion|
    Relocate|Fog modifier|500|Io's original location|Until the end of the spell or Io's death|
    Power Cog|Ground|1600/600|Cogs|Spell duration + 3s|
    Rocket Flare (1)|Flying|450/450|Rocket|Rocket travel|
    Rocket Flare (2)|Fog modifier|600|Impact|10s|
    Hookshot (1)|Flying|100/100|Regular hook link|Duration of the link|
    Hookshot (2)|Flying|450/450|Last hook link|Duration of the link|
    Fire Spirits|Flying|300/300|Spirit|While the Spirit exists|
    Sun Ray (1)|Fog modifier|225|Every 150 distance along the ray|2s, created every 0.2s|
    Sun Ray (2)|Fog modifier|500|Phoenix's position|For 2s after being damage by Sun Ray|Given to the enemy
    Supernova|Flying|450/450|Sun|Sun duration + 3.34s|
    Ice Shards|Flying|300/300|Projectile|Projectile travel|
    Snowball|Flying|800/800|Snowball|Snowball travel + 3.34s|
    Timber Chain (1)|Flying|100/100|Regular hook link|Duration of the link|
    Timber Chain (2)|Flying|450/450|Last hook link|Duration of the link|
    Chakram|Flying|300/300|Chakram|Duration of the spell + 0.1s|
    Phantasm|Fog modifier|400|CK's location|Around 0.63s (0.5s + illusion projectile travel)|
    Infest|Shared vision|N/A|Infested unit|Until the end of the spell|
    Night Stalker with Aghanim's|Flying|0/1800|NS's position|As long as NS has Aghanim|
    Meat Hook|Flying|500/500|Position of hooked enemy|4s when an enemy is hooked|
    Amplify Damage|Faerie Fire|N/A|Target|Spell duration|
    Charge of Darkness|Flying|400/400|Target's position|Charge duration + 0.94s|
    Sand Storm|Ground|1000/750|4 units offset by (-150,-150), (-150,150), (150,-150), (150,150) to SK|Spell duration|
    Shrapnel|Fog modifier|360|Center of target area|9.4s|
    Assassinate|Shared vision|N/A|Target|Until Sniper stops casting the spell|
    Omnislash|Flying|200/200|Juggernaut|Spell duration + 0.94s|
    Mirror Image (Naga Siren)|Fog modifier|400|Naga's position|Around 0.43s (0.3s + illusion projectile travel)|
    Elune's Arrow|Flying|800/800|Projectile|Projectile travel + 3.34s|
    Whirling Axes (ranged)|Flying|500/500|Axes|Axes travel (0.6s) + 3s|
    Whirling Axes (melee)|Flying|500/500|Axes|Axes travel (3s) + 3s|
    Homing Missile (1)|Flying|500/500|Missile|Missile travel + 3.34s|
    Homing Missile (2)|Shared vision|N/A|Missile|From 1 second after the missile starts moving|Given to the enemy
    Call Down|Fog modifier|350|Center of the target area|4s|
    Wave of Terror|Flying|500/500|Every 400 distance along the wave|3s each|
    Track|Faerie Fire|N/A|Target|Spell duration|
    Sleight of Fist|Fog modifier|600|Center of the target area|Spell duration|
    Fire Remnant|Ground|450/450|Fire remnant|Remnant duration + 0.1s|
    Strygwyr's Thirst (1)|Shared vision|N/A|Non invisible heroes under 40% HP inside the AoE|As long as they have under 40% HP and are not invisible|
    Strygwyr's Thirst (2)|Faerie Fire|N/A|Heroes under 20% HP inside the AoE|As long as they have under 20% HP|
    Stifling Dagger|Flying|600/600|Projectile|Projectile travel + 3.34s|
    Spectral Dagger|Flying|200/200|Each shadow of the shadow path|15s|
    Venomous Gale|Flying|400/400|Projectile|Projectile travel (0.7s)|
    Earthbind|Flying|300/300|Projectile|Projectile travel + 0.1s|
    Plasma Field|Flying|800/800|Razor's position|Spell duration (2.4s) + 3.34s|
    Static Link|Flying|800/800|End of the link (not on Razor's side)|Spell duration + 3.34s|
    Chronosphere|Flying|1000/1000|Center of Chronosphere|Spell duration|
    Mystic Snake|Flying|300/300|Projectile|Projectile travel + 0.1s|
    Spark Wraith|Flying|300/300|Wraith|Duration of the wraith + 3.34s|
    Crystal Nova|Ground|1000/750|Center of the target area|5s|
    Illusory Orb|Flying|800/800|Projectile|Projectile travel + 3.34s|
    Illuminate|Flying|350/350|1 unit created every 0.5s every 150 distance while Ezalor is channeling|10.34s each|
    Lightning Bolt|Flying|1000/1000|Target's position|6s|This is a unit casting Chain Lightning
    Thundergod's Wrath|Flying|1000/1000|Position of each target|6s|Same
    Sprout|Fog modifier|1000|Center of the target area|Spell duration|
    Last Word|Ground|1800/800|Target|Spell duration + 0.94s|
    Static Remnant|Flying|800/800|Static remnant|Spell duration|
    Ball Lightning|Flying|1000/1000|Position of Storm|Travel time|
    Shackleshot|Flying|300/300|Projectile|Projectile travel + 0.1s|
    Powershot|Flying|800/800|Projectile|Projectile travel + 3.34s|
    Thunder Strike|Flying|450/450|Target's position|Spell duration (4s) + 3s|
    Glimpse|Flying|400/400|Projectile|Projectile travel + 3.34s|
    Kinetic Field|Fog modifier|300|Center of the target area|5.5s|
    Static Storm|Flying|450/450|Center of the target area|Spell duration (5s)|
    Ice Path|Ground|200/200|1 ice block created every 0.05s every 100 distance|3.5s each|
    Arcane Bolt|Flying|325/325|Projectile|Projectile travel + 3.34s|
    Concussive Shot|Flying|400/400|Projectile|Projectile travel + 3.34s|
    Wall of Replica|Ground|200/200|39 units along the wall|Spell duration (15/30/45s)|
    Black Hole|Ground|800/800|Black Hole|Spell duration (4s) + 1s|
    Chain Frost|Flying|1000/750|Projectile|Projectile travel|
    Astral Imprisonment|Ground|1800/800|Target|Spell duration + 1s + 0.94s|Given to the enemy
    Disruption|Ground|1800/800|Target|2.6s + 0.94s|Given to the caster and target
    Shadow Poison (1)|Flying|300/300|Projectile|Projectile travel (1.5s) + 3.34s|
    Shadow Poison (2)|Ground|1800/800|Each hero affected|Spell duration + 0.94s|
    Sticky Napalm|Fog modifier|500|Center of the target area|2s|
    Flamebreak|Flying|300/300|Projectile|Projectile travel + 0.1s|
    Weave|Flying|800/800|Center of the target area|8.34s|
    Sun Strike|Fog modifier|400|Center of the target area|5.7s (Starts 1.7s before the damage is dealt)|
    Tornado|Flying|1200/1200|Projectile|Projectile travel + 1.75s|
    Chaos Meteor|Flying|500/500|Meteor on the ground|While the meteor rolls + 3s|
    Ice Vortex|Ground|200/200|Vortex|Spell duration (12s)|
    Ice Blast (1)|Flying|500/500|First projectile|First projectile travel|
    Ice Blast (2)|Flying|500/500|Second projectile|Second projectile travel + 3.34s|
    Ice Blast (3)|Fog modifier|500|Center of the final area|Second projectile travel|
    Arctic Blast (Shiva's Guard)|Flying|800/800|Caster's position|Spell duration (1.98s) + 3.34s|
    Mirror Image (Manta Style)|Fog modifier|1000|Caster's position|Around 0.23s (0.1s + illusion projectile travel)|
    Teleport (Scroll of Teleportation)|Fog modifier|200|Destination|During the channeling time|
    [/table]
    {|}
    As you may know, the area around Roshan cannot be seen until you are inside it, except for flying units (like a Scout Hawk, or the unit over Night Stalker with an Aghanim's Scepter)

    This is because this area is surrounded by things called "Line of Sight Blockers", whose purpose are exactly as their name suggest.
    These blockers do not prevent you from entering the area, but you cannot see through them, meaning vision is blocked from the outside of the area, as well as from the inside.

    Additionally, a trigger is in place to prevent you from placing wards inside the area.

    [​IMG]
    [/TAB][/TAB]
     
    Last edited: Apr 20, 2013
  2. Pingus!

    Pingus! Well-Known Member

    Nice, "short", concise guide, full of little nuggets of information :3
    Nice work Shinjo.

    E: I think you should order the heroes from highest to lowest night vision.
     
  3. antiweltteilchen

    antiweltteilchen Well-Known Member

    /me iterates over LordShinjo's item slots and adds a Refrencher Orb in the slot.

    awesome work as usual shinjo :>
     
  4. Pingus!

    Pingus! Well-Known Member

    Refrencher, I loled. Does it make you twice the french?
     
  5. SoletLuna

    SoletLuna Moderator

    /me germinates Double Shinjo D:
     
  6. Black Isle

    Black Isle Well-Known Member

    Compact wall of text! D:

    I heard this Storm, Earth and Fire and Mirror Image gives some sight and stuff. Maybe test and add them o.o

    Since I'm so good with Meat Hook, I observed that in case of a successful hook against an enemy unit it creates a dummy unit with 500 sight or something. Maybe it's my imagination.

    Maybe add Lunar Blessing, doesn't really suit any particular section though. I guess you just discluded it.
     
  7. Dagguh

    Dagguh Well-Known Member

    It's a Gameplay Constant, right?

    BTW. What are the Sunstrike values?
     
    Last edited: Dec 2, 2010
  8. Fail Pacman. He (it?) got a cut at the end of his mouth (inner)
     
  9. Lordshinjo

    Lordshinjo Well-Known Member

    Added these. (I remember testing that Mirror Image thing, and Invoker has too many spells D: )

    About the fog update time, it seems like a gameplay constant is supposed to do that, but it's actually always 0.4s.
     
  10. wd.Ripper

    wd.Ripper Well-Known Member

    Really great guide, but to be honest I do not like the tabs too much. Ofcourse it makes it nice and compact but it doesn't make it any more clear or pretty. I prefer the guides where you have to scroll all the ffing time :eek: .

    Great job though.

    Edit; So if Sniper ulties an enemy Balanar with Aghanims Scepter, Sniper will get full, unobstructed nightvision too?
     
  11. PEW_PEW

    PEW_PEW Well-Known Member

    No. The bonus vision is granted by a dummy unit, and since only the target of snipers ult has its vision shared, the sniper player would just see things the way balanar would without aghanims.
     
  12. Sinisterz

    Sinisterz Well-Known Member

    what about the bug when u buy back and still have 500/500 range until u die again?
     
  13. Lordshinjo

    Lordshinjo Well-Known Member

    This is related to the Dying Units section : buying back when you're still dying makes you be considered as always dying (even when still alive), and your vision is capped at 500/500.
    Only dying again can fix it.
     
  14. Kikut

    Kikut Well-Known Member

    Great job, everything about sight and whatnot in one thread.
    Really appreciate it.
     
  15. Aravis

    Aravis Well-Known Member

    I heared that if akasha blinks and casts her aoe in the 0.4sec update time (if she blinked at n*0.4 sec after map start) its not yet updated, and nobody will be hit.
    Same thing with shaker.

    Correct me if im wrong pls.
     
  16. antiweltteilchen

    antiweltteilchen Well-Known Member

    you misunderstood.
    the content of this sentence is that if you blink into fow it looks like your vision will expand smoothly. but actually the full vision is granted at the time the fow is updated again (meaning at max 0.4 secs later)
     
  17. MauranKilom

    MauranKilom Well-Known Member

    and during that max of 0.4 seconds, casting scream of pain (which is based on fan of knives, which in return doesn't hit units you don't see) will have no effect (if you blinked somewhere you had no vision of)
     
  18. ElementUser

    ElementUser Well-Known Member

    YES a list of vision spells! ^.^

    You forgot Kunkka's Torrent - it gives 4 seconds of 400/400 vision.
     
  19. Der_kleine_Tomy

    Der_kleine_Tomy Well-Known Member

    Scream of Pain is completely triggered, so it doesn't matter if it's based on fan of knives or not.
     
  20. MauranKilom

    MauranKilom Well-Known Member

    Uh, sorry.