Topic was automatically imported from the old Question2Answer platform.
Asked By
Zera
Old Version
Published before Godot 3 was released.
I’m starting development of a multiplayer turn based strategy game and need a way to store information about the players, their units, stats and other information so that they aren’t lost as soon as the server is closed. A database would be ideal for this but so far I haven’t been able to find any information on how to connect to a database from within Godot. This could be useful for other types of games like RPGs, I think, and would allow for easy tuning of game balance if developed correctly.
TL;DR, how can I connect to a database from within the game engine?
a database is not supported wirte now but I think a module for sqlite can be written, you can use dictionaries for most of things that you said.
but if you need a sqlite or something like that you can write a module for it or just open an issue for feature request in github.
I thought about using dictionaries, too, but the problem would then be how to persist those dictionaries (in case of server crash or anything like that). I guess the best option will be to write a C++ module to connect to a PostgreSQL database, then.