Awe, it’s awesome that you’re curious ^^ the _added are set to true as soon as it adds the data for that category to the save file. So the first time it saves kitties (which is one second after you start the game actually), it sets kitties_added to true. Even if the kitty data is just an empty array!
The reason for those variables is so that the load functions know whether or not they’re reading data loaded from a save file, or data that was just initialized (and set to default values).
The line “if _new_kitties != [] or data.kitties_added == true:” is saying “If the list is not empty, OR the list is empty but the data is from a save file, then go on to delete all the kitties in the map currently (to load the ones from the data in their place).
It technically isn’t necessary for kitties anymore, but for bowls and toys, it’s very important. Without the bowls_added variable etc, there’s no way to know whether it’s trying to load a save file that simply has no data for bowls/toys (because you sold them then saved the game), or if it’s a fresh save file. So you could sell the starting items, reload the save, and it would spawn new ones (or rather, not delete the ones that exist at the start).
Hopefully this is a helpful explanation :3 I’m happy to answer any other questions you may be curious about, and if you want to really get into game development with Godot, feel free to add me on Discord or whatever to chat! I’d love to help you out however I can