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

Improve Naval and Smart missiles #6027

Merged
merged 5 commits into from
Jan 21, 2025

Conversation

sturnclaw
Copy link
Member

Alternative title: finally fixed a bit of the mess that is missile handling in this game.

This PR rewrites how missiles get their "data", i.e. all parameters used in-flight. Missiles still reference a special ShipType file (one of the missile_*.json shipdefs), but we're no longer constrained to only four missile types any more!

What's more, Naval and Smart missiles now actually do more damage than regular guided missiles (as one would expect), and missiles in general got a bit better about detonating close to the target rather than at a 100m+ standoff.

As a quick perusal of Missile.cpp and data/modules/Equipment/Weapons.lua will show, most meaningful parameters for missiles are now defined in "data" rather than code, allowing mods to introduce new missile equipment and making it much easier to tweak missile gameplay balance.

Fixes #5926.
Fixes #6014.
Fixes #4159.

- Allow gameplay code to specify a number of missile parameters as a spawn argument.
- Don't hardcode missile types in C++.
- Add EquipType.MissileType
- Pass the missile_stats table from missile equipment to Ship:SpawnMissile()
- Larger missiles now contain more explosive and are better at damaging enemy ships.
- As before, smart and naval missiles are more ECM resistant than basic guided missiles.
- The fuzeRadius has been drastically lowered for most missiles, increasing their effective damage to an enemy target in situations other than head-on collision.
- Can't use Space::GetBodyByIndex until PostLoadFixup()
- Since we're no longer grouping by a hardcoded missile id, we need to group by equipment type.
- Consequently, the missile display interface got a lot more modular to new missile types.
- Generally reduced some of the tech debt of the module related to missile handling.
@impaktor
Copy link
Member

What's more, Naval and Smart missiles now actually do more damage than regular guided missiles (as one would expect),

Is this distinction visible to the player when buying?

@fluffyfreak
Copy link
Contributor

This is fantastic work! 👍🎉 It's a very exciting improvement to an ancient system that needed reworking, good job

@sturnclaw
Copy link
Member Author

What's more, Naval and Smart missiles now actually do more damage than regular guided missiles (as one would expect),

Is this distinction visible to the player when buying?

Not yet. That's tracked in #6014 for implementation before we release.

@syonfox
Copy link

syonfox commented Jan 19, 2025

Just testing this with both the hyperdrive code and this and when I install a Naval missile rack I get the fallowing error:

image

output.txt

image

This happens when i but a rack supporting huge missiles.

Can reproduce on ac33 as well

@sturnclaw
Copy link
Member Author

Completely unrelated to either branch, it's caused by attempting to draw details for a MILITARY tech-level item. Will fix in a separate PR.

@sturnclaw sturnclaw merged commit 6b63d37 into pioneerspacesim:master Jan 21, 2025
4 checks passed
@sturnclaw sturnclaw deleted the missile-api branch January 21, 2025 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants