IRC logs for #openttd on OFTC at 2016-09-19
⏴ go to previous day
00:56:59 <Samu> i think i found the problem
00:57:06 <Samu> coast tiles are not water
00:57:32 <Samu> let me continue this investigation
01:18:20 *** FLHerne_ has joined #openttd
02:31:21 *** Lejving has joined #openttd
07:08:42 *** sla_ro|master has joined #openttd
09:38:10 *** Biolunar has joined #openttd
10:43:32 *** NoShlomo has joined #openttd
10:52:19 *** tokai|noir has joined #openttd
10:52:19 *** ChanServ sets mode: +v tokai|noir
11:28:06 *** JacobD88 has joined #openttd
11:46:02 *** mindlesstux has joined #openttd
12:03:27 *** argoneus has joined #openttd
12:10:40 <argoneus> good morning train friends
12:54:39 <Samu> I discovered the reason why terraforming with flags | DC_NO_WATER was not failing sometimes
12:55:39 <Samu> coast tiles was not prepared to handle the | DC_NO_WATER
12:56:11 <Samu> if (IsSlopeWithOneCornerRaised(slope) && flags & DC_NO_WATER) return_cmd_error(STR_ERROR_CAN_T_BUILD_ON_WATER);
12:56:33 <Samu> there's no easy way to detect water on coastal slopes
13:01:29 <Samu> now i can't place rail on coast
13:12:18 *** JacobD88 has joined #openttd
13:38:40 <Samu> i got a bigger problem apparently, the special case of rails on coastal track
13:44:47 <Samu> it's funny that i got to work on rail part of the code about water
13:47:24 <Samu> terraform has the flags | DC_NO_WATER
13:48:00 <Samu> i should be getting an error, but I got an estimated cost, which means, it's gonna remove the water
13:48:05 <Samu> problem is on the rail tiles
13:48:35 <Samu> rail code is ubberly big, complex
13:50:34 <Samu> water was removed from the rail tiles
13:50:42 <Samu> that shouldn't happen :(
14:02:10 <Samu> maybe this is simpler than i thought, let me see
14:20:37 <Samu> terraforming object tiles is really messed up
15:04:04 *** Lejving has joined #openttd
15:28:35 <Samu> sorry i don't understand newgrf crap, i need help, someone
15:30:32 <Samu> problem I want to solve is about terraforming with 'flags | DC_NO_WATER
15:31:51 <Samu> when I do: ret = DoCommand(tile_cur, z ? slope : ComplementSlope(slope), z ? 0 : 1, flags | DC_NO_WATER, CMD_TERRAFORM_LAND);
15:32:28 <Samu> it gets to the object terraform part of the code, and i just have no idea what happens there
15:42:15 <supermop> almost certainly not
15:42:20 <supermop> i dont know anything about code
15:42:23 <Samu> are you familiar with OpenGFX+ Landscape 1.1.2?
15:42:41 <supermop> that is trees right?
15:42:53 <supermop> i just got into work
15:43:00 <Samu> it's wind turbines, ground without squares
15:45:33 <Samu> planetmaker: do you own OpenGFX+ Landscape 1.1.2?
15:48:16 <supermop> if it is gpl maybe no one owns it
15:50:24 <Samu> this is difficult for me
15:51:03 <Samu> there is no easy way to check for a coastal tile with 1 corner raised that is an object
15:51:16 <Samu> if it is an object, it's no longer a coast
15:53:53 <Samu> it's not a coast, but i see a coast
15:54:08 <Samu> I can't use IsCoastTile(tile)
16:15:44 <Samu> too bad i have no one to talk to
16:16:42 <Samu> newgrf objects are bugged, or i just don't get their purpose
16:18:32 <Samu> placing rocky land on a flat water tile costs £640
16:19:29 <Samu> placing rocky land on a 2-corner-raised coast tile costs £680
16:19:42 <Samu> placing rocky land on a 1-corner-raised coast tile costs..... *gasp*....
16:23:17 <Samu> I don't know who's at fault
16:23:25 <Samu> the newgrf itself, or openttd code
16:25:21 <Samu> place rocky land on a 1-corner-raised coast tile, with SLOPE_N
16:25:47 <Samu> build a rail track on either X or Y axis - track is built
16:26:54 <Samu> now, try placing a rail track on either X or Y axis on a 1-corner-raised coast tile, with SLOPE_N - cannot build here
16:30:13 <peter1138> that's the cost of clearing water
16:34:41 <Samu> if i place rocks, i can build track, if i don't, i can't build track
16:36:39 *** Alberth has joined #openttd
16:36:39 *** ChanServ sets mode: +o Alberth
16:36:42 <Flygon> In that first screen shot
16:36:50 <Flygon> Them railway tracks look like an Age of Empires building
16:36:58 <Flygon> Sorry for the random observatio!
16:42:27 <Samu> should be the cost of clearing the rocks
16:47:50 <Samu> costs for placing rocky lands on those tiles
16:50:53 <Samu> not really sure what makes more sense there, but certainly not £10k
17:37:43 *** NoShlomo has joined #openttd
17:58:38 *** TheMask96 has joined #openttd
18:27:24 <Samu> i'm getting WATER_CLASS_INVALID
18:27:59 <Samu> seems like the bug is happening somewhere during object placement
18:28:12 <Samu> it did not maintain the waterclass of the tile
18:28:23 <Samu> should have been WATER_CLASS_SEA
18:30:45 *** Flygon_ has joined #openttd
18:30:49 <Samu> TILE_AREA_LOOP(t, ta) { if (HasTileWaterGround(t)) {
18:31:03 <Samu> HasTileWaterGround returns false for coast
18:34:15 <Samu> HasTileWaterGround is the wrong question
18:35:01 <Samu> a big chunk of object code depends on it
18:35:50 <Samu> some coasts are not coast, such as tree tiles
18:36:11 <Samu> tree tiles on coasts makes coasts no longer coasts, and yet they're coasts
18:38:28 <Samu> can't use IsCoast because of trees, can't use HasTileWaterGround because of coasts
18:40:59 <Samu> i'm relunctant to make changes to HasTileWaterGround, a whole portion of OpenTTD code depends on it the way it works right now
18:49:15 *** Lejving has joined #openttd
18:52:00 <Samu> testing with IsTileOnWater, brb
18:53:00 <Samu> HasTileWaterClass && IsTileOnWater
19:00:09 <Samu> IsWaterTile can't be used for coasts with 1 corner raised
19:00:40 <Samu> in certain cases you want coasts to be water tiles
19:00:57 <Samu> in some others, you don't
19:07:18 <Samu> i don't know what ppl expect from a IsWaterTIle
19:07:27 <Samu> or from a HasTileWaterGround
19:10:03 <Samu> dunno what to call this... some part of openttd assumes a result and work from there, like rail code, then some other part of the code assumes the other result, there's a coding divergence, do you get what I mean?
19:10:34 <Samu> does the opposite of rail code, when using this same function
19:10:51 *** frosch123 has joined #openttd
19:11:46 <Samu> the object code tries to be more thorough, and yet fails at it
19:11:49 *** gelignite has joined #openttd
19:17:11 <Alberth> euhm, I think you are mostly, I don't know what the various water-class values mean either. Did you check the documentation strings of the values? They might contain valuable clues what they mean.
19:17:38 <Alberth> Of course, there is always the option to add another value, assuming there are enough bits for it
19:18:00 <Alberth> but then you need to check all uses of the water-class, and add your new value to it
19:26:16 <Samu> thinking of a IsWaterHalfTile
19:26:57 <Samu> IsWaterFullTile vs IsWaterHalfTile
19:27:12 <Samu> half-full, half-empty situation
19:31:35 <Samu> all coast tiles are tiles of tile type MP_WATER
19:32:05 <Samu> gah, this is hard to explain
19:43:28 *** mescalito has joined #openttd
19:50:27 <Samu> trees don't have a water class
19:50:40 <Samu> and yet they are placed on tiles with water class
19:51:52 <Samu> rail doesn't have a water class either, and yet they can be placed on tiles with water class
19:52:37 <Samu> this means I can't use HasTileWaterClass either
19:57:20 *** andythenorth has joined #openttd
20:09:38 <Samu> IsWateredTile seems to be the function i'm looking for, but it requires a direction, grrr
20:19:04 *** Progman has joined #openttd
20:37:19 <Samu> I need a ANY_DIRECTION :(
20:41:15 <Samu> if (IsWateredTile(t)) { if (!IsWaterTile(t)) {
21:12:39 <Samu> void tiles are crashing me
21:13:18 <Samu> can't really consider void tiles as watered in this case
21:24:10 <Samu> £640 is yet not the right price though
21:24:28 <Samu> should be £680 or £660, need to investigate more
21:25:15 <Samu> I'm more inclined towards £680, what do you say?
21:27:55 *** HerzogDeXtEr has joined #openttd
21:52:08 *** FLHerne has joined #openttd
22:07:45 <Samu> half-empty, half-full problem again :(
22:08:30 <Samu> when building a OpenGFX+ Landscape 1.1.2 lighthouse (land-only object)
22:08:49 <Samu> i can place it on all coastal tiles, including those with water
22:09:04 <Samu> it gets a foundation under the tile
22:09:39 <Samu> with the fix I'm currently experimenting with
22:10:06 <Samu> i can't place it on a coast tile with 1 corner raised
23:06:52 <goodger> Wolf01: well, there's a Y in the day
23:09:54 <Samu> it's only a monologue because nobody answers
23:10:42 <Wolf01> We don't want to interrupt your teddy-bear-programming ;)
23:16:03 <goodger> yeah, that is still not the origin of my surname
23:16:24 <Samu> now that I give the correct water class for the rocky land, the graphics get corrupted :(
23:48:28 <Samu> i "fixed" the problem... had to make it "broken"
23:50:45 <Samu> but now i don't know how the other newgrf objects are drawed
23:51:06 <Samu> i maybe have broken for the others :(
23:52:45 <Samu> i changed it to: if ((image == SPR_FLAT_WATER_TILE || spec->flags & OBJECT_FLAG_DRAW_WATER) && IsTileOnWater(ti->tile) && !IsSlopeWithOneCornerRaised(GetTileSlope(ti->tile))) {
23:53:27 <Samu> this alone will show broken
23:53:48 <Samu> have to complement it with another line change
23:56:34 <Samu> IsWaterTile returns false for coasts with 1 corner
23:56:43 <Samu> but it should have returned true
23:57:11 <Samu> I changed to WaterClass wc = (IsWateredTile(t) ? GetWaterClass(t) : WATER_CLASS_INVALID);
23:57:48 <Samu> but IsWateredTile in trunk needs a direction
23:58:17 <Samu> I changed IsWateredTile to accept no direction at all, an INVALID_DIRECTION
23:59:37 <Samu> when no direction is provided, it will make INVALID_DIR behave like any direction
continue to next day ⏵