Two new trajectories with enhanced straight trajectory#1261
Two new trajectories with enhanced straight trajectory#1261CrimRecya wants to merge 63 commits intoPhobos-developers:developfrom
Conversation
New Disperse trajectory and Engrave trajectory with enhanced Straight trajectory
|
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. |
chaserli
left a comment
There was a problem hiding this comment.
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 #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. |
Got a point. Excuse me for the oversight, I'll have a look later on this one. |
This is a feature based on #1261 . It may have similarities with other parts. - You can now make technos recount their current burst index when they have changed the firing weapon or have maintained for a period of time without any targets. Defaults to `[General] -> RecountBurst`, which defaults to false. In `rulesmd.ini`: ```ini [General] RecountBurst=false ; boolean [SOMETECHNO] ; TechnoType RecountBurst= ; boolean ``` --------- Co-authored-by: Starkku <starkku.ppmod@gmail.com>
This is a feature split from #1261 . It may have similarities with other parts. If set `SubjectToGround` to true ,it will predict will predict the height of the connecting straight line from the bullet's source coordinates to target coordinates. If the predicted height is lower than the ground height of the current predicted position, the firer will also consider targets blocked by such obstacles as out of range and will attempt to reposition themselves. In `rulesmd.ini`: ```ini [SOMEPROJECTILE] ; Projectile SubjectToGround=false ; boolean ``` --------- Co-authored-by: Starkku <starkku.ppmod@gmail.com>
New Disperse trajectory and Engrave trajectory with enhanced Straight trajectory.
First, the enhanced Straight trajectory.
Trajectory.Straight.DetonationDistancecontrols the maximum distance in cells from intended target (checked at start of each game frame, before the projectile moves) at which the projectile will be forced to detonate. Set to 0 to disable forced detonation (note that this can cause the projectile to overshoot the target). By settingTrajectory.Straight.PassThrough=true, it refers to the distance that projectile should travel from itself when it above 0, and the distance that projectile should move behind the target when it below 0 (use the absolute value).Trajectory.Straight.TargetSnapDistancecontrols the maximum distance in cells from intended target the projectile can be at moment of detonation to make the projectile 'snap' on the intended target. Set to 0 to disable snapping.Trajectory.Straight.PassThroughenables special case logic where the projectile does not detonate in contact with the target but instead travels up to a distance defined byTrajectory.Straight.DetonationDistance. Note that the firing angle of the projectile is adjusted with this in mind, making it fire straight ahead if the target is on same elevation.Trajectory.Straight.PassDetonateenables extra detonations when the projectile is traveling.Trajectory.Straight.PassDetonateWarheaddefined the warhead detonated byTrajectory.Straight.PassDetonate, andTrajectory.Straight.PassDetonateDamagedefined the damage caused byTrajectory.Straight.PassDetonateWarhead.Trajectory.Straight.PassDetonateDelaycontrols the delay for detonating the warhead defined byTrajectory.Straight.Warhead.Trajectory.Straight.PassDetonateTimercontrols the initial delay for detonating the warhead defined byTrajectory.Straight.Warhead.Trajectory.Straight.PassDetonateLocalcontrols whetherTrajectory.Straight.PassDetonateWarheadand weapon'sWarheadare always detonate at ground level. It will also no longer restrict vertical velocity of the projectile when usingTrajectory.Straight.ConfineAtHeight.Trajectory.Straight.LeadTimeCalculatecontrols whether the projectile need to calculate the lead time of the target when firing. Note that this will not affect the facing of the turret.Trajectory.Straight.OffsetCoordcontrols the offsets of the target. Projectile will aim at this position to attack. It also supportsInaccurate=yesandTrajectory.Straight.LeadTimeCalculate=trueon this basis.Trajectory.Straight.RotateCoordcontrols whether to rotate the projectile's firing direction within the angle bisector ofTrajectory.Straight.OffsetCoordaccording to the weapon'sBurst. Set to 0 to disable this function.Trajectory.Straight.MirrorCoordcontrols whetherTrajectory.Straight.OffsetCoordneed to mirror the lateral value to adapt to the current burst index. At the same time, the rotation direction calculated byTrajectory.Straight.RotateCoordwill also be reversed, and the rotation angle between each adjacent projectile on each side will not change as a result.Trajectory.Straight.UseDisperseBurstcontrols whether the calculation ofTrajectory.Straight.RotateCoordis based on its superior'sTrajectory.Disperse.WeaponBurstof the dispersed trajectory, rather thanBurstof the weapon. If this value is not appropriate, it will result in unsatisfactory visual displays.Trajectory.Straight.AxisOfRotationcontrols the rotation axis when calculatingTrajectory.Straight.RotateCoord. The axis will rotates with the unit orientation or the vector that from target position to the source position.Trajectory.Straight.ProximityImpactcontrols the initial proximity fuse times. When there are enough remaining times and the projectile approaches another valid target, it will detonate a warhead defined byTrajectory.Straight.Warheadon it. If the times is about to run out, it will also detonate itself at its location. This function can be cancelled by setting to 0. A negative integer means unlimited times. By the way, you can use the weapon'sWarheadwith low versus only to aim at the target, and use theTrajectory.Straight.ProximityWarheadto causing actual harm.Trajectory.Straight.ProximityWarheaddefined the warhead detonated byTrajectory.Straight.ProximityImpact, andTrajectory.Straight.ProximityDamagedefined the damage caused byTrajectory.Straight.ProximityWarhead.Trajectory.Straight.ProximityRadiuscontrols the range of proximity fuse. It can NOT be set as a negative integer.Trajectory.Straight.ProximityAlliescontrols the damage ratio if the target of proximity fuse is ally. It will not detonate at allies by setting as 0. Note that this is not related to whether the warhead itself affect allies.Trajectory.Straight.ProximityFlightcontrols whether to count units in the air.Trajectory.Straight.ThroughVehiclescontrols whether the projectile will not be obstructed by vehicles or aircrafts on the ground. When it is obstructed, it will be directly detonated at its location. If it still haveTrajectory.Straight.ProximityImpacttimes, it will also detonate aTrajectory.Straight.ProximityImpactat the location of the obstacle.Trajectory.Straight.ThroughBuildingcontrols whether the projectile will not be obstructed by buildings. When it is obstructed, it will be directly detonated at its location. If it still haveTrajectory.Straight.ProximityImpacttimes, it will also detonate aTrajectory.Straight.ProximityImpactat the location of the obstacle.Trajectory.Straight.EdgeAttenuationcontrols the edge attenuation ratio of projectile damage, includesTrajectory.Straight.Damage. Can NOT be set to a negative integer.Trajectory.Straight.SubjectToGroundcontrols whether the projectile should explode when it hits the ground. Note that this will make AI search for suitable attack locations.Trajectory.Straight.ConfineAtHeightcontrols the height above ground that projectile will try to travel as it can. It can not move down from the cliff by settingSubjectToCliffs=yes. It can be cancelled by setting as a non positive integer. It will be forcibly cancelled by settingTrajectory.Speedabove 256.In
rulesmd.ini:Trajectory.Straight.ConfineAtHeightTrajectory.Straight.OffsetCoordTrajectory.Straight.PassDetonateTrajectory.Straight.ProximityImpactTrajectory.Straight.LeadTimeCalculateThen, the new Disperse trajectory.
ROT, but its settings are more flexible. It also has a unique trajectory. And as its name suggests, it can even spread out more weapons.Trajectory.Disperse.UniqueCurvecontrols whether to enable simulated Qian Xuesen trajectory. After enabling this, it will NOT respect the following 19 items andTrajectory.Speed.Trajectory.Disperse.PreAimCoordcontrols the initial flight direction of the projectile, and after reaching this coordinate, it will begin to turn towards the target direction. When it is set to 0,0,0 , it will directly face the target.Trajectory.Disperse.RotateCoordcontrols whether to rotate the projectile's firing direction within the angle bisector ofTrajectory.Disperse.PreAimCoordaccording to the weapon'sBurst. Set to 0 to disable this function.Trajectory.Disperse.MirrorCoordcontrols whetherTrajectory.Disperse.PreAimCoordneed to mirror the lateral value to adapt to the current burst index. At the same time, the rotation direction calculated byTrajectory.Disperse.RotateCoordwill also be reversed, and the rotation angle between each adjacent projectile on each side will not change as a result.Trajectory.Disperse.FacingCoordcontrols whether the forward direction inTrajectory.Disperse.PreAimCoordis depending on the orientation of the firer. By default, it will depend on the vector between the firer and the target.Trajectory.Disperse.ReduceCoordcontrols whetherTrajectory.Disperse.PreAimCoorddefines the initial movement coordinates when the attack distance is 10 cells, and the actual initial movement coordinates will change with the length of the attack distance. It can be simply understood as an optimization term aimed at ensuring hits at close range.Trajectory.Disperse.UseDisperseBurstcontrols whether the calculation ofTrajectory.Disperse.RotateCoordis based on its superior'sTrajectory.Disperse.WeaponBurstof the dispersed trajectory, rather thanBurstof the weapon. If this value is not appropriate, it will result in unsatisfactory visual displays.Trajectory.Disperse.AxisOfRotationcontrols the rotation axis when calculatingTrajectory.Disperse.RotateCoord. The axis will rotates with the unit orientation or the vector that from target position to the source position.Trajectory.Disperse.LaunchSpeedcontrols the initial flight speed of the projectile, it will be directly reduced to this value if it exceedsTrajectory.Speed.Trajectory.Disperse.Accelerationcontrols the acceleration of the projectile's flight speed, increasing the speed per frame according to this value, the final speed will not exceedTrajectory.Speed.Trajectory.Disperse.ROTcontrols the turning speed of the projectile and can determine the turning radius of the projectile. The turning speed will increase with the increase of speed.Trajectory.Disperse.LockDirectioncontrols whether after reachingTrajectory.Disperse.PreAimCoordand completing the first turn, the projectile will lock the direction of motion without further adjustment.Trajectory.Disperse.CruiseEnablecontrols whether after reachingTrajectory.Disperse.PreAimCoordand completing the first turn, the projectile will maintain altitude while moving towards the target.Trajectory.Disperse.CruiseUnableRangecontrols how far away it is from the target to end the cruise phase, no longer maintaining the cruise altitude, and begins to move directly towards the target. If the distance is already below this value by the timeTrajectory.Disperse.PreAimCoordis reached, the cruise phase will be skipped.Trajectory.Disperse.LeadTimeCalculatecontrols whether the projectile need to calculate the lead time of the target during motion.Trajectory.Disperse.TargetSnapDistancecontrols the maximum distance in cells from intended target the projectile can be at moment of detonation to make the projectile 'snap' on the intended target. Set to 0 to disable snapping.Trajectory.Disperse.RetargetRadiuscontrols the radius of the projectile to search for a new target after losing its original target. If it hasn't arrivedTrajectory.Disperse.PreAimCoordyet, the last coordinate of the original target is taken as the center of the searching circle. Otherwise, the coordinate of the distance in front of the projectile is taken as the center of the circle. Set to 0 indicates that this function is not enabled, and it will still attempt to attack the original target's location. If it is set to a negative value, it will directly self explode in place.Trajectory.Disperse.RetargetAlliescontrols whether the projectile chooses allies as its target when searching for new targets after losing its original target.Trajectory.Disperse.SuicideShortOfROTcontrols whether the projectile will explode when it detected its insufficient turning ability.Trajectory.Disperse.SuicideAboveRangecontrols the projectile to self destruct directly after reaching the flight distance. Set to 0 to disable suicide.Trajectory.Disperse.SuicideIfNoWeaponcontrols whether the projectile will self destruct after the number of times it spreads the weapon has been exhausted. IfTrajectory.Disperse.WeaponCountset to 0, this will not be enabled.Trajectory.Disperse.Weaponsdefined the dispersal weapons of the projectile.Trajectory.Disperse.WeaponBurstdefined how many corresponding weapons each time the projectile will fire. When the quantity is lower thanTrajectory.Disperse.Weapons, it will use the last value.Trajectory.Disperse.WeaponCountcontrols how many times the projectile can spread the weapon. Set to a negative value means unlimited times.Trajectory.Disperse.WeaponDelaycontrols the delay for dispersing the weapons defined byTrajectory.Disperse.Weapons.Trajectory.Disperse.WeaponTimercontrols the initial delay for dispersing the weapons defined byTrajectory.Disperse.Weapons.Trajectory.Disperse.WeaponScopecontrols the weapon dispersing timer to start counting only within this distance of reaching the target. Set to 0 to disable this function. Set to a negative value means it will only disperse the weapon at most once before detonation.Trajectory.Disperse.WeaponSeparatecontrols whether the projectile no longer fire all the weapons inTrajectory.Disperse.Weaponsat once and instead fire a group of weapons in the list order, followingTrajectory.Disperse.WeaponBurst.Trajectory.Disperse.WeaponRetargetcontrols whether the dispersed weapons will find new targets on their own. Using the range of weapons to search new targets.Trajectory.Disperse.WeaponLocationcontrols whether the dispersed weapons will search for new targets at the center of the spreading position, otherwise they will focus on the original target. If a suitable target cannot be found, it will randomly attack the ground.Trajectory.Disperse.WeaponTendencycontrols whether the dispersed weapons will choose the original target as the first new target in each group of weapons.Trajectory.Disperse.WeaponToAlliescontrols whether the dispersed weapons will choose allies as targets when searching for new targets.Trajectory.Disperse.WeaponToGroundcontrols whether the dispersed weapons will only choose the ground as their targets.In
rulesmd.ini:Trajectory=DisperseTrajectory.Disperse.UniqueCurveTrajectory.Disperse.FacingCoordTrajectory.Disperse.LeadTimeCalculateTrajectory.Disperse.RotateCoordTrajectory.Disperse.Weapons> Straight :InaccurateLast, the new Engrave trajectory.
Trajectory.Engrave.SourceCoordcontrols the starting point of engraving line segment. Taking the target as the coordinate center. Specifically, it will start from the firing position when set to 0,0 . The height of the point will always at ground level.Trajectory.Engrave.TargetCoordcontrols the end point of engraving line segment. Taking the target as the coordinate center. The height of the point will always at ground level.Trajectory.Engrave.MirrorCoordcontrols whetherTrajectory.Engrave.SourceCoordandTrajectory.Engrave.TargetCoordneed to mirror the lateral value to adapt to the current FLH.Trajectory.Engrave.TheDurationcontrols the duration of the entire engrave process. Set to 0 will automatically useTrajectory.Engrave.SourceCoordandTrajectory.Engrave.TargetCoordto calculate the process duration.Trajectory.Engrave.IsLasercontrols whether laser drawing is required.Trajectory.Engrave.IsSupportedcontrols whether the engrave laser will be brighter and thicker. Need to setTrajectory.Engrave.IsHouseColororTrajectory.Engrave.IsSingleColorto true.Trajectory.Engrave.IsHouseColorcontrols whether set the engrave laser to draw using player's team color. These lasers respectTrajectory.Engrave.LaserThicknessandTrajectory.Engrave.IsSupported.Trajectory.Engrave.IsSingleColorcontrols whether set the engrave laser to draw using onlyTrajectory.Engrave.LaserInnerColor. These lasers respectTrajectory.Engrave.LaserThicknessandTrajectory.Engrave.IsSupported.Trajectory.Engrave.LaserInnerColorcontrols the inner color of the engrave laser.Trajectory.Engrave.LaserOuterColorcontrols the outer color of the engrave laser.Trajectory.Engrave.LaserOuterSpreadcontrols the spread color of the engrave laser.Trajectory.Engrave.LaserThicknesscontrols the thickness of the engrave laser. Need to setTrajectory.Engrave.IsHouseColororTrajectory.Engrave.IsSingleColorto true.Trajectory.Engrave.LaserDurationcontrols the duration of the engrave laser.Trajectory.Engrave.LaserDelaycontrols how often to draw the engrave laser.Trajectory.Engrave.DamageDelaycontrols how often to detonate warheads.In
rulesmd.ini:Trajectory=EngraveThe comprehensive display.
Trajectory.Disperse.Weapons> Straight :Trajectory.Straight.UseDisperseBurstTrajectory.Engrave.IsSingleColorTrajectory.Disperse.Weapons> Straight :InaccurateTrajectory.Engrave.TheDurationTrajectory.Disperse.Weapons> Straight :InaccurateTrajectory.Engrave.IsSupportedTrajectory.Disperse.CruiseEnableTrajectory.Disperse.Weapons> Disperse :Trajectory.Disperse.PreAimCoordTrajectory.Straight.ProximityImpact