Announcement

Collapse

Forum Rules

  • No flaming or derogatory remarks, directly or through insinuation.
  • No discussion, sharing or referencing illegal software such as hacks, keygen, cracks and pirated software.
  • No offensive contents, including but not limited to, racism, gore or pornography.
  • No excessive spam/meme, i.e. copious one liners in a short period of time, typing with all caps or posting meme responses (text/image).
  • No trolling, including but not limited to, flame incitation, user provocation or false information distribution.
  • No link spamming or signature advertisements for content not specific to Dota 2.
  • No Dota 2 key requests, sell, trade etc.
  • You may not create multiple accounts for any purpose, including ban evasion, unless expressly permitted by a moderator.

  • Please search before posting. One thread per issue. Do not create another thread if there is an existing one already.
  • Before posting anything, make sure you check out all sticky threads (e.g., this). Do not create new threads about closed ones.
  • It is extremely important that you post in correct forum section.

  • Balance discussion only in Misc.
  • All art related (such as hero model) feedbacks go to Art Feedback Forum.
  • All matchmaking feedback should go here: Matchmaking Feedback
  • All report/low priority issues should go here: Commend/Report/Ban Feedback
  • No specific workshop item feedback. These should go to workshop page of that item.
  • When posting in non-bugs section (such as this), use [Bugs], [Discussion] or [Suggestion] prefix in your thread name.



In case you object some action by a moderator, please contact him directly through PM and explain your concerns politely. If you are still unable to resolve the issue, contact an administrator. Do not drag these issues in public.



All rules are meant to augment common sense, please use them when not conflicted with aforementioned policies.
See more
See less

[Confirmed] Magnus's Reverse Polarity has incorrect duration for non-heroes

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • igo95862
    replied
    It is called Func1935813854915372 because it is deobfuscated code. To explain it simply look at some code from my test map:

    1). This function shows distance between two units:

    function DistanceF takes nothing returns nothing
    local unit a
    local unit b
    call DefineUnits()
    if CountUnitsInGroup(PlayerSelectedGroup)==2 then
    set a=FirstOfGroup(PlayerSelectedGroup)
    call GroupRemoveUnit(PlayerSelectedGroup,a)
    set b=FirstOfGroup(PlayerSelectedGroup)
    call DistanceA(a,b)
    else
    call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,10 ,"Incorrect amount of units. Please select two units.")
    endif
    set a=null
    set b=null
    endfunction

    function DistanceA takes unit a, unit b returns nothing
    local real x1=GetUnitX(a)
    local real x2=GetUnitX(b)
    local real y1=GetUnitY(a)
    local real y2=GetUnitY(b)
    call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,10 ,R2S(Pow(Pow(x2-x1,2)+Pow(y2-y1,2),0.5)))
    endfunction

    2). Then I obfuscate it to be better optimized and work faster:

    function GEC takes nothing returns nothing
    local unit a
    local unit b
    call F1C()
    if CountUnitsInGroup(JQE)==2 then
    set a=FirstOfGroup(JQE)
    call GroupRemoveUnit(JQE,a)
    set b=FirstOfGroup(JQE)
    call GVC(a,b)
    else
    call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,$A ,"Incorrect amount of units. Please select two units.")
    endif
    set a=null
    set b=null
    endfunction
    function GVC takes unit a,unit b returns nothing
    local real x1=GetUnitX(a)
    local real x2=GetUnitX(b)
    local real y1=GetUnitY(a)
    local real y2=GetUnitY(b)
    call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,$A ,R2S(Pow(Pow(x2-x1,2)+Pow(y2-y1,2),.5)))
    endfunction

    3). If I don't have my source code I need to use deobfusicator. It will be shown for me like this:

    function Func4441 takes unit loc_unit01,unit loc_unit02 returns nothing
    local real loc_real01=GetUnitX(loc_unit01)
    local real loc_real02=GetUnitX(loc_unit02)
    local real loc_real03=GetUnitY(loc_unit01)
    local real loc_real04=GetUnitY(loc_unit02)
    call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,$i ntegers003,R2S(Pow(Pow(loc_real02-loc_real01,2)+Pow(loc_real04-loc_real03,2),.5)))
    endfunction

    function Func4440 takes nothing returns nothing
    local string loc_string01=SubString(GetEventPlayerChatString(), 9,99)
    call Func4435()
    set real408=S2R(loc_string01)
    call ForGroup(group043,function Func4439)
    endfunction

    Icefrog has original source code where all functions are written logically but we can only have obfuscated code

    Leave a comment:


  • Kryil-
    replied
    I'm also pretty sure that IceFrog is NOT coding in Jass but using the GUI. There are many functions doing nothing but calling another function what's most likely a product of the automatism behind the GUI-Jass conversion. I haven't done this conversion for a long time (as the GUI produces horrible code), but while the names are not as cryptic as Func123312213 they're just as cryptic as TriggerNameNumber where TriggerName is the name given by Ice and Number simply increases by 1 per function. At LEAST you see what function belongs to what trigger.

    AFAIK there are two widely used optimizers: the first thing you'll find is the one from Vexorian himself (http://www.wc3c.net/showthread.php?t=79326 ) and the second one I found was from Pitzer (http://www.wc3c.net/showthread.php?t=79231 )
    EDIT: You can use in fact both. Pitzer recommends to use his first, then Vexs tool.
    Last edited by Kryil-; 07-31-2014, 11:07 AM.

    Leave a comment:


  • ThoAppelsin
    replied
    Originally posted by DarkLite View Post
    ... why are they all so unreadable? Why is everything called Func123124325435643 instead of something like Invoker_AddInvokedSpell, and the variables are all loc_unit13 / loc_integer1324 instead of things like "target" and "playerId"?

    ...
    IceFrog most probably works with a code that makes the most sense to them. It could be as in your example, or with some other names...

    What he most likely does is, using some optimizers that change the structure of the .w3x package thoroughly. I guess there was one from someone called PizerMike (might be wrong here), it was doing things like making the map package independent of the generic resource package that is located in the W3 directory. I don't remember their names, there was one for the Reign of Chaos and one for The Frozen Throne expansion.

    Being independent of those generic resource packages shortens the loading time greatly. Without that, loading of the map takes horribly late. This is, I guess, because otherwise the W3 needs to look up in those big resource packages for the values that are not present in the map package itself, to fill in the gaps itself. Only downside is that the map file size increases greatly, but it's not a big deal as long as it is beneath the threshold size.

    I guess this process itself already makes the map incompatible with the World Editor. Still, as far as I remember, one extra measure was being taken to prevent it from being opened by the World Editor, which I don't exactly remember.

    Anyway, these are all extra information.

    The JASS script for DotA, before being processed by the optimizer, should be rather more human-readable. Optimizer changes the identifier names (variable and function names) to be as short as possible, in order to reduce the size of the script. It reduces the size greatly, as well as, I think, makes its easier to process by computer. Harder to read by a human, but easier for a computer. AA, B02, RL, stuff like that; that's how they look when they are obfuscated, that's the term for it.

    Being harder to read by humans is just a side-effect, desired or not, the main purpose there is to make it run faster and also take less space.

    The scripts I was providing were from the de-obfuscated version of the code, from the obfuscated one. I don't remember the name of the programme I was using. It was extracting the JASS for me from the map package, and also de-obfuscating it: Changing identifier names into something more sensible, local variable names for the units to loc_unit##, things like that.

    Now that I come to think of it, it was slightly inconsiderate of me to not to change the variable names into sensible ones. Even changing them into just A, B and Cs could be better, I guess... It's not like the variable names matter, they are just identifiers.

    Leave a comment:


  • Noo
    replied
    Clicking "Reverse Polarity pulls and stuns couriers" leads to this thread.

    Leave a comment:


  • blash365
    replied
    added to sticky.

    Leave a comment:


  • hoveringmover
    replied
    Because the code was encrypted and no matter how well you can read that garbage code, it is still garbage code. If Icefrog gave everyone code that was not encrypted then it would be much easier to read. In fact, it is my suspicion that even Valve has to read garbage code and that is why they always have so many bugs in the game. That Icefrog is extremely protective of the WarCraft 3 DotA map it seems.

    Leave a comment:


  • DarkLite
    replied
    I realise this is wildly off topic, but something that's been bugging me about the JASS snippets you keep posting: why are they all so unreadable? Why is everything called Func123124325435643 instead of something like Invoker_AddInvokedSpell, and the variables are all loc_unit13 / loc_integer1324 instead of things like "target" and "playerId"?

    In other words: is it some sort of bizarre JASS requirement that everything be named like this? Or is it just that horrible coding style by the developers? It just seems incredibly odd if it's done voluntarily, because it makes the code substantially harder to understand and to maintain :/

    Leave a comment:


  • ThoAppelsin
    replied
    [A06F]
    ...
    Dur1=2.5
    HeroDur1=2.5
    ...
    Dur2=3.25
    HeroDur2=3.25
    ...
    Dur3=4
    HeroDur3=4


    ^ 6.76c
    I have checked its jass functions, too. It is relatively a lot easier to read, consists of 4 functions, and two being only event and ability checks... It might even be the easiest function chain I have read so far, it is like the drow ranger of the DotA JASS, would be my primary suggestion to beginners to start.

    I think either such a difference has never existed, or was a long past change. I actually do remember those two being different, but last time I played DotA was more than 1.5 year ago. Maybe it was like that back then...

    Leave a comment:


  • bu3ny
    replied
    It used to be 3/4/5 seconds on non-hero units, but I think it changed with the last change to its duration on heroes.

    Leave a comment:


  • [Confirmed] Magnus's Reverse Polarity has incorrect duration for non-heroes

    It is 3 4 5 seconds on creeps
    it should be 2.25 3 3.75 seconds, just as it is on heroes, there shouldn't be any difference...


    Playdota is wrong. In-game descriptions in DotA are not reliable and can miss such information, but it does not mention a single word related to creeps.
    If I am not failing to see something, code only uses a single ability to deal with the stun and the damage.
    Here is the full data dump for that ability:

    01 [A06F]
    02 code=AOws
    03 checkDep=1
    04 levels=3
    05 reqLevel=6
    06 levelSkip=5
    07 targs1=ground,organic

    08 Dur1=2.25
    09 HeroDur1=2.25

    10 Cool1=120
    11 Cost1=200
    12 Area1=410
    13 DataA1=150
    14 BuffID1=BPSE
    15 targs2=ground,organic

    16 Dur2=3
    17 HeroDur2=3

    18 Cool2=110
    19 Cost2=250
    20 Area2=410
    21 DataA2=225
    22 BuffID2=BPSE
    23 targs3=ground,organic

    24 Dur3=3.75
    25 HeroDur3=3.75

    26 Cool3=100
    27 Cost3=300
    28 Area3=410
    29 DataA3=300
    30 BuffID3=BPSE
    31 targs4=ground,organic
    32 Dur4=5
    33 HeroDur4=5.00
    34 Cool4=6
    35 Cost4=100
    36 Area4=300.00
    37 DataA4=100.00
    38 BuffID4=BPSE
    39 Art=ReplaceableTextures\CommandButtons\BTNReverseP olarity.blp
    40 Buttonpos=3,2
    41 Casterart=Abilities\Spells\Orc\WarStomp\WarStompCa ster.mdl
    42 Order=stomp
    43 Animnames=spell,slam
    44 Researchart=ReplaceableTextures\CommandButtons\BTN ReversePolarity.blp
    45 Researchbuttonpos=3,0
    46 Name="Reverse Polarity"
    47 Tip="Re|cffffcc00v|rerse Polarity - [|cffffcc00Level 1|r]","Re|cffffcc00v|rerse Polarity - [|cffffcc00Level 2|r]","Re|cffffcc00v|rerse Polarity - [|cffffcc00Level 3|r]","Wa|cffffcc00r|r Stomp - [|cffffcc00Level 4|r]"
    48 Ubertip="Through some unknown property of matter, the Magnataur sucks all nearby units to his position. He stuns them with a powerful stomp, dealing 150 damage and stunning them for 2.5 seconds. |n|n|cff99ccffCooldown: |r 120","Through some unknown property of matter, the Magnataur sucks all nearby units to his position. He stuns them with a powerful stomp, dealing 225 damage and stunning them for 3.25 seconds. |n|n|cff99ccffCooldown: |r 110","Through some unknown property of matter, the Magnataur sucks all nearby units to his position. He stuns them with a powerful stomp, dealing 300 damage and stunning them for 4 seconds. |n|n|cff99ccffCooldown: |r 100","Slams the ground, dealing 100 damage to nearby enemy land units and stunning them for 5 seconds."
    49 Hotkey=V
    50 Researchtip="Learn Re|cffffcc00v|rerse Polarity - [|cffffcc00Level %d|r]."
    51 Researchubertip="Through some unknown property of matter, the Magnataur sucks all nearby enemies to his position and stuns them with a powerful slam, dealing damage. |n|n|cffffcc00Level 1|r - 2.5 second stun, deals 150 damage. |n|cffffcc00Level 2|r - 3.25 second stun, dealing 225 damage. |n|cffffcc00Level 3|r - 4 second stun, dealing 300 damage. |n|n|cff99ccffCooldown: |r 120/110/100"
    52 Researchhotkey="V"



    I am entirely sure that I am not missing anything. It would be as easy as editing 3 values to make non-heroes have a different scale of stun duration.
    Anyone may feel free to provide a video proof or such if they find think that it is necessary.
Working...
X