The Big Refactoring - Chapter 3
Town Alight Dev Diaries – The Big Refactoring
Hello everyone!
Welcome back to The Big Refactoring, where I explain the significant changes we’ve made to Town Alight since we published its first version. Feel free to ask any questions about the development process in the comments! Today, I'll share how we've customized various elements in the game to enhance its complexity and gameplay depth.
Chapter 3: Resourceful Resources
Let’s talk about an important aspect of game design: customization. When you play an RPG, you may control multiple characters. Some are tall, some short. Some deal damage, others heal. And some are only there to be cannon fodder. But have you ever wondered if each character needs to be coded from scratch? Probably not! They likely all originate from the same base script, with customizations applied to make each one unique.
In the original game jam version of Town Alight, we couldn’t afford the luxury of customizing different elements. While this is a very useful practice, we only had two weeks to create the game, and customization wasn’t a top priority. But all that has changed! With more time on our hands, I’m excited to show you how we’ve customized various aspects of the game.
Villagers
Let’s start with the main characters of Town Alight. In the original version, all the villagers shared the same script—the only difference between them was their sprites. Now, let’s take a look at Kevin and Olu, two of the new, brilliant villager designs made by Doops:
It wouldn’t be fair to give them identical stats, considering their unique body types and strengths. These differences make them valuable in different situations, and, as with any good team, their diversity is their strength. Does this mean we need new scripts for each character? Not at all!
Fortunately, Godot offers a powerful feature called Resource, which allows us to customize each villager’s stats without altering the base script. This also helps prevent anyone from accidentally breaking the script (looking at you, Doops). Here are the stats that currently differentiate our villagers, with more to come as the game grows:
- Movement Speed
- Water Filling Speed
- Fire Delay by Throw
- Water Used by Throw
Knowing this, would you use the same villagers in every situation? What other stats would you like us to include for each character? Let us know in the comments!
Structures
Villagers aren’t the only ones having fun. Now that structures are no longer part of the tilemap, we’ve been able to include a host of new, complex interactions. But first, what is a structure? Simply put, it’s any element that villagers can interact with (besides fires). Since The Big Refactoring, structures follow this hierarchy:
Using inheritance to design the structure system offers several advantages. Here are a couple of examples:
- If I want to add a new building, I don’t need to worry about setting up its ignite resistance. Since it’s a structure, those basic properties are already sorted.
- If I want to create a critter, it will already have a signal that triggers whenever it burns, and I only need to code its unique behavior (maybe it smells good when burning?).
Levels
Since The Big Refactoring, levels are now fully customizable, allowing for a more dynamic and varied gameplay experience! If you remember the game jam version, every level had the same objective: put out all the fires before the town was scorched or the mayor’s house burned down. Well… I don’t want to ruin the surprise (not yet, at least), but levels will have different objectives in the final version.
Previously, levels were named sequentially: Level1.tscn, Level2.tscn, and so on. The level loader simply tracked the current number and loaded the next one. Now, things work differently. Each level is represented by a Resource with properties like these:
- ID
- Name
- Description
- Level Type
- Levels Unlocked by Level
Among other things, this change means the game experience will no longer be as linear! I’ll dive deeper into this in a future dev diary, but I hope this change excites you as much as it excites me.
That’s all from me for now. Which changes are your favorites? Do you have ideas for unique villager or structure behaviors? What would you like to see in future levels? Let us know in the comments!
This might be the last entry for The Big Refactoring series—for now—but fear not! I'll be back soon with another dev diary focusing on exciting new features in Town Alight. See you then!
–Anthuulos
Get Town Alight
Town Alight
Micromanage a group of villagers as they fight a spreading fire.
Status | In development |
Authors | Anthuulos, Doops, nova harbor |
Genre | Strategy |
Tags | 2D, Indie, Pixel Art, Real time strategy, Top-Down |
Languages | English |
More posts
- The Big Refactoring - Chapter 227 days ago
- The Big Refactoring - Chapter 144 days ago
- The Big Refactoring - Chapter 059 days ago
Leave a comment
Log in with itch.io to leave a comment.