IRC logs for #openttd on OFTC at 2017-11-26
⏴ go to previous day
00:53:25 *** mindlesstux has joined #openttd
01:02:57 *** orudge` has joined #openttd
01:02:57 *** ChanServ sets mode: +o orudge`
01:56:46 *** mindlesstux has joined #openttd
02:08:42 *** Thedarkb has joined #openttd
02:10:15 *** Biolunar has joined #openttd
02:57:43 *** Thedarkb has joined #openttd
04:10:33 *** Biolunar_ has joined #openttd
05:04:19 *** PressureLine has joined #openttd
05:04:32 <PressureLine> being horsepower-limited is such a pain
05:21:28 <PressureLine> If I double-head I'll need 11 trains on this route.
05:21:43 <PressureLine> triple-head and I can do it with 8 :/
05:27:39 <PressureLine> or just double-head with a more capable engine i guess
07:36:02 *** orudge` has joined #openttd
07:36:02 *** ChanServ sets mode: +o orudge`
08:01:00 *** mindlesstux has joined #openttd
08:45:23 *** sla_ro|master has joined #openttd
09:11:19 *** Progman has joined #openttd
09:12:46 *** sim-al2 has joined #openttd
09:18:10 *** Progman has joined #openttd
09:28:11 *** ToffeeYogurtPots has joined #openttd
09:39:41 <crem> (the most horsepower-limited creatures)
09:50:17 *** Alberth has joined #openttd
09:50:17 *** ChanServ sets mode: +o Alberth
10:06:15 *** V453000 has joined #openttd
10:17:30 *** gelignite has joined #openttd
11:03:38 *** ToffeeYogurtPots has quit IRC
12:03:21 *** synchris has joined #openttd
12:05:01 *** frosch123 has joined #openttd
12:09:15 *** orudge` has joined #openttd
12:09:15 *** ChanServ sets mode: +o orudge`
12:15:33 *** HerzogDeXtEr has joined #openttd
12:50:34 *** Stimrol has joined #openttd
13:23:50 *** andythenorth has joined #openttd
13:37:00 *** Gustavo6046 has joined #openttd
13:41:44 *** Wormnest has joined #openttd
13:47:22 *** orudge` has joined #openttd
13:47:23 *** ChanServ sets mode: +o orudge`
13:55:45 *** tycoondemon has joined #openttd
14:20:32 *** Gustavo6046 has joined #openttd
14:26:43 *** orudge` has joined #openttd
14:26:43 *** ChanServ sets mode: +o orudge`
15:04:39 * andythenorth could use a new GS :P
15:19:23 *** Thedarkb has joined #openttd
15:43:23 <Alberth> we settled on anything?
15:43:53 <Alberth> not that I have time, currently, RL is too busy currently
15:45:21 <andythenorth> nah no firm ideas
16:08:31 <supermop_home> I'm trying mczapkie's GS
16:13:55 <Alberth> I considered playing that GS too
16:14:15 <Alberth> but not ottd-ing currently
16:23:43 <Samu> i'm really not sure how to work with tiles outside or in the border of the map
16:23:55 <Samu> so I went with a step by step approach
16:29:27 <Alberth> it's really hard to introduce temporary variables for intermediate values, isn't it?
16:33:16 <Alberth> Noticed how often you compute values like "tile + m * delta_mid + d * delta" ?
16:33:17 <Samu> TileIndex t = tile + m * delta_mid; if (IsValidTile(t))
16:34:21 <Alberth> copy/paste is simple for you, but I have to manually check you're not making a typo somewhere, which is quite horrible
16:35:09 <Alberth> not to mention that any change in such an expression is equally horrible for you, as you mustn't make a mistake and forget one
16:35:36 <Alberth> unless you like digging around for eons, looking for typos
16:36:29 <Alberth> so don't copy/paste expressions
16:37:13 <Alberth> as a nice side-effect it reduces the expression length, so stuff fits onto a line more easily
16:38:22 <Samu> i think they're all different, unless...
16:38:43 <Samu> tile + m * 2 * delta_mid
16:38:52 <Samu> tile + m * 3 * delta_mid
16:39:00 <Samu> tile + m * delta_mid + d * delta
16:39:11 <Samu> tile + m * delta_mid + d * 2 * delta
16:39:22 <Samu> tile + m * 2 * delta_mid + d * delta
16:39:32 <Samu> tile + m * delta_mid + d * delta
16:39:45 <Samu> tile + m * 2 * delta_mid + d * delta
16:39:50 <Samu> there's some repeats down there i see
16:40:04 <Samu> tile + m * 3 * delta_mid + d * delta
16:41:33 <Alberth> "tile + m * delta_mid + d * delta" you have 6 times at least
16:42:25 <Samu> i got to create 7 TileIndexes then?
16:44:23 <Alberth> probably with some name system
16:44:57 <Alberth> to make it less confusing
16:45:54 <Alberth> TileIndex t_m = tile + m * delta_mid ; TileIndex t_m2 = tile + m * 2 * delta_mid; TileIndex t_m3 = tile + m * 3 * delta_mid
16:47:43 <Alberth> really nice blog about brix!
16:47:56 <Alberth> and it seems you got Zeph inspired :)
16:51:05 <Samu> brb, gonna try TileIndex some stuff liek that
16:52:49 <V453000> thanks Alberth, it seems so indeed :) if that's the case then it did more than it's job :P
16:55:29 <V453000> now I need to figure out how to render this wagon for testing
16:56:35 <Alberth> right side up is useful
16:56:36 *** ChanServ sets mode: +v tokai
17:26:38 *** Thedarkb has joined #openttd
17:55:28 *** SgtStroopwafel_ has quit IRC
17:57:43 *** SgtStroopwafel_ has joined #openttd
18:00:26 <Alberth> you added new for loops?
18:01:19 <Alberth> but euhm, run a diff between both versions and you know what changed :)
18:01:55 <Samu> they wouldn't accept t_2dm
18:03:13 <Samu> the order of checking changs, but i don't think the end result changes
18:03:38 <Alberth> t_2dm looks valid to me
18:04:26 <Samu> it has to go through all checks either way
18:12:50 <Alberth> yep, the point is how to reduce or eliminate the double-ish looking code
18:13:08 <Alberth> considered adding a function that performs the actual check?
18:13:38 <Alberth> ie one that you can call eg 7 times?
18:23:08 <Samu> that's what this function is for
18:24:22 <Samu> MakeLake is unchanged, I dunno why I copy pasted it
18:26:37 <Samu> ideally, I would work with two for cycles
18:27:31 <Samu> a cycle for positive delta_mid and negative delta_mid
18:27:47 <Samu> the other for positive delta and negative delta
18:28:45 <Samu> but how would i deal with those tiles in the middle without checking twice?
18:37:54 <Alberth> some checks may have gotten inverted, I tried to keep them equivalent, but not sure I succeeded there
18:45:36 <Samu> where would that bool be placed?
18:50:16 <Samu> TileCheckThingie is undefined if i place it after FlowsLock
18:50:29 <Samu> FlowsLock is undefined if I place it before TileCheckThingie
18:52:29 <Samu> it's not TileSlope it's DiagDirection
18:52:40 <Samu> DiagDirection ts = GetInclinedSlopeDirection(GetTileSlope(t));
18:54:39 <Samu> if (ts != dir_rot) return true; identifier dir_rot is undefined
18:54:48 <Samu> ok, i think i know what to do
18:55:52 <Samu> bool TileCheckThingie(TileIndex t, DiagDirection dir_rot) {
18:56:21 <Samu> identifier FlowsLock is undefined, I dunno what to do now
19:01:54 <Alberth> bool TileCheckThingie(TileIndex t, DiagDirection dir_rot);
19:02:18 <Alberth> it says "there is such a function, I will define it later
19:02:32 <Alberth> you can call it after a declaration
19:04:53 <Samu> i put declaration in landscape.h file, right?
19:05:27 <Alberth> after FlowsLock would be fine
19:05:43 <Alberth> you can make the function static, as it's only used in one file
19:06:14 <Alberth> in a .h it becomes known at far more places in the code, which is not needed
19:06:47 <Alberth> you may also want to find a better name than "Thingie" :)
19:07:06 <Samu> sometimes I don't check if the tile is flat
19:07:15 <Samu> doesn't suit all needs :(
19:07:36 <Alberth> only that check is omitted sometimes?
19:08:17 <Samu> if (IsValidTile(t_3dm + d * delta)) { if ((GetInclinedSlopeDirection(GetTileSlope(t_3dm + d * delta)) == dir ||
19:08:23 <Alberth> add a parameter "bool must_be_flat"
19:08:49 <Alberth> and perform the flatness test only when the boolean holds
19:11:47 <Samu> static bool TileCheckThingie(bool check_for_flatness, TileIndex t, DiagDirection dir_rot) {
19:11:56 <Samu> dunno what to call this function yet
19:14:39 <Samu> what the fuction is trying to do is to see if a lock can be placed adjacently to the main lock in a way it would block passage
19:15:28 <Samu> the lock can be placed in two manners
19:21:12 <Samu> static bool AdjacentLock(bool check_flat, TileIndex t, DiagDirection d) {
19:21:24 <Samu> adjacent lock good name?
19:22:11 <Samu> looks like i don't need to declare with 'static' before
19:28:44 <Samu> oww, i found one that doesn't check if tile is valid
19:35:21 <Samu> IsValidTile can't be included
19:35:41 <Samu> i need to use isValidTile to advance to the next tile
19:36:10 <Samu> or else, i may end checking for a tile on the opposite edge of the map...
19:36:21 <Samu> because I've passed the borders twice
19:43:14 *** orudge` has joined #openttd
19:43:14 *** ChanServ sets mode: +o orudge`
19:58:11 <Samu> gonna test this right now
19:58:43 <Samu> FlowsLock identifier not found bah
19:59:43 <Alberth> if (!IsValidTile(..)) return false; ??? if it returns false you stop checking anyway
20:00:13 <Samu> because that would be a tile outside the map
20:01:34 <Alberth> if it can, return false <-- that sounds like inverse logic, you want something in the name that holds if you return true
20:02:24 <Alberth> eg LockBlocked() or so
20:02:37 <Alberth> alternatively swap true and false returns
20:04:34 <Samu> i check by the positive: IsValidTile
20:05:08 <Samu> then it wouldn't need to check, or advance to subsequent tiles
20:05:46 <Samu> i don't want it to return a false
20:07:15 <Samu> there's line 114 with return true
20:11:16 <Samu> i fail at declaring FlowsLock :(
20:13:08 <Samu> generating 4k x 4k rivers, will take 10 min
20:20:43 <Samu> t.t, it generated them wrongly:(
20:22:07 <Samu> i'm getting half-bitten locks, meaning i fail
20:22:12 *** chomwitt has joined #openttd
20:26:42 <Samu> for (int d = -1; d <= 1; d += 2) { if (IsValidTile(t_3dm + d * delta)) { if (!AdjacentLock(t_3dm + d * delta, dir, false)) return false;
20:27:19 <Samu> what did AdjacentLock returned?
20:28:44 <Alberth> afaik, false when your code did "return false"
20:29:46 <Samu> if (!false) return false;?
20:30:22 <Samu> so confused with these double negatives
20:30:23 <Alberth> I don't know what you all changed
20:31:03 <Alberth> yeah, so pick a meaning for AdjacentLock, and code for that meaning
20:31:34 <Samu> i wonder if i declared it correctly
20:32:16 <Alberth> declaration doesn't change the return value of a function
20:32:41 <Alberth> you just tell the compiler it will find a function with some name somewhere else
20:32:42 <Samu> ah, it was well declared
20:33:05 <Alberth> so it doesn't scream about not knowing the function
20:33:15 <Alberth> this is also what is done in .h files
20:35:11 <Samu> GetInclinedSlopeDirection(GetTileSlope(t)) sometimes comes up with INVALID_DIAGDIR
20:35:45 <Samu> if (INVALID_DIAGDIR != DIAGDIR_NE) return true;
20:36:18 <Samu> if (!true) return false;
20:38:13 <Samu> no code is ever reaching return !FlowsLock(t);
20:38:29 <Samu> sec, will wait, still generating
20:38:39 <Samu> so far none reached that part
20:40:09 <Samu> 2000 rivers and nothing yet
20:41:02 <Samu> if (ts != d) return true; if (ts != ReverseDiagDir(d)) return true;
20:41:23 <Samu> 4000 rivers and nothing yet
20:43:21 <Samu> 8196 rivers and none reached return !FlowsLock(t);
20:45:36 <Alberth> condistions are wrong probably, I messed up, sorry
20:46:54 <Samu> if (A && (B || C) && D) return false;
20:48:06 <Samu> A: !IsTileFlat(t_dm + d * 2 * delta)
20:48:19 <Samu> B: GetInclinedSlopeDirection(GetTileSlope(t_dm + d * 2 * delta)) == dir_rot
20:48:30 <Samu> C: GetInclinedSlopeDirection(GetTileSlope(t_dm + d * 2 * delta)) == ReverseDiagDir(dir_rot)
20:48:40 <Samu> D: FlowsLock(t_dm + d * 2 * delta)
20:55:38 <Samu> if (ts != d && ts != ReverseDiagDir(d)) return true;?
21:15:45 <Samu> it's generating them well now
21:24:42 *** Gustavo6046 has joined #openttd
21:25:04 <Samu> previously, there was always a 3 tile gap from the borders :(
21:25:37 <Samu> no more unneccessary gaps
21:59:35 <V453000> unsure if grass is ass
21:59:44 <V453000> certainty estimate 14%
22:00:10 <V453000> no today I procrastinated playing Starcraft 2 for about 2 hours already
22:00:27 <V453000> that's unacceptable, back to doing shit
22:14:22 <andythenorth> I started making FIRS stuff
22:14:28 <andythenorth> but dunno, lost interest
22:14:46 <andythenorth> I doubt it's forever
22:16:27 <V453000> andythenorth: know a place where I could download some 3D models of lego duplo rail track pieces?
22:17:22 <V453000> I will probably end up modelling it but eh
22:19:01 <Samu> i feel like expanding the checks further
22:19:56 <andythenorth> dunno if ldraw converts to max or whatever
22:20:59 *** orudge` has joined #openttd
22:20:59 *** ChanServ sets mode: +o orudge`
22:22:31 <Samu> introducing the "IsTileWithOneCornerRaised" and it's twin brother "IsTileWithThreeCornersRaised"
22:41:00 *** ToffeeYogurtPots has joined #openttd
22:41:07 *** dustinm` has joined #openttd
22:48:29 *** sim-al2 has joined #openttd
22:58:48 *** ToffeeYogurtPots has quit IRC
22:58:51 *** sim-al2 has joined #openttd
22:58:51 *** dustinm` has joined #openttd
22:58:51 *** ToffeeYogurtPots has joined #openttd
22:58:51 *** innocenat has joined #openttd
22:58:51 *** fkinglag has joined #openttd
22:58:51 *** techmagus has joined #openttd
22:58:51 *** nahkiss has joined #openttd
22:58:51 *** mikegrb has joined #openttd
22:58:51 *** greeter has joined #openttd
22:58:51 *** Guest295 has joined #openttd
22:58:51 *** supermop_home has joined #openttd
22:58:51 *** Smedles has joined #openttd
22:58:51 *** Stevensoner has joined #openttd
22:58:51 *** ccfreak2k has joined #openttd
22:58:51 *** Tharbakim has joined #openttd
22:58:51 *** nauticalnexus has joined #openttd
22:58:51 *** Warrigal has joined #openttd
22:58:51 *** fiatjaf has joined #openttd
22:58:51 *** Extrems has joined #openttd
22:58:51 *** supermop_ has joined #openttd
22:58:51 *** mindlesstux has joined #openttd
22:59:49 *** andythenorth has left #openttd
23:01:11 *** ChanServ sets mode: +v orudge`
23:01:11 *** ChanServ sets mode: +o orudge
23:01:11 *** ChanServ sets mode: +v DorpsGek
23:01:13 *** ChanServ sets mode: +v Rubidium
23:01:13 *** ChanServ sets mode: +v peter1138
23:04:13 *** smoke_fumus has joined #openttd
23:41:01 *** Gustavo6046 has joined #openttd
continue to next day ⏵