From: <Dr....@t-...> - 2016-06-09 09:22:35
|
Good Morning, justone word of caution :) 1.8/9 and 2.0 use a different directory layout. If you plan on producing new enhancements you should stay on the 2.0 tree.The maintainer/responsible lead developer is Stefan Frey. I am the maintainer of the "old" version 1.8/9. If you look into the history of this group you can find some tips and hints by Stefan/Erik Vos/Brett Lenz about the principles of development. For the basic part: one goal was to have a complete seperation of GUI and Core Components (this had to abandoned meanwhile) You'll find the gui components in <net.sf.>rails.ui.... The core game components (base classes) are in <net.sf.>rails.game and subclasses. If you require game specific code cause the base classes dont provide all necessary logic the convention is that this code will go into subclasses in <net.sf.>rails.game.specific._gamename or <net.sf.>rails.ui.swing.gamespecific._gamename because of backward and gameengine compatibility the so called game action classes reside in <net.sf.>rails.game.action/correct respectivly in <net.sf.>game.specific._name The base game was 1830. theres no specific code for 1830. Deriviations from 1830 mechanismns have to go into game specific code. If you find a number of games that use the same mechanismn and thus require the same code it might be appropriate to create a new base class with a descriptive name though. Please make sure that a new base class comes with extensive documentation and Junit Tests :) How to configure a new game... below src/main/resources you'll find a data directory inside in subdirectories reside the gamespecific configuration files. Have a look at a number of those to note the differences (1835 or 1880 would be suitable candidates). tiles and tiles.svg contain the routines and svg-images for the maps. We are still lacking gamespecific tiles for newer games but the basis should be complete by now. To create new tiles is a rather tedious process since we lack currently a good editor to create new tiles in the needed format and the information (the game uses xml-descriptions to create the internal relation map, the UI uses the svg to display the map). Tiledictionary.xml and Tiles.xml contain the necessary information. Each game has its own Tiles.xml (a subset of the "global Tiles.xml) and Tileset.xml defining the upgrades and amount of tiles available. I hope this will help you find your way.. Any more questions please dont hesitate to ask. If you got code please send that code in a diff to me/the list (for 1.8/9) or to Stefan/the list (for 2.0). I would be willing to setup new branches for you on the repository and will import the code there. Regards, Martin -----Original-Nachricht----- Betreff: Re: [Rails-devel] Help learning the source? Datum: 2016-06-08T23:56:07+0200 Von: "Jonathan Coveney" <jco...@gm...> An: "Development list for Rails: an 18xx game" <rai...@li...> To close the loop, it looks like log4j.properties is a red herring... this got me the logging I wanted: $ git diff src/main/resources/logback.xml diff --git a/src/main/resources/logback.xml b/src/main/resources/logback.xml index e084235..7020a75 100644 --- a/src/main/resources/logback.xml +++ b/src/main/resources/logback.xml @@ -15,8 +15,14 @@ <pattern>%d{yyyy-MM-dd HH:mm:ss} %-5p %m%n</pattern> </encoder> </appender> + <appender name="C" class="ch.qos.logback.core.ConsoleAppender"> + <encoder> + <pattern>%d{yyyy-MM-dd HH:mm:ss} %-5p %m%n</pattern> + </encoder> + </appender> <logger name="net.sf.rails.algorithms" level="WARN"/> <root level="DEBUG"> <appender-ref ref="F"/> + <appender-ref ref="C"/> </root> </configuration> 2016-06-08 17:46 GMT-04:00 Jonathan Coveney <jco...@gm... <mailto:jco...@gm...> >: Oh weird, it's logging to 18xx.log, instead of to the console 2016-06-08 17:44 GMT-04:00 Jonathan Coveney <jco...@gm... <mailto:jco...@gm...> >: This log4j thing is tricky! I have the following file: # Root logger option log4j.rootLogger=DEBUG, stdout # Direct log messages to stdout log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n which I have placed in many places... src/, the base directory, I've added the folder containing it to eclipse's classpath, I've changed -Dlog4j.configuration to point to it... it just doesn't want to configure itself. I can replace all of the debug statements with prints but having the line class/line numbers is super useful! Thanks for any guidance... 2016-06-08 17:00 GMT-04:00 Jonathan Coveney <jco...@gm... <mailto:jco...@gm...> >: I have this largely set up, the one thing I'm not sure is how to properly set the log4j properties while debugging. Do I just need to put a log4j.properties on the classpath, or is there some more canonical way? Thank you! 2016-06-08 16:30 GMT-04:00 Jonathan Coveney <jco...@gm... <mailto:jco...@gm...> >: Thank you! Very helpful 2016-06-08 14:19 GMT-04:00 Martin Brumm < dr....@t-... <mailto:dr....@t-...> > : Good evening Jonathan, i am glad to be of assistance. I personally use Eclipse to handle everything IDE wise. The Code can be found as a git repository on sourceforge. The main component to run resides on the 1.8/1.9 branch in rails.util.rungame. In eclipse you can rightclick on the class and eithe run the class as Java Application or Debug :) Just as easy as that. The following branches are more or less active in the moment: rails_2_develop is the development branch for 2.x rails_2_maintenance is the maintenance branch for 2.0 rails1.8.x is the development and maintenance branch for 1.9 in the moment. rails.2.0 is the release branch of Rails2.0 the other branches you see is development ongoing (more or less private branches denoted by the initials of the developers mbr=is me for example..) If you use eclipse theres currently no need to run gradle. You can handle everything inside your IDE. More in the next post. Regards, Martin Am 08.06.2016 um 19:46 schrieb Jonatha Coveney: One thing that would be particularly useful is how to run my own version of rails, with debugging, so that I can add extra traces etc. Is this easy to do? I am new-ish to gradle 2016-06-08 13:23 GMT-04:00 Jonathan Coveney < jco...@gm... <mailto:jco...@gm...> >: Hello friends! I am an 18xx enthusiast who is also a programmer, and I really have enjoyed using rails. As such, I'd like to learn the code, and see if I can't eventually pitch in. For now, I'm really curious to see how the game logic is implemented...any tips for learning the code? Because I imagine there is also a lot of code around networking, UI, etc, and for now I'm curious to see how the game itself is driven. ------------------------------------------------------------------------------ What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic patterns at an interface-level. Reveals which users, apps, and protocols are consuming the most bandwidth. Provides multi-vendor support for NetFlow, J-Flow, sFlow and other flows. Make informed decisions using capacity planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e <https://ad.doubleclick.net/ddm/clk/305295220;132659582;e> _______________________________________________ Rails-devel mailing list Rai...@li... <mailto:Rai...@li...> https://lists.sourceforge.net/lists/listinfo/rails-devel <https://lists.sourceforge.net/lists/listinfo/rails-devel> |