News:

Simutrans.com Portal
Our Simutrans site. You can find everything about Simutrans from here.

[Bugs v6.8] distance_per_tile in einstellungen_t

Started by knightly, September 15, 2009, 10:38:01 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

knightly

James,

(1)
In einstellungen_t::einstellungen_t() :
Quote
   // Revenue calibration settings
   // @author: jamespetts
   min_bonus_max_distance = 4;
   max_bonus_min_distance = 256;
   median_bonus_distance = 0;
   max_bonus_multiplier_percent = 300;
   distance_per_tile = 2.5F;
I think the green line should use 0.25F instead of 2.5F. Although the default value is rarely used, it's better to fix it.


(2)
Last time I suggested you to move all the cost adjustments involving distance_per_tile to the following block of code :
Quote
            if(file->get_experimental_version() < 6)
            {
               min_bonus_max_distance /= distance_per_tile;
               max_bonus_min_distance /= distance_per_tile;
               // Scale the costs to match the scale factor.
               cst_multiply_dock *= distance_per_tile;
               cst_multiply_station *= distance_per_tile;
               cst_multiply_roadstop *= distance_per_tile;
               cst_multiply_airterminal *= distance_per_tile;
               cst_multiply_post *= distance_per_tile;
               maint_building *= distance_per_tile;
               cst_signal *= distance_per_tile;
               cst_tunnel *= distance_per_tile;
               cst_third_rail *= distance_per_tile;
               cst_buy_land *= distance_per_tile;
               cst_remove_tree *= distance_per_tile;
            }
However, this block of code is invoked only when EXP version > 1. For STD save games, these costs are not adjusted, causing serious losses. So, the correct way is to move this whole block of code together with its IF condition out of 2 levels of outer IF. That is, move the whole code block out of the following 2 nested IF blocks, and place it after them :
Quote
      if(file->get_experimental_version() >= 1)
      {
         file->rdwr_short(min_bonus_max_distance, "");
         file->rdwr_short(max_bonus_min_distance, "");
         if(file->get_experimental_version() == 1)
         {
            uint16 dummy;
            file->rdwr_short(dummy, "");
         }
         else
         {


Knightly

jamespetts

Thank you very much for the reports; apologies for the delay in replying: I've been a little busy, not least with adding code to replace factories after they have closed down. I have implemented your suggestions, which will be in the next release. Thank you for your help :-)
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.