Thread: Librarian
View Single Post
04/18/14, 06:09 AM   #19
Flamage
 
Flamage's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 60
Originally Posted by ilmarine View Post
The problem isn't so much with loading (although that will also become an issue), but rather with the saving. I noticed that lua database is only created once you logout or quit which means that a lot of writing has to be done at that one time. This is also the moment that freezes my system (I suspect it is due to the fact that your addon is still writing and telling that the game cannot close while the game itself is saying that it has to close, or sth). Couldn't the writing be done at the time of discovery?

Where does the game keep it's own book data? How do you get information from the game that the character is reading a book? The game probably tells its own internal database that a book with thisandthis id should be displayed. Couldn't you store that id and use the games own database to display books? This way you wouldn't have to store the text. Or at least not load it constantly.
The game only allows an addon to say that a particular LUA table should be persisted between sessions, so there is no way to trigger saving of data manually. As for retrieving book data from the game itself, the API that the game exposes to addons (including the default book reading UI) only provides data for books that the current character has found. For all others, it returns an empty title and body. Once a character gets the eidetic memory perk it would be entirely possible for me to remove the database completely, but then the cross-character book reading ability would be lost, which is something a lot of users have requested.

Unfortunately, I don't have a character nearly high enough to unlock Eidetic Memory, but when I do I will probably work on making the cross-character database optionally able to be removed once the character gets the Eidetic Memory perk. You would lose some features but the load time of the addon would become almost nothing.

In the meantime, I still have some ideas about compressing the data or aggregating it into a smaller number of records which may reduce the loading / saving speed enough that none of this is an issue any more.
  Reply With Quote