Populating a scenegraph and Dynamism

Iv come to a point in my project where a significant amount of time is going into creating levels. These levels consist of bezier patches, vertex data, height maps, lights, physics objects, and emitters

Im loading all the information for each type of object from a text file in a manner similar to:

This obviously makes for some really long initialization code. And anytime i want to add/remove or fundamentally change my level i have to recompile my app (which isn't a big deal but annoying.)

Its also becoming harder and harder to refine or add new features to my different objects. Im seriously thinking about creating a new loading system that relies on dynamism. I was wondering if someone has attempted something like this already? And if so wether or not revamping my entire engine to rely on such technology is really going to help things out.

There was a long silence...
'I claim them all,' said the Savage at last.

Couldn't you just have a text file that lists the objects, their types, and the files it should reference? Then it takes each object, dynamically allocates memory for it, initializes it with the correct type, and initialization file. That seems like it would work and prevent you from needed to compile when changing the level.

# primary and secondary colors to be
# selected based on modulation
primaryColor:reallist=1,1,1,1
secondaryColor:reallist=1,0.95,0.9,1

# color for low z values
lowColor:reallist=0.8,0.8,0.8,1

# color for high z values
highColor:reallist=1,1,1,1

# color of light hitting terrain
lightColor:reallist=1,1,0.9,1

# color of shadows on terrain
shadowColor:reallist=0.4,0.4,0.6,1

# thresholding values for modulation; the tighter, the more
# severe modulation you'll see between primary & secondary
mixMin:real=0.25
mixMax:real=0.4

#!
contrast and brightening, applied as a post-processing
effect on the mixmap.

mixBrighten is an offset, pushing the mix value up or down.
valid values are from -1 to +1, will be clamped if out
of range. Default value is zero, which has no effect.

mixContrast is a power the mix value ( after brightening )
will be raised to. Where valid values are from 0 and up.
Values from [0, 1) will result in a raising of contrast,
with 0 resulting in absolute contrast.
Values from (1,infinity) will result in a dampening of
contrast, to gray. Default value is 1 which has no effect.
!#

#!
if true, resulting colormap and mixmap will be written
to disk where the app is located as the
two files "Colormap_RGB.png" and "Colormap_Alpha.png",
where the RGB file is the colormap, and the Alpha file
is the mixmap. This is useful for tuning.
!#
dumpOutput:boolean=true

So as I descend the DOM tree for the file, I create objects by name and pass them the DOM node for initialization. Objects defined *inside* of other objects ( see CelestialBody, which is a child of Sky ) become logical children of the parent, so the parent "owns" it, and acts as it's proxy in the scene graph.

DOn't pass up classloadin and deferral of configuration to the class. It'll keep your code very clean.

One note: The file format above is a custom file format I came up with a few years ago because at the time I didn't know about TinyXML. Had I, I wouldn't have come up with my own... but what's done is done, and my APIs for the file format are pretty easy to work with.