Nick:  
Pass:     
Help Register


Post Reply 
Modding Game Configuration Modding
Author Message
damiant Offline
Dungeon Lord

Posts: 43
Joined: Feb 2014
Reputation: 11
Post: #1
Game Configuration Modding
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.
(This post was last modified: 05-06-2015 07:34 PM by Sebt.)
14-02-2014 04:44 PM
Find all posts by this user Quote this message in a reply
Seriously Unserious Offline
The Ninja Dinosaur

Posts: 1.607
Joined: Jun 2013
Reputation: 69
Post: #2
RE: Modification - Game Configuration Modding
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!
14-02-2014 11:00 PM
Find all posts by this user Quote this message in a reply
Rasmus Online
Main developer of Dwelvers
Dwelvers Developers

Posts: 3.622
Joined: Sep 2013
Reputation: 502
Post: #3
RE: Modification - Game Configuration Modding
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
15-02-2014 03:14 AM
Find all posts by this user Quote this message in a reply
damiant Offline
Dungeon Lord

Posts: 43
Joined: Feb 2014
Reputation: 11
Post: #4
RE: Modification - Game Configuration Modding
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
15-02-2014 01:48 PM
Find all posts by this user Quote this message in a reply
Seriously Unserious Offline
The Ninja Dinosaur

Posts: 1.607
Joined: Jun 2013
Reputation: 69
Post: #5
RE: Modification - Game Configuration Modding
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!
16-02-2014 08:12 AM
Find all posts by this user Quote this message in a reply
damiant Offline
Dungeon Lord

Posts: 43
Joined: Feb 2014
Reputation: 11
Post: #6
RE: Modification - Game Configuration Modding
(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.
16-02-2014 02:18 PM
Find all posts by this user Quote this message in a reply
Rasmus Online
Main developer of Dwelvers
Dwelvers Developers

Posts: 3.622
Joined: Sep 2013
Reputation: 502
Post: #7
RE: Modification - Game Configuration Modding
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
17-02-2014 02:10 AM
Find all posts by this user Quote this message in a reply
Seriously Unserious Offline
The Ninja Dinosaur

Posts: 1.607
Joined: Jun 2013
Reputation: 69
Post: #8
RE: Modification - Game Configuration Modding
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!
17-02-2014 04:59 AM
Find all posts by this user Quote this message in a reply
Rasmus Online
Main developer of Dwelvers
Dwelvers Developers

Posts: 3.622
Joined: Sep 2013
Reputation: 502
Post: #9
RE: Modification - Game Configuration Modding
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.
(This post was last modified: 17-02-2014 05:38 AM by Rasmus.)
17-02-2014 05:37 AM
Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)


© 2013-2017 Dwelvers | Contact