Developer diary entry #6
What can i say? My little refactoring adventure blew up over, one thing pulls another and suddenly entire codebase needs to be rewritten... No, more like shuffled around. Not meaninglessly, things are improving because of that, old problems are being solved, while old solutions get broken in the meantime.
Sounds like your typical complex system, intricate and all, some might say to just plan better, but tell you what - it might not be possible. Perhaps this is where IQ enters the picture, as indeed, someone with a better intellectual capacity will produce a more robust system, envision and solve problems before they appear. But you can sit there, design perfect solutions, but by the time it is ready aeons would have passed and you are yet to release a demo. Maybe someone exceptionally brilliant would do a somewhat better job, a team of people would almost certainly do a better job.
What i am trying to say is that everything is a trade off on this fucking prison planet. You would see hours go by, be taunted by analytics and this is how they get you trapped in this damnable numbers game, while qualitative matters lie somewhere beyond the veil. Remember to resist the illusory world.
Anyways, what was the whole refactoring about?
Mostly about getting rid of "get_node(...)" calls, i had a lot of them everywhere.
First problem is that they are bloody brittle. Move things around and those paths risk being invalidated. Downwards calls are better than upwards ones, because when parent accesses children the compiler can at least warn you that you are about to shoot your foot off.
Now, you are supposed to use signals for upwards calls, like when child wants to do something it calls parents and all the logic happens up above where it can see everything. Well, that works when nodes are within a single scene. You can connect signals dynamically when you instantiate shit, and thanks God functions are first class these days (i think they were not prior to Godot 4). I think i already been doing that with interaction menu buttons, and i am yet to find another opportunity for connecting signals dynamically.
For now, when i need something to causally affect something else, which may as well not be even loaded into memory at the moment, i still would utilise my flag system, or store the state directly... i think eventually i would need to sort these two seemingly redundant systems out as well.
And second problem is that they create boilerplate. Any time i needed to access, well, let me call it the equivalent of GameManager, i had to write "get_node(/root/...)". Unfortunately, there is no avoiding that, a videogame without a singleton in it? Perhaps possible, but not feasible. Anyways, i simply set up my autoload to handle these, i reference it in there once via get_node root call, diminishing that boilerplate significantly. Huge bonus is that it is now mostly type safe.
Let me present you this schematic for clarity:
As you can see, loaded scenes need a way to communicate with this structure anyways. Took me long enough to figure out how to make Godot's intellisense recognise that outer structure, so that these green calls are not blind. Now they are less brittle and compiler will yell at me if i mess up the types.
There was more, of course, but i would rather not describe every single little problem i encountered along the way, as not only it would be uninteresting, but also unnecessary.
Instead of that, let me ask you... Do you remember what day is it today?
🕺🕺And we say ba-dee-ya 🪩 Say, do you remember?🕺🕺
🕺🕺Ba-dee-ya 🪩 Dancing in September🕺🕺
🕺🕺Ba-dee-ya 🪩 Never was a cloudy day🕺🕺
Get British Wonderland // Pre-Alpha v0.5.0-pre
British Wonderland // Pre-Alpha v0.5.0-pre
Conspiracy puzzle/adventure walking simulator
| Status | In development |
| Author | prikol_kot |
| Genre | Adventure, Puzzle |
| Tags | Alternate History, Atmospheric, Exploration, Mystery, Point & Click, Sci-fi, trashcore, Walking simulator |
| Languages | English |
More posts
- Addendum: on slop, data collection and everything dystopian11 days ago
- Developer diary entry #1012 days ago
- Developer diary entry #926 days ago
- Developer diary entry #843 days ago
- Developer diary entry #757 days ago
- Developer diary entry #587 days ago
- Anniversary and Intermediate update93 days ago
- Developer diary entry #4Aug 21, 2025
- Developer diary entry #3Aug 07, 2025
Comments
Log in with itch.io to leave a comment.
I forgor