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
78 stars 22 forks source link

Kruzenshtern's Bugs: HyperSpace coordinates displayed incorrectly during conversation. #33

Closed Serosis closed 4 years ago

Serosis commented 4 years ago

A gentleperson named Kruzenshtern got in touch with me and sent me a lovely list of bugs that I'm entering in here so they can be tracked proper.

This is their first bug, verbatim:

When player encounters an alien ship and chooses Converse Menu Option (if offered), function HailAlien() is called.

        if (GET_GAME_STATE (BATTLE_SEGUE) == 0)
    {
        // Not offered the chance to attack.
        status = HAIL;
    }
    else if ((status = InitEncounter ()) == HAIL && LocDataPtr)
    {
        // The player chose to talk.
        SET_GAME_STATE (BATTLE_SEGUE, 0);
    }
    else
    {
        // The player chose to attack.
        status = ATTACK;
        SET_GAME_STATE (BATTLE_SEGUE, 1);
    }

    if (status == HAIL)
    {
        HailAlien ();
    }

comm.c/COUNT InitCommunication (CONVERSATION which_comm)

HailAlien() draws SIS message and SIS title. However if it’s not a friendly Starbase, SIS title displays only Planet Name.

                        r.corner.x = SIS_ORG_X;
            r.corner.y = SIS_ORG_Y;
            SetContextClipRect (&r);
            CommWndRect.corner = r.corner;

            DrawSISFrame ();
            // TODO: find a better way to do this, perhaps set the titles
            // forward from callers.
            if (GET_GAME_STATE (GLOBAL_FLAGS_AND_DATA) == (BYTE)~0
                    && GET_GAME_STATE (STARBASE_AVAILABLE))
            {   // Talking to allied Starbase
                DrawSISMessage (GAME_STRING (STARBASE_STRING_BASE + 1));
                        // "Starbase Commander"
                DrawSISTitle (GAME_STRING (STARBASE_STRING_BASE + 0));
                        // "Starbase"
            }
            else
            {   // Default titles: star name + planet name
                DrawSISMessage (NULL);
                DrawSISTitle (GLOBAL_SIS (PlanetName));
            }
        }

        DrawSISComWindow ();
    }

comm.c/static void HailAlien(void)

Because there are no planets in HyperSpace, it draws Last Visited planet name or leaves it empty. This issue exists in UQM v0.7.0 and MegaMod v0.8.0.84.

Steps to reproduce:

⦁ Start a New Game ⦁ Leave Solar system without visiting any planets ⦁ Wait for Probe in HyperSpace ⦁ Select Converse menu option ⦁ SIS title should be empty

image

Conversation with Probe right after New game start

However if planet is visited, SIS title will display name of Last visited location (Jupiter, Planet II e.t.c) image

Conversation with Probe after New game start and visiting Jupiter

Possible solution

Add inHQSpace check:

    if (inHQSpace ())
    {
        DrawHyperCoords (GLOBAL (ShipStamp.origin));

    }
    else if (GLOBAL (ip_planet) == 0)
    {
        DrawHyperCoords (CurStarDescPtr->star_pt);
    }
    else
    {
    DrawSISTitle (GLOBAL_SIS (PlanetName));
    }

Sidenote: in original game if ip_planet == 0, SIS Title displayed coordinates of current star, and planet name of in inner system. image

Conversation in interplanetary with ip_planet == 0 in original game

Sidenote: it is possible to draw Arilou homeworld name during their conversation in QuasiSpace, but it’s too long, and can only work in HD mode. It can be moved SIS Message but that’s just a suggestion.

if (inHQSpace ())
{
DrawHyperCoords (GLOBAL (ShipStamp.origin));

if (GET_GAME_STATE (ARILOU_SPACE_SIDE) > 1)
    {
    //Full Arilou homeworld name don't fit in SD, so it moved to SISMessage utf8StringCopy(GLOBAL_SIS(PlanetName), sizeof(GLOBAL_SIS(PlanetName)), GAME_STRING(STAR_STRING_BASE + 148));                        
    DrawSISMessage (GLOBAL_SIS (PlanetName));
    }
}

image

Conversation with Probe after fix

image

Conversation in interplanetary with ip_planet == 0 after fix

image

Arilou homeworld after fix (coords there were broken too)

Serosis commented 4 years ago

Fixed with commit 0de7e8