Outer-Wilds-New-Horizons / new-horizons

A tool for modifying or creating new planets, dialogue, ship logs, and more for Outer Wilds.
https://nh.outerwildsmods.com/
MIT License
42 stars 15 forks source link

Allow HourglassTwins marker type without invoking the FocalPoint machinery #847

Closed tgiddings closed 3 weeks ago

tgiddings commented 2 months ago

Feature

It is my understanding that MarkerType.HourglassTwins is what allows the marker to disappear when viewed up close in the map. This would be useful for any named cluster of objects where the individual markers would clash when viewed from afar. However, currently the only code path in New Horizons that sets this checks for the FocalPoint configuration, and this configuration also overrides the gravity settings of the body it's applied to and the orbit settings of the bodies referenced as primary and secondary.

Context

Consider the following example. It would not be possible to rework "Equilateral Trinary" to use FocalPoint, since the gravity would be too small and none of the bodies are 180 degrees apart. I would like to be able to add a configuration to "Equilateral Trinary" which results in its map marker popping out at the same time that the map markers for the individual bodies pop in.

{
    "name": "Equilateral Trinary",
    "$schema": "https://raw.githubusercontent.com/Outer-Wilds-New-Horizons/new-horizons/main/NewHorizons/Schemas/body_schema.json",
    "starSystem": "SolarSystem",
    "Base": {
        "surfaceSize": 1,
        "surfaceGravity": 3636,
        "soiOverride": 0,
        "hasMapMarker": true
    },
    "Orbit": {
        "semiMajorAxis": 13000,
        "primaryBody": "SUN",
        "isTidallyLocked": true
    }
}
{
    "name": "Trinary 1",
    "$schema": "https://raw.githubusercontent.com/Outer-Wilds-New-Horizons/new-horizons/main/NewHorizons/Schemas/body_schema.json",
    "starSystem": "SolarSystem",
    "Base": {
        "groundSize": 100,
        "surfaceSize": 101,
        "surfaceGravity": 12,
        "hasMapMarker": true
    },
    "Orbit": {
        "semiMajorAxis": 700,
        "primaryBody": "Equilateral Trinary",
        "isMoon": true
    }
}
{
    "name": "Trinary 2",
    "$schema": "https://raw.githubusercontent.com/Outer-Wilds-New-Horizons/new-horizons/main/NewHorizons/Schemas/body_schema.json",
    "starSystem": "SolarSystem",
    "Base": {
        "groundSize": 100,
        "surfaceSize": 101,
        "surfaceGravity": 12,
        "hasMapMarker": true
    },
    "Orbit": {
        "semiMajorAxis": 700,
        "primaryBody": "Equilateral Trinary",
        "isMoon": true,
        "trueAnomaly": 120
    }
}
{
    "name": "Trinary 3",
    "$schema": "https://raw.githubusercontent.com/Outer-Wilds-New-Horizons/new-horizons/main/NewHorizons/Schemas/body_schema.json",
    "starSystem": "SolarSystem",
    "Base": {
        "groundSize": 100,
        "surfaceSize": 101,
        "surfaceGravity": 12,
        "hasMapMarker": true
    },
    "Orbit": {
        "semiMajorAxis": 700,
        "primaryBody": "Equilateral Trinary",
        "isMoon": true,
        "trueAnomaly": 240
    }
}
xen-42 commented 2 months ago

Does this not achieve what you want to do here, under the Orbit module image Think the wording on these is a bit confusing, but I think if Equilateral Trinary had its fade start distance equal to the fade end distance of the other 3 it'd do what you're trying to achieve, right?

MegaPiggy commented 2 months ago

Does this not achieve what you want to do here, under the Orbit module image Think the wording on these is a bit confusing, but I think if Equilateral Trinary had its fade start distance equal to the fade end distance of the other 3 it'd do what you're trying to achieve, right?

That is different. He is talking about the map markers that show the name of the object. https://github.com/Outer-Wilds-New-Horizons/new-horizons/blob/e0a28557e207e51e829c7cced0f03ea9b5520499/NewHorizons/Builder/General/MarkerBuilder.cs#L18-L39

The display distances for the markers depend on the type

switch (_markerType)
{
    case MarkerType.Planet:
    case MarkerType.Ship:
    case MarkerType.Probe:
        _maxDisplayDistance = 50000f;
        break;
    case MarkerType.HourglassTwins:
        _maxDisplayDistance = 50000f;
        _minDisplayDistance = 5000f;
        break;
    case MarkerType.ShipLog:
        _maxDisplayDistance = 50000f;
        _disableMapMarker = true;
        break;
    case MarkerType.Sun:
        _maxDisplayDistance = 1E+10f;
    case MarkerType.Moon:
    default:
        _maxDisplayDistance = 5000f;
        break;
    case MarkerType.Player:
        _maxDisplayDistance = 0f;
        break;
}
tgiddings commented 2 months ago

@MegaPiggy is correct about what I'm wanting. Name markers clash and create visual noise much more readily than orbit lines.

Also, the behavior of orbitLineFadeEndDistance and orbitLineFadeStartDistance are backwards from their descriptions. orbitLineFadeEndDistance caused the orbit line to fade when close.