Three professions, one town: what I learned building a life RPG solo in Godot 4.7

I’ve been building a 3D life RPG on my own in Godot 4, using GDScript. There’s a free prototype on itch.io, and I wanted to share some of the work behind its economy and NPC systems.

The game has three playable characters for this MVP: a farmer, a merchant, and a mercenary. I’m trying to give each a different daily routine within the same town. Farming, running a stall, and exploring a dungeon all need to work with the same inventory, money, and market systems.

mira_time_lapse_build108

Eventually, I want a questionnaire to assign the player’s profession. That part isn’t implemented yet.

One problem I’m working through is how much of the town’s economy to simulate. I have a broader Python model for checking the setting and a smaller economy running inside the game. They operate at different scales, so connecting them takes more than copying numbers across.

The Python model uses no external dependencies. It compares household income, taxes, cash and in-kind income, and living costs across eleven political and economic regions, with the game’s town included as a separate local sample.

I run four conditions across those twelve entries: baseline, bad harvest, trade disruption, and population pressure. That gives me 48 combinations to compare.

These are independent scenarios with assumed inputs. They don’t simulate a whole world trading with itself over time. Their purpose is to help me spot inconsistencies in the setting.

For example, the current reference basket in the home kingdom comes to 168G per day for a household of four. That includes food, housing, fuel, clothing and tools, and medical spending averaged over time. It’s a balancing assumption, and the physical quantities behind that basket still need work.

The accounting checks are more definite. The script checks that pre-tax income equals post-tax income plus tax, cash and in-kind income add up correctly, and central and local tax revenue match the total. It also checks that total income stays constant in the scenario where population rises by 25% while production stays fixed.

yorn_watering

Those checks tell me whether the arithmetic is consistent. They don’t tell me whether I’ve chosen good assumptions.

The garrison is a useful example. The town has around 2,000 residents and a registered garrison of 120. Under the current model, annual town tax revenue is about 4.68 million G. Compensating all 120 at the assumed local rate for 240 working days would cost about 6.22 million G.

The more detailed budget proposal separates 40 full-time personnel from 80 serving on rotation. That brings annual compensation to about 4.15 million G, still almost 89% of the modeled tax revenue before other expenses.

kyle_kobold_combat

Part of that compensation can be paid in grain, but grain still has a cost. The surrounding countryside and the lord’s estates need their own accounts too. I can’t count them as extra funding without also accounting for what they produce and contribute.

The setting already includes royal support having stopped three years ago. The model helps me work through what that means for the town’s finances.

Inside the game, the economy is smaller and more concrete. Daily processing already connects NPC work, production, food purchases, debt repayments, and shipments to market stock and funds.

yorn_fishing_1500_build108

Wheat, bread, and bandages use this system. Other goods still use simpler restocking rules, so there isn’t a complete production chain for every item.

NPC customers have persistent wallets and inventories. A cash purchase reduces the customer’s money. A credit sale creates a debt and a player receivable; it doesn’t immediately give the player cash. Repayments come from the NPC’s funds and can only be collected once.

The market also recalculates prices one item at a time during a bulk transaction. Selling twenty items increases stock as the sale proceeds, so you can’t sell the entire batch at the initial price. Purchases work the same way in reverse.

For goods with variable prices, the underlying market price has a floor of 0.4 times the base price and no explicit ceiling. Buying stops when stock runs out. Fixed-price items such as seeds have separate rules.

I’ve written headless tests for cash conservation, inventory changes, save/load consistency, and repeated processing of the same day. There are also checks that advancing several days at once produces the same state as processing them individually. These are the kinds of errors I want to catch before judging whether the economy feels good to play.

The NPC numbers need some explanation. I have a generated pool of 1,000 named NPCs for the wider world, but they aren’t all walking around the town.

The current economic data contains 689 profiles, with the selected player character excluded when a new game starts. Daily market activity uses a rotating sample of up to four NPCs per region. That’s separate from the smaller cast of named characters who physically follow schedules in the 3D town.

Those characters have work locations, patrol routes, and trips home. Their movement uses pathfinding and local avoidance. Going home currently means walking to a home destination and then being hidden outside; it doesn’t include a full indoor sleeping routine.

Keeping those layers separate lets me work on persistent customers and debts without putting hundreds of moving characters into a small market.

The prototype is free on itch.io, for Windows and macOS, in English and Korean. It’s still rough. If you try it, I’d like to know where you stopped playing and whether you’d come back.

I used AI tools for parts of the assets and code. The design, economy systems, NPC structure, and scenarios are my own work.

For anyone who’s built something similar: how did you connect a broad economic model to a much smaller playable market? I’m especially interested in how you chose the scale of NPC demand and trade volumes once players could buy up stock or sell large quantities into it.

8 Likes

This is a very interesting project, and it’s described in great detail. I try to keep up with projects like this, and I don’t know of any game on this scale.

I’m trying to do something similar, but I’m starting on a very small scale (a farm, a little village) and then plan to expand gradually.

As far as I understand, there’s only one currency here, and there’s no conversion between different currencies? And inflation isn’t factored in either?

Perhaps there’s no point in creating a separate thread.

Thanks for taking the time to read it!

Starting with a farm and a small village is close to how I’m approaching the playable side too. The worldbuilding and reference models cover a much larger area than the current prototype actually simulates.

You’re right about the currency. The current implementation uses one currency, G, with no exchange rates or currency conversion.

It doesn’t model monetary inflation either. Prices can rise when stock falls or transport is disrupted, but that’s a response to supply conditions. I don’t currently simulate money creation or changes in the money supply driving a general rise in prices. The Python model uses assumed price changes for its scenarios, while the in-game market responds to actual stock.

My approach is to make the underlying simulation detailed and reasonably realistic while keeping the game approachable. Players shouldn’t need to understand the whole model to enjoy it. I’m simplifying the decisions they face and how information is presented, so they can learn through playing.

For now, I’m concentrating on a small set of goods and checking that inventories, payments, shipments, and debts stay consistent. Expanding the model won’t help much if a local transaction accidentally creates money or duplicates goods.

And fair point about the separate thread. I intended that one for the broader game and this discussion for the economy, but there’s overlap. I’m happy to keep the economy discussion here.

1 Like

I’m the one who should thank you for such a detailed post. I’m very interested in this topic.

It’s a very sensible concept. I try to stick to it myself. I think it’s wonderful when a game not only entertains but also educates.

Long discussions on this forum aren’t very convenient — the engine is clunky, and there’s a limit on the number of posts. It might be more convenient to create a separate website for this game, but for now, I recommend checking out this site. There might be more potential players there (here, it’s mostly developers who make games themselves).

1 Like

I’m stuck here. There’s no way out.

Thanks for reporting this! I'm looking into it and working on a fix.

It looks like there was an issue with the collision checks. I'm running collision simulations across all routes to check for similar problems.

Thanks for playing!
I'm checking out the site you mentioned and reading through it. Thanks for pointing me to it!

Time seems to stop while fishing — is that by design?

It looks like the player is getting stuck near some rocks.

Thanks for the feedback!

The in-game clock intentionally pauses during fishing and while you’re in a dungeon. A full day currently lasts about seven real-world minutes, which I’ve sped up for testing.

With days this short, fishing and dungeon combat could take up too much of the daily schedule, so I chose to pause the clock during those activities. Weather effects still apply, though.

The clock also pauses while Mira is running her stall.

I’m still checking collision issues throughout the game world. Thanks again!

A few quick suggestions.

  1. Create a title screen that includes audio settings, monitor resolution options, and the option to launch in full-screen mode.
  2. Include several save slots.
  3. Allow players to specify the destination for character movement with a mouse click.
1 Like

A few thoughts on the dungeon.

  1. It might make sense to generate the dungeon once when you enter it or create a map. It’s a bit surprising when the same dungeon looks different every time. Although, probably not everyone will care about that.
  2. Will it be possible to recruit NPCs to join your team for clearing dungeons and other dangerous areas?

Thanks for the suggestions!

I’ve increased the number of save slots to 10 and added Load Game, New Game, Settings, and Help to the startup menu.

I’m developing on a Mac, so I’ll look into the mouse issue as well.

Thanks again!

1 Like

I chose procedural generation for the dungeons to encourage repeat visits and keep exploration from becoming too predictable.

My long-term roadmap includes multiplayer, so players can explore together. I’ll also give NPC companions some thought.

Thanks for the suggestion!

1 Like

One option is to give players a choice regarding dungeon generation:

  1. anew with every visit
  2. only on the first visit, and then save the layout.

I’ve added the features you suggested:

  • More save slots.
  • The ability to save to and load from individual slots.
  • Load Game and Help options on the startup screen.

You can download the latest version here:

Thanks for the feedback!

2 Likes

This is… bueatiful. You have made good graphics, UI and everything. You have made the RPG. I can only dream of. I like you added different systems. It kinda reminds me of albion but in a whole different league. Keep it up and also are you thinking of selling your game? If you need any help on storyline thou, I’m just a message away!

2 Likes

That’s how you build a team! BTW, that’s a very sensible suggestion, since this is indeed a very substantial amount of work, and what’s already been done shows your ability to handle it—I suggest we consider working as a team.

On this project? Ok then just send me a summary of the lore so far and I can do what I can.

My apologies. I was trying to write this to the author of this thread. If he deems it necessary, he’ll respond. I’m working on my own project.

Thank you so much! It means a lot to hear that, and I really appreciate the offer to help with the story.

Right now, I’m testing the MVP, so I’d love to hear your feedback as you play. I already have the MVP scenario and the broader setting mapped out, and that’s what I’m working from for now. I might reach out for help with the story when I get to Early Access, though. Thanks for offering!

And if you have any ideas or suggestions, feel free to share them anytime!

1 Like