distributing mods as saved games

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

distributing mods as saved games

Sean Bridges
Administrator
In the spirit of openness, I would prefer people distribute maps as xml files, rather than as saved games.  

There are some practical reasons for using xml.  xml is compatible with different versions (saved games can only be loaded by the same version of TripleA as saved the game) and xml files are easier for people to  install.

The main reason to use xml though is to encourage people to modify the game, and contribute back to TripleA.  Everything in TripleA is open source, and easily modifiable (for those with the right skills at least).

Distributing maps as saved games doesn't really prevent other people from modifying them anyway, as it's pretty easy to write a utility that dumps a saved game as an xml file.
Reply | Threaded
Open this post in threaded view
|

Re: distributing mods as saved games

sieg
hi,

dont get me wrong, i will release the xml soon.

i did only release a save file first to get a good beta version.

i dont have much time atm and dont want that tons of versions came out before iam ready with my part of the work.

otherwise i would have hold back the release till i think its ready for the community, and this would be sad for all the players enjoying it...

greets

sieg

Reply | Threaded
Open this post in threaded view
|

Re: distributing mods as saved games

Veqryn
Administrator
sieg,
can you release the actual map now?
we have a new unstable triplea (1.3) up, and more will follow soon,
it would be great if people could play your map on this triplea too,
not to mention all the other good reasons why there should be a map rather than a savegame.
thx,
veqryn
Please contribute to the TripleA 2013 donation drive:
http://tripleadev.1671093.n2.nabble.com/2013-TripleA-Donation-Drive-tp7583455.html
Reply | Threaded
Open this post in threaded view
|

Re: distributing mods as saved games

U-boat
In reply to this post by Sean Bridges
One thing I wish was possible, is that you can save a game as an xml. I would really prefer doing unit placements via the actual map, because it is instantly reflected and much easier than manual, and a little more better than the way that the triplea map creator handles unit placements. The xml would only change the unit placements of the original xml and would save it as a different copy. The techs, units, etc would all be the same as the last. Not really sure how easy this would be to do, or if it is even that important.
Reply | Threaded
Open this post in threaded view
|

Re: distributing mods as saved games

Edwin van der Wal
See: http://triplea.sourceforge.net/mywiki/Forum#nabble-td6412337

Just presure Veq into adding it to the SVN and integrating it with UI and make someone volunteer to test/debug it and upgrade it to 1.3.1.1

... or wait for me to do it.
Reply | Threaded
Open this post in threaded view
|

Re: distributing mods as saved games

Edwin van der Wal
Edwin van der Wal wrote
See: http://triplea.sourceforge.net/mywiki/Forum#nabble-td6412337

Just presure Veq into adding it to the SVN and integrating it with UI and make someone volunteer to test/debug it and upgrade it to 1.3.1.1

... or wait for me to do it.
Ok... I integrated it with the UI and trying to fix it for 1.3.1.1 (darn Veq, you made the xml somewhat more complex in the 1.3 branch - fun to reverse back to your your 1-3,4,7,9-+ values in the rule attachment)
Reply | Threaded
Open this post in threaded view
|

Re: distributing mods as saved games

Veqryn
Administrator
lol, that would be squid's fault

btw, you don't have to reverse them back to exactly 1-3,4,5-+, as the exact same thing would become 1-+,
etc,

as long as the effect is the same,

or more importantly, as sgb tells, that both the original xml and the xml your utility makes, create the exact SAME gamedata object....


anyway, if you can get it to work with 1.3.1.1 then I will DEFINITELY include it in the next release

thx,
veqryn
Please contribute to the TripleA 2013 donation drive:
http://tripleadev.1671093.n2.nabble.com/2013-TripleA-Donation-Drive-tp7583455.html
Reply | Threaded
Open this post in threaded view
|

Re: distributing mods as saved games

Edwin van der Wal
Ok, I will put in some more time...

I tried to make this 100% non-intrusive (just 1 extra class, no changes to other classes) otherwise it wasn't possible to load savegames from other versions.

However I encountered a lot of spots that made it very difficult to do the conversion.

1) There is ununused conversioncode in the GameParser, which I can't test, for example game properties of valuetype: </color> -- could these be removed form the GameParser?

2) Why is GameProperty and IEditableProperty handled totally different in GameData and the XML conversions

3) Attributes of for example attachments are set using reflection, however it is not done clean enough to extract the same data from the class using reflection again in a straightforward way.

"isDestroyer" -> setIsDestroyer(String) -> boolean m_isDestroyer -> getIsDestroyer():boolean
"isAir" -> setIsAir(String) -> boolean m_isAir -> isAir():boolean

Which made me revert to use the private  m_??? fields of the class which of course are private and not guaranteed to be clean either and need to use some workaround setting them accessible through reflection.

Then look at how Capital and VictoryCity is handled in the TerritoryAttachment

"capital" -> setCapital(String) -> String m_capital -> isCapital():boolean & getCapital:String
"vicotoryCity -> setVictoryCity(String) -> boolean m_isVictoryCity -> isVictoryCity():boolean

So there are 4 different ways of storing boolean values in attachments.

4) You can't get a list of ProductionRules from the Rulelist. You have to first get a FrontierList from the gameData and then extract all FrontierNames and then get all ProductionRules from all Frontiers before you can write them back to the XML.

5) You can't get the delegate from a GameStep, have to access m_delegate field.

6) You can't get the connections from the gamedata, only possible to iterate through all territories and then through their neighbors and then create the connections, which results in double connections (but not a big deal I guess)

I guess if I am allowed to tweak some attachments/properties I can do the Exporter much cleaner and thereby more maintainable.