src/settings_type.h
branchnoai
changeset 10715 6bdf79ffb022
parent 10455 22c441f5adf9
child 10776 07203fc29812
equal deleted inserted replaced
10713:c5c9dc32c052 10715:6bdf79ffb022
     3 /** @file settings_type.h Types related to global configuration settings. */
     3 /** @file settings_type.h Types related to global configuration settings. */
     4 
     4 
     5 #ifndef SETTINGS_TYPE_H
     5 #ifndef SETTINGS_TYPE_H
     6 #define SETTINGS_TYPE_H
     6 #define SETTINGS_TYPE_H
     7 
     7 
     8 #include "yapf/yapf_settings.h"
       
     9 #include "date_type.h"
     8 #include "date_type.h"
    10 #include "town_type.h"
     9 #include "town_type.h"
    11 #include "transport_type.h"
    10 #include "transport_type.h"
    12 
    11 
    13 #define GAME_DIFFICULTY_NUM 18
    12 /** Settings related to the difficulty of the game */
    14 
    13 struct DifficultySettings {
    15 /** Specific type for Game Difficulty to ease changing the type */
    14 	byte   max_no_competitors;               ///< the number of competitors (AIs)
    16 typedef uint16 GDType;
    15 	byte   competitor_start_time;            ///< how long to wait for the first competitors (AIs)
    17 struct GameDifficulty {
    16 	byte   number_towns;                     ///< the amount of towns
    18 	GDType max_no_competitors;
    17 	byte   number_industries;                ///< the amount of industries
    19 	GDType competitor_start_time;
    18 	uint32 max_loan;                         ///< the maximum initial loan
    20 	GDType number_towns;
    19 	byte   initial_interest;                 ///< amount of interest (to pay over the loan)
    21 	GDType number_industries;
    20 	byte   vehicle_costs;                    ///< amount of money spent on vehicle running cost
    22 	GDType max_loan;
    21 	byte   competitor_speed;                 ///< the speed at which the AI builds
    23 	GDType initial_interest;
    22 	byte   competitor_intelligence;          ///< the competior's (AI) intelligence
    24 	GDType vehicle_costs;
    23 	byte   vehicle_breakdowns;               ///< likelihood of vehicles breaking down
    25 	GDType competitor_speed;
    24 	byte   subsidy_multiplier;               ///< amount of subsidy
    26 	GDType competitor_intelligence; ///< no longer in use
    25 	byte   construction_cost;                ///< how expensive is building
    27 	GDType vehicle_breakdowns;
    26 	byte   terrain_type;                     ///< the mountainousness of the landscape
    28 	GDType subsidy_multiplier;
    27 	byte   quantity_sea_lakes;               ///< the amount of seas/lakes
    29 	GDType construction_cost;
    28 	byte   economy;                          ///< how volatile is the economy
    30 	GDType terrain_type;
    29 	byte   line_reverse_mode;                ///< reversing at stations or not
    31 	GDType quantity_sea_lakes;
    30 	byte   disasters;                        ///< are disasters enabled
    32 	GDType economy;
    31 	byte   town_council_tolerance;           ///< minimum required town ratings to be allowed to demolish stuff
    33 	GDType line_reverse_mode;
    32 	byte   diff_level;                       ///< the difficulty level
    34 	GDType disasters;
    33 };
    35 	GDType town_council_tolerance; ///< minimum required town ratings to be allowed to demolish stuff
    34 
    36 };
    35 /** Settings related to the GUI and other stuff that is not saved in the savegame. */
    37 
    36 struct GUISettings {
    38 struct GameOptions {
    37 	bool   vehicle_speed;                    ///< show vehicle speed
    39 	GameDifficulty diff;
    38 	bool   sg_full_load_any;                 ///< new full load calculation, any cargo must be full read from pre v93 savegames
    40 	byte diff_level;
    39 	bool   lost_train_warn;                  ///< if a train can't find its destination, show a warning
    41 	byte currency;
    40 	uint8  order_review_system;              ///< perform order reviews on vehicles
    42 	byte units;
    41 	bool   train_income_warn;                ///< if train is generating little income, show a warning
    43 	byte town_name;
    42 	bool   status_long_date;                 ///< always show long date in status bar
    44 	byte landscape;
    43 	bool   show_finances;                    ///< show finances at end of year
    45 	byte snow_line;
    44 	bool   sg_new_nonstop;                   ///< ttdpatch compatible nonstop handling read from pre v93 savegames
    46 	byte autosave;
    45 	bool   new_nonstop;                      ///< ttdpatch compatible nonstop handling
    47 	byte road_side;
    46 	bool   autoscroll;                       ///< scroll when moving mouse to the edge
    48 };
    47 	byte   errmsg_duration;                  ///< duration of error message
    49 
    48 	bool   link_terraform_toolbar;           ///< display terraform toolbar when displaying rail, road, water and airport toolbars
    50 /* These are the options for the current game
    49 	bool   reverse_scroll;                   ///< right-Click-Scrolling scrolls in the opposite direction
    51  * either ingame, or loaded. Also used for networking games */
    50 	bool   smooth_scroll;                    ///< smooth scroll viewports
    52 extern GameOptions _opt;
    51 	bool   measure_tooltip;                  ///< show a permanent tooltip when dragging tools
    53 
    52 	byte   liveries;                         ///< options for displaying company liveries, 0=none, 1=self, 2=all
    54 /* These are the default options for a new game */
    53 	bool   prefer_teamchat;                  ///< choose the chat message target with <ENTER>, true=all players, false=your team
    55 extern GameOptions _opt_newgame;
    54 	uint8  advanced_vehicle_list;            ///< use the "advanced" vehicle list
    56 
    55 	uint8  loading_indicators;               ///< show loading indicators
    57 /* Pointer to one of the two _opt OR _opt_newgame structs */
    56 	uint8  default_rail_type;                ///< the default rail type for the rail GUI
    58 extern GameOptions *_opt_ptr;
    57 	uint8  toolbar_pos;                      ///< position of toolbars, 0=left, 1=center, 2=right
    59 
    58 	uint8  window_snap_radius;               ///< windows snap at each other if closer than this
    60 struct Patches {
    59 	bool   always_build_infrastructure;      ///< always allow building of infrastructure, even when you do not have the vehicles for it
    61 	bool modified_catchment;            ///< different-size catchment areas
    60 	byte   autosave;                         ///< how often should we do autosaves?
    62 	bool vehicle_speed;                 ///< show vehicle speed
    61 	bool   keep_all_autosave;                ///< name the autosave in a different way
    63 	bool build_on_slopes;               ///< allow building on slopes
    62 	bool   autosave_on_exit;                 ///< save an autosave when you quit the game, but do not ask "Do you really want to quit?"
    64 	bool mammoth_trains;                ///< allow very long trains
    63 	byte   max_num_autosaves;                ///< controls how many autosavegames are made before the game starts to overwrite (names them 0 to max_num_autosaves - 1)
    65 	bool join_stations;                 ///< allow joining of train stations
    64 	bool   population_in_label;              ///< show the population of a town in his label?
    66 	bool sg_full_load_any;              ///< new full load calculation, any cargo must be full read from pre v93 savegames
    65 	uint8  right_mouse_btn_emulation;        ///< should we emulate right mouse clicking?
    67 	bool improved_load;                 ///< improved loading algorithm
    66 	uint8  scrollwheel_scrolling;            ///< scrolling using the scroll wheel?
    68 	bool gradual_loading;               ///< load vehicles gradually
    67 	uint8  scrollwheel_multiplier;           ///< how much 'wheel' per incoming event from the OS?
    69 	byte station_spread;                ///< amount a station may spread
    68 	bool   pause_on_newgame;                 ///< whether to start new games paused or not
    70 	bool inflation;                     ///< disable inflation
    69 	bool   enable_signal_gui;                ///< show the signal GUI when the signal button is pressed
    71 	bool selectgoods;                   ///< only send the goods to station if a train has been there
    70 	Year   ending_year;                      ///< end of the game (just show highscore)
    72 	bool longbridges;                   ///< allow 100 tile long bridges
    71 	Year   colored_news_year;                ///< when does newspaper become colored?
    73 	bool gotodepot;                     ///< allow goto depot in orders
    72 	bool   timetable_in_ticks;               ///< whether to show the timetable in ticks rather than days
    74 	uint8 raw_industry_construction;    ///< Type of (raw) industry construction (none, "normal", prospecting)
    73 	bool   bridge_pillars;                   ///< show bridge pillars for high bridges
    75 	bool multiple_industry_per_town;    ///< allow many industries of the same type per town
    74 	bool   auto_euro;                        ///< automatically switch to euro in 2002
    76 	bool same_industry_close;           ///< allow same type industries to be built close to each other
    75 	byte   drag_signals_density;             ///< many signals density
    77 	bool lost_train_warn;               ///< if a train can't find its destination, show a warning
    76 	Year   semaphore_build_before;           ///< build semaphore signals automatically before this year
    78 	uint8 order_review_system;
    77 	bool   autorenew;                        ///< should autorenew be enabled for new companies?
    79 	bool train_income_warn;             ///< if train is generating little income, show a warning
    78 	int16  autorenew_months;                 ///< how many months from EOL of vehicles should autorenew trigger for new companies?
    80 	bool status_long_date;              ///< always show long date in status bar
    79 	int32  autorenew_money;                  ///< how much money before autorenewing for new companies?
    81 	bool signal_side;                   ///< show signals on right side
    80 	byte   currency;                         ///< currency we currently use
    82 	bool show_finances;                 ///< show finances at end of year
    81 	byte   units;                            ///< unit system we show everything
    83 	bool sg_new_nonstop;                ///< ttdpatch compatible nonstop handling read from pre v93 savegames
    82 };
    84 	bool new_nonstop;                   ///< ttdpatch compatible nonstop handling
    83 
    85 	bool roadveh_queue;                 ///< buggy road vehicle queueing
    84 /** Settings related to the creation of games. */
    86 	bool autoscroll;                    ///< scroll when moving mouse to the edge.
    85 struct GameCreationSettings {
    87 	byte errmsg_duration;               ///< duration of error message
    86 	uint32 generation_seed;                  ///< noise seed for world generation
    88 	byte land_generator;                ///< the landscape generator
    87 	Year   starting_year;                    ///< starting date
    89 	byte oil_refinery_limit;            ///< distance oil refineries allowed from map edge
    88 	uint8  map_x;                            ///< X size of map
    90 	byte snow_line_height;              ///< a number 0-15 that configured snow line height
    89 	uint8  map_y;                            ///< Y size of map
    91 	byte tgen_smoothness;               ///< how rough is the terrain from 0-3
    90 	byte   land_generator;                   ///< the landscape generator
    92 	uint32 generation_seed;             ///< noise seed for world generation
    91 	byte   oil_refinery_limit;               ///< distance oil refineries allowed from map edge
    93 	byte tree_placer;                   ///< the tree placer algorithm
    92 	byte   snow_line_height;                 ///< a number 0-15 that configured snow line height
    94 	byte heightmap_rotation;            ///< rotation director for the heightmap
    93 	byte   tgen_smoothness;                  ///< how rough is the terrain from 0-3
    95 	byte se_flat_world_height;          ///< land height a flat world gets in SE
    94 	byte   tree_placer;                      ///< the tree placer algorithm
    96 	bool bribe;                         ///< enable bribing the local authority
    95 	byte   heightmap_rotation;               ///< rotation director for the heightmap
    97 	bool nonuniform_stations;           ///< allow nonuniform train stations
    96 	byte   se_flat_world_height;             ///< land height a flat world gets in SE
    98 	bool adjacent_stations;             ///< allow stations to be built directly adjacent to other stations
    97 	byte   town_name;                        ///< the town name generator used for town names
    99 	bool always_small_airport;          ///< always allow small airports
    98 	byte   landscape;                        ///< the landscape we're currently in
   100 	bool realistic_acceleration;        ///< realistic acceleration for trains
    99 	byte   snow_line;                        ///< the snowline level in this game
   101 	bool wagon_speed_limits;            ///< enable wagon speed limits
   100 };
   102 	bool forbid_90_deg;                 ///< forbid trains to make 90 deg turns
   101 
   103 	bool no_servicing_if_no_breakdowns; ///< dont send vehicles to depot when breakdowns are disabled
   102 /** Settings related to construction in-game */
   104 	bool link_terraform_toolbar;        ///< display terraform toolbar when displaying rail, road, water and airport toolbars
   103 struct ConstructionSettings {
   105 	bool reverse_scroll;                ///< Right-Click-Scrolling scrolls in the opposite direction
   104 	bool   build_on_slopes;                  ///< allow building on slopes
   106 	bool smooth_scroll;                 ///< Smooth scroll viewports
   105 	bool   autoslope;                        ///< allow terraforming under things
   107 	bool disable_elrails;               ///< when true, the elrails are disabled
   106 	bool   longbridges;                      ///< allow 100 tile long bridges
   108 	bool measure_tooltip;               ///< Show a permanent tooltip when dragging tools
   107 	bool   signal_side;                      ///< show signals on right side
   109 	byte liveries;                      ///< Options for displaying company liveries, 0=none, 1=self, 2=all
   108 	bool   extra_dynamite;                   ///< extra dynamite
   110 	bool prefer_teamchat;               ///< Choose the chat message target with <ENTER>, true=all players, false=your team
   109 	bool   road_stop_on_town_road;           ///< allow building of drive-through road stops on town owned roads
   111 	uint8 advanced_vehicle_list;        ///< Use the "advanced" vehicle list
   110 	uint8  raw_industry_construction;        ///< type of (raw) industry construction (none, "normal", prospecting)
   112 	uint8 loading_indicators;           ///< Show loading indicators
   111 };
   113 	uint8 default_rail_type;            ///< The default rail type for the rail GUI
   112 
   114 
   113 /** Settings related to the AI. */
   115 	uint8 toolbar_pos;                  ///< position of toolbars, 0=left, 1=center, 2=right
   114 struct AISettings {
   116 	uint8 window_snap_radius;           ///< Windows snap at each other if closer than this
   115 	bool   ai_in_multiplayer;                ///< so we allow AIs in multiplayer
   117 
   116 	bool   ai_disable_veh_train;             ///< disable types for AI
   118 	bool always_build_infrastructure;   ///< Always allow building of infrastructure, even when you do not have the vehicles for it
   117 	bool   ai_disable_veh_roadveh;           ///< disable types for AI
   119 	UnitID max_trains;                  ///< max trains in game per player (these are 16bit because the unitnumber field can't hold more)
   118 	bool   ai_disable_veh_aircraft;          ///< disable types for AI
   120 	UnitID max_roadveh;                 ///< max trucks in game per player
   119 	bool   ai_disable_veh_ship;              ///< disable types for AI
   121 	UnitID max_aircraft;                ///< max planes in game per player
   120 };
   122 	UnitID max_ships;                   ///< max ships in game per player
   121 
   123 
   122 /** Settings related to the old pathfinder. */
   124 	bool servint_ispercent;             ///< service intervals are in percents
   123 struct OPFSettings {
   125 	uint16 servint_trains;              ///< service interval for trains
   124 	uint16 pf_maxlength;                     ///< maximum length when searching for a train route for new pathfinder
   126 	uint16 servint_roadveh;             ///< service interval for road vehicles
   125 	byte   pf_maxdepth;                      ///< maximum recursion depth when searching for a train route for new pathfinder
   127 	uint16 servint_aircraft;            ///< service interval for aircraft
   126 };
   128 	uint16 servint_ships;               ///< service interval for ships
   127 
   129 
   128 /** Settings related to the new pathfinder. */
   130 	uint8 pathfinder_for_trains;        ///< the pathfinder to use for trains
   129 struct NPFSettings {
   131 	uint8 pathfinder_for_roadvehs;      ///< the pathfinder to use for roadvehicles
       
   132 	uint8 pathfinder_for_ships;         ///< the pathfinder to use for ships
       
   133 
       
   134 	uint8 plane_speed;                  ///< divisor for speed of aircraft
       
   135 
       
   136 	bool autorenew;
       
   137 	int16 autorenew_months;
       
   138 	int32 autorenew_money;
       
   139 
       
   140 	byte pf_maxdepth;                      ///< maximum recursion depth when searching for a train route for new pathfinder
       
   141 	uint16 pf_maxlength;                   ///< maximum length when searching for a train route for new pathfinder
       
   142 
       
   143 	bool bridge_pillars;                   ///< show bridge pillars for high bridges
       
   144 
       
   145 	bool ai_disable_veh_train;             ///< disable types for AI
       
   146 	bool ai_disable_veh_roadveh;           ///< disable types for AI
       
   147 	bool ai_disable_veh_aircraft;          ///< disable types for AI
       
   148 	bool ai_disable_veh_ship;              ///< disable types for AI
       
   149 	Year starting_year;                    ///< starting date
       
   150 	Year ending_year;                      ///< end of the game (just show highscore)
       
   151 	Year colored_news_year;                ///< when does newspaper become colored?
       
   152 
       
   153 	bool keep_all_autosave;                ///< name the autosave in a different way.
       
   154 	bool autosave_on_exit;                 ///< save an autosave when you quit the game, but do not ask "Do you really want to quit?"
       
   155 	byte max_num_autosaves;                ///< controls how many autosavegames are made before the game starts to overwrite (names them 0 to max_num_autosaves - 1)
       
   156 	bool extra_dynamite;                   ///< extra dynamite
       
   157 	bool road_stop_on_town_road;           ///< allow building of drive-through road stops on town owned roads
       
   158 
       
   159 	bool never_expire_vehicles;            ///< never expire vehicles
       
   160 	byte extend_vehicle_life;              ///< extend vehicle life by this many years
       
   161 
       
   162 	bool auto_euro;                        ///< automatically switch to euro in 2002
       
   163 	bool serviceathelipad;                 ///< service helicopters at helipads automatically (no need to send to depot)
       
   164 	bool smooth_economy;                   ///< smooth economy
       
   165 	bool allow_shares;                     ///< allow the buying/selling of shares
       
   166 	byte dist_local_authority;             ///< distance for town local authority, default 20
       
   167 
       
   168 	byte wait_oneway_signal;               ///< waitingtime in days before a oneway signal
       
   169 	byte wait_twoway_signal;               ///< waitingtime in days before a twoway signal
       
   170 
       
   171 	uint8 map_x;                           ///< Size of map
       
   172 	uint8 map_y;
       
   173 
       
   174 	byte drag_signals_density;             ///< many signals density
       
   175 	Year semaphore_build_before;           ///< Build semaphore signals automatically before this year
       
   176 	bool ai_in_multiplayer;                ///< Do we allow AIs in multiplayer
       
   177 
       
   178 	/*
       
   179 	 * New Path Finding
       
   180 	 */
       
   181 	bool new_pathfinding_all;              ///< Use the newest pathfinding algorithm for all
       
   182 
       
   183 	/**
   130 	/**
   184 	 * The maximum amount of search nodes a single NPF run should take. This
   131 	 * The maximum amount of search nodes a single NPF run should take. This
   185 	 * limit should make sure performance stays at acceptable levels at the cost
   132 	 * limit should make sure performance stays at acceptable levels at the cost
   186 	 * of not being perfect anymore. This will probably be fixed in a more
   133 	 * of not being perfect anymore.
   187 	 * sophisticated way sometime soon
       
   188 	 */
   134 	 */
   189 	uint32 npf_max_search_nodes;
   135 	uint32 npf_max_search_nodes;
   190 
   136 
   191 	uint32 npf_rail_firstred_penalty;      ///< The penalty for when the first signal is red (and it is not an exit or combo signal)
   137 	uint32 npf_rail_firstred_penalty;        ///< the penalty for when the first signal is red (and it is not an exit or combo signal)
   192 	uint32 npf_rail_firstred_exit_penalty; ///< The penalty for when the first signal is red (and it is an exit or combo signal)
   138 	uint32 npf_rail_firstred_exit_penalty;   ///< the penalty for when the first signal is red (and it is an exit or combo signal)
   193 	uint32 npf_rail_lastred_penalty;       ///< The penalty for when the last signal is red
   139 	uint32 npf_rail_lastred_penalty;         ///< the penalty for when the last signal is red
   194 	uint32 npf_rail_station_penalty;       ///< The penalty for station tiles
   140 	uint32 npf_rail_station_penalty;         ///< the penalty for station tiles
   195 	uint32 npf_rail_slope_penalty;         ///< The penalty for sloping upwards
   141 	uint32 npf_rail_slope_penalty;           ///< the penalty for sloping upwards
   196 	uint32 npf_rail_curve_penalty;         ///< The penalty for curves
   142 	uint32 npf_rail_curve_penalty;           ///< the penalty for curves
   197 	uint32 npf_rail_depot_reverse_penalty; ///< The penalty for reversing in depots
   143 	uint32 npf_rail_depot_reverse_penalty;   ///< the penalty for reversing in depots
   198 	uint32 npf_buoy_penalty;               ///< The penalty for going over (through) a buoy
   144 	uint32 npf_buoy_penalty;                 ///< the penalty for going over (through) a buoy
   199 	uint32 npf_water_curve_penalty;        ///< The penalty for curves
   145 	uint32 npf_water_curve_penalty;          ///< the penalty for curves
   200 	uint32 npf_road_curve_penalty;         ///< The penalty for curves
   146 	uint32 npf_road_curve_penalty;           ///< the penalty for curves
   201 	uint32 npf_crossing_penalty;           ///< The penalty for level crossings
   147 	uint32 npf_crossing_penalty;             ///< the penalty for level crossings
   202 	uint32 npf_road_drive_through_penalty; ///< The penalty for going through a drive-through road stop
   148 	uint32 npf_road_drive_through_penalty;   ///< the penalty for going through a drive-through road stop
   203 
   149 };
   204 	bool population_in_label;              ///< Show the population of a town in his label?
   150 
   205 
   151 /** Settings related to the yet another pathfinder. */
   206 	uint8 freight_trains;                  ///< Value to multiply the weight of cargo by
   152 struct YAPFSettings {
   207 
   153 	bool   disable_node_optimization;        ///< whether to use exit-dir instead of trackdir in node key
   208 	/** YAPF settings */
   154 	uint32 max_search_nodes;                 ///< stop path-finding when this number of nodes visited
   209 	YapfSettings  yapf;
   155 	bool   ship_use_yapf;                    ///< use YAPF for ships
   210 
   156 	bool   road_use_yapf;                    ///< use YAPF for road
   211 	uint8 right_mouse_btn_emulation;
   157 	bool   rail_use_yapf;                    ///< use YAPF for rail
   212 
   158 	uint32 road_slope_penalty;               ///< penalty for up-hill slope
   213 	uint8 scrollwheel_scrolling;
   159 	uint32 road_curve_penalty;               ///< penalty for curves
   214 	uint8 scrollwheel_multiplier;
   160 	uint32 road_crossing_penalty;            ///< penalty for level crossing
   215 
   161 	uint32 road_stop_penalty;                ///< penalty for going through a drive-through road stop
   216 	uint8 town_growth_rate;      ///< Town growth rate
   162 	bool   rail_firstred_twoway_eol;         ///< treat first red two-way signal as dead end
   217 	uint8 larger_towns;          ///< The number of cities to build. These start off larger and grow twice as fast
   163 	uint32 rail_firstred_penalty;            ///< penalty for first red signal
   218 	uint8 initial_city_size;     ///< Multiplier for the initial size of the cities compared to towns
   164 	uint32 rail_firstred_exit_penalty;       ///< penalty for first red exit signal
   219 
   165 	uint32 rail_lastred_penalty;             ///< penalty for last red signal
   220 	bool pause_on_newgame;       ///< Whether to start new games paused or not.
   166 	uint32 rail_lastred_exit_penalty;        ///< penalty for last red exit signal
   221 
   167 	uint32 rail_station_penalty;             ///< penalty for non-target station tile
   222 	TownLayoutByte town_layout;  ///< Select town layout
   168 	uint32 rail_slope_penalty;               ///< penalty for up-hill slope
   223 
   169 	uint32 rail_curve45_penalty;             ///< penalty for curve
   224 	bool timetabling;            ///< Whether to allow timetabling.
   170 	uint32 rail_curve90_penalty;             ///< penalty for 90-deg curve
   225 	bool timetable_in_ticks;     ///< Whether to show the timetable in ticks rather than days.
   171 	uint32 rail_depot_reverse_penalty;       ///< penalty for reversing in the depot
   226 
   172 	uint32 rail_crossing_penalty;            ///< penalty for level crossing
   227 	bool autoslope;              ///< Allow terraforming under things.
   173 	uint32 rail_look_ahead_max_signals;      ///< max. number of signals taken into consideration in look-ahead load balancer
   228 
   174 	int32  rail_look_ahead_signal_p0;        ///< constant in polynomial penalty function
   229 	bool mod_road_rebuild;       ///< Roadworks remove unneccesary RoadBits
   175 	int32  rail_look_ahead_signal_p1;        ///< constant in polynomial penalty function
   230 
   176 	int32  rail_look_ahead_signal_p2;        ///< constant in polynomial penalty function
   231 	bool exclusive_rights;       ///< allow buying exclusive rights
   177 
   232 	bool give_money;             ///< allow giving other players money
   178 	uint32 rail_longer_platform_penalty;           ///< penalty for longer  station platform than train
   233 
   179 	uint32 rail_longer_platform_per_tile_penalty;  ///< penalty for longer  station platform than train (per tile)
   234 	bool enable_signal_gui;      ///< Show the signal GUI when the signal button is pressed
   180 	uint32 rail_shorter_platform_penalty;          ///< penalty for shorter station platform than train
   235 
   181 	uint32 rail_shorter_platform_per_tile_penalty; ///< penalty for shorter station platform than train (per tile)
   236 	bool dynamic_engines;    ///< Enable dynamic allocation of engine data
   182 };
   237 };
   183 
   238 
   184 /** Settings related to all pathfinders. */
   239 extern Patches _patches;
   185 struct PathfinderSettings {
   240 
   186 	uint8  pathfinder_for_trains;            ///< the pathfinder to use for trains
   241 /** The patch values that are used for new games and/or modified in config file */
   187 	uint8  pathfinder_for_roadvehs;          ///< the pathfinder to use for roadvehicles
   242 extern Patches _patches_newgame;
   188 	uint8  pathfinder_for_ships;             ///< the pathfinder to use for ships
       
   189 	bool   new_pathfinding_all;              ///< use the newest pathfinding algorithm for all
       
   190 
       
   191 	bool   roadveh_queue;                    ///< buggy road vehicle queueing
       
   192 	bool   forbid_90_deg;                    ///< forbid trains to make 90 deg turns
       
   193 
       
   194 	byte   wait_oneway_signal;               ///< waitingtime in days before a oneway signal
       
   195 	byte   wait_twoway_signal;               ///< waitingtime in days before a twoway signal
       
   196 
       
   197 	OPFSettings  opf;                        ///< pathfinder settings for the old pathfinder
       
   198 	NPFSettings  npf;                        ///< pathfinder settings for the new pathfinder
       
   199 	YAPFSettings yapf;                       ///< pathfinder settings for the yet another pathfinder
       
   200 };
       
   201 
       
   202 /** Settings related to orders. */
       
   203 struct OrderSettings {
       
   204 	bool   improved_load;                    ///< improved loading algorithm
       
   205 	bool   gradual_loading;                  ///< load vehicles gradually
       
   206 	bool   selectgoods;                      ///< only send the goods to station if a train has been there
       
   207 	bool   gotodepot;                        ///< allow goto depot in orders
       
   208 	bool   no_servicing_if_no_breakdowns;    ///< dont send vehicles to depot when breakdowns are disabled
       
   209 	bool   timetabling;                      ///< whether to allow timetabling
       
   210 	bool   serviceathelipad;                 ///< service helicopters at helipads automatically (no need to send to depot)
       
   211 };
       
   212 
       
   213 /** Settings related to vehicles. */
       
   214 struct VehicleSettings {
       
   215 	bool   mammoth_trains;                   ///< allow very long trains
       
   216 	bool   realistic_acceleration;           ///< realistic acceleration for trains
       
   217 	bool   wagon_speed_limits;               ///< enable wagon speed limits
       
   218 	bool   disable_elrails;                  ///< when true, the elrails are disabled
       
   219 	UnitID max_trains;                       ///< max trains in game per player
       
   220 	UnitID max_roadveh;                      ///< max trucks in game per player
       
   221 	UnitID max_aircraft;                     ///< max planes in game per player
       
   222 	UnitID max_ships;                        ///< max ships in game per player
       
   223 	bool   servint_ispercent;                ///< service intervals are in percents
       
   224 	uint16 servint_trains;                   ///< service interval for trains
       
   225 	uint16 servint_roadveh;                  ///< service interval for road vehicles
       
   226 	uint16 servint_aircraft;                 ///< service interval for aircraft
       
   227 	uint16 servint_ships;                    ///< service interval for ships
       
   228 	uint8  plane_speed;                      ///< divisor for speed of aircraft
       
   229 	uint8  freight_trains;                   ///< value to multiply the weight of cargo by
       
   230 	bool   dynamic_engines;                  ///< enable dynamic allocation of engine data
       
   231 	bool   never_expire_vehicles;            ///< never expire vehicles
       
   232 	byte   extend_vehicle_life;              ///< extend vehicle life by this many years
       
   233 	byte   road_side;                        ///< the side of the road vehicles drive on
       
   234 };
       
   235 
       
   236 /** Settings related to the economy. */
       
   237 struct EconomySettings {
       
   238 	bool   inflation;                        ///< disable inflation
       
   239 	bool   bribe;                            ///< enable bribing the local authority
       
   240 	bool   smooth_economy;                   ///< smooth economy
       
   241 	bool   allow_shares;                     ///< allow the buying/selling of shares
       
   242 	byte   dist_local_authority;             ///< distance for town local authority, default 20
       
   243 	bool   exclusive_rights;                 ///< allow buying exclusive rights
       
   244 	bool   give_money;                       ///< allow giving other players money
       
   245 	bool   mod_road_rebuild;                 ///< roadworks remove unneccesary RoadBits
       
   246 	bool   multiple_industry_per_town;       ///< allow many industries of the same type per town
       
   247 	bool   same_industry_close;              ///< allow same type industries to be built close to each other
       
   248 	uint8  town_growth_rate;                 ///< town growth rate
       
   249 	uint8  larger_towns;                     ///< the number of cities to build. These start off larger and grow twice as fast
       
   250 	uint8  initial_city_size;                ///< multiplier for the initial size of the cities compared to towns
       
   251 	TownLayoutByte town_layout;              ///< select town layout
       
   252 	bool   station_noise_level;              ///< build new airports when the town noise level is still within accepted limits
       
   253 	uint16 town_noise_population[3];         ///< population to base decision on noise evaluation (@see town_council_tolerance)
       
   254 };
       
   255 
       
   256 /** Settings related to stations. */
       
   257 struct StationSettings {
       
   258 	bool   modified_catchment;               ///< different-size catchment areas
       
   259 	bool   join_stations;                    ///< allow joining of train stations
       
   260 	bool   nonuniform_stations;              ///< allow nonuniform train stations
       
   261 	bool   adjacent_stations;                ///< allow stations to be built directly adjacent to other stations
       
   262 	bool   always_small_airport;             ///< always allow small airports
       
   263 	byte   station_spread;                   ///< amount a station may spread
       
   264 };
       
   265 
       
   266 /** All settings together. */
       
   267 struct Settings {
       
   268 	DifficultySettings   difficulty;         ///< settings related to the difficulty
       
   269 	GUISettings          gui;                ///< settings related to the GUI
       
   270 	GameCreationSettings game_creation;      ///< settings used during the creation of a game (map)
       
   271 	ConstructionSettings construction;       ///< construction of things in-game
       
   272 	AISettings           ai;                 ///< what may the AI do?
       
   273 	PathfinderSettings   pf;                 ///< settings for all pathfinders
       
   274 	OrderSettings        order;              ///< settings related to orders
       
   275 	VehicleSettings      vehicle;            ///< options for vehicles
       
   276 	EconomySettings      economy;            ///< settings to change the economy
       
   277 	StationSettings      station;            ///< settings related to station management
       
   278 };
       
   279 
       
   280 /** The current settings. */
       
   281 extern Settings _settings;
       
   282 
       
   283 /** The settings values that are used for new games and/or modified in config file */
       
   284 extern Settings _settings_newgame;
   243 
   285 
   244 #endif /* SETTINGS_TYPE_H */
   286 #endif /* SETTINGS_TYPE_H */