P-152: Virtual World Concept Update 45: Procedural Content: Object Builder
I will be making a number of posts shortly on the important of procedural content in the virtual world that I am building. I have done extensive research into this, and I have come up with some ideas for what I want my procedural content generation system to look like.
The game will essentially allow the player to build their own tools, weapons, structures, vehicles, and much more, from just the discrete elements provided in the world. These elements will be things like wood, iron, stone, water, etc etc.
I have decided that the best way to implement this functionality would be to allow the player to construct prefabricated shapes from these elements, for example Steel Rod, Steel Tube, Iron Nail, Wood Plank, Wood Sheet, etc.
The user will then combine these very basic elements to construct almost anything.
I had tried simply adding the objects to the world as individual meshes, and then updating the position of each one in C++, but this didn’t work for two reasons:
1:
Adding many meshes to the world results in a massive performance (framerate) drop. Even with just a few dozen objects, (all with their own collision boxes)I was having framerate issues. This was with a debug build, but even so, I would need to be able to render a lot more objects than that for this to work.
2:
Moving all of these objects at once does not work. Even when running the position update code in C++, instead of script, the objects would update one at a time, which means with a moving vehicle, the player will see noticeable jitter as the position of every object making up the vehicle update one at a time.
So, clearly, what I need to do is to allow the user to create their vehicle or object by dynamically creating and placing regular static meshes. Then, I need to combine all of those meshes into a single in-game object, so that it can be rendered and updated at once.
The question is, how can I go about doing this? Or, is this even a viable option?
