Dungeon Tools - EasterEggProductions/adventure-mode-godot GitHub Wiki
Dungeon Tools is a system building dungeon levels, as well as managing the synchronization of dungeon-specific data between players. Levels are contained in a separate Godot scene from the overworld, and are linked together using doors with transition triggers.
DungeonButton: A button for the player to walk on
DungeonDoor: A basic door that can be triggered by other dungeon objects
Spawnpoint3D: Defines a point in a scene where players will spawn in. This could be an initial entry point, or become a target for an Exit Zone. There are three Spawnpoint subtypes: Default, Multiplayer, and "Walk-in."
ExitZone3D: Defines a 3D area in a scene where players will transition from one scene to another. When an ExitZone3D is created, a target scene and Spawnpoint3D should be selected in the editor to set it up.
Dungeon Tools provides support for linking dungeon objects across separate Godot scenes. The most obvious use-case for this behavior is triggering an event/door in another scene when a player interacts with a toggle-able dungeon object in the current scene.
All dungeon objects have a Remote Connections variable within the editor. This is an array that stores ObjectConnection resources.
The ObjectConnection resource stores all necessary data for a single cross-scene connection between objects. The required fields are:
- Scene Path: The file path for the scene that contains the remote dungeon object
- Affected Properties: Dictionary that stores all properties and their changed values for when the dungeon object is triggered
- Object Name: The name of the remote dungeon object within the specified scene (This enum will be populated with all valid dungeon objects when the scene path is entered)
Dungeon state information is stored within the Dungeon State Manager. This singleton handles the synchronization of dungeon object data across multiple clients. The server has ultimate authority over the dungeon state, where clients send state updates to the server and the server then verifies and broadcasts this state change among all the connected clients.
Another component of the Dungeon Tools module are the editor gizmos. Gizmos are helpful graphical elements within the Godot editor for the purpose of debugging and communicating information about nodes. As of the time of writing, there are currently two gizmos in Dungeon Tools:
- Dungeon Button: Draws a yellow line between a dungeon button and the door it is connected to.
- Spawnpoint3D: Draws a 3D orange ring that changes shape depending on the Spawnpoint's subtype.
- [x] Generalized state synchronization between clients for all dungeon objects
- [x] Synchronization among the different dungeon scenes so that players in different rooms maintain the same game state.
- A good selection of dungeon objects that can be used to construct interesting dungeon levels
- A modular design that allows the user to expand upon the template, creating their own specialized dungeon objects.