0 votes

Hi,

I'm trying to develop a save system for saving my main map. The map is a 2d array of MapTile classes, where each MapTile has associated variables. Some of these variables include references to other classes, like a Settlement class, which in turn stores its own variables.

Using dictionaries, and serializing to json seems to be the preferred way of saving state to file in Godot, but I'm not sure how I would go about doing so without packing/unpacking each layer of each tile of the 2d array manually, which seems like a bit of a pain.

Is there a more convenient way to do this?

Thanks!

in Engine by (50 points)
recategorized by

Is there any way you can make scenes out of them?

I guess probably? I could make a MapTile scene, with a child settlement node. However, 2400 of these MapTile scenes would need to be instantiated. I don't know if there would be a performance hit? Also, accessing the data from MapTiles, and their child nodes, would be a lot less convenient through the scene tree, then directly through the 2D array.

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.

Categories