From: Freek D. <sf_...@ma...> - 2010-01-30 20:52:45
|
I know the formatting standard for java code is 4 spaces in this project, but how about XML files? That is currently mostly -but not all- tabs: 8543 lines with tabs only 1715 lines with spaces only 390 lines without spaces or tabs 68 lines with both spaces and tabs 33 empty lines Also, tiles/TileDictionary.xml is a 355 kiByte file without any carriage return, and 1830/CompanyManager.xml contains a spurious ` (backtick) character. I like to clean the formatting. Preferences? tabs or spaces? Regards, Freek |
From: Rick W. <wes...@pu...> - 2010-01-30 21:22:25
|
On Jan 30, 2010, at 3:52 PM, Freek Dijkstra wrote: > I know the formatting standard for java code is 4 spaces in this > project, but how about XML files? That is currently mostly -but not > all- > tabs: > > 8543 lines with tabs only > 1715 lines with spaces only > 390 lines without spaces or tabs > 68 lines with both spaces and tabs > 33 empty lines > > Also, tiles/TileDictionary.xml is a 355 kiByte file without any > carriage > return, and 1830/CompanyManager.xml contains a spurious ` (backtick) > character. > > I like to clean the formatting. Preferences? tabs or spaces? > > Regards, I believe that TileDictionary was automatically generated and is not meant to be parsed by humans. Formatting is one of those issues that drives people crazy in shared projects. I find it very hard to get common formatting guidelines or directory structure guidelines enforced unless I make a total pain of myself. That is not to say that some sort of guide would be unwelcome. In addition to tabs vs. space and how much indent you need to think about: (1) Space before ending tag; e.g., <Game name="1830"/> or <Game name="1830" /> ... the stock market chart uses spaces at times and other times not. (2) Line size? 80 characters maximum? Or as long as is needed? (3) Multi-line comments: Does the end tag come on a separate line? How about the beginning tag? Should there be some requirement for comments (e.g., version or author) at the top of the XML files? Personally I do not care as long as there is some standard. -- Rick |
From: Erik V. <eri...@xs...> - 2010-01-30 23:04:34
|
Personally I do not care much about spacing standards at all, as long as the indentation looks right. I only manually format Java code (because Eclipses formatting does strange things when it thinks lines being too long), and I usually don't take notice of whether it's done with tabs or spaces. TileDesigner.xml is an intermediate file created by TileDesigner as a oneliner, and used to create Tiles.xml. Whenever I want to inspect a new version, I format it with XMLBuddy; if not, I don't. So I would say: feel free to format stuff in any way, and I will try to follow, but no guarantees. On line length: 80 is too short for my taste. 100 would be OK. Erik. -----Original Message----- From: Rick Westerman [mailto:wes...@pu...] Sent: Saturday 30 January 2010 22:24 To: Development list for Rails: an 18xx game Subject: Re: [Rails-devel] Tabs vs spaces in xml files On Jan 30, 2010, at 3:52 PM, Freek Dijkstra wrote: > I know the formatting standard for java code is 4 spaces in this > project, but how about XML files? That is currently mostly -but not > all- > tabs: > > 8543 lines with tabs only > 1715 lines with spaces only > 390 lines without spaces or tabs > 68 lines with both spaces and tabs > 33 empty lines > > Also, tiles/TileDictionary.xml is a 355 kiByte file without any > carriage > return, and 1830/CompanyManager.xml contains a spurious ` (backtick) > character. > > I like to clean the formatting. Preferences? tabs or spaces? > > Regards, I believe that TileDictionary was automatically generated and is not meant to be parsed by humans. Formatting is one of those issues that drives people crazy in shared projects. I find it very hard to get common formatting guidelines or directory structure guidelines enforced unless I make a total pain of myself. That is not to say that some sort of guide would be unwelcome. In addition to tabs vs. space and how much indent you need to think about: (1) Space before ending tag; e.g., <Game name="1830"/> or <Game name="1830" /> ... the stock market chart uses spaces at times and other times not. (2) Line size? 80 characters maximum? Or as long as is needed? (3) Multi-line comments: Does the end tag come on a separate line? How about the beginning tag? Should there be some requirement for comments (e.g., version or author) at the top of the XML files? Personally I do not care as long as there is some standard. -- Rick ---------------------------------------------------------------------------- -- The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com _______________________________________________ Rails-devel mailing list Rai...@li... https://lists.sourceforge.net/lists/listinfo/rails-devel |
From: Freek D. <sf_...@ma...> - 2010-01-31 16:22:07
|
Erik Vos wrote: > TileDesigner.xml is an intermediate file created by TileDesigner as a > oneliner, and used to create Tiles.xml. > Whenever I want to inspect a new version, I format it with XMLBuddy; if not, > I don't. Out of curiousity, how are tiles created? So apparently, TileDictionary.18t is (or has been) the base set of tiles created with Tile Designer. Tile Designer can output to TileDictionary.xml, which is then converted to Tiles.xml (whose format is specific for this project), and the relevant contents is copied to Tiles.xml in the data directory. At the same time, Tiles.xml is used to create the SVG files. So there are two scripts (which are not in the repository) to create tiles: - Convert TileDictionary.xml to Tiles.xml - Convert Tiles.xml to the SVG files I presume that the conversion from tiles/Tiles.xml to data/*/Tiles.xml is manual? Also, the Java engine reads Tiles.xml which is used to know about tracks and Stations (and Cities), but displays the SVG tile (without verifying if they match). Am I correct so far? So it would not yet be possible to, let's say, display a path on top of the board showing an optimal run for a train, since there is no algorithm in the Java code to render the (abstract) information in Tiles.xml on the board? Regards, Freek |
From: brett l. <wak...@gm...> - 2010-01-31 21:50:04
|
On Sun, Jan 31, 2010 at 10:08 AM, Erik Vos <eri...@xs...> wrote: > So it would not yet be possible to, let's say, display a path on top of > the board showing an optimal run for a train, since there is no > algorithm in the Java code to render the (abstract) information in > Tiles.xml on the board? > > [EV] As there is no linkage to the SVG contents, it would not be possible > (or at least far too hard for me) to highlight routes on the map. > > However, nothing prevents anyone to write code to derive routes > (optimal or not) from the available information in Tiles.xml, > combined with the knowledge which tiles exist on which hexes in which > orientation. > And these routes could of course be displayed in some message area, > as A5-B6-B8-C7 or whatever. > > Erik. There's a few possible ways to skin that cat. SVG is an XML-based format, plus we've got the route metadata in the Tiles XML files. As I see it, between Swing and Batik, it's possible to draw whatever you want on the map, using as much or as few data sources as you like. Some possible options are: 1. Identify the discrete objects within the SVG that constitute a path from hex-to-hex. 2. Identify routes based solely on the Tiles metadata, and use Swing to draw on top of the map. The math to calculate the path of the line is somewhat complex, but not impossible. 3. Some combination of using metadata and the SVG path data to do interesting things. Maybe there are other options I'm not aware of. ---Brett. |
From: Freek D. <sf_...@ma...> - 2010-01-31 22:10:58
|
brett lentz wrote: >> So it would not yet be possible to, let's say, display a path on top of >> the board showing an optimal run for a train [...] > Some possible options are: > [...] > Maybe there are other options I'm not aware of. Let's tackle this by the time route calculation is done and we can generate SVG directly from Tiles.xml. Both are feasible, but with my current spare time, this can take a while. Your mileage my vary ;). (Also the last time I looked at SVG was in 2002, when SVG 1.1 was not even out). Regards, Freek |
From: Freek D. <sf_...@ma...> - 2010-01-31 22:25:36
|
Rick Westerman wrote: > In addition to tabs vs. space and how much indent you need to think > about: > > (1) Space before ending tag; e.g., <Game name="1830"/> or > <Game name="1830" /> ... the stock market chart uses spaces at times > and other times not. > > (2) Line size? 80 characters maximum? Or as long as is needed? > > (3) Multi-line comments: Does the end tag come on a separate > line? How about the beginning tag? > > Should there be some requirement for comments (e.g., version or > author) at the top of the XML files? > > Personally I do not care as long as there is some standard. This never bothered me, so I don't care either. If you like this to be standardized in some way, pick a choice, and I'll do a batch commit. Regards, Freek |
From: Rick W. <wes...@pu...> - 2010-02-01 14:15:41
|
Freek Dijkstra wrote: > Rick Westerman wrote: > > >> In addition to tabs vs. space and how much indent you need to think >> about: >> >> (1) Space before ending tag; e.g., <Game name="1830"/> or >> <Game name="1830" /> ... the stock market chart uses spaces at times >> and other times not. >> >> (2) Line size? 80 characters maximum? Or as long as is needed? >> >> (3) Multi-line comments: Does the end tag come on a separate >> line? How about the beginning tag? >> >> Should there be some requirement for comments (e.g., version or >> author) at the top of the XML files? >> >> Personally I do not care as long as there is some standard. >> > > This never bothered me, so I don't care either. If you like this to be > standardized in some way, pick a choice, and I'll do a batch commit. > I am not sure if any of us care that much. But then I don't think many of us cared about the space/tab issue either. If I ever get my manual out on how to create a game then I will include some recommendations. Until then we can probably just leave the files as they are. -- Rick Westerman wes...@pu... |
From: Michał B. <ba...@tl...> - 2010-01-31 16:59:04
|
1851 and its map - why is J12 (Birmingham) a red off-board city in the rails implementation? the maps I see on bgg (http://boardgamegeek.com/image/126915/1851?size=original, http://boardgamegeek.com/image/123136/1851?size=original) show it is a grey town that trains can run through, not a route start/end. mike |
From: Chris S. <chr...@gm...> - 2010-01-31 17:07:16
|
This was reported as a bug recently and is fixed in the latest cvs. It will be in the next release. -- Chris Please consider the environment before printing this e-mail. 2010/1/31 Michał Bażyński <ba...@tl...> > 1851 and its map - why is J12 (Birmingham) a red off-board city in the > rails implementation? the maps I see on bgg > (http://boardgamegeek.com/image/126915/1851?size=original, > http://boardgamegeek.com/image/123136/1851?size=original) show it is a > grey town that trains can run through, not a route start/end. > > > mike > > > ------------------------------------------------------------------------------ > The Planet: dedicated and managed hosting, cloud storage, colocation > Stay online with enterprise data centers and the best network in the > business > Choose flexible plans and management services without long-term contracts > Personal 24x7 support from experience hosting pros just a phone call away. > http://p.sf.net/sfu/theplanet-com > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel > |
From: Erik V. <eri...@xs...> - 2010-01-31 18:08:13
|
[EV] Answers below Out of curiousity, how are tiles created? So apparently, TileDictionary.18t is (or has been) the base set of tiles created with Tile Designer. Tile Designer can output to TileDictionary.xml, which is then converted to Tiles.xml (whose format is specific for this project), and the relevant contents is copied to Tiles.xml in the data directory. At the same time, Tiles.xml is used to create the SVG files. [EV] No, the SVG tiles are exported from TileDesigner. See the comments in CombineTiles.pl for the procedure. This script does the final filling of tiles/svg from 3 different sources: - tiles with ID (>0, i.e. the layable tiles) - tiles without ID (<=0, i.e. the preprinted tiles) - handmade tiles (edited from exported tiles with Inkscape). I have not checked these 3 source directories into CVS. So there are two scripts (which are not in the repository) to create tiles: - Convert TileDictionary.xml to Tiles.xml [EV} not a script but the Java class rails.util.ConvertTilesXML (which should move to some tools directory) - Convert Tiles.xml to the SVG files [EV] No, see above. I presume that the conversion from tiles/Tiles.xml to data/*/Tiles.xml is manual? [EV] No, that is done with Java class rails.util.MakeGameTileSets (should also become a tool). Also, the Java engine reads Tiles.xml which is used to know about tracks and Stations (and Cities), but displays the SVG tile (without verifying if they match). [EV] Yes. Am I correct so far? [EV] See above corerections. So it would not yet be possible to, let's say, display a path on top of the board showing an optimal run for a train, since there is no algorithm in the Java code to render the (abstract) information in Tiles.xml on the board? [EV] As there is no linkage to the SVG contents, it would not be possible (or at least far too hard for me) to highlight routes on the map. However, nothing prevents anyone to write code to derive routes (optimal or not) from the available information in Tiles.xml, combined with the knowledge which tiles exist on which hexes in which orientation. And these routes could of course be displayed in some message area, as A5-B6-B8-C7 or whatever. Erik. |
From: Freek D. <sf_...@ma...> - 2010-01-31 22:23:23
|
Freek Dijkstra wrote: > I know the formatting standard for java code is 4 spaces in this > project, but how about XML files? That is currently mostly -but not all- > tabs. I just did a large commit, only converting spaces and tabs. The XML files now use tabs (25 files changed); the code files now use spaces (110 files changed). In fact, I don't mind. However, some CompanyManager.xml files freaked my out, combining tabs, 4-spaces and 2-spaces in a single file. For example 1856/CompanyManager.xml: one indent achieved using 2 spaces, two indents using 1 tab and three indents using 2 tabs. I must be neurotic to be bothered by it, but you wouldn't like to see that part of me, so I'll commited. Regards, Freek |