Ahli / sc2xml

11 stars 1 forks source link

Melee attacks sometimes having a bigger range than intended #66

Open Ahli opened 1 year ago

Ahli commented 1 year ago

In some cases, melee units seem to be able to attack over a much greater distance than expected.

Facts:

Weapon range visualized: The difference is day and night! Screenshot2023-02-05 14_24_55 Screenshot2023-02-05 14_19_59

Theories:

Ahli commented 1 year ago

I was able to recreate the first bug in an automated test map.

Screenshot2023-02-12 00_32_04

Test Map - the bug with happen at 1:10 on timer

Test results:

Ahli commented 1 year ago

It does not happen when I set the range slop to 0. => This is a fix for the Zealot. His second hit is not influenced by the weapon, so this is a fix without side effects.

However, the bug is still present for all other melee attackers =/

When I reduce the range slop, it only happens at that distance. So, the buggy scenario uses the range slop distance to initiate an attack. For the Zealot, range slop 0.1 and range 0.0 do not trigger the bug. Having both at 0.1 triggers it. Thus, the buggy scenario uses both ranges combined when starting an attack

Partial Fix:

Most units with a damage point of 0.0 can have their range slop set to 0.0. Just the Mutalisk could require that value as it has to slow down, thus I would not suggest changing it without a lot of tests. The following units can be altered without issues:

    <CWeaponLegacy id="InterceptorLaunch">
        <RangeSlop value="0"/>
    </CWeaponLegacy>
    <CWeaponLegacy id="LurkerMP">
        <RangeSlop value="0"/>
    </CWeaponLegacy>
    <CWeaponLegacy id="MothershipBeam">
        <RangeSlop value="0"/>
    </CWeaponLegacy>
    <CWeaponLegacy id="P38ScytheGuassPistol">
        <RangeSlop value="0"/>
    </CWeaponLegacy>
    <CWeaponLegacy id="PsiBlades">
        <RangeSlop value="0"/>
    </CWeaponLegacy>
    <CWeaponLegacy id="PunisherGrenades">
        <RangeSlop value="0"/>
    </CWeaponLegacy>
    <CWeaponLegacy id="VolatileBurst">
        <RangeSlop value="0"/>
    </CWeaponLegacy>
    <CWeaponLegacy id="VolatileBurstBuilding">
        <RangeSlop value="0"/>
    </CWeaponLegacy>