WorldScene ​
Inherits: Node3D
WorldScene manages all objects within a specific map/scene Handles object discovery, tracking, and provides query methods
Properties ​
WorldData | world_data | |
TerrainProvider | terrain_provider | |
Marker3D | party_spawn | |
Array[Marker3D] | respawn_points | [] |
Callable | generate_minimap | _generate_minimap |
Callable | fit_minimap_button | fit_minimap_to_terrain |
float | minimap_size | 512.0 |
Vector2 | minimap_center | Vector2.ZERO |
int | minimap_grid_divisions | 4 |
Vector2i | minimap_image_size | Vector2i(512, 512) |
MapQuality | map_preview_quality | MapQuality.MEDIUM |
MapQuality | zone_map_quality | MapQuality.HIGH |
Callable | generate_map_preview_button | _generate_map_preview |
Callable | generate_zone_maps_button | _generate_zone_maps |
Callable | generate_reference_sheet_button | _generate_reference_sheet |
Variables ​
bool | objects_discovered_flag | false |
Methods ​
Dictionary | get_world_objects() |
bool | fit_minimap_to_terrain() |
Array[Dictionary] | get_zone_map_plan() |
float | get_map_top() |
AABB | get_scene_bounds() |
Rect2 | get_map_rect() |
String | get_terrain_surface_type( target_position: Vector3 ) |
Dictionary | get_ground_hit( position: Vector3 ) |
int | get_world_id() |
String | get_display_name() |
Signals ​
objects_discovered() ​
Emitted when object discovery is complete
object_interacted( interactable: InteractableObject ) ​
Emitted when an object is interacted with
world_objects_ready() ​
Emitted when all world objects have been collected and are ready for registration
world_scene_ready() ​
Emitted when the world scene is fully ready (after _ready() completes)
Enumerations ​
enum MapQuality ​
Quality preset for full map preview capture
- LOW =
256 - MEDIUM =
512 - HIGH =
1024 - ULTRA =
2048
Property descriptions ​
WorldData world_data ​
WorldData reference for this scene
TerrainProvider terrain_provider ​
Terrain3D reference for surface detection
Marker3D party_spawn ​
Party spawn point marker
Array[Marker3D] respawn_points = [] ​
Respawn/checkpoint points for player death respawning
Minimap Settings
Callable generate_minimap = _generate_minimap ​
A button of the editor: makes the picture of the mini map.
Callable fit_minimap_button = fit_minimap_to_terrain ​
A button of the editor: sets the size and the middle of the minimap to the area of the terrain of this scene (a world with no terrain keeps the numbers you typed).
float minimap_size = 512.0 ​
Total world area to cover (will be divided into grid tiles)
Vector2 minimap_center = Vector2.ZERO ​
The middle of the area the minimap covers (x, z in metres). 0, 0 for a world built round the origin; Fit Size to Terrain sets it for a terrain that is not
int minimap_grid_divisions = 4 ​
Number of grid tiles per side (map_size will be divided by this)
Vector2i minimap_image_size = Vector2i(512, 512) ​
Size of the image to capture per grid tile (pixels)
Map Preview Settings
MapQuality map_preview_quality = MapQuality.MEDIUM ​
The size of the picture of the map preview.
MapQuality zone_map_quality = MapQuality.HIGH ​
The size of the picture of each zone (the pictures of the zones for the world map).
Callable generate_map_preview_button = _generate_map_preview ​
A button of the editor: makes the map preview.
Callable generate_zone_maps_button = _generate_zone_maps ​
A button of the editor: makes a picture of every zone of the world for the world map (files in the maps folder of the world).
Callable generate_reference_sheet_button = _generate_reference_sheet ​
A button of the editor: makes the reference sheet for drawing a stylized map (a grid, the borders of the zones, a text file of the numbers).
Variable descriptions ​
bool objects_discovered_flag = false ​
Whether object discovery has been completed
Method descriptions ​
Dictionary get_world_objects() ​
Get world objects from live scene tree at runtime Always collects current instances to ensure we work with actual scene nodes
bool fit_minimap_to_terrain() ​
Sets the size and the middle of the minimap to the area of the terrain of this scene, so the minimap covers all of it. The size is the longer side of the terrain, rounded up to 4 m. A world with no terrain is not changed: type its size and middle by hand. Says how sharp the tiles will be, so the divisions and the image size can be raised for a big terrain. Returns false when there is nothing to fit to
Array[Dictionary] get_zone_map_plan() ​
What Generate Zone Maps takes a picture of (see WorldMapMaker.plan_zone_maps)
float get_map_top() ​
Where the camera goes to see all of the world from above: over the highest ground (or the top of the scene bounds)
AABB get_scene_bounds() ​
Get the bounds of the entire scene (uses same area as minimap)
Rect2 get_map_rect() ​
The area of the world (x, z) the map picture shows: a square round the terrain when the scene has one, else the square of the minimap size. Its corner is on the grid of 4 m, the cell of the zones
String get_terrain_surface_type( target_position: Vector3 ) ​
The kind of ground at a position (for footsteps): the object under it first, then the terrain.
Dictionary get_ground_hit( position: Vector3 ) ​
Updated raycast to return the full result dictionary The ground under a foot at a position, from half a metre above it to a metre below: {"position", "normal", "collider"}, or {} when there is none (for the marks on the ground)
int get_world_id() ​
Get world ID
String get_display_name() ​
Get world name