joevenzon Wrote:slowDan, if you get to this before I do try to use either the CONFIGFILE class or the functions WriteObjectToFile and LoadObjectFromFileOrCreateDefault in joeserialize.h.
I went for the CONFIGFILE format in the end. Lots of ready made examples already in the code swung it for me!
I've added a surfaces.txt file to Rouen which shows the format so far. The game loads it, reads the values from it, and stores them as a vector of TRACKSURFACE structs.
This is where it gets a little complicated! To use the values in game I had to jump through a few hoops. The sounds and the wheel contact properties are still expecting to see a CARSURFACETYPE. This means that both need to exist until I can switch everything to the new arrangement. Which also means that we need a default surfaces.txt to use if a track doesn't supply one.
For now I wouldn't try adding any new surfaces to other tracks because if the two surface formats don't match strange things are likely to happen.
On the plus side I figure that this means that sound parameters can also be specified in the surfaces file and possibly (in future!) particle graphics as well. Also because its in the Config file format it uses names for each section as well as an ID number. :wink: