IRC logs for #openttd.dev on OFTC at 2013-10-17
⏴ go to previous day
03:23:23 *** JGR has joined #openttd.dev
06:06:28 *** adf88 has joined #openttd.dev
07:36:57 *** LordAro has joined #openttd.dev
07:36:57 *** ChanServ sets mode: +v LordAro
07:47:44 *** LordAro has joined #openttd.dev
07:47:44 *** ChanServ sets mode: +v LordAro
07:50:17 *** Lord_Aro has joined #openttd.dev
07:51:21 *** LordAro is now known as Guest2639
07:51:21 *** Lord_Aro is now known as LordAro
07:51:41 *** ChanServ sets mode: +v LordAro
09:23:22 *** adf88 has joined #openttd.dev
09:56:06 *** zydeco has joined #openttd.dev
13:43:39 *** Ristovski has joined #openttd.dev
15:45:52 *** Alberth has joined #openttd.dev
15:45:52 *** ChanServ sets mode: +v Alberth
15:49:05 *** ntoskrnl has joined #openttd.dev
15:57:17 *** Sturmi has joined #openttd.dev
16:56:45 *** frosch123 has joined #openttd.dev
16:56:45 *** ChanServ sets mode: +v frosch123
17:10:23 *** adf88 has joined #openttd.dev
17:19:30 <Rubidium> oh... even blathijs has more recent commits than I have...
17:19:42 <Rubidium> ah well... back to moving house stuff...
18:42:04 *** Supercheese has joined #openttd.dev
19:14:30 *** DorpsGek sets mode: +o Supercheese
19:14:34 <planetmaker> @deop Supercheese
19:14:34 *** DorpsGek sets mode: -o Supercheese
19:14:37 <planetmaker> @voice Supercheese
19:14:37 *** DorpsGek sets mode: +v Supercheese
19:15:28 <frosch123> planetmaker: add "static" in front of functions, which are not external
19:15:36 <planetmaker> Supercheese> No voice at the .dev channel, so: For objects-at-mapgen, are they still built with view 0 always, or is that randomized? <-- it *should* be randomized
19:16:45 <planetmaker> frosch123, so basically the Try* functions?
19:17:24 <frosch123> planetmaker: yes, i am no futher :)
19:18:12 <planetmaker> no further functions get introduced which are local
19:19:15 <frosch123> "WasEverAvailable" sounds weird
19:20:13 <frosch123> but i cannot think of a better one :)
19:20:26 <frosch123> just add a "." at the end of the doxygen to make albert happy :)
19:20:52 <planetmaker> Belugas, not covering future here
19:21:03 <planetmaker> that is covered by IsEverAvailable ;-)
19:21:28 <planetmaker> WasEverAvailable is true iff it was or is available
19:22:49 <planetmaker> WasEverIntroduced?
19:22:59 <planetmaker> it need not be available anymore either
19:23:21 <frosch123> well, stay with WasEverAvailable :)
19:25:38 <frosch123> c867672e4c10: count the number of water tiles only once?
19:25:42 <frosch123> instead of per object type
19:25:46 <frosch123> they do not change, do they?
19:25:57 <planetmaker> indeed not. Good point
19:27:32 <frosch123> you are lacking a if case for OBJECT_FLAG_SCALE_BY_WATER && !freeform_edges
19:27:41 <frosch123> ScaleByMapSize1D went missing
19:29:31 <frosch123> uint8 view = RandomRange(spec->views - 1); <- the "-1" is too much
19:29:38 <frosch123> RandRange returns 0 to (max -1)
19:30:50 <planetmaker> ah, k. And I'll move ScaleByMapSize1D outside the if
19:32:02 <planetmaker> scaling before water calculation. Then scaling by water amount
19:32:36 <frosch123> if ((spec->flags & OBJECT_FLAG_SCALE_BY_WATER) && _settings_game.construction.freeform_edges) {
19:32:45 <planetmaker> yes, then I scale
19:32:47 <frosch123> that freeform_edges check is wrong
19:33:02 <frosch123> there is also water when freeform_edges is disabled
19:33:07 <planetmaker> no. If we have freeform edges, it's 100% water
19:33:27 <frosch123> that makes it even more wrong
19:33:37 <planetmaker> I didn't touch that logic
19:33:45 <frosch123> when freeform is disabled you are currently scaling everything by map area
19:34:01 <frosch123> you ignore SCALE_BY_WATER when freform is disabled
19:34:29 <planetmaker> hm, let's see what we do currently
19:36:45 <planetmaker> we scale by 1D. And then if that condition holds, we scale by that water amount. Yes, that needs fixing
19:37:22 <planetmaker> two if conditions with the 1D scaling in between
19:37:57 <planetmaker> if (flag) { scale 1D; if (freeform) { ... } }
19:46:28 <frosch123> i guess, unless it is better for rounding to put the 1D inside the if and in an else
19:47:37 <planetmaker> well. The scale1D need be done always if the flag is set
19:48:40 <planetmaker> why do I make two ifs: if (flag & freeform) {...} else if (flag) { ... } else { scale2d}
19:56:32 <planetmaker> thanks for the thorough review, frosch123 :-)
20:04:15 <frosch123> planetmaker: the point is that "ScaleByMapSize1D(amount * num_water_tiles ) / (2 * MapMaxY() + 2 * MapMaxX() - 6)" might result in better values than "ScaleByMapSize1D(amount) * num_water_tiles / ( ... )" or "ScaleByMapSize1D(amount * num_water_tiles / (...))"
20:04:36 <frosch123> so, first all-multiplications, then all devisions is better
20:09:54 <planetmaker> frosch123, if it's like
20:11:17 <planetmaker> if (flag) { amount = Scale1D(amount); if (freeform) amount = amount * num_water / whatever; }
20:11:38 <planetmaker> the multiplication is done first.
20:11:50 <frosch123> Scale1D can be both multiplication or division
20:12:33 <planetmaker> ah, you mean first mult by water tiles. ok
20:42:00 *** Alberth has left #openttd.dev
20:47:00 <Rubidium> frosch123: in the perfect (and very very good) case, there's no difference
20:48:12 <frosch123> how is server-downtime good?
20:49:08 <Rubidium> oh... so also in the worst case there's no difference
continue to next day ⏵