From: Erik V. <eri...@hc...> - 2005-07-17 16:42:04
|
> Excellent. I hope you had a good vacation. Yes, it was great (2.5 weeks in the UK). > > The XML syntax is still fairly rudimentary at this point, but > > it's a starting point. > > > > Please check it out of CVS and let me know what you think. IMO we need three object types to model a map: - Map, defining the coordinate system and, optionally, the fixed non-tile graphics, - Hex (or Location in Stewart's object model - I prefer Hex), defining any location on the map that has relavance for playing, and what (type of) tiles can be laid initially (if any at all), or what "fixed" tile is there (i.e. a preprinted or off-board tile), - Tile (defing the cities and connections). IMHO the XML should reflect this structure. So I would propose something like <Map hexOrientation="vertical" horCoordinates="numbers,right" vertCoordinates="letters,down" relative="SE" picture="1830map.jpg"> <Hex location="A9" type="offboard" tile="somethingThatDefinesThisPreprintedOffboardHex"/> <Hex location="B10" type="playable" firstTiles="57"/> <Hex location="C11" type="playable" firstTiles="7,8,9"/> ... </Map> and a separate xml to define tiles (see below). hexOrientation defines if the tiles are pointed N/S or E/W. relative means how location B2 is oriented with respect to A1. I don't think we need Row as a separate concept. Any location in the coordinate system that is not defined as a Hex is unreachable; the (optional) Map jpg may define some nice graphics there, but that location does not play a role in the game. If there is a picture, the precise pixel location of the center of hex A1 must also be defined. > > I've been slowly poking and prodding the Hex code into > > submission. Right now, I've got a working test class for it > > in CVS. Essentially it's just a stripped down version of the > > Colossus code. I've stripped out all of the > > Colosssus-specific bits. So, now it's ready for us to extend > > it to fit our own needs. If I run HexTest, I only get an empty window. What am I missing? > > The todo list I've got so far for the HexMap looks something > > like this: > > > > # Define map XML specification > > # Generate map XML files > > # Need to create classes for loading the map files. > > # Decide whether to draw hexes using Drawing2D or use loaded > > graphics overlayed on top of the hex panel. > > # Decide on tile XML specification > > # Generate tile XML files > > # Create code for placing tiles Marco Rocci's file TileDesigner.18t contains detailed tile definitions, though not in XML format. We might not need the level of detail contained in that file, but my suggestion would be to see if we can translate this file into a tile.xml file. Erik. |