Modding Game Configuration Modding
#1
Game Configuration Modding


Info
After looking at the files on disk, it seems like many of the data that describe the objects in the world are hardcoded and not accessible to the modder.
This suggestion is to expose much of the internal data of many game objects/processes that would be fun to tweak in data files that would be read at startup. Coding work entails writing serializers and deserializers for configuration data and to save/load config from those files, and any necessary validation to constrain invalid (impossible) inputs.

Examples of data I would like to tweak for experimenting: cost of producing creatures, what and how much the consume, how strong they are, how fast they train, eat, sleep, etc. Or the production speed of farms or various item requirements of different buildings and constructs.

Appearance
At first, just data files in the file system. Allows for users to create their own tools to edit these data files. Use xml or some structured format easily editable by common text editors. Later, in game editing could be supported through dev/cheat mode.
Reply
#2
I'd love to see the game made moddalbe. In many cases mods can dramatically increase replay value of a game without significant investment from the developers.
[Image: 11619898803_7d3a89e6bd_n.jpg]
The Golden One!
Reply
#3
I have started on it very small as you can see, being able to change the lore stories was just something to get me started down that path. Right now the player have the option to change the language of the game as 80% of all text is not hardcoded and are in the XML files, but this is just a small start. I have plans to make the buildings and creatures fully modable, the issue with creating more buildings on the other hand is a little bit harder. The storage room tables could easily be made with XML files as they are just plain models and the only info the game needs is how many items they can store and where to put it.

There are other buildings that are a lot harder to do with XML, for example the iron smelter. There we have a rigged model with different animations and different jobs being sent out to the workers depending on its current state (Have coal?, Have Iron?, Is smelting?, Ready for pickup?) and so on. I have been looking into having scripting in the game, but as it is c++ the game is made in it don't support compiling of the code during runtime as many other compilers do. But there are of course libraries that I can use that supports this non the less. So this is something I am definitely considering Wink

But it will take some time to implement as everything else, so everything have to wait for its turn Smile
Reply
#4
Yes, I saw those xmls and I want more! I hope you can expose more of these constants as time goes on, even if the bigger plan for a scripting language is not so quick. For that, you could look into embedding Python. I am not a huge fan of Python myself, but I've seen it done before to good effect. I don't know if it is fast enough, however.

Smile
Reply
#5
If it can be used only during initial loading just to import assets into RAM where the C++ code could call on it then it shouldn't be too much of an issue, as the slowdown would only affect the initial loading and I can handle it taking a few seconds longer to load if it means more modalbe contents.
[Image: 11619898803_7d3a89e6bd_n.jpg]
The Golden One!
Reply
#6
(16-02-2014, 08:12 AM)Seriously Unserious Wrote: If it can be used only during initial loading just to import assets into RAM where the C++ code could call on it then it shouldn't be too much of an issue, as the slowdown would only affect the initial loading and I can handle it taking a few seconds longer to load if it means more modalbe contents.
I think Ras was talking about allowing structuring the program so that you could broadly customize behaviors much more than I was initially suggesting. In theory one can basically write a lot of the program's logic in a script language (javascript, python to name a few), then call out to those scripts at runtime (once they are compiled during startup). The problem is even after this pre-compilation, it still is slower to execute that code than well written pure C++ (native) code. However, as to whether it is too slow or not, it can really only be determined through experimentation.
Reply
#7
Yeah, atm in the code all the buildings just inherit from another building and that is it. So for example, when I added the farm, all I needed to do was create a file named farm.cpp and made it inherit from building.cpp and that is it, voila, we have a farm in the game.

So if I were only able to make the user create the farm.cpp himself it would be incredibly easy Smile
Reply
#8
How much would would it be to make a user friendly editor to create the cpp files automatically based on what the user enters into the editor?

I could code in c++ and create my own cpp files but many potential modders may not be able to, so if it's not too difficult then that would be a great way to expand the modding community dramatically.
[Image: 11619898803_7d3a89e6bd_n.jpg]
The Golden One!
Reply
#9
Well, cpp files is actually just plain txt files, so there is nothing special about them. It is just that all the cpp files get compiled into the code when creating the exe file. It is not possible doing this during runtime unfortunately.

If I find a library that could support it, then it would be awesome.

EDIT: Awesome because it would be like you having the source code yourself, but that you are only allowed to add parts to it, not remove or change.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)