I’ve been writing a 3D City-Builder, inspired by The Settlers and Timberborn, amongst others.
Set in a spooky Victorian Model Town, you build up your City, and watch the Citizens work away… until Disasters strike! Can you rebuild Hawk Hill Manor, and uncover the Secret of the Scarlet Sisters?
As I struggled to find any specific guidance on City Builders, I have started writing my own Guide/Tutorial. It is very much a Work-in-Progress, and I would appreciate feedback!
7 Likes
I love city builders!
will take a look and try to follow this tutorial as soon as i have some free time
nice to see another case of “i did not find any tutorials/resources, so i did my own” around Godot 
1 Like
I’m currently rewriting the Tutorial, and it’s very much a work-in-progress, but I would appreciate any feedback
Ok,
i had about an hour to start your tutorial today.
got to the third part, with no real issues so far.
the only “technical” issue i found is:
When pasting code from your web into a script inside Godot i always get a “Invalid white space character U+00A0” error in all blank lines. I got the error when using the copy button in your code blocks but not when i copied the text inside the blocks.
I found your instructions (deliberately i think) enough to find all i needed to do, without being a microstep following tutorial.
Hopefully i can continue with the UI part tomorrow.
thanks!
1 Like
Thanks!
Yes, there seems to be something about the wiki software that inserts an extra character (I think a “Non-Breaking Space”). I am looking into what can be done about his, if anything
I’m learning a lot, and also refreshing some old knowledge about Godot, with your tutorial!
Also: Great sponsors you got there! and nice touches of british humor 
i found some minor typing errors here and there, but nothing that makes thing confusing.
only “error” i found today is in part 13, at the “find_actor” function code block.
Last line is “current_actor.mesh.albedo = "
I think it should be current_actor.mesh.albedo = worker_colour”
or maybe finding that out was part of the tutorial.
Your notes and links are also of great help.
thanks again for your work!
1 Like
Well done for spotting the “deliberate mistake”! You correctly solved the challenge!
(Haha! No, that was me getting muddled in editing, and forgetting to fix that bit! I think it still does not work, and I’ll have to come back to it later)
Thanks for the feedback. Great to know it is helping.
I’ve still got a few more Core sections to add, but am now wondering when to stop! 
Once I reach a certain point, can I leave the Tutorial at “Now you should be able to add extra Features yourself!” ?
Yesterday i finally got stuck in the tutorial, at the end of part 16 my workers are not planting!!
I took some time to review everything related to them being assigned a job, i don’t think i skipped any steps. Will give everything another look later today, and hopefully find the error/mistake.
I think getting stuck is great when learning, a bit struggle and an oportunity to check if i understood and can fix it is the way to go!
I see you added some more pages lately, thanks for your work!
1 Like
Sorry you’re hitting bugs! I’ll take a glance at what I’ve written, see if I’ve missed anything!
You are right, it can be good to run in to problems, see if you can fix them! It can help with understanding what is actually going on, rather than just copy/pasting code! 
The Worker should arrive at the Workplace (PlanterBuilding) and enter WorkingState. WorkingState update() will match the Type of workplace, and move to the appropriate State (WalkingState, Target: PlantingSpot). When they arrive at PlantingSpot, a Sapling is Instanced, and the Worker goes back to Workplace
I find that littering my code with print() statements can track down what is going on, what functions are firing,
Pines are planted and growing as i write this!!!
Found my mistake, i was overriding the “process” function from the BuildingObject class in the planter_building script, i accidentally left the empty “_ready” and “_proc” from the template
got to find the problem spamming some “print” debug lines
then i got into another problem, looks like “.mesh.albedo” is not the way to access the albedo color property of the “MeshInstance3D” in Citizen. As it is not a property of the CharacterBody3D.
Just commented that line for now, will read some gdscript reference tomorrow to try to find out the correct way to do it.
thanks for your response!
1 Like
Glad you got it figured out! (Spamming debug prints is a great tool - right up until you hit “Too Mamy Prints! 100,000 lines! Please sort this out!” Errors!
)
Hopefully you are seeing the structure of how the game is written. If you’re at Planting, maybe you can see how Gathering and Manufacturing are going to work?
Once “Placing Buildings” and “Making Citizens go to Work and Do Things” are sorted, a lot of the rest is just iterating on the same ideas.
Yes, the albedo change does not work. I will look into that, as I did have it working in a previous version. Do let me know if you find a way to change Citizen Colour! 
Feel free to drop me a line if you have any queries!
Still trundling along with this Tutorial, but I’ve decided to rewrite the Trading/Import/Export system (well, the UI for it), so updates may be delayed
Also, I’m running out of ideas for the Intermissions. What would give you a nice break from the coding?
For now, the Main Systems are completed.
Buildings, Citizens and Import/Export should be working, and expanding the World is extensions on these concepts
We have a few alterations and additions that I feel will round things out, but for now, we’ll be taking a Well-Earned Break!
Hi!
I had a busy week, so i couldn’t get past part 17 on the tutorial.About intermissions, maybe you could find some international sponsors! 
I will try to advance some steps today and tomorrow (thanks to the Pope visiting our country i don’t have to work…)
Thanks again for your work
1 Like
Part 17 is quite a bit of work - The Worker State Machine is the heart of what Citizens do! If you can get your head around it, a lot of expansions and additions can fall in to place!