Skip to content
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

Wertz public branch #173

Merged
merged 3 commits into from
Mar 17, 2021
Merged

Wertz public branch #173

merged 3 commits into from
Mar 17, 2021

Conversation

IndustrialDonut
Copy link
Collaborator

Tank shell damage successfully moved from being instantly applied on shooting to being dealt upon the round actually hitting the target, done in the actual ShellBehavior collision logic now and utilizing collision shapes in the 3D world.
Shell velocity is tweaked based on the target velocity at launch such that it will have the same lateral displacement as the target (lead) over time. To do this, I had to make a manual Velocity property in the MovementComponent to reference.

"components": [
"Microsoft.VisualStudio.Workload.ManagedGame"
]
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we leave this file in or add it to gitignore instead?

Explode();
_launchPlatform = other;
_justLaunched = false;
print("instant collision avoided now");
Copy link
Collaborator

Choose a reason for hiding this comment

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

leftover print; if you want to leave it in, use Logger.LogDamage

src/FieldWarning/Assets/Units/ShellBehaviour.cs Outdated Show resolved Hide resolved
src/FieldWarning/Assets/Units/ShellBehaviour.cs Outdated Show resolved Hide resolved
src/FieldWarning/Assets/Units/ShellBehaviour.cs Outdated Show resolved Hide resolved
@@ -24,6 +24,7 @@ public sealed class MovementComponent : MonoBehaviour
private const float ORIENTATION_RATE = 8.0f;
private const float TRANSLATION_RATE = 6.0f;

public Vector3 Velocity; //{ get; private set; }
Copy link
Collaborator

Choose a reason for hiding this comment

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

This can have a private setter

src/FieldWarning/Assets/Units/ShellBehaviour.cs Outdated Show resolved Hide resolved
// HE damage is applied by the shellBehavior when it explodes
}
}
shellBehaviour.Initialize(shellDestination, ammo, target.Enemy.gameObject.GetComponent<PFW.Units.Component.Movement.MovementComponent>().Velocity);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Break up giga long lines if its not too much trouble.

Also normally this kind of thing would be done through the UnitDispatcher (add a UnitDispatcher property called 'CurrentMovementSpeed' or something and then have that get the value from movement component; the intent is to avoid non-unit code fiddling with specific components, and have the UnitDispatcher provide a clean interface for outside requests. Then this code just goes target.Enemy.CurrentMovementSpeed. If it sounds like too much boilerplate you can leave it like this tho.

@IndustrialDonut IndustrialDonut merged commit fdc3bdc into master Mar 17, 2021
@IndustrialDonut IndustrialDonut deleted the WertzPublicBranch branch March 17, 2021 20:52
@IndustrialDonut IndustrialDonut linked an issue Mar 17, 2021 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

KE/HEAT impact prediction + detection
2 participants