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
ScanManager improvements and ship properties fixes #5635
ScanManager improvements and ship properties fixes #5635
Conversation
Probably going to do more fixes to scanning mission. I have a orbital scanner, which says that maximum scanning altitude is 5.71Mm, but as soon as my frame body changes (~2.3Mm altitude) I can't scan planet. Unless I misunderstood something. |
443d3e9
to
6d05dc2
Compare
I guess this is how it meant to be: OrbitalScan.mp4 |
bd5ff25
to
00bdecc
Compare
Had an occasion where I need to do two scans from the same planet, but I can do only one scan. Oh well. |
00bdecc
to
d66804c
Compare
Personally I think the constraint of one active scan is acceptable for multiple reasons:
The point of the work being done on Pioneer's economy is to provide consistent rewards to the player for their time investment no matter which gameplay loop they want to try, not have most activities be a pointless grind for pennies and a select few exploits/activities trivialize the rest of the game, as in Elite Dangerous. |
Thank you for your opinion. I agree with you on exploiting and min-maxing part. I can also add that performing multiple scans with just one scanner when you have missions that require scanning in different conditions sounds like nonsense in itself. How is this even supposed to be possible? |
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.
Of the changes here in the PR, I've left two comments here where I'd like to see the solutions amended to better address the underlying issues. Otherwise, this seems fairly sensible and non-invasive; thank you for tackling these issues!
Also, if you're willing, I will push a commit to this PR once you've addressed the above PR feedback that amends the time acceleration limits in Game.cpp to allow higher "default" time acceleration while near bodies, without needing to Ctrl+Click and override time acceleration. |
As a minor nitpick for future contributions, we prefer the use of either |
I think disabling Ctrl+Click can be added as an option in setting's menu like "Always force time acceleration". I can add that if you want, since I already done some changes to
Edit: aside from that, feel free to make any changes you deem necessary. |
I would strongly prefer not to do this. The Ctrl+Click is intended to override the game's limits as to what's considered a "safe" time acceleration both in-world and from a developer perspective. I'm willing to amend those limits slightly given the optimizations and improvements that have been made since Pioneer first introduced them, however the distinction between forcing a time acceleration setting and requesting one is an important one to have. If clicking on the buttons always forces time acceleration, the player will experience many unintended deaths and other program errors. For an example, in a low orbit around a Titan-sized body at 10,000x time acceleration your orbit will shift very drastically due to numerical error. EDIT: the goal should be to improve other parts of Pioneer so that the game functions correctly with relaxed limits on requested time acceleration, rather than always force time acceleration regardless of the game's limits. I'll address the other comments etc. later once I've gotten a fresh mind to go over them. |
|
d66804c
to
dc9db90
Compare
You appear to have a partial manual rebase against master in Ship.cpp - this branch currently doesn't compile because it's missing the change to Ship.h from master. That said, I've tested and pushed the commits I spoke of prior - you should be able to rebase this branch against master in preparation for merge. |
1. The ship's properties "totalCargo" and "usedCargo" were reinitialized by CargoManager's constructor to zero; 2. maxHyperspaceRange would be zero after save load.
Fixes for this problems: 1. ScanManager: StartScanCallback had no way to determine if the current ScanManager was loaded from save when it needed to set up a callback; 2. The orbital scanning stopped when the frame of reference changed.
674b1b7
to
86ba20d
Compare
- Attempt to calculate physically-correct frame of influence from Hill sphere metric
- Slightly reduce time acceleration limits to allow 1000x time acceleration in medium/high orbits around small bodies
Excellent work, did a quick playtest and everything seems to work correctly! |
Thank you so much @Max5377, for finding and fixing the cause of #5534. I had to stop playing the game after spending two weekends trying to wrap my brain around all the things that participate in cargo/mass calculations. I was so stuck on this that I never got around to notifying flatpak people about #5574. ... which is apparently still hitting people -- see #5595. Mea maxima culpa. |
@yump Have fun) Don't forget to also thank @Web-eWorks for the advice on finalizing my solution. I don't have Linux, so I can't look why this issue happenes. |
UPDATE
As suggested by @Web-eWorks, first solution changed to wrap
totalCargo
andusedCargo
around this check (ex. fortotalCargo
) infunction CargoManager:Constructor(ship)
:so this properties will not be reinitialized by
CargoManager
's constructor, because after saving the game, this properties will be already stored in the ship and will be unserialized during loading the game.self.ship:UpdateEquipStats()
was not needed since it's called internally from C++.While testing more, another bug was found,
maxHyperspaceRange
wasn't properly initialized after loading the game.This happened, because in this line in
void Ship::UpdateLuaStats()
:m_stats.hyperspace_range_max
,m_stats.hyperspace_range
are mixed up sinceGetHyperspaceRange
returnsrange
andrange_max
,range
is zero at this time, but will be initialized later.Switched them up so
maxHyperspaceRange
will be properly initialized.Incorrect display of
cargo space used
after loading the gameFixes #5557 fixes #5534
(Maybe more)
The
Ship
's properties were not assigned newCargoManager
property values after it was loaded from save.The most evident case of this is incorrect display of
cargo space used
inpersonal info
after loading the save.This properties is used in a bunch of other places that I listed here.
One of this places is calculating probability of pirates attacking player, so I guess expect more pirate attacks?!
I also want to clarify that this was happening to every ship present during save loading.
To fix it, added this lines in
CargoManager:Unserialize
:To assign new values to
Ship
's properties duringCargoManager
unserialization.Still don't know if this line is needed:
but I leave it for now, just in case, like in
CargoManager:OnShipTypeChanged()
.Scanner not starting previous scan after loading the game
Fixes #5577
ScanManager: StartScanCallback
had no way to determine if the currentScanManager
was loaded from save when it needed to set up a callback, because fieldactiveCallback
ofScanManager
is saved and during unserializationScanManager:StartScanCallback
is called which has this check:which basically thinks that callback is already setted up for current
ScanManager
, which in reality is not.Added additional argument to
ScanManager:StartScanCallback
force
and changed this check to:to force through this check if
ScanManager:StartScanCallback
was called fromScanManager:Unserialize
.Orbital scanning stops despite meeting maximum altitude requirements
This was due to an oversight in the
ScanManager
s code, when it did not take into account that player might be too far from the planet, when his frame of reference (frameBody
) was changing, immediately stopping the scanning process.Added additional checks when current scan is orbital (ex. immediatly returning from
onFrameChanged
when current scan is orbital) and branching body choice:Update: a small revision of code.
Update2: added additional assertions with messages to better describe what happened.