Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix attack speed test failures #72997

Merged
merged 3 commits into from
Apr 14, 2024

Conversation

GuardianDll
Copy link
Member

@GuardianDll GuardianDll commented Apr 13, 2024

Summary

None

Purpose of change

Unbreak CI

Describe the solution

slap !mayfail to test block bouldering effect, also make character attack the debug mon, and not themselves

@github-actions github-actions bot added Code: Tests Measurement, self-control, statistics, balancing. [C++] Changes (can be) made in C++. Previously named `Code` Mechanics: Enchantments / Spells Enchantments and spells astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions labels Apr 13, 2024
@mqrause
Copy link
Contributor

mqrause commented Apr 13, 2024

i can't reproduce it locally

I just went through recent PRs to look for some windows fails. You could try reproducing it with these seeds:
1712972203
1712879528
1712952697

You'll need to do a full test run, though, since the windows build doesn't use any filters.

@GuardianDll
Copy link
Member Author

tried to run 1712972203, but have a lot of some mysterious errors - first error in Character_attacking_a_zombie, now in crafting_with_a_companion

@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Apr 13, 2024
@osuphobia
Copy link
Contributor

https://github.com/CleverRaven/Cataclysm-DDA/actions/runs/8673271162/job/23784451215?pr=72987

Failed in Basic Build and Test (Clang 10, Ubuntu, Curses), randomness seeded to: 1713010785.

(~[slow] ~[.],starting_items)=> ../tests/enchantments_test.cpp:242: FAILED:
(~[slow] ~[.],starting_items)=>   REQUIRE( moves_spent_on_attacks == -380 )
(~[slow] ~[.],starting_items)=> with expansion:
Error: (~[slow] ~[.],starting_items)=>   -446 == -380
(~[slow] ~[.],starting_items)=> with messages:
(~[slow] ~[.],starting_items)=>   Character, melee skill lvl 10, attacks with no enchantment
(~[slow] ~[.],starting_items)=>   10 attacks cost 380 moves
(~[slow] ~[.],starting_items)=> 
(~[slow] ~[.],starting_items)=> Log messages during failed test:
(~[slow] ~[.],starting_items)=> 10:00:27AM: 
(~[slow] ~[.],starting_items)=> 10:00:27AM: You eat your holy SPAM of debugging (fresh).
(~[slow] ~[.],starting_items)=> 10:00:27AM: You start walking.
(~[slow] ~[.],starting_items)=> 10:00:27AM: 
(~[slow] ~[.],starting_items)=> 10:00:27AM: You have learned a new style: Brawling!
(~[slow] ~[.],starting_items)=> 10:00:28AM: You hit you for 4 damage.
(~[slow] ~[.],starting_items)=> 10:00:28AM: attack 0: attack cost: 38, total amount of moves: -38
(~[slow] ~[.],starting_items)=> 10:00:28AM: 
(~[slow] ~[.],starting_items)=> 10:00:28AM: You hit you for 9 damage.  Critical!
(~[slow] ~[.],starting_items)=> 10:00:28AM: attack 1: attack cost: 38, total amount of moves: -76
(~[slow] ~[.],starting_items)=> 10:00:28AM: 
(~[slow] ~[.],starting_items)=> 10:00:28AM: You hit you for 4 damage.
(~[slow] ~[.],starting_items)=> 10:00:28AM: attack 2: attack cost: 38, total amount of moves: -114
(~[slow] ~[.],starting_items)=> 10:00:28AM: 
(~[slow] ~[.],starting_items)=> 10:00:28AM: You try to keep your balance.
(~[slow] ~[.],starting_items)=> 10:00:28AM: You hit you for 8 damage.  Critical!
(~[slow] ~[.],starting_items)=> 10:00:28AM: attack 3: attack cost: 38, total amount of moves: -152
(~[slow] ~[.],starting_items)=> 10:00:28AM: 
(~[slow] ~[.],starting_items)=> 10:00:28AM: You miss.
(~[slow] ~[.],starting_items)=> 10:00:28AM: attack 4: attack cost: 49, total amount of moves: -201
(~[slow] ~[.],starting_items)=> 10:00:28AM: 
(~[slow] ~[.],starting_items)=> 10:00:28AM: You hit you for 3 damage.
(~[slow] ~[.],starting_items)=> 10:00:28AM: attack 5: attack cost: 49, total amount of moves: -250
(~[slow] ~[.],starting_items)=> 10:00:28AM: 
(~[slow] ~[.],starting_items)=> 10:00:28AM: You hit you for 2 damage.
(~[slow] ~[.],starting_items)=> 10:00:28AM: attack 6: attack cost: 49, total amount of moves: -299
(~[slow] ~[.],starting_items)=> 10:00:28AM: 
(~[slow] ~[.],starting_items)=> 10:00:28AM: You hit you for 3 damage.  Critical!
(~[slow] ~[.],starting_items)=> 10:00:28AM: attack 7: attack cost: 49, total amount of moves: -348
(~[slow] ~[.],starting_items)=> 10:00:28AM: 
(~[slow] ~[.],starting_items)=> 10:00:28AM: You hit you for 2 damage.
(~[slow] ~[.],starting_items)=> 10:00:28AM: attack 8: attack cost: 49, total amount of moves: -397
(~[slow] ~[.],starting_items)=> 10:00:28AM: 
(~[slow] ~[.],starting_items)=> 10:00:28AM: You hit you for 3 damage.
(~[slow] ~[.],starting_items)=> 10:00:28AM: attack 9: attack cost: 49, total amount of moves: -446

After a miss, the attack cost changed from 38 to 49.

@osuphobia
Copy link
Contributor

osuphobia commented Apr 13, 2024

After a miss, the attack cost changed from 38 to 49.

Missed attack is irrelevant.
The real reason should be this: You try to keep your balance.

{
"type": "effect_type",
"id": "bouldering",
"name": [ "Unstable Footing" ],
"desc": [ "Your footing is unstable. It's more difficult to fight while standing here." ],
"apply_message": "You try to keep your balance.",
"resist_traits": [ "GASTROPOD_BALANCE", "BIRD_LEGS" ],
"rating": "bad",
"limb_score_mods": [ { "limb_score": "balance", "modifier": 0.75 }, { "limb_score": "footing", "modifier": 0.4 } ],
"flags": [ "EFFECT_LIMB_SCORE_MOD" ]
},

The avatar walked on a terrain with the flag UNSTABLE ( in my test, a small boulder), and got a limb_score balance penalty, which will Modifies thrown attack speed, movement cost and melee attack rolls. as it is said in the JSON_INFO.md.

bf af

https://github.com/CleverRaven/Cataclysm-DDA/actions/runs/8674099317/job/23786095337?pr=72987

This test failed again in my PR, with exactly 11 extra moves cost for each attack affected.

(~[slow] ~[.],starting_items)=> ../tests/enchantments_test.cpp:259: FAILED:
(~[slow] ~[.],starting_items)=>   REQUIRE( moves_spent_on_attacks == -1000 )
(~[slow] ~[.],starting_items)=> with expansion:
Error: (~[slow] ~[.],starting_items)=>   -1022 == -1000

(~[slow] ~[.],starting_items)=> 10:00:29AM: You eat your holy SPAM of debugging (fresh).
(~[slow] ~[.],starting_items)=> 10:00:29AM: You start walking.
(~[slow] ~[.],starting_items)=> 10:00:29AM: You wield your test_ATTACK_SPEED_ench_item_2.
(~[slow] ~[.],starting_items)=> 10:00:29AM: 
(~[slow] ~[.],starting_items)=> 10:00:29AM: You have learned a new style: Brawling!
(~[slow] ~[.],starting_items)=> 10:00:30AM: 
(~[slow] ~[.],starting_items)=> 10:00:30AM: You hit you for 4 damage.  Critical!
(~[slow] ~[.],starting_items)=> 10:00:30AM: attack 0: attack cost: 100, total amount of moves: -100
(~[slow] ~[.],starting_items)=> 10:00:30AM: 
(~[slow] ~[.],starting_items)=> 10:00:30AM: You hit you for 3 damage.
(~[slow] ~[.],starting_items)=> 10:00:30AM: attack 1: attack cost: 100, total amount of moves: -200
(~[slow] ~[.],starting_items)=> 10:00:30AM: 
(~[slow] ~[.],starting_items)=> 10:00:30AM: You hit you for 5 damage.
(~[slow] ~[.],starting_items)=> 10:00:30AM: attack 2: attack cost: 100, total amount of moves: -300
(~[slow] ~[.],starting_items)=> 10:00:30AM: 
(~[slow] ~[.],starting_items)=> 10:00:30AM: You hit you for 3 damage.
(~[slow] ~[.],starting_items)=> 10:00:30AM: attack 3: attack cost: 100, total amount of moves: -400
(~[slow] ~[.],starting_items)=> 10:00:30AM: 
(~[slow] ~[.],starting_items)=> 10:00:30AM: You hit you for 2 damage.
(~[slow] ~[.],starting_items)=> 10:00:30AM: attack 4: attack cost: 100, total amount of moves: -500
(~[slow] ~[.],starting_items)=> 10:00:30AM: 
(~[slow] ~[.],starting_items)=> 10:00:30AM: You hit you for 5 damage.  Critical!
(~[slow] ~[.],starting_items)=> 10:00:30AM: attack 5: attack cost: 100, total amount of moves: -600
(~[slow] ~[.],starting_items)=> 10:00:30AM: 
(~[slow] ~[.],starting_items)=> 10:00:30AM: You miss.
(~[slow] ~[.],starting_items)=> 10:00:30AM: attack 6: attack cost: 100, total amount of moves: -700
(~[slow] ~[.],starting_items)=> 10:00:30AM: 
(~[slow] ~[.],starting_items)=> 10:00:30AM: You try to keep your balance.
(~[slow] ~[.],starting_items)=> 10:00:30AM: You hit you for 6 damage.  Critical!
(~[slow] ~[.],starting_items)=> 10:00:30AM: attack 7: attack cost: 100, total amount of moves: -800
(~[slow] ~[.],starting_items)=> 10:00:30AM: 
(~[slow] ~[.],starting_items)=> 10:00:30AM: You hit you for 4 damage.  Critical!
(~[slow] ~[.],starting_items)=> 10:00:30AM: attack 8: attack cost: 111, total amount of moves: -911
(~[slow] ~[.],starting_items)=> 10:00:30AM: 
(~[slow] ~[.],starting_items)=> 10:00:30AM: You hit you for 4 damage.
(~[slow] ~[.],starting_items)=> 10:00:30AM: attack 9: attack cost: 111, total amount of moves: -1022

@GuardianDll
Copy link
Member Author

why characters starts to move, interestingly 🤔
clear_map should remove all the stuff

@github-actions github-actions bot added the [JSON] Changes (can be) made in JSON label Apr 13, 2024
@mqrause
Copy link
Contributor

mqrause commented Apr 13, 2024

If I interpret that correctly, because the test guy attacks themself, whenever they hit their own legs with a crit, they get a chance to apply the bouldering effect. So yes, blocking the effect should work, but also they probably shouldn't attack themselves.

@GuardianDll
Copy link
Member Author

wdym attack themselves?

@osuphobia
Copy link
Contributor

osuphobia commented Apr 14, 2024

The attack speed test seems fine now, but the tests in iteminfo_test.cpp failed this time.
https://github.com/CleverRaven/Cataclysm-DDA/actions/runs/8482270578/job/23241203488?pr=72690
I've got exactly the same failure, do you know the reason of it?

Never mind, resist test was labeled !mayfail so that's not the same case. The firstaid_test failed because of NPC's arm not bandaged.

@osuphobia
Copy link
Contributor

osuphobia commented Apr 14, 2024

If I interpret that correctly, because the test guy attacks themself, whenever they hit their own legs with a crit, they get a chance to apply the bouldering effect. So yes, blocking the effect should work, but also they probably shouldn't attack themselves.

The test do generate a debug monster though, you mean the test guy is not attacking the monster but themself?
Ahh, the sentence You start walking is misleading me, it pops up not because the guy starts moving, but movement_mode set to walk?

@mqrause
Copy link
Contributor

mqrause commented Apr 14, 2024

wdym attack themselves?

guy.melee_attack_abstract( guy, false, matec_id( "" ) );

guy is attacking guy instead of the debug monster.

@GuardianDll
Copy link
Member Author

I didn't know it is possible
Should it be pseudo_debug_mon instead of a guy there?

@github-actions github-actions bot removed the BasicBuildPassed This PR builds correctly, label assigned by github actions label Apr 14, 2024
@mqrause
Copy link
Contributor

mqrause commented Apr 14, 2024

Sorry, that might have been a bit of a miscommunication. You need to add the target creature as a parameter to test_melee_attack_attack_stamina and then adjust the calls in the Enchantment_MELEE_STAMINA_CONSUMPTION_test test case.

@GuardianDll GuardianDll force-pushed the mayfail_attack_speed_ench branch from 2a343b6 to 4e7e229 Compare April 14, 2024 12:01
@GuardianDll GuardianDll force-pushed the mayfail_attack_speed_ench branch from 4e7e229 to 5044c99 Compare April 14, 2024 12:33
@akrieger akrieger changed the title attack speed test may fail Fixes attack speed test failures Apr 14, 2024
@akrieger akrieger changed the title Fixes attack speed test failures Fix attack speed test failures Apr 14, 2024
@akrieger akrieger merged commit bafd955 into CleverRaven:master Apr 14, 2024
30 checks passed
@GuardianDll GuardianDll deleted the mayfail_attack_speed_ench branch April 14, 2024 17:38
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Apr 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` Code: Tests Measurement, self-control, statistics, balancing. [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions Mechanics: Enchantments / Spells Enchantments and spells
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants