Original Post
hello. i have ran into a problem where i can't find a practical solution, practical in that it uses the minimal amount of memory in the end. basically i'm in the progress of writing my ever changing engine and world editor, and the problem is that i need a way to keep track of objects that i can create and the object instances that exsist (for ease of use in the world editor). well it's not that i can't solve the problem, it's i can't solve it without seeming to waste memory. i will explain and you will see. basically i have a "manager" which will control the instances of my objects, but also i have a "factory" (which i'm currently working on) which will contain a map with all the different types of objects that can be created. types of objects are not actual types. i mean i have an object type, ground type, scenery type, and others. all of which will be mapped using std::map and given a name (key). then i fill these maps with generic instances of these objects (basically different sprites, and eventually different events tied to them) then i can create these objects and keep track of their instances in another module. but it's bugging me becasue the mapped objects exsist but do nothing, they just sit their and wait to be duplicated for an instance. (really the factory holds instances, but i make other instances of these objects based on their properties). so its bothering me becasue i have multiple objects that are in memory all the time but dont really do anything activly. the whole purpose in this is in the world editor, say i want to make a tree well i want to select a tree and place it in the map. in the code i want to say ... manager.addInstance(factory.getObject("Tree01")); it will the get the object associated with "Tree01" return its self (not a pointer) ... so now i have an instance in the manager class. but it seems its sorta a waste of memory. if this made any sense at all, and you have a solution i would appreciate hearing it, thanks in advance.