frostoven / Cosmosis

Space sim in early development
Other
12 stars 0 forks source link

Implement scene switching mechanism #60

Closed aggregate1166877 closed 2 years ago

aggregate1166877 commented 3 years ago

Details: The game currently only has one scene: the one where you're in a space ship.

Technically, it has two scenes; the world where the local star / local planets / far-away stars reside, and the space ship scene. These were separated as part #7 to make large-scale lighting easier. These two scenes still function as one however, and work together to facilitate space travel.

We need a mechanism to allow switching to / from scene groups in a clean way. This will eventually be useful for the galaxy map (or a potential main menu), but has an immediate use-case: testing star catalogs and shaders via free-flying through stars.

(The honest truth is that flying through real stars is really addictive and I just want it kept as a separate game mode.)

Task:

This should support:

Some considerations: Space ships inhabited by the controlling player are seen as levels from the game's point of view. It's possible we'll need some level logic running in the background. However, slow or dangerous logic such as "calculate distance to door to see if it can be opened" would potentially need to be stopped if switching to another scene. Decide if it's within scope during implementation.

aggregate1166877 commented 2 years ago

Scene switching can be tested by going to Menu -> Debug Tools -> Star free-flight.

This will switch to a scene where you can freely fly through near-Earth stars. In the background, space ship processing will continue even though the ship and its surrounding are no longer being rendered.