Learn Python in 30 Days — Day 28: Final Project Planning (Part 1)
Day 28: Final Project Planning (Part 1)
Welcome to Day 28 of the Learn Python in 30 Days series!
For the final 3 days of the learn python in 30 days series, we’re creating something far bigger than a simple text adventure, you’re building the foundations of a full open-world RPG, complete with:- Multiple explorable regions
- Villages and interiors
- NPCs with races (human/elf/dwarf)
- Enemy creatures
- Gold, XP, magic, items
- Ownership (houses, shops)
- A tile-based world made of 5 separate 10×10 maps
- Player movement across a grid-based overworld
- Travel between maps via edges (north → new region, etc.)
A world you can continue expanding long after Day 30
This is the world-building day, your job is to create the engine, the data, and the structure that will support the next two days of map logic, combat, quests, shops, and saving/loading.
All example files for this series are available on my GitHub: Learn-Python-in-30-Days
By the end of today you will have:
-
A world system with multiple maps
-
A tile engine that tracks terrains & features
-
Villages placed on maps
-
Enterable interiors (shops, houses, farms)
-
Player stats & inventory system
-
NPC data structure for humans/elves/dwarfs/monsters
-
A modular folder structure for a growing RPG
The Vision: RetroRealm – A Console RPG Engine
Let’s give this project a name:
RetroRealm: A Python Open-World RPG Engine
Console-based, modular, expandable, retro-inspired.
You’re essentially creating a micro-scale version of early Final Fantasy, Ultima, or Zelda, but entirely text-driven.
The world consists of:
🌿 Main Region: Green Valley
10×10 overworld
Forests, rivers, mountains
1–2 villages (e.g. Stonebrook Village)
🔥 Region 2: Ashen Wastes
Volcanic desert
Creature-filled
One outpost village
❄ Region 3: Frostlands
Snow fields
Dwarven settlement
🌙 Region 4: Moonshadow Woods
Magical forest
Elven village
Hidden ruins
⚙ Region 5: Ironlands
Mines, steampunk structures
Dwarf/merchant town
Each region is a grid-based overworld.
Certain tiles contain village entrances, which load a new small local map (5×5 or 8×8).
World Structure: Maps, Tiles & Regions
We’ll create a Python structure like this:
Internally, each tile on a map is something like:
This means the player can:
-
Walk tile to tile
-
See what’s on each tile
-
Enter villages/dungeons based on tile contents
-
Encounter creatures depending on danger level
-
Be blocked from moving into / out of tiles in certain directions
Villages & Interiors
Each village is its own mini-map:
(Conceptually it’s like this; in the generators we’ll turn these into richer tile objects with movement rules.)
Entering a tile with "feature": "village" switches maps:
NPCs (Humans, Elves, Dwarfs, Creatures)
NPC template:
Monsters:
Regional encounters depend on danger level.
Player System: Stats, XP, Gold, Magic
Your player needs an actual character sheet:
Owning things means later you can add:
-
Rent income
-
Shops generating profits
-
Storage chests
-
Extra inventory slots
Folder Structure (So We Don’t Create a Giant File)
We’re moving from a tiny game to a multi-file project, with different modules:
This is exactly what you’ve been learning on Days 20–25 real project structure.
World Generator
First, make retrorealm/generators/world_generator.py.
This script:
-
Defines terrains
-
Generates 10×10 maps of tiles
-
Places 1–2 villages per region
-
Adds per-tile movement rules (north/south/east/west only)
-
Saves the whole world to
data/world.json
Run from the retrorealm/generators folder:
You’ve just built a standalone content tool that produces world.json.
You can also download this example from my GitHub here and run it yourself.
NPC Generator
Before we generate villages, we’ll make a generic NPC factory the village generator can use.
Create retrorealm/generators/npc_generator.py:
This module doesn’t save JSON itself; it just builds NPC dicts for other generators to use.
You can also download this example from my GitHub here and run it yourself.
Village Generator: interiors + NPCs
Now create retrorealm/generators/village_generator.py.
This script will:
-
Read
world.json(so it knows where villages are) -
Generate a small interior map for each village
-
Populate each village with NPCs using
npc_generator -
Give each village a name
-
Add per-tile movement rules (inside villages)
-
Save everything to
villages.json
Run in this order:
Now you have:
-
world.json→ overworld tiles + village coordinates (with movement rules) -
villages.json→ each village’s interior + NPCs (also with movement rules)
Creature Generator: region encounter data
Finally, define your creature data per region and save to JSON.
Create retrorealm/generators/creature_generator.py:
You can either:
-
Hand-edit this file as you design monsters, or
-
Later write a more advanced generator if you want randomised creatures.
Quick Preview: Loading JSON into the Game
The actual game loop will live in main.py and be built in Days 29–30, but here’s a tiny preview to show how it all connects.
What You’ve Achieved on Day 28
now that your at the end of this post you have built:
-
A world generator that builds regions and tile maps →
world.json -
A village generator that reads the world and outputs interiors + NPCs →
villages.json -
An NPC generator module used by other tools
-
A creature data generator →
creatures.json -
Per-tile movement rules (north/south/east/west) baked into your JSON data
-
A clean separation between content generation and game logic
Next up (Day 29):
-
Load these JSON files in
main.py -
Implement player movement on the overworld using each tile’s
directions -
Trigger creature encounters using the danger level
-
Add the first version of combat
All example files for this series are available on my GitHub: Learn-Python-in-30-Days
You can see the full series here Learn Python in 30 Days series!
You can see the full series here Learn Python in 30 Days series!

Comments
Post a Comment