← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~widelands-dev/widelands/minimize_time_for_return_skipped into lp:~widelands-dev/widelands/mines-worldsavior

 

Toni Förster has proposed merging lp:~widelands-dev/widelands/minimize_time_for_return_skipped into lp:~widelands-dev/widelands/mines-worldsavior.

Requested reviews:
  Widelands Developers (widelands-dev)

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/minimize_time_for_return_skipped/+merge/352935

That "penalty" is reduced to 10ms. Which means there is no measurable effect. After 1000 produced wares it would be 10 second. For a ware that would be produced constantly every 60 seconds it would take 16.6 in-game hours to result in a loss of 1 product due to the time penalty. Currently this happens very 6 minutes.


-- 
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/minimize_time_for_return_skipped into lp:~widelands-dev/widelands/mines-worldsavior.
=== modified file 'data/tribes/buildings/productionsites/barbarians/big_inn/init.lua'
--- data/tribes/buildings/productionsites/barbarians/big_inn/init.lua	2018-07-24 09:10:45 +0000
+++ data/tribes/buildings/productionsites/barbarians/big_inn/init.lua	2018-08-11 21:10:12 +0000
@@ -71,9 +71,10 @@
          actions = {
             -- time total: 33
             "return=skipped unless economy needs ration",
-            "sleep=23000",
+            "sleep=5000",
             "consume=barbarians_bread,fish,meat",
             "playsound=sound/barbarians/taverns tavern 100",
+            "animate=working 18000",
             "sleep=10000",
             "produce=ration"
          }
@@ -86,7 +87,8 @@
             "return=skipped unless economy needs snack",
             "consume=barbarians_bread fish,meat beer",
             "playsound=sound/barbarians/taverns biginn 100",
-            "sleep=37000",
+            "animate=working 27000",
+            "sleep=10000",
             "produce=snack"
          }
       },
@@ -98,7 +100,8 @@
             "return=skipped unless economy needs meal",
             "consume=barbarians_bread fish,meat beer_strong",
             "playsound=sound/barbarians/taverns biginn 100",
-            "sleep=40000",
+            "animate=working 30000",
+            "sleep=10000",
             "produce=meal"
          }
       },

=== modified file 'data/tribes/buildings/productionsites/barbarians/inn/init.lua'
--- data/tribes/buildings/productionsites/barbarians/inn/init.lua	2018-07-24 09:10:45 +0000
+++ data/tribes/buildings/productionsites/barbarians/inn/init.lua	2018-08-11 21:10:12 +0000
@@ -84,8 +84,8 @@
             "return=skipped unless economy needs snack",
             "consume=barbarians_bread fish,meat beer",
             "playsound=sound/barbarians/taverns inn 100",
-            "animate=working 22000",
-            "sleep=15000",
+            "animate=working 27000",
+            "sleep=10000",
             "produce=snack"
          }
       },

=== modified file 'data/tribes/buildings/productionsites/barbarians/tavern/init.lua'
--- data/tribes/buildings/productionsites/barbarians/tavern/init.lua	2017-11-18 17:57:00 +0000
+++ data/tribes/buildings/productionsites/barbarians/tavern/init.lua	2018-08-11 21:10:12 +0000
@@ -60,11 +60,13 @@
          -- TRANSLATORS: Completed/Skipped/Did not start preparing a ration because ...
          descname = _"preparing a ration",
          actions = {
-            "sleep=14000",
+             -- time total: 33
             "return=skipped unless economy needs ration",
+            "sleep=5000",
             "consume=barbarians_bread,fish,meat",
             "playsound=sound/barbarians/taverns tavern 100",
-            "animate=working 19000",
+            "animate=working 18000",
+            "sleep=10000",
             "produce=ration"
          },
       },

=== modified file 'data/tribes/buildings/productionsites/empire/inn/init.lua'
--- data/tribes/buildings/productionsites/empire/inn/init.lua	2018-07-24 09:10:45 +0000
+++ data/tribes/buildings/productionsites/empire/inn/init.lua	2018-08-11 21:10:12 +0000
@@ -64,10 +64,11 @@
          actions = {
             -- time total: 33
             "return=skipped unless economy needs ration",
-            "sleep=23000",
+            "sleep=5000",
             "consume=empire_bread,fish,meat",
             "playsound=sound/empire/taverns ration 100",
-            "animate=working 10000",
+            "animate=working 18000",
+            "sleep=10000",
             "produce=ration"
          }
       },
@@ -79,8 +80,8 @@
             "return=skipped unless economy needs meal",
             "consume=empire_bread fish,meat",
             "playsound=sound/empire/taverns meal 100",
-            "animate=working 25000",
-            "sleep=15000",
+            "animate=working 30000",
+            "sleep=10000",
             "produce=meal"
          }
       },

=== modified file 'data/tribes/buildings/productionsites/empire/tavern/init.lua'
--- data/tribes/buildings/productionsites/empire/tavern/init.lua	2017-11-18 17:57:00 +0000
+++ data/tribes/buildings/productionsites/empire/tavern/init.lua	2018-08-11 21:10:12 +0000
@@ -56,11 +56,12 @@
          descname = _"preparing a ration",
          actions = {
             -- time total: 33
-            "sleep=14000",
             "return=skipped unless economy needs ration",
+            "sleep=5000",
             "consume=empire_bread,fish,meat",
             "playsound=sound/empire/taverns ration 100",
-            "animate=working 19000",
+            "animate=working 18000",
+            "sleep=10000",
             "produce=ration"
          }
       },

=== modified file 'data/tribes/buildings/productionsites/frisians/drinking_hall/init.lua'
--- data/tribes/buildings/productionsites/frisians/drinking_hall/init.lua	2018-07-24 19:53:30 +0000
+++ data/tribes/buildings/productionsites/frisians/drinking_hall/init.lua	2018-08-11 21:10:12 +0000
@@ -72,10 +72,12 @@
          -- TRANSLATORS: Completed/Skipped/Did not start preparing a ration because ...
          descname = _"preparing a ration",
          actions = {
+            -- time total: 33
             "return=skipped unless economy needs ration",
+            "sleep=5000",
             "consume=fruit,smoked_fish,smoked_meat",
-            "sleep=14000",
-            "animate=working 19000",
+            "animate=working 18000",
+            "sleep=10000",
             "produce=ration"
          }
       },
@@ -83,10 +85,11 @@
          -- TRANSLATORS: Completed/Skipped/Did not start preparing a meal because ...
          descname = _"preparing a meal",
          actions = {
+            --time total: 40
             "return=skipped unless economy needs meal",
             "consume=beer honey_bread smoked_fish,smoked_meat",
-            "sleep=10000",
             "animate=working 30000",
+            "sleep=10000",
             "produce=meal"
          }
       },

=== modified file 'data/tribes/buildings/productionsites/frisians/tavern/init.lua'
--- data/tribes/buildings/productionsites/frisians/tavern/init.lua	2018-06-04 06:19:58 +0000
+++ data/tribes/buildings/productionsites/frisians/tavern/init.lua	2018-08-11 21:10:12 +0000
@@ -73,11 +73,13 @@
          -- TRANSLATORS: Completed/Skipped/Did not start preparing only one ration because ... (can produce more efficient when supply is good)
          descname = _"preparing only one ration",
          actions = {
+            -- time total: 49.5
             "return=skipped unless economy needs ration",
             "return=skipped when site has fruit,bread_frisians and site has smoked_fish,smoked_meat",
-            "sleep=21000",
+            "sleep=5000",
             "consume=fruit,bread_frisians,smoked_fish,smoked_meat",
-            "animate=working 28500",
+            "animate=working 34500",
+            "sleep=10000",
             "produce=ration"
          },
       },
@@ -85,10 +87,12 @@
          -- TRANSLATORS: Completed/Skipped/Did not start preparing rations because ...
          descname = _"preparing rations",
          actions = {
+            -- time total: 66
             "return=skipped unless economy needs ration",
+            "sleep=5000",
             "consume=fruit,bread_frisians smoked_fish,smoked_meat",
-            "sleep=28000",
-            "animate=working 38000",
+            "animate=working 51000",
+            "sleep=10000",
             "produce=ration:2"
          },
       },

=== modified file 'src/logic/map_objects/tribes/productionsite.cc'
--- src/logic/map_objects/tribes/productionsite.cc	2018-06-19 08:52:49 +0000
+++ src/logic/map_objects/tribes/productionsite.cc	2018-08-11 21:10:12 +0000
@@ -899,7 +899,7 @@
 	SkippedPrograms::const_iterator i = skipped_programs_.find(program_name);
 	if (i != skipped_programs_.end()) {
 		uint32_t const gametime = game.get_gametime();
-		uint32_t const earliest_allowed_start_time = i->second + 10000;
+		uint32_t const earliest_allowed_start_time = i->second + 10;
 		if (gametime + tdelta < earliest_allowed_start_time)
 			tdelta = earliest_allowed_start_time - gametime;
 	}


Follow ups