0 votes

Hey guys,
I'm writing a mini multiplayer game, in which a player create a room and others join and play.
Once the game ends, the room closes and the players' data are being discarded.

Therefore, I need to store room data, which contains the players' details (nickname, playerid, playerteam).

I wonder which is a better way of storing the data:
1. Use a Player.tscn node under Room node.
2. Save the players' data as a dictionary in Room.gd.

Which would you go with and why?
Thanks in advance!

in Engine by (77 points)

doesn't really matter, the simplest/fastest done possible, just refactor as you see fit during your dev

Thanks! went with dicts.

1 Answer

+1 vote
Best answer

I think you should go with the 2nd option, as dictionarys are simpler than nodes, and therefore I think that they are more efficcent. (also they can be saved in .json which you might want to do later, but that's another question in itself.)

PS: Good luck with finishing your game ;)

by (125 points)
selected by

Thanks man!
I've taken your advice. It's also a bit more indicative and visual for me I guess.

Glad I could help!

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 Frequently asked questions and 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 [email protected] with your username.