• 2007 AAR League

    My programming is barely good enough to get by, but I’ll take a shot at answering your question.

    I’d recommend going with the Generic and Expandable version of XML tags over the Strict version.  No need to lose flexibility at this point, and you can always build the validation into the map util.

    Just my opinion.

  • 2007 AAR League

    rjclayton, I don’t remember that conversation… maybe it was before I started really hacking triplea.

    I posted this to the general development thread in response to a reference to this thread:

    Hey djensen,
    Before you endeavor to create Yet Another Data Format, you should check out the underbelly of TripleA.  It uses xml files already to specify map layouts and starting unit locations for all games (Classic, AAR, pacific, etc) in a very generic way.
    I can post a sample AAR R1 xml file if you want so you can see what the format is like.  Currently, savegame files are saved as a gzipped serialized java object, but there is discussion on the dev list to also support the xml format for savegame files in TripleA (probably with some form of digital signature).
    I’m also interested in hearing your plans for this data format.  Lots of forum users currently use ABattleMap, for instance.  Are you thinking of replacing that tool with a more modern, open version?  As far as I can tell ABattleMap is closed source and will probably never be interoperable with anything.

    I’m attaching the sample AAR R1 xml file here as referenced in my comments above.

    [attachment deleted by admin]


  • If your not gonna be using scans of the original boards for this project Id gladly offer my map file to help out. I could help you find suitable icons for the units.

  • Founder TripleA Admin

    The idea here is to promote the XML format for future use. XML is human readable for consumption by machines but not for consumption by humans. The idea would be to post your xml as an attachment and it is up to the software package to output something human consummable for email or the forums.

    I’m just worried about compatibility by not going strict. Let me review the DTD specification for XML files. If we can use generic tags and have both a strict and loose DTD, that would be the best.

  • Founder TripleA Admin

    As suspected, this is somewhat specific to TripleA. The issue I see here is that the XML seems to contain everything about the game. Both the rules, the map, where the units are, and what java classes to use. I would like to decouple this into game/gamerules, game status, transformations. I expect the game rules would always be a part of the client.

    I don’t want to create “yet another” XML format but instead I would like to create “the definitive” XML format for Axis & Allies. Given the Google page rank of this site for Axis & Allies, I think we can do that here. (And PR is finally growing on Live.com too).

    @tonez:

    rjclayton, I don’t remember that conversation… maybe it was before I started really hacking triplea.

    I posted this to the general development thread in response to a reference to this thread:

    Hey djensen,
    Before you endeavor to create Yet Another Data Format, you should check out the underbelly of TripleA.  It uses xml files already to specify map layouts and starting unit locations for all games (Classic, AAR, pacific, etc) in a very generic way.
    I can post a sample AAR R1 xml file if you want so you can see what the format is like.  Currently, savegame files are saved as a gzipped serialized java object, but there is discussion on the dev list to also support the xml format for savegame files in TripleA (probably with some form of digital signature).
    I’m also interested in hearing your plans for this data format.  Lots of forum users currently use ABattleMap, for instance.  Are you thinking of replacing that tool with a more modern, open version?  As far as I can tell ABattleMap is closed source and will probably never be interoperable with anything.

    I’m attaching the sample AAR R1 xml file here as referenced in my comments above.

  • Founder TripleA Admin

    What would it take to get TripleA development on board with this? I know a lot of open source projects have egos about their projects. Do you think the TripleA team would be cooperative with outside ideas?


  • Hello, I’m the main developer of TripleA.  I guess I have a bit of an ego, but tonez is also a developer, and he seems quite reasonable.

    You want to do,

    <territtory name=“England”>Rather than

    <england>One reason is dtd, schema validation.  Another reason is that if you try to encode names like

    <finland norway=“”></finland>

    It doesn’t work using the tag name as the country name.Â

    A lot of the xml format can be taken directly from TripleA.  The dtd is here,

    http://triplea.svn.sourceforge.net/viewvc/triplea/trunk/triplea/data/games/strategy/engine/xml/game.dtd?revision=1592&view=markup

    I’m quite supportive of an open xml format, but there are serious technical issues.

    TripleA will be able to write to the xml format very easily, but TripleA will have a lot of problems trying to read this xml format.

    TripleA uses it’s own xml format (an example was posted abvove) only for initializing games.  When TripleA saves a game in progress, a more complicated binary format is used because TripleA’s xml format does not contain enough information.  When a game is underway, TripleA tracks things such as:

    how many territories a unit has moved this round
    what transports are carrying which units
    what territories did units invade a country from (you can only retreat to territories where units came from)
    is the bomber in germany fighting a land battle, or doing a strat bomb raid
    did the strat bomb raid in germany already happen
    did the battleship already shore bombard this combat phase?
    did the battle ship shore bombard in the combat phase (this means it can’t move in non combat)
    if you save after rolling in a battle, TripleA tracks who just fired, what the dice were, and who moves next
    is this a low luck game?

    The list goes on.  The problem is that none of the utilities store this information.  So when TripleA loads a game stored by AABattleMap, it will have to guess (in the case of which transport is carrying which troops) unless there is enough information in the games history to infer this information.</england></territtory>

  • 2007 AAR League

    Hello, I’m the main developer of TripleA.  I guess I have a bit of an ego, but tonez is also a developer, and he seems quite reasonable.

    My ego resents that comment!  lol

    There is certainly some stuff in the TripleA xml that is specific to triplea, but maybe not as much as you might think.  All of the javaClass=“…” attributes could simply be removed.
    The only remaining section that has TripleA-specific information is the <gameplay>section.  This section could probably be removed in its entirety, as much of this information is implicit to all A&A games, as far as I can tell, with the exception of the players and player turn-order.  The player turn order could instead be captured in the existing PlayerList section, like so:
    <playerlist><player name=“Russians” optional=“false” turnnumber=“1”><player name=“Germans” optional=“false” turnnumber=“2”>…

    Notice that the revised.xml file defined map layout, the initial state of the game, any game options, and the gameplay sequence.
    I think these are all good things for an open format to describe (except perhaps the last one, for reasons stated above), so it can support all different flavours of A&A.

    However, you’ll also want new sections for the current state of the game.  Or, perhaps you’ll want to keep that as a separate XML file.
    This is where you’ll need to make tough decisions, like whether it will reflect the current state only, or enumerate all state transitions (ie: unitA moved from terrA to terrB on r3…, etc) that occur in a turn. 
    Also, will it track only one turn (or Round) at a time or will it track the progress of an entire game?
    TripleA does the latter in its saveGame file, and it is extremely useful, and one of the many reasons that I find the tripleA interface far superior to any other I’ve seen.  If you take the easy route and only support the current board state in your open format, you will likely not win over many TripleA users.

    I am currently working on features to TripleA that make it easy to play against a non-triplea player, by enabling the TripleA player to play out the opponents turn in a special “Edit” mode that allows for fixed outcomes of battles, etc.  I think this will be more user-friendly than an open format that loses turn history.

    I think a good place to start is a more in-depth discussion on the revised.xml format I posted from tripleA, and how it does or doesn’t meet general requirements.  I guess I’ve just started that discussion ;)</player></player></playerlist></gameplay>

  • Founder TripleA Admin

    Maybe I didn’t mean ego as much as dogmatic, i.e., “Linux is the best and only operating system, Microsoft is evil, everything should be linux!”

    You guys seem very reasonable to me. :-)

    I’ll post my comments about XML stuff later.


  • Just thought I could throw in a good resource.  Mapview uses XML files to generate a user customizable file to make modules.  Mot has used a Visual basic program to create a compiler.  You make your xml text and drag the file onto the compiler.  Works quite well actually and I’ve made a bunch of modules.  Mot has been kinda out of the scene since having a kid.  I guess I have been too.  He might be a good source of ideas or info so you might check on www.motcreations.com
    Here is an example of the A&A revised xml text I used.

    <module_def format_version=“1”><game_info><title>Axis & Allies Revised Edition</title>
          <author>Der Panzinator</author>
          <url>www.axisdomain.0catch.com</url>
          <copyright>n/a</copyright>
          <min_mv_version>1.2.0</min_mv_version></game_info>
      <game_id><unique_id>AA_Revised</unique_id>
          <version>1</version></game_id>
      <board_settings><board_image>AArevisedMap.gif</board_image>
          <label_font_name>Arial</label_font_name>
          <label_font_size>10</label_font_size>
          <label_is_transparent>False</label_is_transparent></board_settings>  
      <image_settings>     
          <mask_html_color>#FFFFCC</mask_html_color>
          <pallet_img_width>44</pallet_img_width>
          <pallet_img_height>24</pallet_img_height>
          <map_image_width>44</map_image_width>
          <map_image_height>24</map_image_height>
     </image_settings>
      <tabs><category name=“Russia”><token token_id=“russian_flag” token_type=“Image”><pallet_image>rus_flag.gif</pallet_image>
                <drag_image>drag_drop.bmp</drag_image>
                <map_image>rus_flag.gif</map_image>
                Flag
                <click_region_x>0</click_region_x>
                <click_region_y>0</click_region_y>
                <click_region_w>44</click_region_w>
                <click_region_h>24</click_region_h></token>
            <token token_id=“russian_inf” token_type=“Quantity”><pallet_image>rus_inf.gif</pallet_image>
                <drag_image>drag_drop.bmp</drag_image>
                <map_image>rus_inf.gif</map_image>
                Infantry
                <click_region_x>0</click_region_x>
                <click_region_y>0</click_region_y>
                <click_region_w>44</click_region_w>
                <click_region_h>24</click_region_h></token>
            <token token_id=“russian_arm” token_type=“Quantity”><pallet_image>rus_arm.gif</pallet_image>
                <drag_image>drag_drop.bmp</drag_image>
                <map_image>rus_arm.gif</map_image>
                Armor
                <click_region_x>10</click_region_x>
                <click_region_y>4</click_region_y>
                <click_region_w>20</click_region_w>
                <click_region_h>20</click_region_h></token>
            <token token_id=“russian_ftr” token_type=“Quantity”><pallet_image>rus_ftr.gif</pallet_image>
                <drag_image>drag_drop.bmp</drag_image>
                <map_image>rus_ftr.gif</map_image>
                Fighter
                <click_region_x>0</click_region_x>
                <click_region_y>0</click_region_y>
                <click_region_w>44</click_region_w>
                <click_region_h>24</click_region_h></token>
            <token token_id=“russian_bb” token_type=“Quantity”><pallet_image>rus_bb.gif</pallet_image>
                <drag_image>drag_drop.bmp</drag_image>
                <map_image>rus_bb.gif</map_image>
                Battleship
                <click_region_x>0</click_region_x>
                <click_region_y>0</click_region_y>
                <click_region_w>44</click_region_w>
                <click_region_h>24</click_region_h></token></category>
          <category name=“Misc”><token token_id=“misc_remarks” token_type=“Text”><pallet_image>misc_remarks.gif</pallet_image>
                <drag_image>drag_drop.bmp</drag_image>
                <map_image>misc_remarks.gif</map_image>
                Comments
                <click_region_x>10</click_region_x>
                <click_region_y>0</click_region_y>
                <click_region_w>20</click_region_w>
                <click_region_h>28</click_region_h>
                <default_text>Special Orders</default_text></token>
            <token token_id=“misc_complex” token_type=“Image”><pallet_image>misc_complex.gif</pallet_image>
                <drag_image>drag_drop.bmp</drag_image>
                <map_image>misc_complex.gif</map_image>
                Complex
                <click_region_x>10</click_region_x>
                <click_region_y>4</click_region_y>
                <click_region_w>20</click_region_w>
                <click_region_h>20</click_region_h></token>
            <token token_id=“misc_production” token_type=“Numeric”><pallet_image>misc_production.gif</pallet_image>
                <drag_image>drag_drop.bmp</drag_image>
                <map_image>misc_production.gif</map_image>
                Production
                <click_region_x>10</click_region_x>
                <click_region_y>4</click_region_y>
                <click_region_w>20</click_region_w>
                <click_region_h>20</click_region_h></token>
            <token token_id=“misc_money” token_type=“Numeric”><pallet_image>misc_money.gif</pallet_image>
                <drag_image>drag_drop.bmp</drag_image>
                <map_image>misc_money.gif</map_image>
                Income
                <click_region_x>10</click_region_x>
                <click_region_y>4</click_region_y>
                <click_region_w>20</click_region_w>
                <click_region_h>20</click_region_h></token>
            <token token_id=“misc_red_arrow” token_type=“Arrow”><pallet_image>misc_red_arr_pal.gif</pallet_image>
                <drag_image>misc_red_arr_drag.gif</drag_image>
                <map_image>clear.gif</map_image>
                Attack
                <click_region_x>10</click_region_x>
                <click_region_y>4</click_region_y>
                <click_region_w>20</click_region_w>
                <click_region_h>20</click_region_h>
                <line_html_color>#CC3300</line_html_color></token></category></tabs>
      <initial_setup_cmf>AARevised_Initial_Setup.cmf</initial_setup_cmf></module_def>

  • Founder TripleA Admin

    Der Panzinator, can you do me a big favor and invite Mot to this conversation? I’d do it myself but I’m getting tired of creating new accouts everywhere. ;-) It shouldn’t comsume much of his time at all.


  • Hi guys, just poking my head in here.  It was suggested that I stop by to possibly add my two cents.

    Here it goes:

    First, I suggest that the A&A XML file (henceforth called AAX file in this post to save me some typing :) ) be used in an “export/import” format as opposed to the native game storage for currenet and future programs.  This will increase adoption and remove any burden an “outside” format may have on future developement.  (Imagine not being able to add a feature because it might break the AAX format.  That won’t go over well).

    Second, I suggest identifying the common/required pieces of data.  These should be the basis of your format.Â

    Additionally, we must make allowances for additional game-specific data to ride along in the document.  So if there is an XML element for a particular infantry unit that contains just a “location” as a territory, games like TripleA can include extensions such as number-of-spaces-moved and TripleA and MapView both can attach things like X/Y coordinates.  This data should be maintained through the import/export process.  An example:  For MapView, a game id is required because MapView supports many types of games.  So if a MapView game is exported into an AAX file and then imported into a TripleA game, that game id should be re-outputed when the game exported.Â

    (It’s worth noting that the “game id” mebtioned above might not actually be needed since other header information in the “generic/common” sections of the AAX are likely to be enough to identify the game as an A&A game.  But it illustrates the concept).

    Feedback to these ideas?

    Mot


  • Hey at the very least we could supply you with a much better map file for triple A to use than the current one.

  • Founder TripleA Admin

    Sound good.

    My thoughts were to have two XML formats. The first, main format, saves the current state of the game. Turn number, game number, current country’s turn, where the units are on the map, how much money each country has, how many IPCs, etc.

    The next format would come later, it would be the actual turn that was performed. Units purchased, units moved where, the combat that took place, the results of combat etc. The idea here is that you can apply the actions XML file on the game state XML file and “replay” the actions that your opponent took.

    None of the formats “enforce” rules, they simply explain what was done and the results.

    Mot, is there any mroe work being done on MapView? Do you have a way to figure out if units are in a territory? OR is it just X,Y coordinates?

  • 2007 AAR League

    I’ll pop in here too. I had thoughts about building a web-based game engine to work with my dicey so it would be like DAAK on steroids - eg. not only would it save the player’s e-mail addresses and game ID #, but also how many units/IPCs each country has in each territory etc.

    Needless to say, it would get very complicated, and I likely wouldn’t be able to do a visual representation of the game board, at least not without help. But I was also thinking of using some kind of XML file to store the game data.

    I was thinking of a structure like this below (ignore any bad syntax). This shows:

    • Ukraine controlled by Germany with Ger: 4 INf 2 Arm and Jap: 2 Jet Fighters, and
    • Caucasus controlled by Russia with 1 IC 1 AA.

    I think in addition to IPC value each territory should list the “native” owner but I’m too lazy now to type that in yet too…

    
     <map><territory name="Ukraine"><ipc_value>3</ipc_value>
     <owner name="Germany">(or <owner>Germany</owner>?)
    
     <units_present><player name="Germany><quantity>4</quantity>
    
     <unit name="Tanks"><quantity>2</quantity></unit><br /><unit name=" infantry"=""></player> 
    
     <player name="Japan"><unit name="Jet Fighter"><quantity>2</quantity></unit></player></units_present></owner></territory> 
    
     <territory name="Caucasus"><ipc_value>4</ipc_value>
     <owner name="Russia"><units_present><player name="Russia"><unit name="AA"><quantity>1</quantity></unit> 
     <unit name="IC"><quantity>1</quantity></unit></player></units_present></owner></territory></map> 
    
    

    Alternately you could make each unit an individual object with attributes such as just_unloaded_from_transport, num_moves_made, submerged, participated_in_combat, just_built or whatever. Just brainstorming.

  • Founder TripleA Admin

    I’d actually like the main XML file to represent the state of the game between turns. Purely a representation of the map after you finish your turn and before your opponent begins their turn.

    I’m going to gather all of these suggestions and formulate an example.

  • 2007 AAR League

    I’m going to gather all of these suggestions and formulate an example.

    If you build it, they will come!  Bring on the prototype, wise leader.

  • 2007 AAR League

    @djensen:

    I’d actually like the main XML file to represent the state of the game between turns. Purely a representation of the map after you finish your turn and before your opponent begins their turn.

    Good call. Much simpler, and all you need to play/save a game.


  • @djensen:

    I’d actually like the main XML file to represent the state of the game between turns. Purely a representation of the map after you finish your turn and before your opponent begins their turn.

    I’m going to gather all of these suggestions and formulate an example.

    I’m inclined to think there might be advantages to refining that time period from a turn to a phase given the mechanics of A&A.  I know I’d want to see the combat moves and the non-combat moves.

    I think the document should have a few sections:

    1.  An initial state (locations, unit quantities, players IPCs, turn number, phase of turn, etc).
    2.  An end state, again locations, unit quantities, players IPCs, turn number, phase of turn, etc.
    3.  The actions taken to get from the initial state to the end state.  (Combat Move 3 Inf From Eastern Europe To Karelia)

    (The initial and end stat should be discrete and well defined points.  There is no need to create a snapshot in the middle a unit’s move.  This helps eliminate a lot of the tiny bits of information that might be program-specific).

    All this above should be placed into a parent node such that all of these “turns” (which is not a good name because it will actually hold info about less than  turn) can be accumulated for the length of the game.Â

    The goal should be to capture all the information in a generic way.  Whether any current or new program can use that information doesn’t matter.  They can ignore pieces that are not meaningful to them.Â

    I think I’m up to 4 cents now ;)
    Mot

  • Founder TripleA Admin

    The begin state and the end state can be the same XML markup. The same definitions.

    That’s a good idea about storing the phases of the turn in the “transformations” XML.

    Instead of having one universal XML. I’d like 2. The reason being that implementing the current state of the game might be easier for a piece of software to implement than applying the phases during the turns. The state XML would be required to implement to be compatible but the turn XML would be optional. All the turn document is for is to replay or show how did you get from the begin state XML to the end state XML.

Suggested Topics

Axis & Allies Boardgaming Custom Painted Miniatures

24

Online

17.0k

Users

39.3k

Topics

1.7m

Posts