Hello dear fellow dwarf fortress community.
I am making a game in java and I would like to implement something similar to the raw text files in my game to facilitate for modding. Without any real knowledge about dwarf fortress programming I still guess that it's a combination of c++ interfaced openGL, and a scriptlanguage. A very uninformed guess it is but nonetheless..
I have the general engine data structure sort of implemented but when it comes to specific implementations of things like entities, flora, actions/events, storage containers, etc.. I have no good idea how to do this with text files without preloading all texts as instances of predefinied classes, to me that makes modding a bit too inflexible. My other solution is trough the use of interfaces and mostly using one class per object. This flexibility is mainly to make as small memory footprint as possible with each object since there will be tens of thousands of them. Yes indeed enough to win the siege of helms deep actually.
Which is well over 9000, as the perceptive will note... I am trying reach one million active entities, simulated over an area 25% of the earths area with one tile = 1sqm. And that is why memory is a big issue, as is implementation of actions since they will be happening alot. In short the game is based on an old idea I had that is similar to dwarf fortress, especially world gen, that I had before I found this wonderful gem.
I'm self learned in Java except for a simple university course that thought the basic syntax and some very simple instancing. Now I use eclipse and my skill has improved with learning by doing it wrong, and trying again. Fearless and passionate as I am about my design, (leaning dangerously towards careless and stupid) this is my first big project and I haven't made any previous games only small keyboard input + graphic vectorfun funky stuff. Any wizards out there who can explain to a layman or point me in a good direction on how to flexibly and as performance friendly as possible implement such a datastructure that ideally ALSO implements textfile reading like the raw:s. Sincerely hoping I am making sense.
PS: A good solution implies and would aim to make adding objects a breeze, the magic would be in the framework. I thought it would be good to be clear about that, since I'm writing at 4am swedish time.
//Daniel H