This is a starter template for creating 2D RPG games with Godot Engine 4.4. It includes basic structures and systems commonly used in RPG games.
- Player System: Character movement, stats, combat, and interactions
- Dialogue System: NPC conversations with branching options and conditions
- Inventory System: Item management, equipment, and usage
- Quest System: Quest tracking with objectives, rewards, and state management
- Enemy AI: Basic enemy behavior with patrolling, chasing, and attacking
- Level Management: Scene transitions and state preservation
- UI System: Menus, dialogue panels, inventory screens, and more
/scenes: Game scenes/Player.tscn: The main player character/UI: UI-related scenes/levels: Game levels (Village, Forest, etc.)
/scripts: GDScript code/entities: Character scripts (Player, NPC, Enemy)/ui: UI scripts/levels: Level-specific scripts/autoload: Global scripts (GameManager, DialogueManager, InventoryManager)
/data: JSON data files/dialogue.json: NPC conversation data/items.json: Item definitions/quests.json: Quest definitions
- Open the project in Godot Engine 4.4 or higher
- Run the project (F5) to start from the Main Menu
- Click "New Game" to start a new game
- Use WASD or arrow keys to move the player
- Press E to interact with NPCs and objects
- Press SPACE to attack
- Press I to open the inventory
This template uses placeholder graphics (colored rectangles), making it easy to replace with your own assets:
- Replace the ColorRect nodes with Sprite nodes
- Add your own images to each Sprite
- Create animations in the AnimationPlayer nodes
- Update the TileMap with your own tiles for the environment
The GameManager (scripts/autoload/GameManager.gd) handles:
- Global game state
- Player stats and progression
- Quest tracking
- Game flags for story progress
- Save/load functionality
The DialogueManager (scripts/autoload/DialogueManager.gd) provides:
- Loading dialogue data from JSON
- Handling NPC conversations
- Branching dialogue options
- Conditional responses based on game state
- Dialogue-triggered actions (giving items, updating quests)
The InventoryManager (scripts/autoload/InventoryManager.gd) manages:
- Player inventory
- Item database
- Equipment system
- Item usage
- Item effects
- Add item definitions to
data/items.json - Create item sprites (if needed)
- Update InventoryManager._load_item_database() if needed
- Add NPC dialogue to
data/dialogue.json - Create a new CharacterBody2D with the NPC script
- Set the npc_id to match the dialogue data key
- Add quest definitions to
data/quests.json - Connect to NPC dialogue in
data/dialogue.json - Create quest-specific events in level scripts
- Create a new CharacterBody2D with the Enemy script
- Configure enemy stats and behavior
- Add to the appropriate level scene
- Create a new scene with the necessary components (TileMap, YSort, etc.)
- Create a script that extends the level functionality
- Add level transitions in connected level scripts
This template is provided as-is for educational purposes. Feel free to use it as a base for your own projects.
Created with Godot Engine 4.4.