Phobos-developers / Phobos

Ares-compatible C&C Red Alert 2: Yuri's Revenge engine extension
GNU Lesser General Public License v3.0
254 stars 83 forks source link

Two new trajectories with enhanced straight trajectory #1261

Closed CrimRecya closed 1 week ago

CrimRecya commented 1 month ago

New Disperse trajectory and Engrave trajectory with enhanced Straight trajectory.

First, the enhanced Straight trajectory.

In rulesmd.ini:

[SOMEPROJECTILE]                                ; Projectile
Trajectory=Straight                             ; Trajectory type
Trajectory.Straight.DetonationDistance=0.4      ; floating point value
Trajectory.Straight.TargetSnapDistance=0.5      ; floating point value
Trajectory.Straight.PassThrough=false           ; boolean
Trajectory.Straight.PassDetonate=false          ; boolean
Trajectory.Straight.PassDetonateWarhead=        ; WarheadType
Trajectory.Straight.PassDetonateDamage=0        ; integer
Trajectory.Straight.PassDetonateDelay=1         ; integer
Trajectory.Straight.PassDetonateTimer=0         ; integer
Trajectory.Straight.PassDetonateLocal=false     ; boolean
Trajectory.Straight.LeadTimeCalculate=false     ; boolean
Trajectory.Straight.OffsetCoord=0,0,0           ; integer - Forward,Lateral,Height
Trajectory.Straight.RotateCoord=0               ; floating point value
Trajectory.Straight.MirrorCoord=true            ; boolean
Trajectory.Straight.UseDisperseBurst=false      ; boolean
Trajectory.Straight.AxisOfRotation=0,0,1        ; integer - Forward,Lateral,Height
Trajectory.Straight.ProximityImpact=0           ; integer
Trajectory.Straight.ProximityWarhead=           ; WarheadType
Trajectory.Straight.ProximityDamage=0           ; integer
Trajectory.Straight.ProximityRadius=0.7         ; floating point value
Trajectory.Straight.ProximityAllies=0           ; floating point value
Trajectory.Straight.ProximityFlight=false       ; boolean
Trajectory.Straight.ThroughVehicles=true        ; boolean
Trajectory.Straight.ThroughBuilding=true        ; boolean
Trajectory.Straight.EdgeAttenuation=1.0         ; floating point value
Trajectory.Straight.SubjectToGround=false       ; boolean
Trajectory.Straight.ConfineAtHeight=0           ; integer
- Make sure you set a low `Trajectory.Straight.ProximityRadius` value unless necessary.
- Note that if `Trajectory.Straight.ProximityFlight` is true, it will consume more CPU performance.
- Note that the listed Warheads in `Trajectory.Straight.PassDetonateWarhead` and `Trajectory.Straight.ProximityWarhead` must be listed in `[Warheads]` for them to work.

2024-04-2623-21-28-ezgif com-video-to-gif-converter Trajectory.Straight.ConfineAtHeight

2024-05-2100-24-23-ezgif com-video-to-gif-converter Trajectory.Straight.OffsetCoord

2024-05-2100-17-46-ezgif com-video-to-gif-converter Trajectory.Straight.PassDetonate

2024-05-2100-48-34-ezgif com-video-to-gif-converter Trajectory.Straight.ProximityImpact

2024-05-1114-49-41-ezgif com-video-to-gif-converter Trajectory.Straight.LeadTimeCalculate

Then, the new Disperse trajectory.

In rulesmd.ini:

Trajectory=Disperse                             ; Trajectory type
Trajectory.Disperse.UniqueCurve=false           ; boolean
Trajectory.Disperse.PreAimCoord=0,0,0           ; integer - Forward,Lateral,Height
Trajectory.Disperse.RotateCoord=0               ; floating point value
Trajectory.Disperse.MirrorCoord=true            ; boolean
Trajectory.Disperse.FacingCoord=false           ; boolean
Trajectory.Disperse.ReduceCoord=true            ; boolean
Trajectory.Disperse.UseDisperseBurst=false      ; boolean
Trajectory.Disperse.AxisOfRotation=0,0,1        ; integer - Forward,Lateral,Height
Trajectory.Disperse.LaunchSpeed=0               ; floating point value
Trajectory.Disperse.Acceleration=10.0           ; floating point value
Trajectory.Disperse.ROT=30.0                    ; floating point value
Trajectory.Disperse.LockDirection=false         ; boolean
Trajectory.Disperse.CruiseEnable=false          ; boolean
Trajectory.Disperse.CruiseUnableRange=5         ; floating point value
Trajectory.Disperse.LeadTimeCalculate=true      ; boolean
Trajectory.Disperse.TargetSnapDistance=0.5      ; floating point value
Trajectory.Disperse.RetargetRadius=0            ; floating point value
Trajectory.Disperse.RetargetAllies=false        ; boolean
Trajectory.Disperse.SuicideShortOfROT=true      ; boolean
Trajectory.Disperse.SuicideAboveRange=0         ; floating point value
Trajectory.Disperse.SuicideIfNoWeapon=true      ; boolean
Trajectory.Disperse.Weapons=                    ; list of WeaponTypes
Trajectory.Disperse.WeaponBurst=                ; list of integers
Trajectory.Disperse.WeaponCount=0               ; integer
Trajectory.Disperse.WeaponDelay=1               ; integer
Trajectory.Disperse.WeaponTimer=0               ; integer
Trajectory.Disperse.WeaponScope=0               ; floating point value
Trajectory.Disperse.WeaponSeparate=false        ; boolean
Trajectory.Disperse.WeaponRetarget=false        ; boolean
Trajectory.Disperse.WeaponLocation=false        ; boolean
Trajectory.Disperse.WeaponTendency=false        ; boolean
Trajectory.Disperse.WeaponToAllies=false        ; boolean
Trajectory.Disperse.WeaponToGround=false        ; boolean
- Make sure you set a low `Trajectory.Disperse.RetargetRadius` value unless necessary. If you set `Trajectory.Disperse.WeaponRetarget=true`, also make sure you set `Trajectory.Disperse.Weapons` a low `Range` value unless necessary.
- This does not properly support `Arcing=true` projectiles.
- Note that the listed Weapons in `Trajectory.Disperse.Weapons` must be listed in `[WeaponTypes]` for them to work.
- `Trajectory.Disperse.Weapons` now not support customized `LaserThickness`, `Bolt.ColorN`, `Bolt.DisableN`, `Bolt.Arcs`, `Beam.Color`, `Beam.Duration`  and `Beam.Amplitude`.

2024-05-2100-50-25-ezgif com-video-to-gif-converter Trajectory=Disperse

2024-05-2102-38-09-ezgif com-video-to-gif-converter Trajectory.Disperse.UniqueCurve

2024-05-2100-53-47-ezgif com-video-to-gif-converter Trajectory.Disperse.FacingCoord

2024-05-2100-59-26-ezgif com-video-to-gif-converter Trajectory.Disperse.LeadTimeCalculate

2024-05-2620-23-27-ezgif com-video-to-gif-converter Trajectory.Disperse.RotateCoord

2024-05-2100-41-03-ezgif com-video-to-gif-converter Trajectory.Disperse.Weapons > Straight : Inaccurate

Last, the new Engrave trajectory.

In rulesmd.ini:

Trajectory=Engrave                             ; Trajectory type
Trajectory.Engrave.SourceCoord=0,0             ; integer - Forward,Lateral
Trajectory.Engrave.TargetCoord=0,0             ; integer - Forward,Lateral
Trajectory.Engrave.MirrorCoord=true            ; boolean
Trajectory.Engrave.TheDuration=0               ; integer
Trajectory.Engrave.IsLaser=true                ; boolean
Trajectory.Engrave.IsSupported=false           ; boolean
Trajectory.Engrave.IsHouseColor=false          ; boolean
Trajectory.Engrave.IsSingleColor=false         ; boolean
Trajectory.Engrave.LaserInnerColor=0,0,0       ; integer - Red,Green,Blue
Trajectory.Engrave.LaserOuterColor=0,0,0       ; integer - Red,Green,Blue
Trajectory.Engrave.LaserOuterSpread=0,0,0      ; integer - Red,Green,Blue
Trajectory.Engrave.LaserThickness=3            ; integer
Trajectory.Engrave.LaserDuration=1             ; integer
Trajectory.Engrave.LaserDelay=1                ; integer
Trajectory.Engrave.DamageDelay=10              ; integer
- It's best not to let it be intercepted.

2024-05-0401-23-49-ezgif com-video-to-gif-converter Trajectory=Engrave

The comprehensive display.

2024-05-3016-02-33-ezgif com-video-to-gif-converter Trajectory.Disperse.Weapons > Straight : Trajectory.Straight.UseDisperseBurst

2024-05-2100-35-04-ezgif com-video-to-gif-converter Trajectory.Engrave.IsSingleColor Trajectory.Disperse.Weapons > Straight : Inaccurate

2024-05-2201-39-04-ezgif com-video-to-gif-converter Trajectory.Engrave.TheDuration Trajectory.Disperse.Weapons > Straight : Inaccurate

2024-05-2102-40-49-ezgif com-video-to-gif-converter Trajectory.Engrave.IsSupported Trajectory.Disperse.CruiseEnable Trajectory.Disperse.Weapons > Disperse : Trajectory.Disperse.PreAimCoord Trajectory.Straight.ProximityImpact

github-actions[bot] commented 1 month ago

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.

FS-21 commented 1 month ago

By the way, what is exactly a "engrave" trajectory? because I don't get the concept in the documentation. Maybe if I was an English native I could understand.

If possible I would put the right gif you created in the right place documentation for easy understanding :-/ I only recognice the disperse trajectory in the gifs because it works like a shotgun.

For example what trajectory was used in the last gif that remembers me the Protoss Colossus dual weapon

image
CrimRecya commented 1 month ago

By the way, what is exactly a "engrave" trajectory? because I don't get the concept in the documentation. Maybe if I was an English native I could understand.

If possible I would put the right gif you created in the right place documentation for easy understanding :-/ I only recognice the disperse trajectory in the gifs because it works like a shotgun.

For example what trajectory was used in the last gif that remembers me the Protoss Colossus dual weapon image

Apologize for my poor English. The Last gif is the "engrave" trajectory. And thank you for your suggestion. I will create a few more GIF images these days and place them appropriately.

CrimRecya commented 1 month ago

Updated introduction. The resources from mod MO3 are for display purposes only.

CrimRecya commented 1 week ago

Impressive work. The quantity is so huge that I'm afraid it's almost impossible to review and merge all of these on 1 single PR. imo I suggest detach these into several commits:

  • The "engrave" one
  • The "disperse" one
  • As for the straight trajectory one, see if it's possible to incorporate the "inaccurate" part of Trajectory projectiles enhancement #1246. The biggest concern I noticed is that vector of "Causality" thing you made: Are you sure the technos always live longer than your bullet? If not then pointer invalidation will be quite a big trouble for perf. Try to see if there's a simpler way

Okay. But I have a question about splitting here that whether [the state of mutual reference between my Trajectories, such as Disperse using Straight's ‘UseDisperseBurst’ tag, or Disperse, Straight, and Engrave using CheckSubjectToGround() in Hooks.Obstacles’s at the same time] may cause splitting problems. And for the ‘Inaccurate’ part of Straight, I already have the corresponding part here, and the issue of null pointers in the Casualty part is actually no longer returning Vector during Merge step, which has passed hundreds of tests in game and no need to worry about this anymore :).

chaserli commented 1 week ago

Okay. But I have a question about splitting here that whether [the state of mutual reference between my Trajectories, such as Disperse using Straight's ‘UseDisperseBurst’ tag, or Disperse, Straight, and Engrave using CheckSubjectToGround() in Hooks.Obstacles’s at the same time] may cause splitting problems. And for the ‘Inaccurate’ part of Straight, I already have the corresponding part here, and the issue of null pointers in the Casualty part is actually no longer returning Vector during Merge step, which has passed hundreds of tests in game and no need to worry about this anymore :).

Got a point. Excuse me for the oversight, I'll have a look later on this one.