(svn r9537) [gamebalance] -Feature: Added a difficulty setting which sets the complexity of the economic model. Ranges from something very simple (basically what we have now) up to realistic relationships (including passenger/cargo destinations at some point).
--- a/src/lang/english.txt Sat Mar 31 12:34:36 2007 +0000
+++ b/src/lang/english.txt Sat Mar 31 13:19:30 2007 +0000
@@ -2033,6 +2033,7 @@
STR_6815_DISASTERS :{LTBLUE}Disasters: {ORANGE}{STRING}
STR_16816_CITY_APPROVAL :{LTBLUE}City council's attitude towards area restructuring: {ORANGE}{STRING}
STR_ECONOMIC_GROWTH :{LTBLUE}Basic economic growth: {ORANGE}{STRING}
+STR_ECONOMIC_MODEL :{LTBLUE}Economic model: {ORANGE}{STRING}
############ range for difficulty settings ends
STR_26816_NONE :None
@@ -2075,6 +2076,10 @@
STR_6839_PERMISSIVE :Permissive
STR_683A_TOLERANT :Tolerant
STR_683B_HOSTILE :Hostile
+STR_6840_PRIMITIVE :Primitive
+STR_6841_SIMPLISTIC :Simplistic
+STR_6842_COMPLEX :Complex
+STR_6843_REALISTIC :Realistic
##id 0x7000
STR_7000 :
--- a/src/openttd.h Sat Mar 31 12:34:36 2007 +0000
+++ b/src/openttd.h Sat Mar 31 13:19:30 2007 +0000
@@ -191,7 +191,7 @@
NUM_LANDSCAPE = 4,
};
-#define GAME_DIFFICULTY_NUM 19
+#define GAME_DIFFICULTY_NUM 20
struct GameDifficulty {
int max_no_competitors;
@@ -213,6 +213,7 @@
int disasters;
int town_council_tolerance; // minimum required town ratings to be allowed to demolish stuff
int economic_growth;
+ int economic_model;
};
enum {
--- a/src/settings.cpp Sat Mar 31 12:34:36 2007 +0000
+++ b/src/settings.cpp Sat Mar 31 13:19:30 2007 +0000
@@ -1241,8 +1241,9 @@
* XXX - To save file-space and since values are never bigger than about 10? only
* save the first 16 bits in the savegame. Question is why the values are still int32
* and why not byte for example? */
- SDT_GENERAL("diff_custom", SDT_INTLIST, SL_ARR, (SLE_FILE_I16 | SLE_VAR_I32), 0, 0, GameOptions, diff, 17, 0, 0, 0, 0, NULL, STR_NULL, NULL, 0, 3),
- SDT_GENERAL("diff_custom", SDT_INTLIST, SL_ARR, (SLE_FILE_I16 | SLE_VAR_I32), 0, 0, GameOptions, diff, 18, 0, 0, 0, 0, NULL, STR_NULL, NULL, 4, SL_MAX_VERSION),
+ SDT_GENERAL("diff_custom", SDT_INTLIST, SL_ARR, (SLE_FILE_I16 | SLE_VAR_I32), 0, 0, GameOptions, diff, 17, 0, 0, 0, 0, NULL, STR_NULL, NULL, 0, 3),
+ SDT_GENERAL("diff_custom", SDT_INTLIST, SL_ARR, (SLE_FILE_I16 | SLE_VAR_I32), 0, 0, GameOptions, diff, 18, 0, 0, 0, 0, NULL, STR_NULL, NULL, 4, 53),
+ SDT_GENERAL("diff_custom", SDT_INTLIST, SL_ARR, (SLE_FILE_I16 | SLE_VAR_I32), 0, 0, GameOptions, diff, 20, 0, 0, 0, 0, NULL, STR_NULL, NULL, 54, SL_MAX_VERSION),
SDT_VAR(GameOptions, diff_level,SLE_UINT8, 0, 0, 9, 0, 9, 0, STR_NULL, NULL),
SDT_OMANY(GameOptions, currency, SLE_UINT8, N, 0, 0, CUSTOM_CURRENCY_ID, "GBP|USD|EUR|YEN|ATS|BEF|CHF|CZK|DEM|DKK|ESP|FIM|FRF|GRD|HUF|ISK|ITL|NLG|NOK|PLN|ROL|RUR|SIT|SEK|YTL|SKK|BRR|custom", STR_NULL, NULL),
SDT_OMANY(GameOptions, units, SLE_UINT8, N, 0, 1, 2, "imperial|metric|si", STR_NULL, NULL),
--- a/src/settings_gui.cpp Sat Mar 31 12:34:36 2007 +0000
+++ b/src/settings_gui.cpp Sat Mar 31 13:19:30 2007 +0000
@@ -322,6 +322,7 @@
{ 0, 1, 1, STR_6836_OFF},
{ 0, 2, 1, STR_6839_PERMISSIVE},
{ 0, 2, 1, STR_6820_LOW},
+ { 0, 3, 1, STR_6840_PRIMITIVE}
};
static inline bool GetBitAndShift(uint32 *b)
@@ -351,12 +352,13 @@
* Q: disasters
* R: area restructuring (0 = permissive, 2 = hostile)
* S: Economic Growth
+ * T: Economic Model
*/
static const int16 _default_game_diff[3][GAME_DIFFICULTY_NUM] = { /*
- A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S*/
- {2, 2, 1, 3, 300, 2, 0, 2, 0, 1, 2, 0, 1, 0, 0, 0, 0, 0, 2}, //easy
- {4, 1, 1, 2, 150, 3, 1, 3, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1}, //medium
- {7, 0, 2, 2, 100, 4, 1, 3, 2, 2, 0, 2, 3, 2, 1, 1, 1, 2, 0}, //hard
+ A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T*/
+ {2, 2, 1, 3, 300, 2, 0, 2, 0, 1, 2, 0, 1, 0, 0, 0, 0, 0, 2, 1}, //easy
+ {4, 1, 1, 2, 150, 3, 1, 3, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2}, //medium
+ {7, 0, 2, 2, 100, 4, 1, 3, 2, 2, 0, 2, 3, 2, 1, 1, 1, 2, 0, 3}, //hard
};
void SetDifficultyLevel(int mode, GameOptions *gm_opt)