(svn r13666) [NoAI] -Fix: benchmarked and set the default opcodes-till-suspend to a much higher value. Benchmarks show that this value should be relative unnoticable on any 'recent' hardware (read: 5 years or newer), under normal conditions. noai
authortruebrain
Mon, 30 Jun 2008 19:35:57 +0000
branchnoai
changeset 11108 fc7b43610af2
parent 11102 aacdde10b4ad
child 11110 8e553098ad05
(svn r13666) [NoAI] -Fix: benchmarked and set the default opcodes-till-suspend to a much higher value. Benchmarks show that this value should be relative unnoticable on any 'recent' hardware (read: 5 years or newer), under normal conditions.
bin/ai/regression/regression.txt
src/settings.cpp
--- a/bin/ai/regression/regression.txt	Mon Jun 30 13:51:28 2008 +0000
+++ b/bin/ai/regression/regression.txt	Mon Jun 30 19:35:57 2008 +0000
@@ -417,144 +417,144 @@
     1098 => 46116
     1099 => 46158
   Randomize ListDump:
-    1 => 1685581960
-    2 => 408056889
-    1000 => -701496030
-    1001 => 1739759275
-    1002 => 1596170176
-    1003 => -1807679118
-    1004 => 68437861
-    1005 => -411704134
-    1006 => 1308323007
-    1007 => 528006444
-    1008 => -812601094
-    1009 => -1537997771
-    1010 => 1707830639
-    1011 => 410584452
-    1012 => -57211566
-    1013 => -78014297
-    1014 => -959102596
-    1015 => -1659921168
-    1016 => 2114245942
-    1017 => 568894505
-    1018 => 339980362
-    1019 => -1445943418
-    1020 => 1460815232
-    1021 => -712950084
-    1022 => -716011455
-    1023 => 105149852
-    1024 => -1242149037
-    1025 => -1363448996
-    1026 => 434461667
-    1027 => 1658093490
-    1028 => -371756043
-    1029 => 2100538368
-    1030 => -875319
-    1031 => -1613863224
-    1032 => 1300879493
-    1033 => -1687333103
-    1034 => 1510295157
-    1035 => -1247306571
-    1036 => -667309831
-    1037 => -1964798484
-    1038 => 1284903276
-    1039 => 1367099235
-    1040 => 911470581
-    1041 => -1654341127
-    1042 => 535682024
-    1043 => 26325006
-    1044 => -2024462735
-    1045 => 597299179
-    1046 => 1195337799
-    1047 => -867445795
-    1048 => 2053183149
-    1049 => -484919666
-    1051 => 934464479
-    1052 => 1949243159
-    1053 => -63407938
-    1054 => 1448214415
-    1055 => 114131611
-    1056 => -2099340283
-    1057 => -605824390
-    1058 => 2055738669
-    1059 => -1678079216
-    1060 => 1888795169
-    1061 => -864604712
-    1062 => -468724205
-    1063 => -301504782
-    1064 => 155514323
-    1065 => 1287914143
-    1066 => 1472913096
-    1067 => -1880974627
-    1068 => -575399297
-    1069 => 106663987
-    1070 => 646934598
-    1071 => -644576201
-    1072 => 1742846721
-    1073 => 437560120
-    1074 => 2041714867
-    1075 => -881581840
-    1076 => -1634794876
-    1077 => 1116033698
-    1078 => -2123857545
-    1079 => -658723400
-    1080 => -1159625490
-    1081 => -1395382483
-    1082 => 1899912354
-    1083 => -974252866
-    1084 => -1656301759
-    1085 => 1304219090
-    1086 => -1117738382
-    1087 => -1464300391
-    1088 => -870030888
-    1089 => -2049768177
-    1090 => -1882552035
-    1091 => 1810924274
-    1092 => 1150812842
-    1093 => -2013891617
-    1094 => -582213900
-    1095 => 1165070206
-    1096 => -2006618736
-    1097 => -390381818
-    1098 => -459156651
-    1099 => 1126201136
+    1 => -1137077476
+    2 => 314814293
+    1000 => 1806643910
+    1001 => -701534012
+    1002 => 76404638
+    1003 => -746660249
+    1004 => 1271172296
+    1005 => 1911873386
+    1006 => 1070291873
+    1007 => -2061218877
+    1008 => 481282951
+    1009 => -1948938354
+    1010 => 165230198
+    1011 => -2042646804
+    1012 => -1467569596
+    1013 => -311710398
+    1014 => 475683330
+    1015 => -338021888
+    1016 => 186502532
+    1017 => 723274013
+    1018 => 702714756
+    1019 => 40951180
+    1020 => -2126523587
+    1021 => -1643912096
+    1022 => -290937023
+    1023 => -1769229010
+    1024 => -431301526
+    1025 => -626258845
+    1026 => 1613310982
+    1027 => 123425309
+    1028 => -1514677893
+    1029 => -566414020
+    1030 => -1083501024
+    1031 => -1872881543
+    1032 => -1471582135
+    1033 => 1240074973
+    1034 => -140989914
+    1035 => 539992510
+    1036 => 1453919485
+    1037 => 1190499323
+    1038 => 126270290
+    1039 => -2003047485
+    1040 => -203335554
+    1041 => 1661469806
+    1042 => 58751410
+    1043 => -1478702906
+    1044 => -1155451438
+    1045 => 1770958842
+    1046 => 1962472787
+    1047 => -162012143
+    1048 => -1049520326
+    1049 => 2099949607
+    1051 => -828407401
+    1052 => 1689995601
+    1053 => 2129818695
+    1054 => 1250957327
+    1055 => -122992233
+    1056 => -1799261525
+    1057 => -1896080781
+    1058 => -1004677188
+    1059 => -414905905
+    1060 => 2017104944
+    1061 => 1685581960
+    1062 => 408056889
+    1063 => -701496030
+    1064 => 1739759275
+    1065 => 1596170176
+    1066 => -1807679118
+    1067 => 68437861
+    1068 => -411704134
+    1069 => 1308323007
+    1070 => 528006444
+    1071 => -812601094
+    1072 => -1537997771
+    1073 => 1707830639
+    1074 => 410584452
+    1075 => -57211566
+    1076 => -78014297
+    1077 => -959102596
+    1078 => -1659921168
+    1079 => 2114245942
+    1080 => 568894505
+    1081 => 339980362
+    1082 => -1445943418
+    1083 => 1460815232
+    1084 => -712950084
+    1085 => -716011455
+    1086 => 105149852
+    1087 => -1242149037
+    1088 => -1363448996
+    1089 => 434461667
+    1090 => 1658093490
+    1091 => -371756043
+    1092 => 2100538368
+    1093 => -875319
+    1094 => -1613863224
+    1095 => 1300879493
+    1096 => -1687333103
+    1097 => 1510295157
+    1098 => -1247306571
+    1099 => -667309831
   KeepTop(10):
-    1 => 1685581960
-    2 => 408056889
-    1000 => -701496030
-    1001 => 1739759275
-    1002 => 1596170176
-    1003 => -1807679118
-    1004 => 68437861
-    1005 => -411704134
-    1006 => 1308323007
-    1007 => 528006444
+    1 => -1137077476
+    2 => 314814293
+    1000 => 1806643910
+    1001 => -701534012
+    1002 => 76404638
+    1003 => -746660249
+    1004 => 1271172296
+    1005 => 1911873386
+    1006 => 1070291873
+    1007 => -2061218877
   KeepBottom(8):
-    1000 => -701496030
-    1001 => 1739759275
-    1002 => 1596170176
-    1003 => -1807679118
-    1004 => 68437861
-    1005 => -411704134
-    1006 => 1308323007
-    1007 => 528006444
+    1000 => 1806643910
+    1001 => -701534012
+    1002 => 76404638
+    1003 => -746660249
+    1004 => 1271172296
+    1005 => 1911873386
+    1006 => 1070291873
+    1007 => -2061218877
   RemoveBottom(2):
-    1000 => -701496030
-    1001 => 1739759275
-    1002 => 1596170176
-    1003 => -1807679118
-    1004 => 68437861
-    1005 => -411704134
+    1000 => 1806643910
+    1001 => -701534012
+    1002 => 76404638
+    1003 => -746660249
+    1004 => 1271172296
+    1005 => 1911873386
   RemoveTop(2):
-    1002 => 1596170176
-    1003 => -1807679118
-    1004 => 68437861
-    1005 => -411704134
+    1002 => 76404638
+    1003 => -746660249
+    1004 => 1271172296
+    1005 => 1911873386
   RemoveList({1003, 1004}):
-    1002 => 1596170176
-    1005 => -411704134
+    1002 => 76404638
+    1005 => 1911873386
   KeepList({1003, 1004, 1005}):
-    1005 => -411704134
+    1005 => 1911873386
   AddList({1005, 4000, 4001, 4002}):
     1005 => 1005
     4000 => 8000
@@ -5931,12 +5931,12 @@
     Tile 45469
     Tile 45468
     Tile 45467
-    Tile 45211
-    Tile 44955
-    Tile 44699
-    Tile 44443
-    Tile 44187
-    Tile 43931
+    Tile 45466
+    Tile 45210
+    Tile 44954
+    Tile 44698
+    Tile 44442
+    Tile 44186
     Tile 43930
     Tile 43929
     Tile 43928
@@ -6491,13 +6491,13 @@
   KeepAboveValue(10):  done
   Count():             7
   ListDump:
-    41897 => 43
-    41641 => 37
-    42153 => 32
-    41899 => 28
-    41387 => 28
-    41643 => 25
-    42410 => 12
+    41897 => 41
+    41641 => 35
+    42153 => 33
+    41899 => 29
+    41387 => 29
+    41643 => 26
+    42410 => 13
   RoadTile():          done
   KeepValue(1):        done
   Count():             0
@@ -6717,37 +6717,37 @@
   Town 0
     IsValidTown():   true
     GetName():       Planfield
-    GetPopulation(): 749
+    GetPopulation(): 754
     GetLocation():   15508
-    GetHouseCount(): 30
+    GetHouseCount(): 29
     GetRating():     5
   Town 1
     IsValidTown():   true
     GetName():       Trenningville
-    GetPopulation(): 303
+    GetPopulation(): 241
     GetLocation():   46751
-    GetHouseCount(): 17
+    GetHouseCount(): 16
     GetRating():     5
   Town 2
     IsValidTown():   true
     GetName():       Tondston
-    GetPopulation(): 341
+    GetPopulation(): 333
     GetLocation():   28365
     GetHouseCount(): 18
     GetRating():     0
   Town 3
     IsValidTown():   true
     GetName():       Tunford
-    GetPopulation(): 209
+    GetPopulation(): 198
     GetLocation():   41895
-    GetHouseCount(): 12
+    GetHouseCount(): 11
     GetRating():     5
   Town 4
     IsValidTown():   true
     GetName():       Wrundtown
-    GetPopulation(): 396
+    GetPopulation(): 426
     GetLocation():   41450
-    GetHouseCount(): 17
+    GetHouseCount(): 18
     GetRating():     0
   Town 5
     IsValidTown():   true
@@ -6759,16 +6759,16 @@
   Town 6
     IsValidTown():   true
     GetName():       Muningville
-    GetPopulation(): 614
+    GetPopulation(): 579
     GetLocation():   38200
     GetHouseCount(): 28
     GetRating():     0
   Town 7
     IsValidTown():   true
     GetName():       Hutfingford
-    GetPopulation(): 812
+    GetPopulation(): 777
     GetLocation():   59234
-    GetHouseCount(): 33
+    GetHouseCount(): 32
     GetRating():     0
   Town 8
     IsValidTown():   true
@@ -6780,7 +6780,7 @@
   Town 9
     IsValidTown():   true
     GetName():       Frindinghattan
-    GetPopulation(): 364
+    GetPopulation(): 446
     GetLocation():   5825
     GetHouseCount(): 18
     GetRating():     0
@@ -6808,30 +6808,30 @@
   Town 13
     IsValidTown():   true
     GetName():       Great Hinninghall
-    GetPopulation(): 263
+    GetPopulation(): 276
     GetLocation():   9595
-    GetHouseCount(): 13
+    GetHouseCount(): 14
     GetRating():     5
   Town 14
     IsValidTown():   true
     GetName():       Prundinghall
-    GetPopulation(): 306
+    GetPopulation(): 321
     GetLocation():   51298
     GetHouseCount(): 17
     GetRating():     0
   Town 15
     IsValidTown():   true
     GetName():       Benville
-    GetPopulation(): 764
+    GetPopulation(): 776
     GetLocation():   42338
     GetHouseCount(): 32
     GetRating():     5
   Town 16
     IsValidTown():   true
     GetName():       Kennville
-    GetPopulation(): 705
+    GetPopulation(): 717
     GetLocation():   17345
-    GetHouseCount(): 31
+    GetHouseCount(): 32
     GetRating():     5
   Town 17
     IsValidTown():   true
@@ -6846,7 +6846,7 @@
     GetPopulation(): 267
     GetLocation():   10574
     GetHouseCount(): 12
-    GetRating():     5
+    GetRating():     0
   Town 19
     IsValidTown():   true
     GetName():       Mendingston
@@ -6878,28 +6878,28 @@
   Town 23
     IsValidTown():   true
     GetName():       Lardborough
-    GetPopulation(): 734
+    GetPopulation(): 669
     GetLocation():   59622
-    GetHouseCount(): 28
+    GetHouseCount(): 27
     GetRating():     0
   Town 24
     IsValidTown():   true
     GetName():       Little Fruford
-    GetPopulation(): 709
+    GetPopulation(): 636
     GetLocation():   19596
     GetHouseCount(): 33
     GetRating():     5
   Town 25
     IsValidTown():   true
     GetName():       Grinnway
-    GetPopulation(): 513
+    GetPopulation(): 548
     GetLocation():   16433
     GetHouseCount(): 15
     GetRating():     5
   Town 26
     IsValidTown():   true
     GetName():       Bedburg
-    GetPopulation(): 349
+    GetPopulation(): 336
     GetLocation():   39505
     GetHouseCount(): 17
     GetRating():     0
@@ -7063,16 +7063,16 @@
   Count():             11
   Population ListDump:
     12 => 853
-    7 => 812
     21 => 793
-    15 => 764
-    0 => 749
-    23 => 734
-    24 => 709
-    16 => 705
+    7 => 777
+    15 => 776
+    0 => 754
+    16 => 717
     10 => 690
-    6 => 614
-    25 => 513
+    23 => 669
+    24 => 636
+    6 => 579
+    25 => 548
   HasStatue():                     false
   GetRoadReworkDuration():         0
   GetExclusiveRightsPlayer():      -1
@@ -7106,13 +7106,13 @@
   BuildVehicle():       0
   IsValidVehicle(11):   false
   --Transaction--
-    GetCosts():         430
+    GetCosts():         425
     Execute():          true
   IsValidVehicle(11):   true
   CloneVehicle():       12
   --Accounting--
-    GetCosts():         860
-    Should be:          860
+    GetCosts():         850
+    Should be:          850
     ResetCosts():       (null : 0x00000000)
   SellVehicle(12):      true
   IsInDepot():          true
@@ -7124,8 +7124,8 @@
   IsInDepot():          false
   IsStoppedInDepot():   false
   --Accounting--
-    GetCosts():         -430
-    Should be:          -430
+    GetCosts():         -425
+    Should be:          -425
   GetName():            Road Vehicle 1
   SetName():            true
   GetName():            MyVehicleName
@@ -7134,12 +7134,12 @@
     GetLocation():       33417
     GetEngineType():     153
     GetUnitNumber():     1
-    GetAge():            0
+    GetAge():            1
     GetMaxAge():         5490
-    GetAgeLeft():        5490
+    GetAgeLeft():        5489
     GetCurrentSpeed():   4
     GetRunningCost():    13
-    GetProfitThisYear(): 0
+    GetProfitThisYear(): -1
     GetProfitLastYear(): 0
     GetVehicleType():    1
     GetRoadType():       0
@@ -7185,10 +7185,10 @@
     13 => 1
     11 => 1
   Age ListDump:
-    13 => 1
     12 => 1
     11 => 1
     15 => 0
+    13 => 0
   MaxAge ListDump:
     15 => 10980
     13 => 10980
@@ -7196,7 +7196,7 @@
     11 => 5490
   AgeLeft ListDump:
     15 => 10980
-    13 => 10979
+    13 => 10980
     12 => 5489
     11 => 5489
   CurrentSpeed ListDump:
@@ -7296,11 +7296,11 @@
         IsValidSubsidy():     true
         IsAwarded():          false
         GetAwardedTo():       -1
-        GetExpireDate():      712678
+        GetExpireDate():      712647
         SourceIsTown():       true
-        GetSource():          0
+        GetSource():          25
         DestionationIsTown(): true
-        GetDestionation():    24
+        GetDestionation():    20
         GetCargoType():       0
   GetNextEvent:          instance
     GetEventType:        2
@@ -7309,33 +7309,7 @@
         IsValidSubsidy():     true
         IsAwarded():          false
         GetAwardedTo():       -1
-        GetExpireDate():      712678
-        SourceIsTown():       true
-        GetSource():          0
-        DestionationIsTown(): true
-        GetDestionation():    24
-        GetCargoType():       0
-  GetNextEvent:          instance
-    GetEventType:        2
-      EventName:         SubsidyOffer
-      --Subsidy (1) --
-        IsValidSubsidy():     true
-        IsAwarded():          false
-        GetAwardedTo():       -1
-        GetExpireDate():      712708
-        SourceIsTown():       true
-        GetSource():          21
-        DestionationIsTown(): true
-        GetDestionation():    9
-        GetCargoType():       0
-  GetNextEvent:          instance
-    GetEventType:        2
-      EventName:         SubsidyOffer
-      --Subsidy (2) --
-        IsValidSubsidy():     true
-        IsAwarded():          false
-        GetAwardedTo():       -1
-        GetExpireDate():      712861
+        GetExpireDate():      712647
         SourceIsTown():       true
         GetSource():          25
         DestionationIsTown(): true
--- a/src/settings.cpp	Mon Jun 30 13:51:28 2008 +0000
+++ b/src/settings.cpp	Mon Jun 30 19:35:57 2008 +0000
@@ -1669,7 +1669,7 @@
 	    SDT_BOOL(GameSettings, ai.ai_disable_veh_aircraft,                                          0, 0, false,                    STR_CONFIG_PATCHES_AI_BUILDS_AIRCRAFT,     NULL),
 	    SDT_BOOL(GameSettings, ai.ai_disable_veh_ship,                                              0, 0, false,                    STR_CONFIG_PATCHES_AI_BUILDS_SHIPS,        NULL),
 	    /* Disabled until NoAI is merged to trunk, to maintain savegame compatibility with trunk. */
-//	 SDT_CONDVAR(GameSettings, ai.ai_max_opcode_till_suspend, 98, SL_MAX_VERSION, SLE_UINT32,       0, NG, 4000,   100, 40000, 100, STR_CONFIG_PATCHES_AI_MAX_OPCODES,         NULL),
+//	 SDT_CONDVAR(GameSettings, ai.ai_max_opcode_till_suspend, 98, SL_MAX_VERSION, SLE_UINT32,       0, NG, 20000, 5000, 250000, 2500, STR_CONFIG_PATCHES_AI_MAX_OPCODES,         NULL),
 
 	     SDT_VAR(GameSettings, vehicle.extend_vehicle_life,          SLE_UINT8,                     0, 0,     0,     0,     100, 0, STR_NULL,                                  NULL),
 	     SDT_VAR(GameSettings, economy.dist_local_authority,         SLE_UINT8,                     0, 0,    20,     5,      60, 0, STR_NULL,                                  NULL),
@@ -2388,7 +2388,7 @@
 		_settings_newgame.pf.opf.pf_maxlength = 4096;
 	}
 	/* To maintain savegame compatibility with trunk, we force this value for now. */
-	_settings_newgame.ai.ai_max_opcode_till_suspend = 4000;
+	_settings_newgame.ai.ai_max_opcode_till_suspend = 20000;
 }
 
 extern const ChunkHandler _setting_chunk_handlers[] = {