IRC logs for #openttd on OFTC at 2016-09-19
            
00:29:14 *** DDR has joined #openttd
00:39:54 *** Gja has quit IRC
00:50:24 *** gelignite has quit IRC
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
01:18:20 *** FLHerne has quit IRC
01:34:12 *** Samu has quit IRC
02:01:44 *** FLHerne_ has quit IRC
02:04:52 <Wolf01> 'night
02:04:55 *** Wolf01 has quit IRC
02:13:47 *** Flygon has joined #openttd
02:31:04 *** JezK_ has joined #openttd
02:31:21 *** Lejving has joined #openttd
03:28:54 *** glx has quit IRC
04:20:30 *** Mazur has quit IRC
04:25:11 *** Mazur has joined #openttd
05:06:33 *** smoke_fumus has quit IRC
05:16:44 *** funkyL has quit IRC
05:46:05 *** supermop_ has quit IRC
06:15:58 *** argoneus has quit IRC
06:46:20 *** Belugas has quit IRC
07:08:42 *** sla_ro|master has joined #openttd
07:20:10 *** Compu has quit IRC
07:20:32 *** Compu has joined #openttd
09:31:41 *** Lejving has quit IRC
09:38:10 *** Biolunar has joined #openttd
10:19:36 *** funkyL has joined #openttd
10:35:22 *** Wolf01 has joined #openttd
10:35:49 *** Supercheese has quit IRC
10:36:00 <Wolf01> o/
10:43:32 *** NoShlomo has joined #openttd
10:52:19 *** tokai|noir has joined #openttd
10:52:19 *** ChanServ sets mode: +v tokai|noir
10:59:09 *** tokai has quit IRC
11:28:06 *** JacobD88 has joined #openttd
11:33:01 *** JezK_ has quit IRC
11:38:30 *** mindlesstux has quit IRC
11:46:02 *** mindlesstux has joined #openttd
12:03:27 *** argoneus has joined #openttd
12:10:40 <argoneus> good morning train friends
12:14:56 *** JacobD88 has quit IRC
12:49:18 *** Samu has joined #openttd
12:54:39 <Samu> I discovered the reason why terraforming with flags | DC_NO_WATER was not failing sometimes
12:55:08 <Samu> case WATER_TILE_COAST
12:55:39 <Samu> coast tiles was not prepared to handle the | DC_NO_WATER
12:55:52 <Samu> they would always clear
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
12:56:41 <Samu> code isn't too flexible
13:01:29 <Samu> now i can't place rail on coast
13:01:40 <Samu> this is complex
13:12:18 *** JacobD88 has joined #openttd
13:36:18 <Wolf01> Then rewrite the code
13:37:16 <Samu> DARN RAIL TRACKS
13:37:19 <Samu> oops caps
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:46:44 <Samu> here's the problem: http://imgur.com/a/4YdBi
13:47:01 <Samu> there's 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:13 <Samu> now where exactly :(
13:48:35 <Samu> rail code is ubberly big, complex
13:50:25 <Samu> http://imgur.com/a/Btw4X vs http://imgur.com/a/4YdBi
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:04:30 <Samu> yay
14:04:35 <Samu> i did it
14:20:37 <Samu> terraforming object tiles is really messed up
14:43:01 *** JacobD88 has quit IRC
15:04:04 *** Lejving has joined #openttd
15:28:35 <Samu> sorry i don't understand newgrf crap, i need help, someone
15:29:53 <Samu> https://hg.openttd.org/trunk.hg/file/d1ee3e5330e5/src/object_cmd.cpp#l800
15:30:32 <Samu> problem I want to solve is about terraforming with 'flags | DC_NO_WATER
15:30:51 <Samu> '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:34:08 <Samu> who's a NewGRF expert?
15:41:35 <supermop> yo
15:41:58 <Samu> supermop: can you help
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:32 <Samu> oh :(
15:42:33 <supermop> no
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:43:11 <Samu> placing lighthouses
15:43:15 <Samu> as objcts
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:51:20 <Samu> but i see a coast
15:53:41 <Samu> http://imgur.com/a/RqPYe
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:11:30 *** Lejving has quit IRC
16:15:27 <Samu> just found another bug
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:17:04 <Samu> they cause problems
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:19:53 <Samu> £10,640
16:23:17 <Samu> I don't know who's at fault
16:23:25 <Samu> the newgrf itself, or openttd code
16:24:03 <Samu> here's another bug
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:30:16 <peter1138> not a bug
16:34:12 <Samu> http://imgur.com/a/t90mk vs http://imgur.com/a/LaqIJ
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:52 <Flygon> The first one
16:36:58 <Flygon> Sorry for the random observatio!
16:37:02 <Flygon> Good night!
16:37:10 <Samu> :)
16:37:11 <Alberth> hello
16:39:07 <Samu> hello Alberth
16:42:27 <Samu> should be the cost of clearing the rocks
16:42:39 <Samu> peter1138:
16:46:38 <Wolf01> o/ Alberth
16:47:32 <Samu> http://imgur.com/a/Jot4I
16:47:50 <Samu> costs for placing rocky lands on those tiles
16:48:08 <Samu> £10,640 is not okay...
16:49:44 <Samu> should have been £680
16:50:24 <Samu> or perhaps half of £40
16:50:32 <Samu> £660
16:50:53 <Samu> not really sure what makes more sense there, but certainly not £10k
17:37:22 *** NoShlomo has quit IRC
17:37:43 *** NoShlomo has joined #openttd
17:54:08 *** Arveen has joined #openttd
17:54:19 *** TheMask96 has quit IRC
17:55:34 *** mescalito_ has quit IRC
17:58:38 *** TheMask96 has joined #openttd
18:22:50 *** aard 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:33:20 <Samu> https://hg.openttd.org/trunk.hg/file/d1ee3e5330e5/src/object_cmd.cpp#l237
18:34:15 <Samu> HasTileWaterGround is the wrong question
18:34:20 <Samu> what can i do?
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:36:26 <Samu> i'm limited
18:37:56 *** Flygon has quit IRC
18:38:28 <Samu> can't use IsCoast because of trees, can't use HasTileWaterGround because of coasts
18:38:45 <Samu> any ideas?
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:50:57 *** glx has joined #openttd
18:50:57 *** ChanServ sets mode: +v glx
18:52:00 <Samu> testing with IsTileOnWater, brb
18:52:49 <Samu> oh crap
18:53:00 <Samu> HasTileWaterClass && IsTileOnWater
19:00:09 <Samu> IsWaterTile can't be used for coasts with 1 corner raised
19:00:15 <Samu> returns false
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:05:20 <Samu> i dunno what to do
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:18 <Samu> town code for example
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:12:15 <Samu> anyone here?
19:12:19 <Samu> Alberth: ?
19:12:24 <Samu> I'm alone on this?
19:15:54 <Alberth> hola
19:16:19 <frosch123> moi
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:31:42 <Samu> well not really all
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:19 <Samu> kinda like the rail
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:01:12 <andythenorth> o/
20:04:20 <supermop> yo andy
20:07:14 <andythenorth> o/
20:09:38 <Samu> IsWateredTile seems to be the function i'm looking for, but it requires a direction, grrr
20:14:20 <Alberth> o/
20:19:04 *** Progman has joined #openttd
20:23:34 <andythenorth> is tram?
20:37:19 <Samu> I need a ANY_DIRECTION :(
20:37:26 <Samu> ANY_DIR
20:37:49 <Samu> i'm using INVALID_DIR
20:38:05 <Samu> might be misleading
20:38:47 *** andythenorth has quit IRC
20:41:15 <Samu> if (IsWateredTile(t)) { if (!IsWaterTile(t)) {
20:41:21 <Samu> keks
20:48:31 *** Gja has joined #openttd
21:12:39 <Samu> void tiles are crashing me
21:12:50 <Samu> my fault
21:13:18 <Samu> can't really consider void tiles as watered in this case
21:20:03 *** aard has quit IRC
21:22:14 <Samu> I "nearly" fixed a bug
21:23:44 <Samu> https://imageproxy.tt-forums.net/136981332d65b5fd574105f565d72377a6e317fc/687474703a2f2f692e696d6775722e636f6d2f53424c6f3831462e706e67
21:23:53 <Samu> i made the cost £640
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:09:40 *** Alberth has quit IRC
22:10:06 <Samu> i can't place it on a coast tile with 1 corner raised
22:14:33 *** frosch123 has quit IRC
22:23:07 *** Arveen has quit IRC
22:28:06 *** Progman has quit IRC
22:38:08 <Wolf01> Monologue today?
22:57:55 *** sla_ro|master has quit IRC
23:06:52 <goodger> Wolf01: well, there's a Y in the day
23:07:46 <Wolf01> Oh, hi good-badger :)
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:17:12 <Samu> http://imgur.com/a/5ass7
23:20:33 <Wolf01> :/
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:51:12 <Samu> sec
23:52:23 <Samu> this line, 437 https://hg.openttd.org/trunk.hg/file/d1ee3e5330e5/src/newgrf_object.cpp#l437
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:01 <Samu> https://hg.openttd.org/trunk.hg/file/d1ee3e5330e5/src/object_cmd.cpp#l120
23:56:05 <Samu> line 120
23:56:23 *** Biolunar has quit IRC
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:21 <Samu> IsWateredTile
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:58:27 <Samu> oops INVALID_DIR
23:59:37 <Samu> when no direction is provided, it will make INVALID_DIR behave like any direction