The dataset stuff is pretty cool. Also it solves some of the problems that RedMonkey is addressing. I’d like to use it for my FPS game. So: how about splitting the “model dataset” from the OpenRTS project?
The model builder and XML importer might become a library (or, if you prefer, a ‘platform’) that can be reused by other games.
Some parts are quite general (like SoundActor) some other are tied to OpenRTS (like DamageEffect); however other games can provide their implementation of *Effect that are game-specific.
All the parsing part is already quite generic and could easily be used by any other game with few efforts.
I’m talking about :
xml definitions
xm parser
library of definition (we have to extract an abstract class from this one)
For the builders it is more tricky. There is an abstract builder for the basic definition management, but the mapping is hardcoded, and the final build() method (and overloads) can have very specific behavior.
A first step would be to map the builder fields by reflexion. Not trivial ! :
a color will be parsed as three int and will need construction,
a child builder will appear as a string and will need to find the builder in the library by ID,
etc.
This is totally feasable, thougt. And then you only have to define the building behavior.
I’ve decided that the less painful way is to make a branch and try to trim down the parts I won’t use. I can’t commit on the repo, should I fork it? Edit: now working on my fork.
Also: why ModelManager.updateConfigs() on the update thread? Aren’t XML supposed to be loaded at init time and then forgotten?
Edit 2: I have a trimmed openrts:core. Now I’d like to use it as a library from another project; how do I do that? I’m a gradle n00b
there are two ways to add a lib with gradle. The first (and the preferred way) is to add a new dependency in the build.gradle. now gradle download it automatically from a maven repository.
the second way is to copy the jar into the lib directory and gradle graps it too.
This is interesting at development time, but I’m not sure it’s a good idea to ship a game with this behavior, so I’ll make an Appstate which offers both options.
The first way assumes that all the projects that uses the lib are built with gradle too
Where is the jar? Edit: found it
@methusalah@wuendsch how about moving to 3.1 libs? A lot of bugs are fixed, there’s java8 support, plus all the new cool things. And besides, you’ll want to make the jump sooner or later…
The libraries have been reorganized (this is the reason of my error above); some methods are deprecated (probably for a good reason) and so on… therefore no, it’s not backward compatible.
However, on my experience the transition has been rather simple and the benefits outweight the efforts.