From: Dr. M. B. <dr....@t-...> - 2019-05-20 17:43:24
|
On 20.05.19 04:01, Chris Moore wrote: > I think 1861 has a different model from the other games already > implemented, and I'm wondering if I can get it to work just using the > XML configuration or if I'm going to have to code around it. > > In 1861 a train can choose to skip a town or not. If it skips the > town it doesn't get paid for it. So for example, If I have a route > that is City - Town - City I can run a 2-train on that route and get > paid for the two cities. But if a route is just City - Town I can run > a 2-train there and get paid for the city and the town. > > I've played with the options in the XML and I can get it to either > skip a town and score the town it skipped, or I can get it to not > allow me to route to towns at all. But I can't seem to configure this > "route to a town only if needed" option to work. > > Any tips on configuring that? If it can't currently be done through > XML, any tips on where in the algorithm code to add this behavior? > The whole algorithm package is a little overwhelming, and I haven't > figured out yet how it works. > > Thanks, > Chris > > > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel Hi Chris, a change like that wont be possible with the xml-configuration alone i am sure :) the code you are looking for is the heart of rails besides the graphic engine. Its the network and revenue calculation magic being created by Stefan Frey which you can find in the rails/algorithms subdirectory. The both classes you should have a look at are RevenueDynamicModifier and RevenueStaticModifier. Imho you will need to create a RevenueDynamicModifier_1861 which should do the following. Set the Reach of a particular Train to a sufficient large number to count all stops and cities on a route, determine the number of cities and only add towns to the revenue if the maximum of cities couldnt be reached. I am unsure if there is an Expresstrain Implemented already but that would/should use the same mechanismn with a modifier... Hope that helps Martin |