Skip to content

WorldContainer ​

Inherits: Node3D

Lightweight coordinator for world management Handles world transitions and delegates object queries to the current WorldScene

Variables ​

ObjectRegistryobject_registry
PartyManagerparty_manager
ChronoManagerchrono_manager
WorldScenecurrent_world_scenenull :
WorldDatacurrent_world_data
boolis_loading_worldfalse
Dictionarypersistent_worlds_cache{}
Dictionarysession_worlds_cache{}
FogOfWarSystemfog_of_war_systemnull
Dictionaryfog_exploration_cache{}
WeatherSystemweather_system
ZoneTrackerzone_tracker
ZoneLookDriverzone_look_driver

Methods ​

voidload_world( system_hub: GameHost.SystemHub, world_data: WorldData, pending_spawn_override: Dictionary = {}, loading_screen: LoadingScreen = null )
voidunload_current_world()
voidapply_world_environment_overrides( system_hub: GameHost.SystemHub, world_data: WorldData )
voidposition_party_at_spawn( world_data: WorldData, pending_spawn_override: Dictionary )
InteractableObjectfind_rabbit_hole_by_unique_id( unique_id: int )
intget_current_world_id()
WorldDataget_current_world_data()
WorldSceneget_current_world_scene()
boolis_loading()
Dictionaryto_save_data()
voidfrom_save_data( save_data: Dictionary )
voidreset_session_state()
voidclear_fog_exploration_cache()
boolis_fog_of_war_active()
GameplayConfig.FogStateget_fog_state_at_position( world_position: Vector3 )

Signals ​

world_loading_started( world_data: WorldData ) ​

Emitted when a new world starts loading

world_loading_finished( world_scene: WorldScene ) ​

Emitted when a new world finishes loading

world_unloaded( world_data: WorldData ) ​

Emitted when a world is unloaded

Variable descriptions ​

ObjectRegistry object_registry ​

Entity & Object Managment system

PartyManager party_manager ​

PartyManager refrence

ChronoManager chrono_manager ​

ChronoManager reference for time-based logic

WorldScene current_world_scene = null : ​

Reference to the currently loaded WorldScene

WorldData current_world_data ​

Reference to the current world's data

bool is_loading_world = false ​

Whether we're currently loading a world

Dictionary persistent_worlds_cache = ​

Runtime cache for persistent worlds (survives transitions, saved in main save)

Dictionary session_worlds_cache = ​

Runtime cache for the worlds that only last the session (SESSION_ONLY): remembered while the game runs, never written to a save

FogOfWarSystem fog_of_war_system = null ​

The fog of war system for the current world

Dictionary fog_exploration_cache = ​

Cache of fog exploration data per world (persists across world transitions) Key: world_id (int), Value: FogExplorationData

WeatherSystem weather_system ​

Weather system

ZoneTracker zone_tracker ​

Watches which zone the party is in (the events, the condition, the banner and the text tokens ask it)

ZoneLookDriver zone_look_driver ​

Gives the party the sky and the environment of the zone it is in.

Method descriptions ​

void load_world( system_hub: GameHost.SystemHub, world_data: WorldData, pending_spawn_override: Dictionary = {}, loading_screen: LoadingScreen = null ) ​

Load a world using WorldData

void unload_current_world() ​

Unload the current world

void apply_world_environment_overrides( system_hub: GameHost.SystemHub, world_data: WorldData ) ​

Applies the environment of a world (its sky, light, weather), the override of the world or the default one.

void position_party_at_spawn( world_data: WorldData, pending_spawn_override: Dictionary ) ​

Places the party at the spawn point of the world (or the spawn override of a world change). Called when the world is loaded, and again when a new game creates its party.

InteractableObject find_rabbit_hole_by_unique_id( unique_id: int ) ​

Find rabbit hole by unique ID (delegates to WorldScene)

int get_current_world_id() ​

Get current world ID

WorldData get_current_world_data() ​

Get current world data

WorldScene get_current_world_scene() ​

Get current world scene

bool is_loading() ​

Check if currently loading a world

Dictionary to_save_data() ​

Save current game state (called by SaveLoadUtil.save_game)

void from_save_data( save_data: Dictionary ) ​

Load game state (called by SaveLoadUtil.load_game)

void reset_session_state() ​

A new game starts without what the last game left behind: the remembered worlds and the explored fog

void clear_fog_exploration_cache() ​

Clear fog exploration cache (for new game)

bool is_fog_of_war_active() ​

Check if fog of war is active

GameplayConfig.FogState get_fog_state_at_position( world_position: Vector3 ) ​

Get fog state at a world position