Any coder would come to face this one day, its code organization. As project gets bigger and bigger, so does the type, functions and logic. I have been using types to manage my entities (mesh, sound etc) before, and that seems fine until the game structure change drastically during gameplay. For instance, in RPG, World exploration + Battle sequence. Same game, completely differnet in both style and structure.
This doesnt only happen in games, but application creation too. I am suure some of you can think of many scenario. Now what I propose is creating a "world" system. Before the program begins, user must create a world for objects, types, entites etc to be in.
So for instance:
nworld1 = createworld()
sphere = CreateSphere(nworld1)
cubechild = CreateCube(nworld1,sphere)
nworld2 = createworld()
cone = CreateCone(nworld2)
Each world cannot interact with another one. Only one world can be active at anytime. Any world that isnt active will be put to "sleep" and hidden to save memory and increase framerate. Collision will be switch off for the "sleeped" world and when one need to free all object in one world, simply delete the world.
Now I asked, possibly some experts out here, would this idea be feasible? I just happen to thought of it, and seems to me be feasible. Any flaw in this logic?
This doesnt only happen in games, but application creation too. I am suure some of you can think of many scenario. Now what I propose is creating a "world" system. Before the program begins, user must create a world for objects, types, entites etc to be in.
So for instance:
nworld1 = createworld()
sphere = CreateSphere(nworld1)
cubechild = CreateCube(nworld1,sphere)
nworld2 = createworld()
cone = CreateCone(nworld2)
Each world cannot interact with another one. Only one world can be active at anytime. Any world that isnt active will be put to "sleep" and hidden to save memory and increase framerate. Collision will be switch off for the "sleeped" world and when one need to free all object in one world, simply delete the world.
Now I asked, possibly some experts out here, would this idea be feasible? I just happen to thought of it, and seems to me be feasible. Any flaw in this logic?