Moddable Game

I had an idea to make my game moddable by making it so that it reads a list of parts from an XML file on start up and associates the list with identiacally named Models and Textures in a Model and Texture folder in the build subdirectories. Is this even possible and if so, what do I need to do to make it happen.

So Game Folder has two folders in it: Models and Textures, and an xml or text file database that has the Game Object names and stats.

You need a ‘factory’ that can parse through your file and peice together the objects that you want to build. “Design Patterns: Elements of Reusable Object-Oriented Software” is a great read for anyone interested in Object-Oriented Programming, and Moddable games benifit greatly from OOP. Your file format really determines how difficult it is to parse and build objects at runtime. JSON might be a decent option, it was designed with the idea of creating objects from the file and being easily readable for humans, but XML is just fine honestly. Your ‘factory’ will most likly create an empty object and add components and set those components up for each Modded object. I believe you can create prefabs from objects at runtime as well.

http://www.json.org/