IRC logs for #openttd on OFTC at 2016-08-26
            
00:01:22 *** Clockworker_ has quit IRC
00:01:58 <supermop_> i feel like buying this file:
00:01:59 <supermop_> https://3dsky.org/3dmodels/show/la_marzocco_linea_classic
00:07:20 <Samu> i'm bored :(
00:08:23 *** aard has quit IRC
00:11:06 <Samu> GetTrackBits is returning rail tracks, right?
00:11:31 *** Clockworker__ is now known as Clockworker
00:11:32 <Samu> what about the water equivalent? :(
00:13:00 <Samu> bah asserts...
00:17:53 <Samu> GetTileTrackStatus_Water
00:18:05 <Samu> this function hmm uhmmm :(
00:18:54 <Samu> im so confused :(
00:23:35 *** Clockworker_ has joined #openttd
00:27:13 *** Clockworker has quit IRC
00:31:12 *** Stimrol has joined #openttd
00:34:08 *** rellig has joined #openttd
00:38:06 <Samu> tb = TrackStatusToTrackBits(GetTileTrackStatus(tile + (axis == AXIS_X ? TileDiffXY(0, -1) : TileDiffXY(-1, 0)), TRANSPORT_WATER, 0));
00:38:16 *** Wormnest has quit IRC
00:40:07 <NGC3982> http://skarmdump.henjoh.se/villhaaaaa.PNG
00:40:13 <NGC3982> This game is actually quite nice.
00:40:51 *** Supercheese has joined #openttd
00:43:15 <Eddi|zuHause> seems you don't quite have enough money :p
00:44:13 <Samu> erm, too many conversions taking place
00:45:49 <Samu> trackstatus to trackbits to trackdirbits, so confusing, when in the end it works with trackbits which is what i want
00:46:34 <Samu> whatever, I got the trackbits equal to TRACK_BIT_ALL
00:49:06 <Samu> now how do I check if the trackbits that I found have at least one of these tracks in it: TRACK_BIT_LOWER, TRACK_BIT_RIGHT, TRACK_BIT_Y
00:49:33 <Samu> I know TRACK_BIT_ALL have all three, but how exactly to i make the comparison
00:51:32 <Samu> if (TRACK_BIT_ALL & TRACK_BIT_RIGHT != 0)? what operators am i supposed to use grrr
00:51:47 <Wolf01> 'night
00:51:49 *** Wolf01 has quit IRC
01:16:31 *** ElleKitty has joined #openttd
01:19:23 *** supermop has joined #openttd
01:23:38 *** Clockworker__ has joined #openttd
01:25:32 *** supermop_ has quit IRC
01:31:22 *** Clockworker_ has quit IRC
01:31:41 *** Lejving has quit IRC
01:53:49 *** Clockworker_ has joined #openttd
02:01:28 *** Clockworker__ has quit IRC
02:06:39 *** Gja has quit IRC
02:08:51 *** Lejving has joined #openttd
02:20:32 *** HerzogDeXtEr has quit IRC
02:23:38 <Samu> yes! I did it!
02:23:58 <Samu> code is a bit repeating, but meh, it gets the job done
02:24:01 *** Clockworker has joined #openttd
02:25:59 <Samu> i'm just a bit sad I can't specify a vehicle type, maybe I can, needs to investigate better
02:26:51 <Samu> CommandCost EnsureNoVehicleOnGround(TileIndex tile)
02:27:47 <Samu> i'd like to specify vehicle of type Ship
02:27:54 <Samu> any hint?
02:31:28 *** Clockworker_ has quit IRC
02:34:35 *** ccfreak2k_ has joined #openttd
02:37:29 *** ccfreak2k has quit IRC
02:37:29 *** ccfreak2k_ is now known as ccfreak2k
02:41:10 <Samu> EnsureNoShipOnWater; just invented, a fork of EnsureNoVehicleOnGround
02:41:19 <Samu> let's see if it works
02:43:04 *** Snail has joined #openttd
02:51:52 <Samu> looks like i don't actually need to create such function, :)
02:51:55 <Samu> removed it
02:53:59 *** Clockworker_ has joined #openttd
02:54:11 *** Samu has quit IRC
02:56:26 *** Supercheese has left #openttd
03:01:28 *** Clockworker has quit IRC
03:29:04 *** keoz has quit IRC
03:30:04 *** Clockworker has joined #openttd
03:36:33 *** Clockworker_ has quit IRC
03:48:57 *** Bluelight has quit IRC
03:59:33 *** Clockworker_ has joined #openttd
04:07:08 *** Clockworker has quit IRC
04:21:54 *** dustinm`_ has joined #openttd
04:22:49 *** dustinm` has quit IRC
04:23:04 *** dustinm`_ is now known as dustinm`
04:29:47 *** Clockworker__ has joined #openttd
04:33:24 *** Flygon has quit IRC
04:37:13 *** Clockworker_ has quit IRC
04:40:47 *** Flygon has joined #openttd
05:05:49 *** glx has quit IRC
05:29:41 *** Clockworker_ has joined #openttd
05:37:18 *** Clockworker__ has quit IRC
05:38:10 *** Hiddenfunstuff has joined #openttd
05:56:14 *** Supercheese has joined #openttd
05:59:42 *** zeknurn has quit IRC
06:07:25 *** zeknurn has joined #openttd
06:14:50 *** alask0ud has quit IRC
06:15:45 *** Snail has quit IRC
06:19:31 *** TrueBrain has quit IRC
06:53:57 *** supermop_ has joined #openttd
06:59:52 *** Clockworker has joined #openttd
07:07:33 *** Clockworker_ has quit IRC
07:14:53 *** supermop_ has quit IRC
07:56:52 *** supermop_ has joined #openttd
08:00:00 *** Clockworker_ has joined #openttd
08:02:58 *** supermop has quit IRC
08:07:43 *** Clockworker has quit IRC
08:07:49 *** supermop has joined #openttd
08:14:03 *** supermop_ has quit IRC
08:20:11 *** Supercheese has quit IRC
08:21:01 *** Supercheese has joined #openttd
08:24:04 *** urdh has quit IRC
08:30:19 *** urdh has joined #openttd
08:42:30 *** keoz has joined #openttd
09:00:04 *** Clockworker__ has joined #openttd
09:00:56 *** HerzogDeXtEr has joined #openttd
09:07:53 *** Clockworker_ has quit IRC
09:12:49 *** efess has quit IRC
09:29:35 *** Supercheese has quit IRC
09:29:47 *** HerzogDeXtEr has quit IRC
09:43:49 *** Sova has joined #openttd
09:59:38 *** sim-al2 has quit IRC
10:08:52 *** TrueBrain has joined #openttd
10:24:37 *** JacobD88 has joined #openttd
10:32:26 *** TrueBrain_ has joined #openttd
10:35:02 *** TrueBrain has quit IRC
10:37:40 *** TrueBrain has joined #openttd
10:40:57 *** TrueBrain_ has quit IRC
10:45:56 *** TrueBrain has quit IRC
11:00:12 *** JacobD88 has quit IRC
11:04:58 *** efess has joined #openttd
11:22:43 *** Clockworker_ has joined #openttd
11:30:33 *** Clockworker__ has quit IRC
11:30:49 *** Clockworker has joined #openttd
11:37:53 *** Clockworker_ has quit IRC
11:43:31 *** seatsea has joined #openttd
12:03:21 *** Stimrol has quit IRC
12:08:31 *** Fuco has quit IRC
12:10:56 *** Sova has quit IRC
12:12:42 *** Stimrol has joined #openttd
12:12:53 *** Fuco has joined #openttd
12:13:57 *** Samu has joined #openttd
12:14:02 <Samu> hi
12:14:07 <Samu> @logs
12:14:07 <DorpsGek> Samu: https://webster.openttdcoop.org/index.php?channel=openttd
12:14:46 <Samu> oh, new website for logs, nice~
12:18:04 <argoneus> good morning train friends
12:21:44 *** Nitrodev has joined #openttd
12:22:07 <Nitrodev> hi all
12:32:46 *** Wolf01 has joined #openttd
12:32:54 <Wolf01> o/
12:37:15 <Nitrodev> o/
12:42:44 <Nitrodev> how you doing?
12:43:30 <Wolf01> Bad, packing up lego for tomorrow
12:44:43 <Nitrodev> oh?
12:48:57 *** Gja has joined #openttd
12:51:02 <Samu> grr, how do I extract the axis of a lock that is to be placed?
12:52:04 *** Sova has joined #openttd
12:54:22 <Samu> static inline Axis DiagDirToAxis(DiagDirection d)
12:54:28 <Nitrodev> eh?
12:54:30 <Samu> nice, i think this will do
13:00:07 *** Clockworker_ has joined #openttd
13:06:29 *** gnu_jj has quit IRC
13:07:32 *** gnu_jj has joined #openttd
13:07:53 *** Clockworker has quit IRC
13:15:05 *** Nitrodev has quit IRC
13:19:46 *** Sova has quit IRC
13:20:05 *** Sova has joined #openttd
13:23:14 <Wolf01> I really can't understand how to replicate the grf info for a new roadtype, for railtype it looks like it reads only the label and some lengths and then skips all the other informations
13:29:38 *** andythenorth has joined #openttd
13:30:11 <andythenorth> Wolf01 AIUI, the properties will be read from the grf when needed
13:30:11 *** Clockworker__ has joined #openttd
13:30:32 <Wolf01> Yeah, but I have to try without a grf now
13:30:43 <andythenorth> callbacks definitely are read from the grf
13:31:06 <andythenorth> Ok, you're trying to create a stub/mock for testing?
13:31:13 <Wolf01> Yes
13:31:16 <andythenorth> Hmm
13:31:35 * andythenorth reads newgrf spec, brb
13:32:01 <Samu> http://imgur.com/a/wvNOI
13:33:03 <andythenorth> Hmm, i
13:33:16 <andythenorth> Need to read ottd src on tablet
13:33:18 <andythenorth> Brb
13:33:19 <Samu> i always get confused with tilediff
13:33:21 <andythenorth> :p
13:37:32 <andythenorth> readin src through the web is blah :p
13:37:52 <andythenorth> RailTypeInfo, where is that class defined?
13:37:53 *** Clockworker_ has quit IRC
13:38:45 <Wolf01> rail.h
13:39:37 <andythenorth> Yair
13:39:45 <Wolf01> I could put in the array _roadtypes[] another roadtype, but I need to know *when* to do it
13:40:04 <Wolf01> For rails is when it reads the newgrf
13:40:34 <andythenorth> Ach ok
13:40:45 <Samu> done it for the lock
13:40:51 <Samu> now the hardest part... the dock
13:41:11 <Samu> dock is a station, a boring mess of a code station_cmd.cpp
13:42:21 <andythenorth> Wolf01 I have nothing :|
13:44:09 <Samu> who's a code expert? https://paste.openttdcoop.org/pwaldxdg9 - any idea to avoid repetition?
13:44:26 <Samu> the part with ret = if red failed stuff
13:44:34 <Samu> ret*
13:45:24 <Wolf01> Put it in a function, return ret and call it 2 times?
13:46:29 <Wolf01> There you just change it to "ret = MyCheckFunction(); if (ret.Failed()) return ret;"
13:47:14 <Samu> oh i see
13:49:25 <Wolf01> It could be CommandCost EnsureNoVehicleOnAxis(TrackBits tb, Tile t, Axis axis) { ... }
13:50:21 <Wolf01> And you can even use a loop to cycle the TileIndex "tc"
13:50:26 *** andythenorth has quit IRC
13:52:24 <APTX> there is std::all_of for that kind of thing
13:54:01 <Wolf01> Nice, now I removed the ROAD roadtype...
13:54:25 <Wolf01> Just the opposite of what I want to do
13:55:19 *** andythenorth has joined #openttd
14:02:19 *** andythenorth has quit IRC
14:12:53 *** supermop_ has joined #openttd
14:15:16 <Wolf01> I just noticed the problem is on line 1138
14:15:20 <Wolf01> :*
14:16:15 <Wolf01> I might have forgot to add the roadtype definition to vehicles
14:19:23 *** supermop has quit IRC
14:20:00 *** supermop has joined #openttd
14:22:24 *** Sova has quit IRC
14:22:55 *** Sova has joined #openttd
14:26:18 *** supermop_ has quit IRC
14:32:15 *** Sova has quit IRC
14:36:09 *** supermop_ has joined #openttd
14:37:04 <Wolf01> How does the newgrf identifies a road vehicle as a tram?
14:37:40 <Wolf01> Callback?
14:38:06 <Wolf01> Misc flags?
14:42:18 *** supermop has quit IRC
14:43:10 <Wolf01> https://paste.openttdcoop.org/pztziyhiv what am I missing?
14:44:21 <Wolf01> roadtype is always "m_val = 0"
14:46:11 <Wolf01> Which might be even right, but the GetRoadTypeInfo(e->u.road.roadtype) doesn't find it
14:46:17 *** Snail has joined #openttd
14:48:16 <Wolf01> Mmmh, seem there's a problem with roadtype definition
14:55:27 <Wolf01> The roadtypes table looks fine
14:56:45 <Samu> DARN reversed directions
14:57:05 <Samu> it would make no sense to re-reverse it again
14:58:12 *** Milek7_ has joined #openttd
14:58:29 *** Milek7 has quit IRC
14:58:29 *** APTX has quit IRC
15:00:39 *** APTX has joined #openttd
15:01:28 *** Snail has quit IRC
15:02:09 *** Darksecond has quit IRC
15:02:13 *** Darksecond has joined #openttd
15:03:13 <Wolf01> Oh, got it, needed to reset and init the roadtypes, for railtypes it was done by the newgrfs
15:07:23 <Samu> http://imgur.com/a/dRqeh
15:07:33 <Samu> manual reversed the direction
15:07:38 <Samu> so I don't re-reverse it
15:13:24 *** supermop has joined #openttd
15:15:37 <Samu> if (((direction == DIAGDIR_SW && (tb & TRACK_BIT_3WAY_NE) != 0) || (direction == DIAGDIR_NW && (tb & TRACK_BIT_3WAY_SE) != 0) || (direction == DIAGDIR_SE && (tb & TRACK_BIT_3WAY_NW) != 0) || (direction == DIAGDIR_NE && (tb & TRACK_BIT_3WAY_SW) != 0) && !IsShipDepotTile(tile_cur) && IsTileType(tile_cur, MP_WATER) && !IsLock(tile_cur))) {
15:15:44 <Samu> readability... RIP
15:19:43 *** supermop_ has quit IRC
15:19:50 <Samu> sorry to bother you again Wolf01 , docks change the rules a bit... https://paste.openttdcoop.org/pxgtxqlwk
15:20:05 *** sim-al2 has joined #openttd
15:20:07 <Samu> CommandCost EnsureNoVehicleOnAxis(TrackBits tb, Tile t, Axis axis) { ... } would be a nice function otherwise
15:20:58 <Wolf01> Nobody stops you to do the function AND the station_cmd piece of code indipendently
15:22:58 <Samu> axis to direction... direction to axis, let me see if there's a function that does the conversion
15:23:53 <Samu> derp... DiagDirToAxis, i used it for the lock part,
15:24:24 <Samu> so instead of Axis, maybe EnsureNoVehicleOnDiagDir
15:24:54 <APTX> Samu: what are you trying to fix with that change?
15:27:08 <Samu> prevent lock, dock, ship depot placement if there are ships on those tracks (to avoid possible ship lockup
15:27:20 <Samu> AIs are prone to it
15:27:21 <Wolf01> A grf expert plz
15:29:02 <Wolf01> If I want to introduce a new Rail Type, I must define it as "RAIL" label and then "NEWR" as alternate label or what?
15:39:36 <Eddi|zuHause> Wolf01: if you define it as RAIL label, it will overwrite the original railtype
15:39:47 <Samu> i can't really convert Axis to DiagDir apparently, must investigate
15:39:50 <Wolf01> Ok
15:39:52 <Samu> only the other way
15:41:11 *** Guest134 is now known as FR^2
15:41:27 <Samu> oh, i can...
15:41:38 <Samu> AxisToDiagDir(Axis a) * @return The direction pointed to south
15:41:51 <Samu> must take that into consideration
15:42:48 *** andythenorth has joined #openttd
15:44:22 <Wolf01> So I need to 1. reset the roadtypes, 2. add the new roadtype to the _roadtypes[], 3. Init the roadtypes and 4. Allocate the roadtype
15:45:55 <Wolf01> And I still need how to recognize tram from grf
15:46:08 <Wolf01> Because I have only road now
15:47:53 <Eddi|zuHause> why do you need to allocate anything? the array should be fixed size
15:47:56 <andythenorth> Fake the tram bit?
15:48:34 <Wolf01> Eddi|zuHause, that's what I can't understand on how it works
15:48:44 <Wolf01> How do rails allow 12 types?
15:48:52 * andythenorth assumes tram is just a single bit flag, as for vehicles
15:49:15 <Eddi|zuHause> you know how many bits you have in the map array to represent railtypes, the railtype array must have exactly that number of entries
15:49:36 <Wolf01> Ok
15:49:51 <Eddi|zuHause> so if you have 4 bits, you need 16 entries
15:50:21 <Wolf01> I have ROAD and TRAM, and 16 subtypes for each one (4+4 bits)
15:50:40 <Wolf01> But the subtypes are variations of ROAD or TRAM
15:51:27 <Eddi|zuHause> the idea was to separate road and tram, so you need an array for each of them
15:51:46 <Samu> there is a EnsureNoTrainOnTrackBits(TileIndex tile, TrackBits track_bits);
15:52:07 <Samu> EnsureNoShipOnDiagDir(TileIndex tile, Direction diag_dir); hmm... the naming seems off
15:52:43 *** andythenorth has quit IRC
15:53:07 <Wolf01> Ok, so I could make 2 arrays
15:53:13 <Wolf01> Not a problem
15:53:40 <Wolf01> But I still can't get the idea to make it work
15:54:42 *** LadyHawk has quit IRC
15:54:49 *** LadyHawk has joined #openttd
15:57:11 *** andythenorth has joined #openttd
15:57:22 <Eddi|zuHause> so here's what i think the railtype code does (i have never actually looked at it): 1) create the table, 2) fill it with the original railtypes, and some "invalid" initialization for the unused one, 3) go through the newgrfs, whether they define any railytpes. if found, overwrite the entry in the table.
15:57:23 *** andythenorth has joined #openttd
15:57:44 <andythenorth> I think alberth proposed an array with offsets per tram / road
15:57:56 <andythenorth> But I need to see if I kept notes
15:59:57 <andythenorth> Hmm, kind of had notes
16:00:13 <Wolf01> Ok, that's the same I'm doing, table, orig roadtypes (road and tram, the tram should be marked as invalid until a proper grf is loaded), initialization, figuring out how to add a new entry to the railtypes
16:00:14 <andythenorth> But the link to Alberth's paste expired
16:02:24 <Eddi|zuHause> Wolf01: no, the tram should be valid, it has a label, and graphics to display. it's just hidden by other code if there are no vehicles for it
16:02:50 <Wolf01> Right
16:03:39 <Eddi|zuHause> so you have two different values here. invalid/valid and hidden/available
16:04:20 <andythenorth> Meh, google doesn't find much in irc logs, and logs' own search is broken :(
16:04:35 <andythenorth> This was somewhat discussed by frosch and alberth
16:05:17 <Eddi|zuHause> for railtypes, there are three ways to define availability: 1) if a vehicle is for this type, it's available, 2) it can define another type as reference, and copy that one's availability, or 3) it can be available after a certain date
16:06:31 *** keoz has quit IRC
16:10:40 *** andythenorth has quit IRC
16:12:06 *** andythenorth has joined #openttd
16:13:59 *** supermop_ has joined #openttd
16:14:13 <Samu> oh, DiagDirection...
16:15:08 <Samu> CommandCost EnsureNoShipOnDiagDir(TileIndex tile, DiagDirection diag_dir)
16:16:19 <Samu> how do I rotate a DiagDir 90 degrees, or actually minus 90 degrees
16:17:57 *** keoz has joined #openttd
16:18:53 *** andythenorth has quit IRC
16:19:08 *** sim-al2 has quit IRC
16:19:43 *** supermop has quit IRC
16:27:15 <Wolf01> Ok, so I only have the used_roadtypes |= GetRoadTypeInfo(e->u.road.roadtype)->introduces_roadtypes; which now hides the TRAM because all vehicles are default to ROAD
16:27:33 <Wolf01> If I remove the check in the other loop, the tram is shown
16:43:49 *** Alberth has joined #openttd
16:43:49 *** ChanServ sets mode: +o Alberth
16:46:52 *** keoz has quit IRC
16:48:18 <Alberth> hi hi
16:48:58 <Wolf01> o/
16:55:43 *** dustinm` has quit IRC
17:07:39 *** Compu has quit IRC
17:11:41 *** keoz has joined #openttd
17:14:37 *** ElleKitty has quit IRC
17:14:49 *** ElleKitty has joined #openttd
17:18:27 *** dustinm` has joined #openttd
17:30:13 *** Clockworker_ has joined #openttd
17:31:54 *** TheMask96 has quit IRC
17:32:24 *** frosch123 has joined #openttd
17:34:17 <Alberth> hola
17:37:39 *** TheMask96 has joined #openttd
17:37:58 *** Clockworker__ has quit IRC
17:43:08 <frosch123> hoi
17:43:19 <Wolf01> quak
17:43:25 <Wolf01> FOR_ALL_ENGINES_OF_TYPE(e, VEH_ROAD) {
17:43:25 <Wolf01> if (!HasBit(e->info.climates, _settings_game.game_creation.landscape)) continue;
17:43:25 <Wolf01> used_roadtypes |= GetRoadTypeInfo(HasBit(e->info.misc_flags, EF_ROAD_TRAM) ? ROADTYPE_TRAM : ROADTYPE_ROAD)->introduces_roadtypes;
17:43:33 <Wolf01> Wtf I'm doing wrong?
17:43:50 <Wolf01> I have both a tram and a bus running in the map
17:44:10 <Wolf01> FOR_ALL_ENGINE_OF_TYPE -> 1 vehicle
17:45:19 *** Progman has joined #openttd
17:49:03 *** Compu has joined #openttd
17:49:04 <Rubidium> you pass vehicle type instead of engine type?
17:49:36 <Wolf01> It's the same loop used to build the dropdown list in toolbar_gui
17:49:55 <Rubidium> oh, then ignore my comment ;)
17:54:59 <keoz> Out of curiosity, what are you coding ?
17:55:06 <Wolf01> RoadTypes
17:55:15 <Alberth> NotRoadTypes
17:55:20 *** tokai has joined #openttd
17:55:20 *** ChanServ sets mode: +v tokai
17:56:28 *** CompuDesktop has joined #openttd
17:56:36 *** Compu has quit IRC
17:58:23 *** CompuDesktop is now known as Compu
17:58:44 *** Compu has joined #openttd
18:01:28 <Samu> Wolf01: https://paste.openttdcoop.org/pfrpc7gor
18:01:53 <Samu> how to improve it further
18:01:58 <Samu> i forgot
18:02:08 *** tokai|noir has quit IRC
18:03:16 <Wolf01> It's ok
18:04:13 <Samu> the function name and explanation are a bit unclear
18:05:03 *** HerzogDeXtEr has joined #openttd
18:05:14 <Samu> those 3way tracks
18:05:21 <Samu> must have no ship
18:07:17 <Samu> EnsureNoShipOn3WayTrackBits ? lol
18:08:32 <Wolf01> Isn't track bits for trains only?
18:08:54 <Samu> nop
18:09:13 <Wolf01> Water has tracks too?
18:09:15 <Samu> they're water bits
18:09:22 <Samu> yes
18:10:31 <Samu> TrackBits tb = TrackStatusToTrackBits(GetTileTrackStatus(tile, TRANSPORT_WATER, 0));
18:11:20 <Samu> then it goes deep into that function chain and finds static TrackStatus GetTileTrackStatus_Water(TileIndex tile, TransportType mode, uint sub_mode, DiagDirection side)
18:12:32 <Samu> it converts and re-converts and it's kinda messed, a bit sub-optimal but it gets the job done
18:12:51 <Wolf01> All this for?
18:13:03 <Samu> avoid ships getting blocked
18:13:43 <Wolf01> Why not doing a tile loop around the dock and just chesk if a water tile has a ship on?
18:13:50 <Wolf01> *check
18:14:08 <Wolf01> All this track bits on water is confusing
18:14:49 <Samu> because not all tiles need to check for a ship, and not all water tracks need to be checked for a ship presence
18:15:35 <Samu> a paralel ship depot being placed to a ship doesn't need to error out that there's a ship there
18:16:19 <Samu> let me find that screenshot of yesterday
18:16:31 <Alberth> @logs
18:16:31 <DorpsGek> Alberth: https://webster.openttdcoop.org/index.php?channel=openttd
18:17:02 <Samu> ah, here, thx http://imgur.com/a/RBYhH
18:17:54 <Samu> those are the places a ship cannot be
18:17:59 <Samu> those tracks
18:19:52 *** supermop has joined #openttd
18:20:34 <Samu> it will help AIs mostly, not really important for human players, but I was still concerned about the amount of times it would trigger the error
18:21:07 <Samu> trackbits was a way I found to minimize the number of errors
18:21:41 *** keoz has quit IRC
18:21:55 *** Progman has quit IRC
18:23:24 *** TrueBrain has joined #openttd
18:23:34 <Samu> i'm also wondering if I can do this for the oil rig as well
18:23:45 <Samu> but oil rig is a bit more complex structure
18:24:29 *** supermop_ has quit IRC
18:25:15 <Samu> i got nonocab saves that show the problem
18:29:45 <Samu> got it
18:29:46 <Samu> http://imgur.com/a/MjNpD
18:31:11 *** CompuDesktop has joined #openttd
18:31:49 <Samu> hmm may need further checks for the dock?
18:31:59 <Samu> i got to investigate this further t.t
18:33:31 <Samu> yeh... it needs more checks... t.t
18:33:43 <Samu> back to fixing it t.t
18:36:49 *** Compu has quit IRC
18:39:09 <Wolf01> I give up until monday
18:40:39 <Alberth> fresh look often helps
18:46:08 <Samu> http://imgur.com/a/w5A9t
18:46:12 <Samu> moar checks incoming t.t
18:48:38 *** Gja has quit IRC
18:58:30 *** Gja has joined #openttd
19:00:26 *** Clockworker__ has joined #openttd
19:03:14 <Eddi|zuHause> "Track Bit" is just a way of describing which entrance to a tile is connected to which exit
19:03:50 <Eddi|zuHause> on water, all (valid) exits are also connected, so lots of track bits
19:08:08 *** Clockworker_ has quit IRC
19:08:35 *** Clockworker has joined #openttd
19:10:23 *** andythenorth has joined #openttd
19:12:35 <andythenorth> Samu are 90 degree turns disabled for ships in your test game?
19:13:17 <Samu> nop
19:13:24 <Samu> they can make 90 degrees
19:15:08 *** Clockworker__ has quit IRC
19:16:13 *** andythenorth has quit IRC
19:16:30 <Samu> https://paste.openttdcoop.org/pntsd7s9a - better checkings for docks, i believe
19:17:01 <Samu> now i need to test those rotations, tile differences and crap are not wrong
19:19:48 *** andythenorth has joined #openttd
19:22:37 *** andythenorth has quit IRC
19:22:46 *** supermop_ has joined #openttd
19:23:49 <Eddi|zuHause> why have we not removed the 90° setting for ships yet? it's totally pointless
19:24:02 <Eddi|zuHause> it's not even based on "realism"
19:24:40 <Wolf01> At least ships don't make 180° turns
19:26:21 <Eddi|zuHause> they do, when they run into a dead end
19:26:26 <Samu> they reverse direction
19:27:06 *** andythenorth has joined #openttd
19:27:21 <Wolf01> Pfff movement direction and graphics orientation should not read from the same variable :(
19:28:20 <Eddi|zuHause> most ships are not designed to run backwards :p
19:28:45 <Wolf01> And then let them stuck forever
19:28:53 *** supermop has quit IRC
19:30:27 *** glx has joined #openttd
19:30:27 *** ChanServ sets mode: +v glx
19:32:01 <Samu> dauym, a parenthesis bug, fixing, brb
19:35:11 *** andythenorth has quit IRC
19:37:03 *** Wormnest has joined #openttd
19:53:33 <Samu> alright, ship depot placement just tested, it is doing the correct checks
19:53:46 <Samu> testing lock now
20:15:15 <SpComb> frosch123: did you manage to load in the old irclogs?
20:16:00 <Samu> i just thought of a better name for the function
20:16:16 <Samu> EnsureNoVehicleFromDiagDir
20:17:04 <Samu> what you thnk?
20:20:06 *** Stimrol has quit IRC
20:30:27 *** Clockworker_ has joined #openttd
20:31:26 <frosch123> yes
20:31:33 <frosch123> i even converted the timezones
20:31:36 <SpComb> frosch123: I added a deprecation notice to irclogs.qmsk.net
20:31:51 <frosch123> @logs
20:31:51 <DorpsGek> frosch123: https://webster.openttdcoop.org/index.php?channel=openttd
20:32:28 <frosch123> well, except for 2a and 2b o'clock :)
20:32:30 <Samu> strange finding
20:32:43 <frosch123> they are both mapped to 2a, that can only be sorted manually, if someone really cares :p
20:32:48 <Samu> some half-slope tiles have water, some don't
20:32:53 <frosch123> but the rest did python for me :)
20:35:25 <SpComb> good
20:35:45 <SpComb> you should have used the irclogs LogParser code, it has full timezone support etc :P
20:36:10 <frosch123> i speak regex fluently :)
20:36:44 <SpComb> http://hg.qmsk.net/qmsk.irclogs/file/47dbaa6b13b0/qmsk/irclogs/log_parser.py#l45
20:37:53 *** Clockworker has quit IRC
20:38:07 <Samu> funny
20:38:18 <Samu> if there are trees, the tiletype no longer has waterclass
20:38:37 <Samu> if there are no trees, it's a coast and now the tile has waterclass
20:39:02 <Samu> trees are evil
20:39:57 <Samu> regardless, it doesn't ruin my function
20:43:35 <Samu> lock tested, it's doing the correct checks
20:43:42 <Samu> next is dock, but now dinner time
20:50:25 *** supermop has joined #openttd
20:56:49 *** supermop_ has quit IRC
21:00:37 *** Clockworker__ has joined #openttd
21:02:17 *** Clockworker_ has quit IRC
21:02:18 *** Clockworker__ has quit IRC
21:02:56 *** Clockworker__ has joined #openttd
21:07:36 *** Clockworker__ is now known as Clockworker
21:10:48 *** DDR has quit IRC
21:23:22 <Samu> ship depot is correct!
21:24:10 <Samu> i could perhaps improve ship depot a bit further
21:24:22 <Samu> crap, I mean ship dock
21:24:55 <Samu> when trying to place a ship dock, it wants a flat tile with water
21:25:13 <Samu> doesn't care about half-slope tiles
21:25:18 <Samu> gonna try improve this
21:25:20 <Samu> brb
21:35:11 <Samu> if (!IsTileType(tile_cur, MP_WATER) || !IsTileFlat(tile_cur) && !IsSlopeWithOneCornerRaised(GetTileSlope(tile_cur))) {
21:35:37 <Samu> better imo
21:35:38 *** Clockworker has quit IRC
21:35:58 *** Clockworker has joined #openttd
21:37:25 <Samu> * Ensure there is no ship coming from or going to the given diagonal direction.
21:37:32 <Samu> good english?
21:37:40 <Wolf01> Some parenthesis? "a || b && c" or "a || (b && C)"?
21:38:00 <Eddi|zuHause> i'd put them
21:38:36 <Samu> EnsureNoShipFromDiagDir is a more fitting name
21:38:44 <Eddi|zuHause> they might be redundant, but it's not immediately obvious like with + and *
21:38:56 <Wolf01> ^
21:39:02 <frosch123> every decent compiler will yell at you if you do a || b && c
21:39:25 <frosch123> oh, i remember something horrible...
21:40:10 <Samu> ah, you talking to me?
21:40:13 <Samu> ok let me fix
21:40:34 <frosch123> some infamous guy figured out a trick to detect "if (a = b)" at compile time
21:40:47 <frosch123> so that assignement inside if does not compile
21:41:32 <frosch123> the trick was to define a macro "#define if(a) if (true && a)"
21:41:44 <frosch123> since "true && a = b" does not compile
21:42:14 <Wolf01> I'm amazed
21:42:17 <frosch123> until eventually a new compiler came around that printed warning to put parentheses around &&
21:42:36 <frosch123> but noone could see the && in "if (a || b)" :)
21:43:09 <Samu> if (!IsTileType(tile_cur, MP_WATER) || (!IsTileFlat(tile_cur) && !IsSlopeWithOneCornerRaised(GetTileSlope(tile_cur)))) {
21:43:53 <frosch123> the macro was long forgotten in some weird header file, which noone remembered, so everyone was puzzled about the weird warnings :p
21:47:03 <Samu> just finished coding
21:47:04 <Samu> https://paste.openttdcoop.org/prgjo8rdm
21:47:08 <Samu> what do u think?
21:53:36 <Samu> the first change at line 10 should make it easier to place docks on tight passages now
21:54:26 <Samu> now, onto my next task, about towns and the way they build
21:54:40 *** sim-al2 has joined #openttd
21:54:43 <Samu> where in the code does a town build a house? must find
21:55:41 <Samu> i want to negate building on some certain tile with a given slope configuration (to prevent closing narrow water passages)
21:55:59 <Samu> do not want ships to be blocked
22:00:38 *** Clockworker_ has joined #openttd
22:02:21 <Samu> AIAI bankrupted with Easy profile, that was strange
22:02:37 <Samu> he usually crashes
22:07:18 *** Wolf01 is now known as Guest1031
22:07:18 *** Wolf01 has joined #openttd
22:08:18 *** Clockworker has quit IRC
22:10:40 *** Samu has quit IRC
22:11:05 *** Alberth has left #openttd
22:13:03 <Eddi|zuHause> need a compiler that also shows the macro expansion for that line
22:14:39 *** Guest1031 has quit IRC
22:15:46 *** Samu has joined #openttd
22:15:59 <Samu> bah windows updated ruined my testing servers
22:16:03 <Samu> updates*
22:36:20 *** Samu has quit IRC
22:38:08 *** Progman has joined #openttd
22:48:28 *** Samu has joined #openttd
22:48:47 <Samu> strange, my system crashed twice
22:49:02 <Samu> i'm wondering why
22:51:30 <Milek7_> Eddi|zuHause: gcc -E
22:51:59 <Eddi|zuHause> Milek7_: yes, but if it doesn't show it on error message directly, you're unlikely to try that
22:53:55 *** tokai has quit IRC
22:55:17 *** tokai has joined #openttd
22:55:17 *** ChanServ sets mode: +v tokai
23:00:42 *** Clockworker__ has joined #openttd
23:04:54 *** Progman has quit IRC
23:08:23 *** Clockworker_ has quit IRC
23:10:42 *** Wolf01 is now known as Guest1044
23:10:42 *** Wolf01 has joined #openttd
23:11:21 *** Guest1044 has quit IRC
23:13:54 *** supermop_ has joined #openttd
23:20:23 *** supermop has quit IRC
23:21:11 *** Hiddenfunstuff has quit IRC
23:22:47 <Samu> started all servers again, let's see if it happens again
23:23:11 *** frosch123 has quit IRC
23:26:30 <_dp_> hm, just got another random idea for fair payments...
23:26:56 *** supermop has joined #openttd
23:27:08 *** Supercheese has joined #openttd
23:27:20 <_dp_> calculate distance as 3 * min(dx, dy) + 2 * |dx-dy| (train time)
23:27:38 <_dp_> but increase all rv speed for 50% xD
23:27:58 <Eddi|zuHause> uhm, how is that "fair"?
23:29:05 <_dp_> ok, nvm, it's not))
23:33:18 *** supermop_ has quit IRC
23:33:49 *** gelignite has joined #openttd
23:37:47 <Samu> where in the code do I deny where town houses can be built at?
23:41:21 <_dp_> hm, you know what... don't increase rv speed, just using that distance will make it fair for all vehicle types except rv and won't change anything in train/rv balance anyway
23:47:16 *** Wormnest has quit IRC
23:49:34 <_dp_> apparently it's now even a new idea... https://bugs.openttd.org/task/6121
23:51:08 <Eddi|zuHause> you know how rare it is for an idea to be actually "new"?
23:55:27 <_dp_> that patch is wierd, it seems it tries to use sqrt(2) which is useless here as vehicles don't travel on diagonals with euclidean speed.
23:55:45 <Eddi|zuHause> the above propsed formula is indeed closer to the way vehicles travel as "shortest" distance, but it has two flaws... 1) 3/2 is a rather poor approximation of sqrt(2), and 2) the way vehicles travel on diagonals (speed vs. length) is not "balanced"
23:57:06 <Eddi|zuHause> well, euclidean distance is the diagonal of a rectangle, the way vehicles travel is a straight bit, and a diagonal of a square
23:57:43 <Eddi|zuHause> with some adjustments to rounding so you can do integer maths gets you to something like your formula
23:58:53 <_dp_> yeah, but it travels of 150% speed (using manhattan distance), not 141% or whatever it is for euclidean
23:59:20 <Eddi|zuHause> you sure? movement on diagonals is totally wonky