JHGuitarFreak / UQM-MegaMod

A fork of The Ur-Quan Masters + HD-mod that remasters the HD graphics with a veritable smorgasbord of extra features, options, QoL improvements, and much more...
https://uqm-mods.sourceforge.net
GNU General Public License v2.0
80 stars 22 forks source link

A suggestion to make dynamic orbits in inner system #48

Closed Kruzen closed 2 years ago

Kruzen commented 4 years ago

During my tests of #45 I found that planet orbits in inner system are static despite planet position in outer system. So I've come with a small solution to it.

1) Add DrawOrbit () call to IP_Frame()

if (optOrbitingPlanets || optTexturedPlanets) 
    {
        // BW: recompute planet position to account for orbiting
        if (playerInInnerSystem ()) 
        {
            // Draw the inner system view
            ValidateInnerOrbits ();
            DrawOrbit (pSolarSysState->pOrbitalDesc, DISPLAY_FACTOR * 4, DISPLAY_FACTOR, pSolarSysState->pOrbitalDesc->radius);
            DrawInnerPlanets (pSolarSysState->pOrbitalDesc);

        } 
        else 
        {
            // Draw the outer system view
            ValidateOrbits ();
            DrawOuterPlanets (pSolarSysState->SunDesc[0].radius);
        }

2) Modify DrawSystem () so it calls DrawOrbit () only when !optOrbitingPlanets

pBaseDesc = pSolarSysState->pBaseDesc;
if (IsInnerSystem && !optOrbitingPlanets)
    {   // Draw the inner system view *planet's* orbit segment
        pCurDesc = pSolarSysState->pOrbitalDesc;
        DrawOrbit (pCurDesc, DISPLAY_FACTOR * 4, DISPLAY_FACTOR, radius);
    }

// Draw the planet orbits or moon orbits 

3) Modify DrawInnerSystem() to call DrawOrbit() (This will fix orbit pop-up effect when we leave orbit or conversation in inner system with smooth transitions)

ValidateInnerOrbits ();
DrawSystem (pSolarSysState->pOrbitalDesc->radius, TRUE);
if (optOrbitingPlanets)
        DrawOrbit (pSolarSysState->pOrbitalDesc, DISPLAY_FACTOR * 4, DISPLAY_FACTOR, pSolarSysState->pOrbitalDesc->radius);

This is a minor issue if an issue at all since planets move on their orbits extremely slow in most cases so the final decision is up to you.

Kruzen commented 4 years ago

The more I play with it the more I dislike it. It looks very stuttery from time to time and have no effect if a player not decided to stay in inner system for 7-10 minutes (on fastest moving planets). Close this case or put it on extremely low priority.

Serosis commented 4 years ago

I'll just label it as an enhancement and leave it up.