title: Storing named data, where the 'name' is larger than the 'data'?
body: <p>I'm writing the logic portion of a game, and want to create, retrieve, and store values (integers) to keep track of progress.  For instance, a door would create the pair (<code>"location.room.doorlock"</code>, <code>0</code>) in an std::map, and unlocking this door would set that value to <code>1</code>.  Anytime the player wants to go through this door, it would retrieve the value by that keyname to see if it's passable.  (Just an example, but it's important that this information exist outside of the "door" object itself, as characters or other events might retrieve this data and act on it.)</p>
  
  <p>The problem though is that the name (or map key) itself is far larger than the data it's referring to, which seems wasteful, and feels 'wrong' as a result.</p>
  
  <p>Is there a commonly used or best approach for storing this type of data, one where the key isn't so much larger than the data itself?  </p>
  
  <p>It is possible to know how much space to allocate at compile time for the progress data itself, if it's important.  It need not use <code>std::map</code> either, so long as I don't have to use raw array indices to get or store data.</p>