Skip to content

[Highly Customized] Directional armor #1623

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

Open
wants to merge 17 commits into
base: develop
Choose a base branch
from

Conversation

NetsuNegi
Copy link
Contributor

@NetsuNegi NetsuNegi commented Apr 11, 2025

  • The damage suffered by the vehicle can now be affected by the hit direction.
  • 方向护甲逻辑,即受到的伤害量跟伤害来源方向有关。
  • The front and rear judgment ranges are always symmetrical. A front angle of 0.5 indicates that the front direction is the axis, and the 45 degree angle range on both sides belongs to the front judgment range.
    A front angle of 1.0 indicates that the 90 degree angle range on both sides belongs to the front judgment range;
  • 判定范围始终都是对称的,正面0.5表示以车头方向为轴,左右各45度角范围内均属于正面判断范围,1.0则表示左右各90度均为正面判定范围。
  • The lateral range refers to the remaining angle range after excluding the front and back sides.
  • 侧面范围是除开正面和背面后剩余的角度范围。
  • The warhead needs to have Directional=true to enable this effect.
  • 弹头需要具有Directional=true以启用此效果。
  • Directional.Multiplier is an additional multiplier used to control the intensity of the effect.
  • Directional.Multiplier是一个用来控制效果程度的额外乘数。

In rulesmd.ini

[CombatDamage]
DirectionalArmor=false                 ; boolean
DirectionalArmor.FrontMultiplier=1.0   ; float
DirectionalArmor.SideMultiplier=1.0    ; float
DirectionalArmor.BackMultiplier=1.0    ; float
DirectionalArmor.FrontField=0.5        ; float
DirectionalArmor.BackField=0.5         ; float

[SOMEVEHICLE]                          ; VehicleType
DirectionalArmor=                      ; boolean
DirectionalArmor.FrontMultiplier=      ; float
DirectionalArmor.SideMultiplier=       ; float
DirectionalArmor.BackMultiplier=       ; float
DirectionalArmor.FrontField=           ; float
DirectionalArmor.BackField=            ; float

[SOMEWARHEAD]
Directional=false                      ; boolean
Directional.Multiplier=1.0             ; float

Copy link

github-actions bot commented Apr 11, 2025

Nightly build for this pull request:

This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build.

@TaranDahl TaranDahl added the ⚙️T2 T2 maintainer review is sufficient label Apr 12, 2025
@NetsuNegi NetsuNegi added ⚙️T1 T1 maintainer review is sufficient and removed ⚙️T2 T2 maintainer review is sufficient labels Apr 17, 2025
Copy link
Contributor

@TaranDahl TaranDahl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Only small concerns.


[SOMEWARHEAD]
Directional=false ; boolean
Directional.Multiplier=1.0 ; float
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the use case of this flag?

@@ -38,6 +39,21 @@ DEFINE_HOOK(0x701900, TechnoClass_ReceiveDamage_Shield, 0x6)
else
multiplier = pWHExt->DamageOwnerMultiplier.Get(pRules->DamageOwnerMultiplier);

if (pTypeExt->DirectionalArmor.Get(RulesExt::Global()->DirectionalArmor) && pThis->WhatAmI() == AbstractType::Unit && WarheadTypeExt::HitDirection >= 0 && args->DistanceToEpicenter <= 64)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why UnitClass only?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

becase only unit can move by reverse direction (need #1622)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe required distance could be made customisable?

@Metadorius
Copy link
Member

As it is, I don't think this feature should be merged alone.

  1. From my experience, in C&C the control on rotation is lackluster and units rotate freely as they wish, it's very hard to control rotation. Imagine the player frustration of having directional armor and not being able to control what side your units face the enemy.
  2. In my opinion, this feature needs some sort of feedback to inform the players that the vehicle has been hit in a weaker spot. I've played the game AirMech, and there units light up or flash just a bit when they are being damaged, and when they are attacked from the rear -- they flash in red instead, providing intuitive feedback to the players. Maybe something like this could be done here? Or warheads could be given multiple anims (or weapons could be give multiple warheads) that will trigger depending on amount of damage/which direction is hit. Needs further consideration though, not sure what would be the best.

Also a side idea, I think maybe Crit logic would mesh nicely here? Modify Crit chance whether the armor is on front or back. Front could have 0%, sides 50%, back 100%.

@Metadorius
Copy link
Member

For the rotation controls, some potential ideas:

  1. "Face towards point" command (should be the easiest)
  2. "Forbid rotation" option for selected units (would require something to display that though)
  3. Move command that requires units to arrive facing some direction (basically hold and drag towards direction they need to face), but that I am not sure how well that would work in C&C

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs testing ❓New feature ⚙️T1 T1 maintainer review is sufficient
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants