What is the best/most appropriate way to load information that will be referred to relatively infrequently? For example, a file with the text for hundreds of ‘event pop-ups’ (like Crusader Kings II/III, Stellaris) or lists of names being used for random characters.
Loading it all at game start is an obvious solution, involving reading it from a file into objects and holding it for use. This is useful in that my event/character manager objects can reference the information easily. However, I know this can also be quite expensive in terms of loading times and involve loading information that may not be used during the session (potentially hundreds of objects sitting and waiting).
Loading at need would only bring in the information as needed, but would need me to iterate over a file to find the exact ID number and pull the information in specifically. Iterating over a file to find a specific string could be quite expensive as well, and would be done fairly frequently.
Is there another way I could look to do it?