Godot Version
4.2.1
Question
Hi everyone,
I have a question about the general node hierarchy and the best ways to connect the various parts of my game.
Background: I am new to Godot and game design generally, but know a bit about coding. I wanted to make a simple text based game to get used to the fundamentals without worrying about graphics. A sort of resource management game where the player manages a medieval town.
I think the four main branches of my game should be (I’ve coded a lot of this already)
- Output - Mostly writing text to the screen
- Input - Handling the user’s input
- Data - Storing game data/updating/saving/etc
- MenuManager - The various ‘menus’ the user interacts with to buy/sell/check the status of things/etc. These menus would contain my game logic.
My question is: what is the best way to connect these four parts in terms of their hierarchy and how they should communicate?
For example, the Menu system needs to be able receive strings from Input, and send strings to Output, and read and write the data. Should all that happen with signals to keep them loosely connected? That seems like a lot of signals…
Or should I have a root node that handles the communication between the four branches? That seems like a lot of up-down-up-down communication that will be hard to set up…
Should the Menus be a child of Input, to have those strings feed down easily? Should Data be a child of the Menus since they interact a lot?
Should anything be global?
I’m just wondering if there are some good practices I should follow here. This seems like a problem that would crop up in one way or another in most games. Do you have any tips or tricks or things to avoid. (BTW: I do know about the concept of ‘reference down, signal up’.)
Thanks for your help!