GameDataExporter

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

GameDataExporter

Edwin van der Wal
Hi Veqryn/Guys,

I created a GameDataExporter for version 1.2.5.5 it is pretty alpha stage. But seems to work with at least 1 map I tested it on. And it probably needs some tweaks to make it 1.3.1.1 compatible.

Basically it takes GameData and converts it to an XML format.

This class could be used for people that prefer to use Editmode to place units on the map and then export it to a new XML file.

Or it could be used to convert maps distributed as Savegames to the XML format.

Link: http://www.roletact.com/triplea/GameDataExporter.java

Reply | Threaded
Open this post in threaded view
|

Re: GameDataExporter

Veqryn
Administrator
edwin,

if you were to make this work with 1.3.1.1, then I would LOVE to include this with triplea and even make a menu option in the export menu to have people create xml's right from triplea

i love you,
please get it to work with 1.3.1.1,
veqryn

edit:
sgb says that a good way to test this is to do a circle: start with a map.  make a savegame right when the game starts.  use this utility to make an xml.  put the xml in the map.  start that new xml as a game.  make a savegame as the game starts.  use the utility to make an xml.  
then compare all 3 xml's, they should all be the exact same.
and the gamedata object that they each create should be the same too

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: GameDataExporter

Edwin van der Wal
patch for 1.3.1.1 in your mail.
Reply | Threaded
Open this post in threaded view
|

Re: GameDataExporter

sneakingcoward
how to use it ?

can you please make an xml from waw1.5 save ?
Reply | Threaded
Open this post in threaded view
|

Re: GameDataExporter

Edwin van der Wal
In reply to this post by Veqryn
new patch in your mail veq.

The old patch works with savegames created in 1.2.5.5

The new patch for 1.3.1.2 will only work with savegames created after 1.3.1.2

Reply | Threaded
Open this post in threaded view
|

Re: GameDataExporter

Veqryn
Administrator
Just a quick update,

the xml exporter should not create the following 2 game properties:


        <property name="games.strategy.engine.framework.ServerGame.GameHasBeenSaved" value="true" editable="false">
            <boolean/>
        </property>


        <property name="GAME_UUID" value="76ba401d-60e8-445e-b99c-169ec618091b" editable="false">
            <string/>
        </property>



other than that, it works freaking beautifully!
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: GameDataExporter

Edwin van der Wal
wow, nice quick review...

I can filter out those properties easy tonight, also I can do some fixes regarding the email exchange we had today if you want, or you can create those updates yourself :)
Reply | Threaded
Open this post in threaded view
|

Re: GameDataExporter

Veqryn
Administrator
i'll let you ... cus i have no clue how to do it, and you built the code

i'll wait for your next version...

thx,
veq
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: GameDataExporter

Wisconsin
In reply to this post by Edwin van der Wal
This is really, really cool, thanks for coding it Edwin!

I'm having a problem, though, when trying to load an exported game xml, of NWO:

Error: URI=jar:file:/C:/Programming/Projects/Java/TripleA%20-%20Latest%20SVN%20-%20Read%20Only/triplea/bin/triplea.jar!/games/strategy/engine/xml/ Line=2410: The content of element type "technologies" is incomplete, it must match "(techname)+".
Error: URI=jar:file:/C:/Programming/Projects/Java/TripleA%20-%20Latest%20SVN%20-%20Read%20Only/triplea/bin/triplea.jar!/games/strategy/engine/xml/ Line=2433: The content of element type "attatchment" is incomplete, it must match "(option)+".
Error: URI=jar:file:/C:/Programming/Projects/Java/TripleA%20-%20Latest%20SVN%20-%20Read%20Only/triplea/bin/triplea.jar!/games/strategy/engine/xml/ Line=2435: The content of element type "attatchment" is incomplete, it must match "(option)+".
etc, etc...

From the message, it sounded like some empty attachments, so I looked at the xml, and saw this:

    <technology>
        <technologies>
        </technologies>
        <playerTech player="Germans">
        </playerTech>
        <playerTech player="Russians">
        </playerTech>
        <playerTech player="Italians">
        </playerTech>
        <playerTech player="French">
        </playerTech>
        <playerTech player="ColonialFrench">
        </playerTech>
        <playerTech player="Finns">
        </playerTech>
        <playerTech player="British">
        </playerTech>
        <playerTech player="Romanians">
        </playerTech>
        <playerTech player="Americans">
        </playerTech>
    </technology>

I removed the whole thing, and those errors where fixed, but then these came up:

Error: URI=jar:file:/C:/Programming/Projects/Java/TripleA%20-%20Latest%20SVN%20-%20Read%20Only/triplea/bin/triplea.jar!/games/strategy/engine/xml/ Line=2412: The content of element type "attatchment" is incomplete, it must match "(option)+".
Error: URI=jar:file:/C:/Programming/Projects/Java/TripleA%20-%20Latest%20SVN%20-%20Read%20Only/triplea/bin/triplea.jar!/games/strategy/engine/xml/ Line=2414: The content of element type "attatchment" is incomplete, it must match "(option)+".
etc, etc...

Found these and removed them:

<attatchment name="techAttatchment" attatchTo="Germans" javaClass="games.strategy.triplea.attatchments.TechAttachment" type="player">
        </attatchment>
        <attatchment name="techAttatchment" attatchTo="Americans" javaClass="games.strategy.triplea.attatchments.TechAttachment" type="player">
        </attatchment>
        <attatchment name="techAttatchment" attatchTo="Russians" javaClass="games.strategy.triplea.attatchments.TechAttachment" type="player">
        </attatchment>
        <attatchment name="techAttatchment" attatchTo="British" javaClass="games.strategy.triplea.attatchments.TechAttachment" type="player">
        </attatchment>
        <attatchment name="techAttatchment" attatchTo="Italians" javaClass="games.strategy.triplea.attatchments.TechAttachment" type="player">
        </attatchment>

After removing these empty attachments, the xml loaded successfully. :)
Just wanted to let you know about this before the next release.

Thanks again,
    Wisconsin
Reply | Threaded
Open this post in threaded view
|

Re: GameDataExporter

Wisconsin
Okay, another issue, non combat move phases are getting exported as combat move phases. I thought I read this was fixed somewhere, so maybe the fix just hasn't been committed yet?
Reply | Threaded
Open this post in threaded view
|

Re: GameDataExporter

Veqryn
Administrator
both should be fixed,.... i updated the svn this morning

the only 2 issues that I know of are:

1) there are double the number of connections (so you have sz1 and sz 2 connect, and sz2 and sz1 connect...)

2) if a unit purchase/price frontier is not being used by a production frontier, it will not be included in the xml output
(like, exporting minimap has the new xml missing the production of all sea units, even though they are in the original xml)


this second issue will need to be solved if we ever have triggers that add things to production frontiers, for example

as of right now, i don't think either stop an xml from working,

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: GameDataExporter

Edwin van der Wal
also sent a patch fixing these two...

just finding a vollunteer for documentation of the code and maybe some code beatifying
ice
Reply | Threaded
Open this post in threaded view
|

Re: GameDataExporter

ice
is this hard to do? if not could someone give a small guide for the computer stupid minds?

ice
Reply | Threaded
Open this post in threaded view
|

Re: GameDataExporter

Edwin van der Wal
ice1 wrote
is this hard to do? if not could someone give a small guide for the computer stupid minds?

ice
Hi ice1,

this functionality is included in the current SVN version, and will be in the next release (stable/unstable)