Skip to content

Ramp up HVLI damage over 1U - #2855

Merged
daid merged 7 commits into
daid:masterfrom
dkapell:hvli_delay
Oct 15, 2026
Merged

daid merged 7 commits into
daid:masterfrom
dkapell:hvli_delay

Conversation

@dkapell

@dkapell dkapell commented Apr 12, 2026 •

Copy link
Copy Markdown
Contributor

For Legacy Compatibility, this PR restores the damage ramp-up for HVLI missiles in a way that I believe is extensible if missile type config gets pulled out of the C++ code.

This adds a initial_lifetime member to the LifeTime component to calculate how long an entity has existed.
This adds a 'full_damage_after` member to the ExplodeOnTouch component, which is used to calculate lifetime before full damage is applied.

For HVLI, the full_damage_after is calculated based on the time for the projectile to travel 1000 units (1U), based on tube size.

@dkapell
dkapell marked this pull request as ready for review April 12, 2026 02:42
@dkapell dkapell changed the title Ramp up HVLI damage over 2U Ramp up HVLI damage over 1U Apr 12, 2026
Comment thread src/components/lifetime.h Outdated
{
public:
float lifetime = 1.0;
float initial_lifetime = 1.0;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I see why you added this. But I don't like the naming now.

I think it would be better to now have:

float alive_for = 0.0;
float maximum = 1.0;

And then count up in the system. This gives no way for a bad invariant. As with your implementation you could have that lifetime is bigger then initial_lifetime.
This also makes it less error prone to use. As you only need to set 1 value after creating the component.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated PR to use this naming convention, and also break LifeTime out into a dedicated system, which resolves a comment in MissileSystem that it didn't belong there. This does minorly change the fields exposed to LUA (lifetime.lifetime -> lifetime.maximum) but no scripts in master access that directly.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I give no guarantee over direct component API stability, as how hard this is linked to the C++ implementation, I do want to have the ability to change that. So that is no problem.

void LifeTimeSystem::update(float delta)
{
if (game_server) {
// TODO: Not really part of missile

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

this comment can now be removed :) glad you cleaned up my messy bit.

@daid
daid merged commit b492ea9 into daid:master Oct 15, 2026
5 checks passed
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.

2 participants