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
Allow to specify game start time #2615
Conversation
Specifying game start time is fine, but I'm not sure about the changes to We've been able to specify rotational phase offset since #1506 was merged back in September 2012. If you want it to be daytime in LA at game start, all you need to do it adjust Earth's |
Or just choose a different start point. We've done it before. Nothing special about LA! |
Actually I do not care at all about LA. It is just a good example. Fiddling with Moreover, I considered it a bug that the rotation resets to Last but not least, this iterative multiplication with the rotation matrix accumulates rounding error astonishingly fast. So, even if you stay longer in the solar system, you may notice day drift. |
I'd rather it was easy to make custom modifications to a generated system (or otherwise specify the system); fiddling with the starting time seems like a hack if that's why you're doing it. But that's a problem for some other PR in the future.
Agreed, that should be fixed.
Agreed, that should be fixed. |
m_state(STATE_NORMAL), | ||
m_wantHyperspace(false), | ||
m_timeAccel(TIMEACCEL_1X), | ||
m_requestedTimeAccel(TIMEACCEL_1X), | ||
m_forceTimeAccel(false) | ||
{ | ||
if (!Pi::game) | ||
Pi::game = this; |
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.
Why is this needed?
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.
Because this constructor calls the Space(Game*, const SystemPath &)
constructor which calls Space::GenBody(SystemBody *, Frame *)
which calls MakeFrameFor(SystemBody *, Body *, Frame*)
which needs the current time (Pi::game->GetTime()
) for setting up the orientation of rotating frames.
Game::CreateViews
seems to use the same hack.
Well the if (!Pi::game)
is probably not needed ;)
Some time ago someone complained that you start at night in Los Angeles.
This PR allows to specify the game start time in the Lua function Game.StartGame and sets the start time for Los Angeles to start at sunrise.