feat: Back row protection depends on column sizes#579
feat: Back row protection depends on column sizes#579OH296 merged 4 commits intoAdeptus-Dominus:mainfrom
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 📝 WalkthroughSummary by CodeRabbit
WalkthroughVerily, the code has undergone a simplification of its targeting algorithm within the shooting mechanics. The previous ritualistic checks to ascertain the presence of enemy marines and vehicles, accompanied by nested conditions and accumulators such as the variable Suggested labels
Suggested reviewers
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 3
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
objects/obj_enunit/Alarm_0.gml(1 hunks)
🔇 Additional comments (1)
objects/obj_enunit/Alarm_0.gml (1)
170-206: Praise be to the Omnissiah! A more efficient logic pattern for back row targeting has been implemented.The sacred binaries of this code segment have been optimized to follow the Machine God's logic:
- First, it seeks enemy marines in the front column, purging them with righteous fire if detected.
- If the front column lacks mortal flesh, it evaluates the columns behind using the divine formula:
_column_size_value = (veh * 2.5) + (dreads * 2) + (men * 0.5)- The algorithm then compares front and rear column values, calculating the probability of penetrating shots as:
_pass_chance = ((_back_column_size_value / _column_size_value) - 1) * 100- The Machine Spirit limits this probability to a maximum of 60%, invoking the sacred randomness to determine targeting.
This implementation properly honors the Mechanicus principle of efficient targeting patterns while preventing excessive unit stacking in single columns.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Purpose of changes
The original rules are not perfect. They basically protect any number of troops behind 11 vehicles. 1k, 1kk, 1kkk, doesn't matter.
Now, not stacking a ton of units in one column may actually save their lives.
When arbitrary unit formation sizes are removed, this will matter even more to prevent single column stacking.
Describe the solution
Row protection now works as follows:
Describe alternatives you've considered
Make the chance also depend on the size of the enemy column that is attacking, so that getting "encircled" is bad.
Make column size also obstruct friendly fire.
Testing done
A couple of fights vs rampant orks. Debug lines show sane pass-through chances.
Related links
https://discord.com/channels/714022226810372107/1348311762629558282
Player notes
Back row protection rules are reworked. A column can only protect back columns if they are smaller than it. Vehicles and dreadnougts give more size to columns.