Godot Version
v4.5.1.stable.official [f62fdbde1]
Question
I'm developing a word game that has a pool of ~60.000 words and, for each one of them, various values, such as length, POS, and so on.
The data is organized in a .res file with the keys being the words.
I set up an Autoload that loads it in a work thread and "put" the values in a Dictionary.
func start_loading():
WorkerThreadPool.add_task(load_words)
func load_words():
var config = ConfigFile.new()
config.load("res://files/lexo.res")
lexo_db = config.get_value("data", "words")
call_deferred("emit_signal", "data_loaded")
I made sure to never ask for this data in the main thread before it's fully loaded in.
The problem is that, sometimes (can't figure what is different), when I run the project, the application closes while the .res is loading (after calling "start_loading" and before emitting the signal)
I don't get any error messages. I figure it must be a memory problem, but I want to be sure first. How can i explore that?
If it is indeed a memory problem, does anyone have tips on how to manage this data properly? I used an Autoload because I need access to the whole list at run-time, because the player can type any combination of letters and the game needs to check if it's valid.