Slow Special Multiplayer Fix

Discussion of all aspects of multiplayer development: unit balancing, map development, server development, and so forth.

Moderators: Forum Moderators, Developers

Post Reply
User avatar
tekelili
Posts: 1038
Joined: August 19th, 2009, 9:28 pm

Slow Special Multiplayer Fix

Post by tekelili » June 11th, 2015, 2:39 pm

(Available on 1.12 add on server)

Slow Special Multiplayer Fix modification changes clean up time of slowed status when inflicted on offense, from unit slowed turn to unit slowing turn.

Default behavior and problem description:
We must consider inflicting slow status as attacker and defender as different cases. When I pointed years ago slow mechanics inconsistence in multiplayers, I was pointed that clean up slowed status at end of unit slowed turn, was a very desired behavior for balance reasons. If a mage attacking a shaman becomed slowed and allies could take advantage of it, was considered overpowered. I agree, and slow satus inflicted on defense has not inconsistence in multiplayer.

However, slowed status inflicted on ofense has a very unbalanced behavior imo. Let us considere the most extreme scenario: 8 human sides fighting vs an AI side 9. If player 1 has a shaman and remaining players have ulfs, all human controlled ulfserkers can attack an slowed enemy unit. If all players have ulfs but side 8 having a shaman, then none ulfserker controlled by humans can attack a slowed enemy unit.

My hypotetical scenario is close to reality, as example Axis and Allies add on has enemies with hundreds of hit points and players always control 1 elf faction and 1 knalga fation, with combo shaman+ulf very handly to end in a short turn limit as scenario has.

This modification becomes all slowing attacks equaly powerfull to be controled by side 1, as allies will have same chance to attack slowed enemies.

If someone interested in code, it is pretty short:

Code: Select all

#ifdef MULTIPLAYER

#define MULTIPLAYER_SLOW_FIX_EVENTS
    [event]
        name=attacker_hits
        first_time_only=no
        ## store on unit side slowing on offense
        [filter_attack]
            special=slow
        [/filter_attack]
        {VARIABLE second_unit.variables.slowed_by_side $unit.side}
        [unstore_unit]
            variable=second_unit
        [/unstore_unit]
    [/event]

    [event]
        name=side turn
        first_time_only=no
        ## clean slowed status from units slowed by current side
        [store_unit]
            [filter]
                [filter_wml]
                    [variables]
                        slowed_by_side=$side_number
                    [/variables]
                [/filter_wml]
            [/filter]
            variable=units_slowed_by_side
        [/store_unit]
        {FOREACH units_slowed_by_side unit_i}
            {VARIABLE units_slowed_by_side[$unit_i].status.slowed no}
            {CLEAR_VARIABLE units_slowed_by_side[$unit_i].variables.slowed_by_side}
            [unstore_unit]
                variable=units_slowed_by_side[$unit_i]
            [/unstore_unit]
        {NEXT unit_i}
        {CLEAR_VARIABLE units_slowed_by_side}
        ## store current side slowed units
        [store_unit]
            [filter]
                side=$side_number
                [filter_wml]
                    [status]
                        slowed=yes
                    [/status]
                [/filter_wml]
            [/filter]
            variable=side_units_slowed
        [/store_unit]
    [/event]

    [event]
        name=side turn end
        first_time_only=no
        ## prevent slowed status (on offense) be removed at end of turn
        {FOREACH side_units_slowed unit_i}
            [store_unit]
                [filter]
                    id=$side_units_slowed[$unit_i].id
                [/filter]
                variable=side_units_slowed[0]
            [/store_unit]
            {VARIABLE side_units_slowed[0].status.slowed yes}
            [unstore_unit]
                variable=side_units_slowed[0]
            [/unstore_unit]
        {NEXT unit_i}
        {CLEAR_VARIABLE side_units_slowed}
    [/event]
#enddef

    [modification]
        id= Slow_Special_Multiplayer_Fix
        name= Slow Special Multiplayer Fix
        require_modification=no
        description= "Changes status clean up time of offensive slow weapon special, to be balanced in multiplayer games."
        {MULTIPLAYER_SLOW_FIX_EVENTS}
    [/modification]
#endif
Note: this modification has not effect in 1v1 as behavior becomes equivalent to default one.
Be aware English is not my first language and I could have explained bad myself using wrong or just invented words.
World Conquest II

User avatar
Ravana
Moderator
Posts: 1887
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Slow Special Multiplayer Fix

Post by Ravana » June 11th, 2015, 3:25 pm

I agree about this for some scenarios, will promote this addon where applicable.

Then again, would make sense to also have option for the behaviour you described that was officially refused.

Post Reply