Port Vector effect system from KratosAI to PhobosAI#2265
Conversation
d193830 to
fdec03a
Compare
|
To Chinese users:
|
| else | ||
| { | ||
| pObject->SetLocation({ currentPos.X + moveDisp.X, currentPos.Y + moveDisp.Y, currentPos.Z + moveDisp.Z }); | ||
| if (pType->Vector_Freeze) | ||
| { | ||
| if (auto const pFoot = abstract_cast<FootClass*>(pObject)) | ||
| pFoot->StopMoving(); | ||
| } | ||
| } |
There was a problem hiding this comment.
Pretty sure these are not enough. Simply SetLocation may be good for BulletClass, but not for FootClass.
I suggest creating a Locomotor to handle this. From my understanding, many parts of the game access the Locomotor of FootClass. Moving characters without going through the Locomotor may cause inconsistencies at these access points.
See #2179. Due to the complexity of this section, I cannot guarantee that it is completely correct.
There was a problem hiding this comment.
ofc. BTW I don't think vector on techno is good - maybe just keep the bullet part, or only support jumpjet&aircraft
There was a problem hiding this comment.
yes, @TaranDahl is completely correct. if you want to manipulate FootClass movement - you must do it through locomotors. Otherwise you're opening a can of worms and fighting the game design.
I did Techno Attachment this way first, it went completely bonkers on many locomotors and had inexplicable bugs, freezes and crashes. When I remade it to be a locomotor - everything got fine.
There was a problem hiding this comment.
Actually I dunno what the heck Deepusheek has written. It needs ofc serious redo - or at least give it stable examples of how things should work.
|
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. |
…,防止引擎误判抛射体卡住提前引爆。
… OriginNoUpdate auto-detect, default horizontal Origin circle plane, TargetOffset init fix
|
Phobos_Vector_Manual.html |
|
I think it's better if this is separated from AttachEffect and instead made its own section, with a vector list also separated from AttachEffectTypes (and call it something like AttachVector and AttachVectorTypes). |
Perhaps. In kratos prototype it merges perfectly into AE infrastructure so the ported version is also started as AE. Maybe a new list, or better no listing at all. The more important part is let projectiles directly accept vector. |
Ported from Kratos code base, the phobos ver of the all mighty vector attach effect. All by vibe coding (including this PR) so human review is very much needed.
preview gifs (kratos based):
https://www.bilibili.com/opus/1214163469064994817
https://www.bilibili.com/opus/1214494881641136144
https://www.bilibili.com/opus/1215222921544335378
The incredibly magical Vector class mechanism, capable of directly displacing projectiles and units.
Ported from Kratos by Deepusheek.
Function Description
Vector is a pure movement effector that forcibly modifies the coordinates of the attached object during the Duration.
Although it also works on Techno, its greatest use lies in:
Programmable, scriptable projectile trajectories.
You can use Vector to create incredibly stunning projectile flight paths.
After the Vector effect ends, the projectile will proceed to attack its original target. Therefore, it is recommended to use only ROT=100.
Each Vector can use a Next statement, allowing other Vectors to be activated after its own effect ends, enabling you to freely combine effects as you wish.
Vector abstracts "displacement" into five independent modes, with only one mode active per AE at a time.
Priority-based matching: Freeze > Circle > MoveTo > ReachTarget > Speed
Freeze: Frozen in mid-air, motionless.
Circle: Draws a circle. The center of the circle itself can also continue moving.
MoveTo: Directly provides a set of coordinates, moving frame by frame. For example, MoveTo=0,0,-10 is equivalent to the vanilla Vertical. If the effect ends halfway, the projectile will drop first, then charge toward the target.
ReachTarget: Takes the current coordinate difference and Duration, ensuring the projectile reaches the target exactly when Duration ends, ignoring speed settings. An arc height can be set. Adding an arc height makes it equivalent to the vanilla Arcing-type projectile.
Speed: Uses a custom speed setting or reads the original speed for straight-line flight.
The following image demonstrates the effects of the ReachTarget mode combined with random arc height, random arc rotation, and random arc vertices.

All tags are written under [AttachEffectSection], prefixed with "Vector."
As an AE, it needs to be registered under AttachEffectTypes.
Due to Phobos's AE underlying architecture, projectiles do not accept AEs. You can only write the Vector on the firer, indicating that projectiles fired by this firer will be subject to displacement.
For example:
[FV]
AttachEffect.AttachTypes=SomeVector