Update/rework of the ATTACK part's hitback damage



  • Right now an attacked creep will always do the full damage of all active ATTACK parts it has as a hit-back onto the attacker, regardless of the attacker's power. This effectively means that an 1m1a creep attacking 10m10a one will get full 300 hits of damage back and die instantly, w/o the defender having to do anything at all. Add that to other 300 hits from Creep.attack() onto its target and it pretty much means that a bigger creep will always have an overwhelming advantage over the smaller one, even in large numbers.

    My idea is to limit the hit-back damage to the minimum value of either creep's ATTACK part damage. In such scenario a single 1m1a creep would be getting maximum of 30 hits of hit-back damage per attack on the larger creep regardless of size difference, however the larger creep would still deal full Creep.attack() damage and get other creep's ATTACK damage on hit-back. This change would offer the smaller creep improved chance in a "David vs. Goliath" scenario. Or, more likely, "Multiple Davids vs. Goliath".

    Let's take a hypothetical scenario of 10× 1m1a (200 hits) creeps attacking a single 10a10m (2000 hits) creep. I know, there are only 8 spaces, but it's hypothetical! We have equal amount of resources and ticks spent on spawning the creeps on both sides, but the 10 smaller creeps have the drawback of using more CPU and requiring more complex code to coordinate.

    As it is right now:

    1. Each of the 1m1a creeps .attack() the 10m10a one, dealing 30 hits of damage and receiving 300 hits of damage back, each. Since they have 200 hits only, they all die. Defending creep loses 300 hits and wonders what was all that noise, since it did not have to do anything. Result: defender has 1700/2000 hits and there are 10 tombstones around it.

    With proposed changes:

    1. Each of the 10× attacking 1m1a creeps .attack() the defending 10m10a creep, dealing 30 hits of damage and receiving min(30, 300) = 30 hits of damage back. Defending creep swats one of the attackers with .attack() of its own and kills it, but also receives extra 30 hits of damage back. Result: defender has 1670/2000 hits, we now have 9× attackers at 170/200 hits and 1× tombstone.
    2. Each of the 9× attacking 1m1a creeps .attack() the defending 10m10a creep again, dealing 30 hits of damage and receiving min(30, 300) = 30 hits of damage back. Defending creep swats another one of the attackers with .attack() of its own and kills it, but also receives extra 30 hits of damage back. Result: defender has 1370/2000 hits, and there are 8× attackers left with 140/200 hits left each, plus 2× tombstones.
    3. Each of the 8× attacking 1m1a creeps .attack() the defending 10m10a creep again, dealing 30 hits of damage and receiving min(30, 300) = 30 hits of damage back. Defending creep swats yet another one of the attackers with .attack() of its own and kills it, but also receives extra 30 hits of damage back. Result: defender now has 1100/2000 hits, there are 7× attackers with 110/200 hits left each, and 3× tombstones.
    4. Each of the 7× remaining attacking 1m1a creeps .attack() the defending 10m10a creep once again, dealing 30 hits of damage and receiving min(30, 300) = 30 hits of damage back. At this point attackers drop to 80 hits and disable their only ATTACK part, which prevents them from dealing any further damage or hit-back damage. Defending creep swats yet another one of the attackers with .attack() of its own and kills it, this time suffering no hit-back damage. Result: defending creep now has 890 hits and two disabled ATTACK parts, we have 6× remaining attackers, and 4× tombstones.
    5. through 10. -- defending 10m10a creep swats the remaining disabled attackers w/o trouble and emerges victorious, albeit battered up. Final result: one 10m10a defending creep at 890/2000 hits and 10× tombstones.

    As you can see, in both scenarios the defending creep was able to achieve victory over its opponents, however, in the latter case the attacking creep actually had a fighting chance.

    The principal goal of this suggestion is to allow a coordinated force of small creeps utilize numerical advantage over large creeps without requiring significant creep body mass advantage. Consider this: right now to kill a single 10m10a creep you would need around 80 to 90 1m1a creeps, giving us around 8-9:1 body parts ratio, which is rather steep. After the change 15-18 creeps would suffice, giving a much more even 1.5-1.8:1 body parts ratio. Still not as efficient as deploying a single big creep, but not ridiculously disadvantageous either.

    This would allow a smaller, less well-equipped force (RCL and/or boosts-wise) to attack or defend against smaller but heavier-armed one, perhaps giving rise to more various tactics of engagement.

    And yes, small numerous forces are still very vulnerable to AoE attacks, like .rangedMassAttack(), and that is absolutely fine.

    I'm also leaving room for tweaking on the way the hit-back is capped. It doesn't necessarily have to be equal to least, can be 1.5× or 2× or whatever of the lowest, with number chosen carefully in order to balance the scales a little bit, in case developers feel that this gives too much of advantage to swarm tactics.

    Or maybe have the defender be able to hit back for full damage on one of the attackers (chosen in some way, say biggest damage or some other logic of dev's choice) for full attack damage if it does not have an .attack() intent set for that tick if you want them to be able to passively defend better.

    👍


  • In principle I agree, though I wouldn't consider it the most important change in the world. I think it would be marginally better, but wither that's worth the overhead of making a change I don't know.

    I think it would be useful to have more practical examples where it's 2 or 3 vs 1.



  • I don't see the logic of the big creep holding back.

    Honestly, if we're looking for a hitback-nerf / anklebiters-buff I think it would be more logical to limit hitback to once per tick but at full power.

    1. Each of the ten 1m1a attack for a combined 300 damage. 1 of them is hit by the big creep, and 1 of them receives hitback damage. 8 remain full health, 2 tombstones, big creep is at 2000-300-30 = 1670 hits.
    2. Repeat: 8x30 = 240 damage, 2 small creeps die, big creep is at 1670-240-30=1400 hits.
    3. Repeat: 6x30 = 180 damage, 2 small creeps die, big creep is at 1400-180-30=1190 hits.
    4. Repeat: 4x30 = 120 damage, 2 small creeps die, big creep is at 1190-120-30=1040 hits
    5. Repeat: 2x30 = 60 damage, 2 small creeps die, big creep is at 1040-60-30=950 hits.

    The result is similar, but make more sense to me.

    Other than that, I'm impartial about this change though. I don't really care whether it goes through at all or not. I don't mind the bias towards big creeps.



  • Honestly I think we should scrap the entire hit back mechanic,
    we have the event log now everybody should be free to implement their own versions of it.


  • Dev Team

    @mrfaul Honestly I tend to agree with this one.

    ☺


  • Honestly, I think we used "honestly" to much in this thread 🤣


  • TMB

    I agree with that thread overall.
    Alternative strike back rules that'd come to my mind are :

    • Full strike back output is split across all attacking creeps. The more there are, the less they individually take.
    • No strike back if the creep is already attacking or performs another blocking action. (E.g healing)


  • @mrfaul How do you implement a version of it using the event log? Currently you can hitback e.g. 3 creeps on the same tick (and attack 1), and I don't see how using the event log can replicate this functionality.



  • @wtfrank I mean: pick the target that bugs you the most. If you don't react, your fault.
    I don't like that the creep is able to deal damage to multiple creeps in one tick by doing nothing.
    It results in former mentioned instant death situations, and those don't feel fair.
    Besides this should also come with a significant amount of callbacks who eat performance and may leave leaks/runaways.

    Regardless this is definitely a mechanic that needs a revisit.
    I personally root for its removal since I don't like the former mentioned nerfs either.
    If this gets nerfed I'd like suggest the echo would be equal in strength if the attacked creep has the necessary amount of attack parts.(Orlets solution)



  • @mrfaul said in Update/rework of the ATTACK part's hitback damage:

    It results in former mentioned instant death situations, and those don't feel fair.

    Why's that not fair? Doesn't it just mean that you made a decision to attack a creep with melee parts and you got the calculation wrong, or didn't do the calculation correctly? Just the same as if you walk towards a tower but die because you fail to calculate correctly the damage that you'll take or the healing that you'll receive?



  • @wtfrank It doesn't feel fair because the enemy creep is able to deal a multitude of damage in a single tick.
    And it is kinda unintuitiv since most of all actions can only be done once, however this mechanic sidesteps this completely by saying it's the attackers fault.



  • @mrfaul Damage reflection is a really common mechanic E.G. power banks in this game, Path of Exile, World of Warcraft, hundreds of other games...

    Should we nerf power banks too...



  • @tigga well I was aiming at more extreme examples, the lower the difference in individual creep power, the lesser the effect is. But let's do some math, shall we?

    The Setup:

    • Attackers: 3× 10m10a creeps. 2000 hits each, 300 hits per attack.
    • Defender: 1× 30m30a creep. 6000 hits, 900 hits per attack.

    The Now:

    1. Attackers hit defender for 3×300 hits, 900 total, each taking 900 hits of damage back. Defender hits one of the attackers, dealing 900 hits of damage more, receiving extra 300 back. Now we have 2× attackers at 1100 hits (full attack power), and one at 200 hits (down to 60 hits attack). Defender is down to 4800 hits (6000-1200), full attack power. 2.Attackers hit defender again, for 2×300 hits + 1×60 hits, 660 hits total, each taking 900 hits of damage back. One attacker dies in the process, other two get reduced to 200 hits and 60 hits attack power. Defender hits and kills another attacker, getting 60 more damage in return. We now have defender down to 4080 hits (still full attack power), one attacker at 200 hits (60 hits attack power), and 2× tombstones.
    2. Last attacker valiantly .attack()s the defender, hitting for 60 more hits, receiving 900 hits hitback and dying in a blaze of glory. Defender is now down to 4020 hits (full attack power) and is surrounded by nothing but tombstones.

    With Change:

    1. Attackers hit defender for 3×300 hits, 900 total, each taking min(300, 900) = 300 hits of damage back. Defender hits one of the attackers, dealing 900 hits of damage more, receiving extra 300 back. Now we have 2× attackers at 1700 hits (full attack power), and one at 800 hits (down to 240 hits attack). Defender is down to 4800 hits (6000-1200), full attack power.
    2. Attackers .attack() again, hitting for 2×300 hits + 1×240 hits, taking 300 hits of hit-back damage. One attacker is now down to 500 hits (150 hits attack power). Defender attacks the same creep again, dealing 900 hits more damage and taking 150 hits of hit-back damage, but killing it in the process. Now the attackers are down to 2× creeps at 1400 hits (full attack power), one defender at 3810 hits (full attack power), and 1× tombstone.
    3. Attackers hit defenders once more for 2×300 hits, and taking 300 hits of damage back. Defending creep hits one of the attacking creeps for 900 hits and takes 300 more damage. Attackers are now down to 1 creep at 1100 hits (full power) and one at 200 hits (60 hits attack power). Defender is down to 2910 hits (and 870 attack power, due to chipping into ATTACK parts now).
    4. Attackers continue, hitting for 300 + 60 hits, and taking 870 hits of damage back. One attacker dies, another one goes down to 800 hits and 240 attack power. Attacker is down to 2550 hits (750 attack power), it hits the remaining creep for 750 hits and takes 240 damage back. The end result is one attacker at 50 hits and 0 attack power, defender at 2310 hits (690 attack), and 2× tombstones.
    5. Defender finishes off the last of the attackers.

    Once again, in the second scenario the larger creep suffered more damage but still emerged victorious with a sufficient buffer of hits to warrant its size.

    @MrFaul I did entertain this idea, however, I feel like completely scrapping the hit-back mechanic of ATTACK part would detract from the variety of the game, and break a lot of code that relies on its existence (point brought up by @Tigga and @wtfrank on slack during discussions). Changing the cap would still have those tactics viable (but might require some tweaking in the code).



  • Honestly :), I'm OK with the idea of scrapping hitback from ATTACK parts.

    Another option. Add a new creep intent called .defend() that enables hitback, then keep the current behavior and values. I'm not sure whether this should be concurrent with .attack(). This feels more fair as the attacked creep is no longer getting free damage. It might help the devs too as the new intent should lighten server load.

    Currently I only count on hitback for SK mining (theoretically, I don't actually run that code) and on healers so naive attackers will eventually kill themselves. The .defend() is only a little more code for my healers. Assuming concurrent .defend() and .attack() the SK creeps should keep working, though they will cost more intents which is why I and others don't run them in the first place.



  • @deft-code said in Update/rework of the ATTACK part's hitback damage:

    Honestly :), I'm OK with the idea of scrapping hitback from ATTACK parts.

    RIP a lot of people's source-keeper killers for minimal benefit



  • @wtfrank said in Update/rework of the ATTACK part's hitback damage:

    @mrfaul Damage reflection is a really common mechanic E.G. power banks in this game, Path of Exile, World of Warcraft, hundreds of other games...

    Should we nerf power banks too...

    First creeps are not a powerbank (and those deal only half the attack dmg),
    second I can't remember any RTS game that had a damage reflection besides for some special/unique hero characters and third,
    most damage reflection items I know deal only very weak damage and not your total attack power,
    mostly only a percentage of the attackers dmg. (granted those insta-kill the low level stuff but last time I checked screeps wasn't a dungeon crawler)

    deft-codes suggestion of the defend intend is also a viable option. I just don't like the fact that the bigger creep is able to attack multiple targets for free.
    I don't care that SK rooms are broken with that change, you are supposed to work for that stuff anyway.



  • After reading through this thread I had a couple of ideas as well.

    1. Modification to Orlet's proposal - Cap the amount of parts used for hitting back based on total amount of atk parts the defending creep carries. Example: 3x 3m3a creeps attacking a single 7m7a creep. The first creep would get hit back with 3 attack parts, the second would get hit back with 3 attack parts and the third would only get hit back with 1 attack part. The creep is unable to hit back with more attack parts than it carries. It can still perform an attack action with all 7 parts.

    2. Different Modification to Orlet's proposal - Keep the cap of limiting attack parts based on the defenders total attack parts carried but only allow them to attack with the left over parts. In the above example the defending creep would not be able to attack anything because all of it's attack parts are busy hitting back. Say our defending creep was bumped up to a 10m11a creep though. The first creep would get hit back with 3 attack, the second creep would get hit back with 3 attack, and the third would get hit back with 3 attack, leaving only 2 attack parts left for the creep to use wherever it wants.

    3. Make hitting back exclusive with Attacking - Add the hit back mechanic into the priority list of simultaneous execution of creep actions. I would put it in between "Harvest" and "Attack". This way you have to choose between attacking or defending yourself. An argument could be made for hitting back with all attack parts or having them limited like Orlet's suggestion or my modifications of it.

    4. Re-purpose the Tough Body Part - With this suggestion we would remove the hit back of attack parts entirely and move that over to the Tough body part. This would function like the "Thorns" stat in Diablo and other similar games/mechanics. This could hit back every target or limit it to the number of Tough body parts the creep owns similar to my suggestion 2. Obviously cost and damage values would need to be tweaked.

    The idea behind these suggestions is that you shouldn't get something for nothing in this game. Currently the hit back mechanic is free damage for no CPU cost, and it highly favors the larger creep.



  • @kyralee said in Update/rework of the ATTACK part's hitback damage:

    Currently the hit back mechanic is free damage for no CPU cost, and it highly favors the larger creep.

    Well your opponent is paying cpu cost to receive the damage 😆



  • @wtfrank I can't tell are you just trolling right now?
    But I guess you see now my gripe with this approach.

    The only people who you should pay to hit you, are working in the oldest trade in the world.
    Well... only if that floats your boat 😆



  • There's something I think doesn't make sense about the hit back mechanic. Either attack parts double as passive damage parts (like thorns) or hitting back is the attacked creep actively counter attacking. If it's passive, then the damage should be proportional to the attacker's damage (i.e. the harder you punch a thorn, the more it hurts you). If it's active, then it should be limited to one per tick. You don't get 9 times faster at punching people because there are 8 people punching you. Whether it's worth making a breaking change to this mechanic and whether that change would improve the game, i don't know.

    👍