I've got the basics wired up for hitting a location that awards "Discovery" XP, whistles and bells. Now, I need a place to store already discovered locations. Before I get into the DB side (cuz I can manage that), I'd like to ask you of the best way to handle it in code.
I was thinking this... When world starts, it reads from `locations` any loc that has discovery = 1, since not all locations will award discovery pts. This will keep the list smaller, perhaps. I would need a struct to hold that data:
Code: Select all
struct DiscoPOIs {
int32 location_id;
}Code: Select all
struct PlayerPOIs {
int32 char_id;
map<int32, bool>;
}Should I use a map<char_id, map<location_id, bool> > so we can quickly iterate through a specific players list when they enter a new location?
If they haven't discovered it, then discover it, add it to the map<>, flag it for player data update, and boom, done.
If they have discovered it, simply show the location popup msg like normal.
I'd like some help getting the >best way possible< to implement this, regardless of what decision i make on the DB side how to store locs.
My two options are a character_history (or something) table with the discovery location ID in it. Or, a blob value in the character_details record that holds each discovery ID in an array fashion (1|2|265|2030) etc
Thoughts?