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

Airplane plus have part hp in the millions? #598

Closed
ghost opened this issue Nov 18, 2018 · 13 comments
Closed

Airplane plus have part hp in the millions? #598

ghost opened this issue Nov 18, 2018 · 13 comments
Labels

Comments

@ghost
Copy link

ghost commented Nov 18, 2018

ISSUE TYPE
  • Bug Report (Something is broken)
KSP and BDA Version

1.5.1

v1.2.3

OS / ENVIRONMENT

Windows 10, device is a laptop

SUMMARY

I noticed that most parts from airplane plus have MILLIONS of hp. I don't know if it's a bug from bda, a bug with module manager, or just the airplane plus parts themselves, but I'm sure either way this behaviour is not supposed to happen.

STEPS TO REPRODUCE

Simply just look at some the airplane plus parts, they have HP in the millions. The ones I specifically noticed to have this issue were the drone core and the drone's cargo bay nose, but there are other parts with this issue too.

Log Files

KSP.log

@jrodrigv
Copy link
Collaborator

jrodrigv commented Nov 18, 2018 via email

@RaptorTech-Inc
Copy link

ISSUE TYPE
  • Bug Report (Something is broken)
KSP and BDA Version

1.5.1

v1.2.3

OS / ENVIRONMENT

Windows 10, device is a laptop

SUMMARY

I noticed that most parts from airplane plus have MILLIONS of hp. I don't know if it's a bug from bda, a bug with module manager, or just the airplane plus parts themselves, but I'm sure either way this behaviour is not supposed to happen.

STEPS TO REPRODUCE

Simply just look at some the airplane plus parts, they have HP in the millions. The ones I specifically noticed to have this issue were the drone core and the drone's cargo bay nose, but there are other parts with this issue too.

Log Files

KSP.log

image

Also occurs with B9 parts as well.

@ghost
Copy link
Author

ghost commented Nov 21, 2018

Maybe we should make adjustable hit points, that way issues like these can be easily resolved. Although the downside of this is HP might be able to be edited in flight like armour, it would provide an easy fix for now until the team look deeper into this problem.

@jrodrigv
Copy link
Collaborator

I will provide some testing binaries soon. The Airplane plus mod is returning wrong values using the same methods I use for the rest of the parts.

I will clamp the Hitpoints value to avoid crazy values in some mods.

@Gedas-S Gedas-S added the bug label Dec 11, 2018
@meltingSnowdrift
Copy link

What is the advisable thing to do for players who have many complicated aircraft using many airplane plus parts? It seems that hitpoint counts of parts are stored in craft files. This means that any hitpoint adjustment requires rebuilding all the craft using the parts that were adjusted. Could a better long-term solution involve no longer storing hitpoint counts in craft files, instead determining them upon loading a craft? That would save a lot of rebuilding.

If this is not possible, can there be created some kind of script or utility that automatically edits craft files so that their parts’ hitpoint counts match the current ones for those parts? This would at least remove the need for manual craft file editing or rebuilding when changes involving hitpoints occur, whether caused by a change in the calculation method or by the user adjusting them.

@jrodrigv
Copy link
Collaborator

@meltingSnowdrift We are not storing the hitpoint values, they are calculated when a vessel is loaded unless maybe when you have a MMpatch. (not completely sure about it)

You can create MMpatch to fix the values as a hotfix, using this example
https://github.com/PapaJoesSoup/BDArmory/blob/master/BDArmory/Distribution/GameData/BDArmory/MMPatches/000000_HitpointModule.cfg

For the next release of BDArmory the MMPatch would not be really necessary for AP+ because I will add some logic to avoid the extreme HP values.

@meltingSnowdrift
Copy link

meltingSnowdrift commented Dec 23, 2018

If hitpoint values are not stored in craft files, why does this appear in a craft file?
image

Update: My testing seems to reveal that it is the hitpoint values stored in the craft files, rather than those in part configurations, that are respected when opening a craft in the editor and when spawning craft.

@jrodrigv
Copy link
Collaborator

Uhm I will do more testing when I have time. Even if the are stored they should be autocalculated at runtime everytime you load a craft. For example if you reduce the mass of a part, it should give you a different HP value.

@ghost
Copy link
Author

ghost commented Dec 24, 2018

Just coming here to say thanks to all the people contributing to help fix this problem, even during the holidays 😄

@meltingSnowdrift
Copy link

In my own testing, hitpoint values were stored in and retrieved from craft files for both parts with explicitly specified hitpoint counts and parts for which hitpoint counts were automatically generated. @jrodrigv

@meltingSnowdrift
Copy link

👏

@ghost
Copy link
Author

ghost commented Dec 28, 2018

Thank you all so much! 😄

@meltingSnowdrift
Copy link

meltingSnowdrift commented Jan 8, 2019

In BDA 1.2.4.0, I launched a vessel created in 1.2.3.0 with an existing (wrong) hitpoint count stored for a part and this value was kept both when loaded in the editor and when launched. This incorrect hitpoint count originated from a value explicitly specified in a config file; neither the original nor the new value with which I wanted to replace it were auto-generated.

If this is very hard to prevent, is it possible to at least make some functionality that automatically corrects all hitpoint counts stored in craft files to the newest ones specified in part configs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants