Class ClientMapSystem
The state both map panels share: which scene is being mapped, how much of it the character has explored, what they have pinned to it, and the overhead camera that photographs it.
public static class ClientMapSystem
- Inheritance
-
ClientMapSystem
- Inherited Members
Remarks
Why the panels do not each own this. The minimap and the world map draw the same world, and almost everything they need is expensive to have twice: a second fog grid is a second quarter-megabyte that has to be revealed in step with the first or the two maps disagree about where the player has been; a second overhead camera is a second full scene render every frame; a second note list is a second writer to the same file. Both panels are views onto this.
Lifetime. Driven entirely from SetCharacter(IPlayerCharacter) and Tick(), which the minimap calls — it is the panel that is always present. The world map reads the same state and works whether or not the minimap is open, but a build that removes the minimap panel entirely has to drive this from somewhere else.
Properties
Character
The character whose map is being shown.
public static IPlayerCharacter Character { get; }
Property Value
Definition
The current scene's map definition, or null when it has none.
public static WorldMapDefinition Definition { get; }
Property Value
DetailsCache
The scene details cache, supplied by whichever panel loads first.
public static WorldSceneDetailsCache DetailsCache { get; set; }
Property Value
Filter
The rule deciding which markers may be drawn.
public static MapMarkerFilter Filter { get; }
Property Value
Fog
The character's explored map for the current scene, or null before one loads.
public static FogOfWarMap Fog { get; }
Property Value
IsMapImageLoading
Whether the baked map image is still being loaded.
public static bool IsMapImageLoading { get; }
Property Value
MapImage
The baked overhead image for the current scene, or null when there is none.
public static Texture2D MapImage { get; }
Property Value
- Texture2D
MapRect
The world rectangle the current scene's map covers.
public static Rect MapRect { get; }
Property Value
- Rect
Notes
The character's notes for the current scene.
public static List<MapNote> Notes { get; }
Property Value
Renderer
The overhead camera feeding the minimap.
public static MinimapCameraRenderer Renderer { get; }
Property Value
SceneDetails
The current scene's details from the cache, or null when the scene is unknown to it. Holds the authored waypoints the map draws once they are discovered.
public static WorldSceneDetails SceneDetails { get; }
Property Value
SceneDisplayName
The scene's player-facing name.
public static string SceneDisplayName { get; }
Property Value
SceneName
The scene the loaded state belongs to.
public static string SceneName { get; }
Property Value
Methods
AddNote(Vector3, string, string, int)
Adds a note at a world position.
public static MapNote AddNote(Vector3 position, string title, string text, int colorIndex)
Parameters
positionVector3Where to pin it.
titlestringThe note's title.
textstringThe note's body.
colorIndexintWhich palette colour to draw the pin in.
Returns
- MapNote
The note, or null when the character's note allowance is full.
ExploreArea(Rect)
Explores every chunk a world-space rectangle touches.
public static int ExploreArea(Rect worldArea)
Parameters
worldAreaRectThe rectangle, on the XZ plane, in world metres.
Returns
- int
How many chunks this explored that were not explored already.
ExploreAround(Vector3, float)
Explores every chunk within a radius of a world position.
public static int ExploreAround(Vector3 worldCenter, float radius)
Parameters
worldCenterVector3Centre of the area, in world space.
radiusfloatRadius in world metres.
Returns
- int
How many chunks this explored that were not explored already.
Remarks
The shape a consumable usually wants: "reveals the land within five hundred metres". A chunk counts when the circle reaches any part of it.
ExploreChunk(int, int)
Explores one chunk by its grid coordinates.
public static bool ExploreChunk(int chunkX, int chunkZ)
Parameters
Returns
- bool
True when that chunk had not been explored before.
Remarks
For content that names chunks directly. Grid coordinates are only meaningful alongside the scene's bounds and chunk size, both of which change when a level designer moves a boundary volume — so anything authored against them should be re-checked when that happens. Naming a world position through ExploreAround(Vector3, float) does not have that problem and is the better choice unless the grid is genuinely what is being described.
ExploreEverything()
Explores the whole of the current scene.
public static void ExploreEverything()
Remarks
For the map that hands a player an entire zone. A scene whose definition disables fog is already fully explored and has nothing to save, so this does nothing there.
Flush()
Writes anything outstanding immediately.
public static void Flush()
Remarks
Called on scene change, character change and application quit. The debounce is a throughput optimisation, not a durability policy — every path that ends the current map's life has to close it out, or the last stretch of walking before a zone change is silently lost.
RemoveNote(long)
Removes a note.
public static bool RemoveNote(long noteID)
Parameters
noteIDlongThe note's identifier.
Returns
- bool
True when a note was removed.
SetCharacter(IPlayerCharacter)
Points the map subsystem at a character, loading everything for the scene they are in.
public static void SetCharacter(IPlayerCharacter character)
Parameters
characterIPlayerCharacterThe local player character, or null to tear down.
Shutdown()
Tears everything down. Called on quit to login.
public static void Shutdown()
Tick()
Advances the fog, and writes it when it has settled.
public static void Tick()
Remarks
Called from the minimap's per-frame update whether or not the minimap is visible. That is deliberate: exploration is something the character does by walking, not something they do by looking at a map, and tying it to the panel's visibility would mean a player who closed their minimap stopped revealing the world.
UpdateNote(long, string, string)
Replaces a note's text.
public static bool UpdateNote(long noteID, string title, string text)
Parameters
Returns
- bool
True when a note was found and updated.
Events
OnNotesChanged
Raised when a note is added, edited or removed.
public static event Action OnNotesChanged
Event Type
OnSceneMapChanged
Raised when the loaded scene changes, so panels can rebuild everything derived from it.
public static event Action OnSceneMapChanged