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
Make Bullet projectile extensible #20931
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to do what the title sais and cleanly.
Feels like bullet is, was already, very custom/hacky. Makes me wonder if it couldn't be cleaned up.
yield break; | ||
|
||
var world = args.SourceActor.World; | ||
foreach (var r in RenderAnimation(wr)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will likely also have quite a negative peformance overhad with many bullets flying around.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did take inspiration from Actor.Renderables(), but I can quickly turn it into standard (non-iterator) method.
ed0addc
to
d661d42
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Untested. Code changes lgtm those two nits aside.
d661d42
to
34d20e8
Compare
34d20e8
to
9ebca7e
Compare
This PR makes
Bullet
projectile extensible, so mods can adjust and modify its behavior.Proposed changes would be used in OpenE2140 mod to implement debris flying out of spot, where original projectile (i.e. the one fired by actor's weapon), hits the target.
Draft implementation of new
FreezingBullet
projectile (based on the new, extensibleBullet
) can be seen in this commit: michaeldgg2/OpenE2140@5a37d20. This commit, however, contains only the use of this new projectile (not the entire implementation of the debris).This is how the debris with
FreezingBullet
looks like. Heavy tank with three cannons shooting at the ground. Notice the small pieces of debris flying out of spots, where the bullets from the tank's cannons hit the ground.Current version of this feature in OpenE2140 uses
CreateEffect
warhead as can be seen here:https://github.com/OpenE2140/OpenE2140/blob/master/mods/e2140/content/core/weapons/debris.yaml#L14
This implementation has however two bugs:
CreateEffect
warhead kicks in and createsSpriteEffect
Bullet
andSpriteEffect
created byCreateEffectWarhead
doesn't matchFirst issue is visible only on low FPS. The second is caused by both
Bullet
andCreateEffectWarhead
picking different random sequence for rendering.Both issues cannot be worked around and require changes in OpenRA (unless
Bullet
andCreateEffectWarhead
are reimplemented from scratch).