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

[Parent issue] Star hopping #74

Open
aggregate1166877 opened this issue Dec 5, 2021 · 0 comments
Open

[Parent issue] Star hopping #74

aggregate1166877 opened this issue Dec 5, 2021 · 0 comments
Labels
parent issue Contains multiple subtasks pre-alpha grind Pre-alpha MVP task: tasks used as rough indication of what needs to be done to get out of pre-alpha

Comments

@aggregate1166877
Copy link
Collaborator

aggregate1166877 commented Dec 5, 2021

Subtasks

Brief description

Implementing rapid travel to other stars via hyperspace is now feasible to implement. This task seek to define the set of features to achieve this.

Definition of done

  • User can choose a star as a destination.
  • Ship modules exist to facilitate navigation.
  • User presses a button to initiate a jump.
  • Skybox and 3D stellar object should update as part of the jump.

Full description

Note: the below was a brain dump meant only for myself, so it's all over the place and needs to be improved. It eventually became a lengthy document so I decided to paste it here.

Units

Large: parsec
Small: centiparsec (0.326156 ly)
Tiny: meter

Navigation

Universe global coordinates are in parsecs. All other coordinate systems are derived from those coordinates.
If in doubt, application will get location in parsecs and convert to smaller units from there.

Your local coordinate units are in meters. Your local coordinates always snapped to the nearest
gravity well (i.e. nearest star in sane space, nearest black hole in busier
space). If you are in a star's coordinate system, and while travelling you find
yourself nearer to another star, your coordinates will suddenly drastically
change to reflect this new positioning. Note that this means recalculating ship
position relative to the rest of the universe. We have the difference in x,y,z
coordinates relative to the new star, we can change our coordinates using that in a
calculation.

This can be seen as a feature: your nav system detects ambient gravity and
orients you accordingly (or, maybe it's a hidden number and no one knows /
cares about it).

Point is, we need local coordinates in meters else things will be jumpy, but on the
hand, we can't travel more than 0.95 ly or things get jumpy anyway. So this is
a trade-off that will, at least in theory, have minimal or no graphical
glitches. If we do end up having glitches, we can invent controls to work
around this.

Procedural generation

The procedural engine always works off global coordinates (units in parsecs).
The engine will then convert this to local coordinates (in meters) for the ship
to fly in.

Development

#59 [now complete] Create a real star skybox, but just plain - nothing fancy. Does not update as
you fly through space. It's plain, boring. Maybe later add dust and whatnot for
pretties. But keep the logic basic. The only not-so-basic bit is that it needs
to be done in a web worker.

#55 Start by procedurally generating ~4 stars. Place Sol in center, and Alpha Cen +
friends nearby. This gives us 1 manual, 1 triple manual, and 4 procedural
stars. These are not part of the skybox calculations. At first, just draw
them as normal dots via shader in the sky. For easy pseudo-realism, you may
choose to hardcode an Alpha Cen exclusion in the skybox code.

Code in support for star gravity. Warp drives should experience drag closer to
these bodies.

Somewhere during all this, you'll need to put a sun shader on your stars.

Now, code flying between stars. The procedural stars should support
the whole coordinate snapping mechanism. The requirements are as follows:

  • You should have navigational systems that understand finding stars, setting
    stars as jump destinations, etc.
  • The coordinates should snap / translate to the new system either before,
    during, or after, the jump (whatever ends up making more sense).

The keep the skybox working properly, it might make sense to unsnap from the
local star after 0.9ly. This could even be the standard in-game definition of
unspecified territory. In that, maybe just snap to local imaginary area. If
coordinates are displayed in-game, the area name should be 'void space'.

This might also be a good time to start with writing ship modules. Creating
a nav module in tandem with writing the navigation system could, for example,
reveal non-obvious problems that should be dealt with sooner rather than later.

Once you can fly between stars properly, start with the skybox implementation and
optimisation. That way you don't see a jarring 10k stars fighting for depth
accuracy.

@aggregate1166877 aggregate1166877 added this to To do in Pre-alpha grind via automation Dec 5, 2021
@aggregate1166877 aggregate1166877 moved this from To do to Parent issues in Pre-alpha grind Dec 5, 2021
@aggregate1166877 aggregate1166877 added pre-alpha grind Pre-alpha MVP task: tasks used as rough indication of what needs to be done to get out of pre-alpha parent issue Contains multiple subtasks labels Dec 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
parent issue Contains multiple subtasks pre-alpha grind Pre-alpha MVP task: tasks used as rough indication of what needs to be done to get out of pre-alpha
Projects
Pre-alpha grind
Parent issues
Development

No branches or pull requests

1 participant