Merge lp:~widelands-dev/widelands/bug988870 into lp:widelands

Proposed by cghislai
Status: Merged
Merged at revision: 6628
Proposed branch: lp:~widelands-dev/widelands/bug988870
Merge into: lp:widelands
Diff against target: 425 lines (+52/-49)
28 files modified
tribes/atlanteans/burners_house/conf (+1/-1)
tribes/atlanteans/coalmine/conf (+2/-2)
tribes/atlanteans/crystalmine/conf (+6/-6)
tribes/atlanteans/goldmine/conf (+2/-2)
tribes/atlanteans/horsefarm/conf (+2/-2)
tribes/atlanteans/ironmine/conf (+2/-2)
tribes/atlanteans/mill/conf (+1/-1)
tribes/atlanteans/smokery/conf (+2/-2)
tribes/atlanteans/spiderfarm/conf (+2/-2)
tribes/atlanteans/spideryarn/conf (+1/-0)
tribes/barbarians/bakery/conf (+2/-2)
tribes/barbarians/brewery/conf (+2/-2)
tribes/barbarians/burners_house/conf (+1/-1)
tribes/barbarians/cattlefarm/conf (+2/-2)
tribes/barbarians/thatchreed/conf (+2/-0)
tribes/barbarians/weaving-mill/conf (+1/-1)
tribes/empire/brewery/conf (+2/-2)
tribes/empire/burners_house/conf (+1/-1)
tribes/empire/coalmine/conf (+2/-2)
tribes/empire/deep_coalmine/conf (+2/-2)
tribes/empire/deep_goldmine/conf (+2/-2)
tribes/empire/deep_oremine/conf (+2/-2)
tribes/empire/donkeyfarm/conf (+2/-2)
tribes/empire/goldmine/conf (+2/-2)
tribes/empire/mill/conf (+1/-1)
tribes/empire/oremine/conf (+2/-2)
tribes/empire/piggery/conf (+2/-2)
tribes/empire/wine/conf (+1/-1)
To merge this branch: bzr merge lp:~widelands-dev/widelands/bug988870
Reviewer Review Type Date Requested Status
Nasenbaer Approve
Widelands Developers Pending
Review via email: mp+174639@code.launchpad.net

Description of the change

Some issues were raised in the bug report with the current handling of skip conditions.
I reverted them to the opposite. I tested some game and it doesn't seem to cause any issue. If needed this can easily be reverted during the release candidate cycles.

I also increased the default target quantities of some essential wares.

To post a comment you must log in.
Revision history for this message
SirVer (sirver) wrote :

Peter (Nasenbaer), could you review this?

Revision history for this message
Nasenbaer (nasenbaer) wrote :

I am between "Approve" and "Needs fixing" therefore I set it "Needs information"

"Approve", because the patch is fine as it is and if you (and nobody else) want to do the job described below, we can just merge it as it is

"Needs fixing" because as we change the "skipped" parts, we should improve the performance of those checks as well and there is quite some room for improvement :)

E.g. file 'tribes/atlanteans/coalmine/conf':
return=skipped unless economy needs coal or not economy needs bread
return=skipped unless economy needs coal or not economy needs smoked_fish

equals
return=skipped unless economy needs coal or not economy needs bread
return=skipped unless not economy needs smoked_fish

difference is, that Widelands won't doublecheck whether the economy needs coal, which (even if little) costs a bit of performance - the more production sites are running the more performance...

cghislai, do you take this task? :)

review: Needs Information
Revision history for this message
cghislai (charlyghislain) wrote :

I knew it would be spotted :)
sed is not smarted than its user... ill fix that

Revision history for this message
Nasenbaer (nasenbaer) wrote :

Oh me... I hope I was the first who found my own error ;)
Of course
return=skipped unless economy needs coal or not economy needs bread
return=skipped unless economy needs coal or not economy needs smoked_fish

equals
return=skipped unless economy needs coal or not economy needs bread
return=skipped unless not economy needs smoked_fish

is not equal... :(

I merge your branch... oh my I am a double work generation machine.
Hope you did not put to much work already in it.
I guess I owe you a beer or coffee :)

review: Approve
Revision history for this message
cghislai (charlyghislain) wrote :

Ah, you merged already
I am pretty sure that it IS equal, but anyway in the last commit I put a when condition, as its more readable.
The best imho would be to put the 3 lines separatelty and only and complex conditions if it is really needed.

Revision history for this message
Nasenbaer (nasenbaer) wrote :

well it is not equal because:
* take the case where coal is needed, but at least the economy needs smoked_fish (bread does not matter in that case)

return=skipped unless economy needs coal or not economy needs bread -> no skip because of coal
return=skipped unless not economy needs smoked_fish -> no skip because of coal

return=skipped unless economy needs coal or not economy needs bread -> no skip because of coal
return=skipped unless not economy needs smoked_fish -> skipped because smoked_fish is needed

the only real equivalent would be:

return=skipped unless economy needs coal or not economy needs bread or not economy needs smoked_fish

but I do not know if that is accepted by the Widelands skip logic - if yes, that would be a real alternative because it would reduce the number of checks maximally :)

Revision history for this message
Nasenbaer (nasenbaer) wrote :

I go to bed... worked to long ;) the FIRST is of course

return=skipped unless economy needs coal or not economy needs bread -> no skip because of coal
return=skipped unless economy needs coal or not economy needs smoked_fish -> no skip because of coal

Revision history for this message
cghislai (charlyghislain) wrote :

Ah yeah you are right. I prefer it this way as well because it is easier to revert back to the and condition if needed

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tribes/atlanteans/burners_house/conf'
2--- tribes/atlanteans/burners_house/conf 2012-02-15 21:25:34 +0000
3+++ tribes/atlanteans/burners_house/conf 2013-07-14 21:49:27 +0000
4@@ -19,7 +19,7 @@
5 work=_Work
6
7 [work]
8-return=skipped when economy needs trunk and not economy needs coal
9+return=skipped unless economy needs coal or not economy needs trunk
10 consume=trunk:6
11 sleep=30000
12 animate=working 90000 # charcoal fires are burning some days in real life
13
14=== modified file 'tribes/atlanteans/coalmine/conf'
15--- tribes/atlanteans/coalmine/conf 2012-02-15 21:25:34 +0000
16+++ tribes/atlanteans/coalmine/conf 2013-07-14 21:49:27 +0000
17@@ -21,8 +21,8 @@
18 work=_Work
19
20 [work]
21-return=skipped when economy needs bread and not economy needs coal
22-return=skipped when economy needs smoked_fish and not economy needs coal
23+return=skipped unless economy needs coal or not economy needs bread
24+return=skipped unless economy needs coal or not economy needs smoked_fish
25 consume=smoked_fish,smoked_meat:2 bread:2
26 sleep=45000
27 animate=working 20000
28
29=== modified file 'tribes/atlanteans/crystalmine/conf'
30--- tribes/atlanteans/crystalmine/conf 2012-02-15 21:25:34 +0000
31+++ tribes/atlanteans/crystalmine/conf 2013-07-14 21:49:27 +0000
32@@ -26,8 +26,8 @@
33 work=_Work
34
35 [mine_stone]
36-return=skipped when economy needs bread and not economy needs stone
37-return=skipped when economy needs smoked_fish and not economy needs stone
38+return=skipped unless economy needs stone or not economy needs bread
39+return=skipped unless economy needs stone or not economy needs smoked_fish
40 consume=smoked_fish,smoked_meat:2 bread:2
41 sleep=45000
42 animate=working 20000
43@@ -44,8 +44,8 @@
44 produce=quartz
45
46 [mine_quartz]
47-return=skipped when economy needs bread and not economy needs quartz
48-return=skipped when economy needs smoked_fish and not economy needs quartz
49+return=skipped unless economy needs quartz or not economy needs bread
50+return=skipped unless economy needs quartz or not economy needs smoked_fish
51 consume=smoked_fish,smoked_meat:2 bread:2
52 sleep=45000
53 animate=working 20000
54@@ -59,8 +59,8 @@
55 produce=quartz:2
56
57 [mine_diamond]
58-return=skipped when economy needs bread and not economy needs diamond
59-return=skipped when economy needs smoked_fish and not economy needs diamond
60+return=skipped unless economy needs diamond or not economy needs bread
61+return=skipped unless economy needs diamond or not economy needs smoked_fish
62 consume=smoked_fish,smoked_meat:2 bread:2
63 sleep=45000
64 animate=working 20000
65
66=== modified file 'tribes/atlanteans/goldmine/conf'
67--- tribes/atlanteans/goldmine/conf 2011-09-12 17:29:32 +0000
68+++ tribes/atlanteans/goldmine/conf 2013-07-14 21:49:27 +0000
69@@ -22,8 +22,8 @@
70 work=_Work
71
72 [work]
73-return=skipped when economy needs bread and not economy needs goldore
74-return=skipped when economy needs smoked_fish and not economy needs goldore
75+return=skipped unless economy needs goldore or not economy needs bread
76+return=skipped unless economy needs goldore or not economy needs smoked_fish
77 consume=smoked_fish,smoked_meat:2 bread:2
78 sleep=45000
79 animate=working 20000
80
81=== modified file 'tribes/atlanteans/horsefarm/conf'
82--- tribes/atlanteans/horsefarm/conf 2013-03-02 20:35:18 +0000
83+++ tribes/atlanteans/horsefarm/conf 2013-07-14 21:49:27 +0000
84@@ -21,8 +21,8 @@
85 work=_Work
86
87 [work]
88-return=skipped when economy needs water and not economy needs horse
89-return=skipped when economy needs corn and not economy needs horse
90+return=skipped unless economy needs horse or not economy needs water
91+return=skipped unless economy needs horse or not economy needs corn
92 consume=corn water
93 playFX=../../../sound/farm/horse 192
94 animate=working 30000 # feeding cute little foals ;)
95
96=== modified file 'tribes/atlanteans/ironmine/conf'
97--- tribes/atlanteans/ironmine/conf 2012-02-15 21:25:34 +0000
98+++ tribes/atlanteans/ironmine/conf 2013-07-14 21:49:27 +0000
99@@ -22,8 +22,8 @@
100 work=_Work
101
102 [work]
103-return=skipped when economy needs bread and not economy needs ironore
104-return=skipped when economy needs smoked_fish and not economy needs ironore
105+return=skipped unless economy needs ironore or not economy needs bread
106+return=skipped unless economy needs ironore or not economy needs smoked_fish
107 consume=smoked_fish,smoked_meat:2 bread:2
108 sleep=45000
109 animate=working 20000
110
111=== modified file 'tribes/atlanteans/mill/conf'
112--- tribes/atlanteans/mill/conf 2011-09-12 17:29:32 +0000
113+++ tribes/atlanteans/mill/conf 2013-07-14 21:49:27 +0000
114@@ -24,7 +24,7 @@
115
116 [produce_cornflour]
117 return=skipped when site has blackroot and economy needs blackrootflour and not economy needs cornflour
118-return=skipped when economy needs corn and not economy needs cornflour
119+return=skipped unless economy needs cornflour or not economy needs corn
120 consume=corn
121 sleep=3500
122 animate=working 15000
123
124=== modified file 'tribes/atlanteans/smokery/conf'
125--- tribes/atlanteans/smokery/conf 2010-08-01 14:35:38 +0000
126+++ tribes/atlanteans/smokery/conf 2013-07-14 21:49:27 +0000
127@@ -27,14 +27,14 @@
128 work=_Work
129
130 [smoke_meat]
131-return=skipped when economy needs trunk and not economy needs smoked_meat
132+return=skipped unless economy needs smoked_meat or not economy needs trunk
133 consume=meat:2 trunk
134 sleep=30000
135 animate=working 30000
136 produce=smoked_meat:2
137
138 [smoke_fish]
139-return=skipped when economy needs trunk and not economy needs smoked_fish
140+return=skipped unless economy needs smoked_fish or not economy needs trunk
141 consume=fish:2 trunk
142 sleep=30000
143 animate=working 30000
144
145=== modified file 'tribes/atlanteans/spiderfarm/conf'
146--- tribes/atlanteans/spiderfarm/conf 2009-12-03 11:58:28 +0000
147+++ tribes/atlanteans/spiderfarm/conf 2013-07-14 21:49:27 +0000
148@@ -18,8 +18,8 @@
149
150 [work]
151 sleep=25000
152-return=skipped when economy needs corn and not economy needs spideryarn
153-return=skipped when economy needs water and not economy needs spideryarn
154+return=skipped unless economy needs spideryarn or not economy needs corn
155+return=skipped unless economy needs spideryarn or not economy needs water
156 consume=corn water
157 animate=working 30000
158 produce=spideryarn
159
160=== modified file 'tribes/atlanteans/spideryarn/conf'
161--- tribes/atlanteans/spideryarn/conf 2010-11-02 12:13:56 +0000
162+++ tribes/atlanteans/spideryarn/conf 2013-07-14 21:49:27 +0000
163@@ -1,5 +1,6 @@
164 help=_This yarn is produced by spiders, which are bred on spiderfarms. It is processed to spidercloth in a weaving-mill.
165
166+default_target_quantity=10
167 preciousness=2
168
169 [idle]
170
171=== modified file 'tribes/barbarians/bakery/conf'
172--- tribes/barbarians/bakery/conf 2011-09-12 17:29:32 +0000
173+++ tribes/barbarians/bakery/conf 2013-07-14 21:49:27 +0000
174@@ -22,8 +22,8 @@
175
176 [work]
177 sleep=20000
178-return=skipped when economy needs water and not economy needs pittabread
179-return=skipped when economy needs wheat and not economy needs pittabread
180+return=skipped unless economy needs pittabread or not economy needs water
181+return=skipped unless economy needs pittabread or not economy needs wheat
182 consume=water:3 wheat:3
183 animate=working 20000
184 produce=pittabread
185
186=== modified file 'tribes/barbarians/brewery/conf'
187--- tribes/barbarians/brewery/conf 2011-09-12 17:29:32 +0000
188+++ tribes/barbarians/brewery/conf 2013-07-14 21:49:27 +0000
189@@ -20,8 +20,8 @@
190 work=_Work
191
192 [work]
193-return=skipped when economy needs water and not economy needs strongbeer
194-return=skipped when economy needs wheat and not economy needs strongbeer
195+return=skipped unless economy needs strongbeer or not economy needs water
196+return=skipped unless economy needs strongbeer or not economy needs wheat
197 consume=water wheat
198 sleep=30000
199 animate=working 30000
200
201=== modified file 'tribes/barbarians/burners_house/conf'
202--- tribes/barbarians/burners_house/conf 2011-09-12 17:29:32 +0000
203+++ tribes/barbarians/burners_house/conf 2013-07-14 21:49:27 +0000
204@@ -19,7 +19,7 @@
205 work=_Work
206
207 [work]
208-return=skipped when economy needs trunk and not economy needs coal
209+return=skipped unless economy needs coal or not economy needs trunk
210 consume=trunk:6
211 sleep=30000
212 animate=working 90000 # charcoal fires are burning some days in real life
213
214=== modified file 'tribes/barbarians/cattlefarm/conf'
215--- tribes/barbarians/cattlefarm/conf 2013-03-02 20:35:18 +0000
216+++ tribes/barbarians/cattlefarm/conf 2013-07-14 21:49:27 +0000
217@@ -21,8 +21,8 @@
218 work=_Work
219
220 [work]
221-return=skipped when economy needs wheat and not economy needs ox
222-return=skipped when economy needs water and not economy needs ox
223+return=skipped unless economy needs ox or not economy needs wheat
224+return=skipped unless economy needs ox or not economy needs water
225 consume=wheat water
226 playFX=../../../sound/farm/ox 192
227 animate=working 30000 # animation of feeding the cattles
228
229=== modified file 'tribes/barbarians/thatchreed/conf'
230--- tribes/barbarians/thatchreed/conf 2010-11-02 12:13:56 +0000
231+++ tribes/barbarians/thatchreed/conf 2013-07-14 21:49:27 +0000
232@@ -1,5 +1,7 @@
233 help=_Thatch reed is produced in a fernery and used to make the roofs of buildings waterproof.
234+
235 preciousness=5
236+default_target_quantity=10
237
238 # Reed is growing near by watersides.
239
240
241=== modified file 'tribes/barbarians/weaving-mill/conf'
242--- tribes/barbarians/weaving-mill/conf 2012-02-15 21:25:34 +0000
243+++ tribes/barbarians/weaving-mill/conf 2013-07-14 21:49:27 +0000
244@@ -19,7 +19,7 @@
245 work=_Work
246
247 [work]
248-return=skipped when economy needs thatchreed and not economy needs cloth
249+return=skipped unless economy needs cloth or not economy needs thatchreed
250 animate=working 45000
251 consume=thatchreed
252 produce=cloth
253
254=== modified file 'tribes/empire/brewery/conf'
255--- tribes/empire/brewery/conf 2010-08-01 14:35:38 +0000
256+++ tribes/empire/brewery/conf 2013-07-14 21:49:27 +0000
257@@ -20,8 +20,8 @@
258 work=_Work
259
260 [work]
261-return=skipped when economy needs water and not economy needs beer
262-return=skipped when economy needs wheat and not economy needs beer
263+return=skipped unless economy needs beer or not economy needs water
264+return=skipped unless economy needs beer or not economy needs wheat
265 consume=water wheat
266 sleep=30000
267 animate=working 30000
268
269=== modified file 'tribes/empire/burners_house/conf'
270--- tribes/empire/burners_house/conf 2010-08-01 14:35:38 +0000
271+++ tribes/empire/burners_house/conf 2013-07-14 21:49:27 +0000
272@@ -19,7 +19,7 @@
273 work=_Work
274
275 [work]
276-return=skipped when economy needs trunk and not economy needs coal
277+return=skipped unless economy needs coal or not economy needs trunk
278 consume=trunk:6
279 sleep=30000
280 animate=working 90000 # charcoal fires are burning some days in real life
281
282=== modified file 'tribes/empire/coalmine/conf'
283--- tribes/empire/coalmine/conf 2011-09-02 12:36:04 +0000
284+++ tribes/empire/coalmine/conf 2013-07-14 21:49:27 +0000
285@@ -21,8 +21,8 @@
286 work=_Work
287
288 [work]
289-return=skipped when economy needs ration and not economy needs coal
290-return=skipped when economy needs beer and not economy needs coal
291+return=skipped unless economy needs coal or not economy needs ration
292+return=skipped unless economy needs coal or not economy needs beer
293 sleep=45000
294 consume=beer ration
295 animate=working 20000
296
297=== modified file 'tribes/empire/deep_coalmine/conf'
298--- tribes/empire/deep_coalmine/conf 2011-09-02 12:36:04 +0000
299+++ tribes/empire/deep_coalmine/conf 2013-07-14 21:49:27 +0000
300@@ -22,8 +22,8 @@
301 work=_Work
302
303 [work]
304-return=skipped when economy needs meal and not economy needs coal
305-return=skipped when economy needs beer and not economy needs coal
306+return=skipped unless economy needs coal or not economy needs meal
307+return=skipped unless economy needs coal or not economy needs beer
308 sleep=42000
309 consume=beer meal
310 animate=working 18000
311
312=== modified file 'tribes/empire/deep_goldmine/conf'
313--- tribes/empire/deep_goldmine/conf 2011-09-02 12:36:04 +0000
314+++ tribes/empire/deep_goldmine/conf 2013-07-14 21:49:27 +0000
315@@ -22,8 +22,8 @@
316 work=_Work
317
318 [work]
319-return=skipped when economy needs meal and not economy needs goldstone
320-return=skipped when economy needs wine and not economy needs goldstone
321+return=skipped unless economy needs goldstone or not economy needs meal
322+return=skipped unless economy needs goldstone or not economy needs wine
323 sleep=43000
324 consume=meal wine
325 animate=working 18000
326
327=== modified file 'tribes/empire/deep_oremine/conf'
328--- tribes/empire/deep_oremine/conf 2011-09-02 12:36:04 +0000
329+++ tribes/empire/deep_oremine/conf 2013-07-14 21:49:27 +0000
330@@ -22,8 +22,8 @@
331 work=_Work
332
333 [work]
334-return=skipped when economy needs meal and not economy needs ironore
335-return=skipped when economy needs beer and not economy needs ironore
336+return=skipped unless economy needs ironore or not economy needs meal
337+return=skipped unless economy needs ironore or not economy needs beer
338 sleep=43000
339 consume=meal beer
340 animate=working 18000
341
342=== modified file 'tribes/empire/donkeyfarm/conf'
343--- tribes/empire/donkeyfarm/conf 2013-03-02 20:35:18 +0000
344+++ tribes/empire/donkeyfarm/conf 2013-07-14 21:49:27 +0000
345@@ -21,8 +21,8 @@
346 work=_Work
347
348 [work]
349-return=skipped when economy needs wheat and not economy needs donkey
350-return=skipped when economy needs water and not economy needs donkey
351+return=skipped unless economy needs donkey or not economy needs wheat
352+return=skipped unless economy needs donkey or not economy needs water
353 consume=wheat water
354 playFX=../../../sound/farm/donkey 192
355 animate=working 30000 # feeding cute little baby donkeys ;)
356
357=== modified file 'tribes/empire/goldmine/conf'
358--- tribes/empire/goldmine/conf 2011-09-02 12:36:04 +0000
359+++ tribes/empire/goldmine/conf 2013-07-14 21:49:27 +0000
360@@ -22,8 +22,8 @@
361 work=_Work
362
363 [work]
364-return=skipped when economy needs ration and not economy needs goldstone
365-return=skipped when economy needs wine and not economy needs goldstone
366+return=skipped unless economy needs goldstone or not economy needs ration
367+return=skipped unless economy needs goldstone or not economy needs wine
368 sleep=45000
369 consume=ration wine
370 animate=working 20000
371
372=== modified file 'tribes/empire/mill/conf'
373--- tribes/empire/mill/conf 2013-03-02 20:35:18 +0000
374+++ tribes/empire/mill/conf 2013-07-14 21:49:27 +0000
375@@ -19,7 +19,7 @@
376 work=_Work
377
378 [work]
379-return=skipped when economy needs wheat and not economy needs flour
380+return=skipped unless economy needs flour or not economy needs wheat
381 consume=wheat
382 sleep=5000
383 playFX=../../../sound/mill/mill_turning 240
384
385=== modified file 'tribes/empire/oremine/conf'
386--- tribes/empire/oremine/conf 2011-09-02 12:36:04 +0000
387+++ tribes/empire/oremine/conf 2013-07-14 21:49:27 +0000
388@@ -22,8 +22,8 @@
389 work=_Work
390
391 [work]
392-return=skipped when economy needs ration and not economy needs ironore
393-return=skipped when economy needs beer and not economy needs ironore
394+return=skipped unless economy needs ironore or not economy needs ration
395+return=skipped unless economy needs ironore or not economy needs beer
396 sleep=45000
397 consume=ration beer
398 animate=working 20000
399
400=== modified file 'tribes/empire/piggery/conf'
401--- tribes/empire/piggery/conf 2013-03-02 20:35:18 +0000
402+++ tribes/empire/piggery/conf 2013-07-14 21:49:27 +0000
403@@ -20,8 +20,8 @@
404 work=_Work
405
406 [work]
407-return=skipped when economy needs water and not economy needs meat
408-return=skipped when economy needs wheat and not economy needs meat
409+return=skipped unless economy needs meat or not economy needs water
410+return=skipped unless economy needs meat or not economy needs wheat
411 sleep=25000
412 consume=water wheat
413 playFX=../../../sound/farm/farm_animal 180
414
415=== modified file 'tribes/empire/wine/conf'
416--- tribes/empire/wine/conf 2010-11-02 12:13:56 +0000
417+++ tribes/empire/wine/conf 2013-07-14 21:49:27 +0000
418@@ -1,6 +1,6 @@
419 help=_This tasty wine is consumed in marble and gold mines. It is produced in a winery.
420
421-
422+default_target_quantity=10
423 preciousness=2
424
425 [idle]

Subscribers

People subscribed via source and target branches

to status/vote changes: