Config
Log for #openttd on 26th August 2016:
Times are UTC Toggle Colours
00:01:28  *** Clockworker__ has quit IRC
00:06:39  *** Gja has quit IRC
00:08:51  *** Lejving has joined #openttd
00:20:32  *** HerzogDeXtEr has quit IRC
00:23:38  <Samu> yes! I did it!
00:23:58  <Samu> code is a bit repeating, but meh, it gets the job done
00:24:01  *** Clockworker has joined #openttd
00:25:59  <Samu> i'm just a bit sad I can't specify a vehicle type, maybe I can, needs to investigate better
00:26:51  <Samu> CommandCost EnsureNoVehicleOnGround(TileIndex tile)
00:27:47  <Samu> i'd like to specify vehicle of type Ship
00:27:54  <Samu> any hint?
00:31:28  *** Clockworker_ has quit IRC
00:34:35  *** ccfreak2k_ has joined #openttd
00:37:29  *** ccfreak2k has quit IRC
00:37:29  *** ccfreak2k_ is now known as ccfreak2k
00:41:10  <Samu> EnsureNoShipOnWater; just invented, a fork of EnsureNoVehicleOnGround
00:41:19  <Samu> let's see if it works
00:43:04  *** Snail has joined #openttd
00:51:52  <Samu> looks like i don't actually need to create such function, :)
00:51:55  <Samu> removed it
00:53:59  *** Clockworker_ has joined #openttd
00:54:11  *** Samu has quit IRC
00:56:26  *** Supercheese has left #openttd
01:01:28  *** Clockworker has quit IRC
01:29:04  *** keoz has quit IRC
01:30:04  *** Clockworker has joined #openttd
01:36:33  *** Clockworker_ has quit IRC
01:48:58  *** Bluelight has quit IRC
01:59:33  *** Clockworker_ has joined #openttd
02:07:08  *** Clockworker has quit IRC
02:21:54  *** dustinm`_ has joined #openttd
02:22:49  *** dustinm` has quit IRC
02:23:04  *** dustinm`_ is now known as dustinm`
02:29:47  *** Clockworker__ has joined #openttd
02:33:24  *** Flygon has quit IRC
02:37:13  *** Clockworker_ has quit IRC
02:40:47  *** Flygon has joined #openttd
03:05:49  *** glx has quit IRC
03:29:41  *** Clockworker_ has joined #openttd
03:37:18  *** Clockworker__ has quit IRC
03:38:10  *** Hiddenfunstuff has joined #openttd
03:56:14  *** Supercheese has joined #openttd
03:59:42  *** zeknurn has quit IRC
04:07:25  *** zeknurn has joined #openttd
04:14:50  *** alask0ud has quit IRC
04:15:45  *** Snail has quit IRC
04:19:31  *** TrueBrain has quit IRC
04:53:57  *** supermop_ has joined #openttd
04:59:53  *** Clockworker has joined #openttd
05:07:33  *** Clockworker_ has quit IRC
05:14:53  *** supermop_ has quit IRC
05:56:52  *** supermop_ has joined #openttd
06:00:00  *** Clockworker_ has joined #openttd
06:02:58  *** supermop has quit IRC
06:07:43  *** Clockworker has quit IRC
06:07:49  *** supermop has joined #openttd
06:14:03  *** supermop_ has quit IRC
06:20:11  *** Supercheese has quit IRC
06:21:01  *** Supercheese has joined #openttd
06:24:04  *** urdh has quit IRC
06:30:19  *** urdh has joined #openttd
06:42:30  *** keoz has joined #openttd
07:00:04  *** Clockworker__ has joined #openttd
07:00:56  *** HerzogDeXtEr has joined #openttd
07:07:53  *** Clockworker_ has quit IRC
07:12:49  *** efess has quit IRC
07:29:35  *** Supercheese has quit IRC
07:29:47  *** HerzogDeXtEr has quit IRC
07:43:49  *** Sova has joined #openttd
07:59:38  *** sim-al2 has quit IRC
08:08:52  *** TrueBrain has joined #openttd
08:24:37  *** JacobD88 has joined #openttd
08:32:26  *** TrueBrain_ has joined #openttd
08:35:02  *** TrueBrain has quit IRC
08:37:40  *** TrueBrain has joined #openttd
08:40:57  *** TrueBrain_ has quit IRC
08:45:56  *** TrueBrain has quit IRC
09:00:12  *** JacobD88 has quit IRC
09:04:58  *** efess has joined #openttd
09:22:43  *** Clockworker_ has joined #openttd
09:30:33  *** Clockworker__ has quit IRC
09:30:49  *** Clockworker has joined #openttd
09:37:53  *** Clockworker_ has quit IRC
09:43:31  *** seatsea has joined #openttd
10:03:21  *** Stimrol has quit IRC
10:08:31  *** Fuco has quit IRC
10:10:56  *** Sova has quit IRC
10:12:42  *** Stimrol has joined #openttd
10:12:53  *** Fuco has joined #openttd
10:13:57  *** Samu has joined #openttd
10:14:02  <Samu> hi
10:14:07  <Samu> @logs
10:14:07  <DorpsGek> Samu: https://webster.openttdcoop.org/index.php?channel=openttd
10:14:46  <Samu> oh, new website for logs, nice~
10:18:04  <argoneus> good morning train friends
10:21:44  *** Nitrodev has joined #openttd
10:22:07  <Nitrodev> hi all
10:32:46  *** Wolf01 has joined #openttd
10:32:54  <Wolf01> o/
10:37:15  <Nitrodev> o/
10:42:44  <Nitrodev> how you doing?
10:43:30  <Wolf01> Bad, packing up lego for tomorrow
10:44:43  <Nitrodev> oh?
10:48:57  *** Gja has joined #openttd
10:51:03  <Samu> grr, how do I extract the axis of a lock that is to be placed?
10:52:04  *** Sova has joined #openttd
10:54:22  <Samu> static inline Axis DiagDirToAxis(DiagDirection d)
10:54:28  <Nitrodev> eh?
10:54:30  <Samu> nice, i think this will do
11:00:07  *** Clockworker_ has joined #openttd
11:06:29  *** gnu_jj has quit IRC
11:07:32  *** gnu_jj has joined #openttd
11:07:53  *** Clockworker has quit IRC
11:15:05  *** Nitrodev has quit IRC
11:19:46  *** Sova has quit IRC
11:20:05  *** Sova has joined #openttd
11: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
11:29:38  *** andythenorth has joined #openttd
11:30:11  <andythenorth> Wolf01 AIUI, the properties will be read from the grf when needed
11:30:11  *** Clockworker__ has joined #openttd
11:30:32  <Wolf01> Yeah, but I have to try without a grf now
11:30:43  <andythenorth> callbacks definitely are read from the grf
11:31:06  <andythenorth> Ok, you're trying to create a stub/mock for testing?
11:31:13  <Wolf01> Yes
11:31:16  <andythenorth> Hmm
11:31:35  * andythenorth reads newgrf spec, brb
11:32:01  <Samu> http://imgur.com/a/wvNOI
11:33:03  <andythenorth> Hmm, i
11:33:16  <andythenorth> Need to read ottd src on tablet
11:33:18  <andythenorth> Brb
11:33:19  <Samu> i always get confused with tilediff
11:33:21  <andythenorth> :p
11:37:32  <andythenorth> readin src through the web is blah :p
11:37:53  <andythenorth> RailTypeInfo, where is that class defined?
11:37:53  *** Clockworker_ has quit IRC
11:38:45  <Wolf01> rail.h
11:39:38  <andythenorth> Yair
11:39:45  <Wolf01> I could put in the array _roadtypes[] another roadtype, but I need to know *when* to do it
11:40:04  <Wolf01> For rails is when it reads the newgrf
11:40:34  <andythenorth> Ach ok
11:40:45  <Samu> done it for the lock
11:40:51  <Samu> now the hardest part... the dock
11:41:11  <Samu> dock is a station, a boring mess of a code station_cmd.cpp
11:42:22  <andythenorth> Wolf01 I have nothing :|
11:44:09  <Samu> who's a code expert? https://paste.openttdcoop.org/pwaldxdg9 - any idea to avoid repetition?
11:44:26  <Samu> the part with ret = if red failed stuff
11:44:34  <Samu> ret*
11:45:24  <Wolf01> Put it in a function, return ret and call it 2 times?
11:46:29  <Wolf01> There you just change it to "ret = MyCheckFunction(); if (ret.Failed()) return ret;"
11:47:15  <Samu> oh i see
11:49:25  <Wolf01> It could be CommandCost EnsureNoVehicleOnAxis(TrackBits tb, Tile t, Axis axis) { ... }
11:50:21  <Wolf01> And you can even use a loop to cycle the TileIndex "tc"
11:50:26  *** andythenorth has quit IRC
11:52:24  <APTX> there is std::all_of for that kind of thing
11:54:01  <Wolf01> Nice, now I removed the ROAD roadtype...
11:54:25  <Wolf01> Just the opposite of what I want to do
11:55:19  *** andythenorth has joined #openttd
12:02:19  *** andythenorth has quit IRC
12:12:54  *** supermop_ has joined #openttd
12:15:16  <Wolf01> I just noticed the problem is on line 1138
12:15:20  <Wolf01> :*
12:16:15  <Wolf01> I might have forgot to add the roadtype definition to vehicles
12:19:23  *** supermop has quit IRC
12:20:00  *** supermop has joined #openttd
12:22:24  *** Sova has quit IRC
12:22:55  *** Sova has joined #openttd
12:26:18  *** supermop_ has quit IRC
12:32:15  *** Sova has quit IRC
12:36:09  *** supermop_ has joined #openttd
12:37:04  <Wolf01> How does the newgrf identifies a road vehicle as a tram?
12:37:40  <Wolf01> Callback?
12:38:06  <Wolf01> Misc flags?
12:42:18  *** supermop has quit IRC
12:43:10  <Wolf01> https://paste.openttdcoop.org/pztziyhiv what am I missing?
12:44:21  <Wolf01> roadtype is always "m_val = 0"
12:46:11  <Wolf01> Which might be even right, but the GetRoadTypeInfo(e->u.road.roadtype) doesn't find it
12:46:17  *** Snail has joined #openttd
12:48:16  <Wolf01> Mmmh, seem there's a problem with roadtype definition
12:55:27  <Wolf01> The roadtypes table looks fine
12:56:46  <Samu> DARN reversed directions
12:57:05  <Samu> it would make no sense to re-reverse it again
12:58:12  *** Milek7_ has joined #openttd
12:58:29  *** Milek7 has quit IRC
12:58:29  *** APTX has quit IRC
13:00:39  *** APTX has joined #openttd
13:01:28  *** Snail has quit IRC
13:02:09  *** Darksecond has quit IRC
13:02:13  *** Darksecond has joined #openttd
13:03:13  <Wolf01> Oh, got it, needed to reset and init the roadtypes, for railtypes it was done by the newgrfs
13:07:23  <Samu> http://imgur.com/a/dRqeh
13:07:33  <Samu> manual reversed the direction
13:07:38  <Samu> so I don't re-reverse it
13:13:24  *** supermop has joined #openttd
13: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))) {
13:15:44  <Samu> readability... RIP
13:19:43  *** supermop_ has quit IRC
13:19:50  <Samu> sorry to bother you again Wolf01 , docks change the rules a bit... https://paste.openttdcoop.org/pxgtxqlwk
13:20:05  *** sim-al2 has joined #openttd
13:20:07  <Samu> CommandCost EnsureNoVehicleOnAxis(TrackBits tb, Tile t, Axis axis) { ... } would be a nice function otherwise
13:20:58  <Wolf01> Nobody stops you to do the function AND the station_cmd piece of code indipendently
13:22:58  <Samu> axis to direction... direction to axis, let me see if there's a function that does the conversion
13:23:53  <Samu> derp... DiagDirToAxis, i used it for the lock part,
13:24:24  <Samu> so instead of Axis, maybe EnsureNoVehicleOnDiagDir
13:24:54  <APTX> Samu: what are you trying to fix with that change?
13:27:08  <Samu> prevent lock, dock, ship depot placement if there are ships on those tracks (to avoid possible ship lockup
13:27:20  <Samu> AIs are prone to it
13:27:21  <Wolf01> A grf expert plz
13:29:03  <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?
13:39:37  <Eddi|zuHause> Wolf01: if you define it as RAIL label, it will overwrite the original railtype
13:39:47  <Samu> i can't really convert Axis to DiagDir apparently, must investigate
13:39:50  <Wolf01> Ok
13:39:52  <Samu> only the other way
13:41:11  *** Guest134 is now known as FR^2
13:41:27  <Samu> oh, i can...
13:41:38  <Samu> AxisToDiagDir(Axis a) * @return The direction pointed to south
13:41:51  <Samu> must take that into consideration
13:42:48  *** andythenorth has joined #openttd
13:44:23  <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
13:45:55  <Wolf01> And I still need how to recognize tram from grf
13:46:08  <Wolf01> Because I have only road now
13:47:53  <Eddi|zuHause> why do you need to allocate anything? the array should be fixed size
13:47:56  <andythenorth> Fake the tram bit?
13:48:34  <Wolf01> Eddi|zuHause, that's what I can't understand on how it works
13:48:44  <Wolf01> How do rails allow 12 types?
13:48:52  * andythenorth assumes tram is just a single bit flag, as for vehicles
13: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
13:49:36  <Wolf01> Ok
13:49:51  <Eddi|zuHause> so if you have 4 bits, you need 16 entries
13:50:22  <Wolf01> I have ROAD and TRAM, and 16 subtypes for each one (4+4 bits)
13:50:40  <Wolf01> But the subtypes are variations of ROAD or TRAM
13:51:28  <Eddi|zuHause> the idea was to separate road and tram, so you need an array for each of them
13:51:46  <Samu> there is a EnsureNoTrainOnTrackBits(TileIndex tile, TrackBits track_bits);
13:52:07  <Samu> EnsureNoShipOnDiagDir(TileIndex tile, Direction diag_dir); hmm... the naming seems off
13:52:43  *** andythenorth has quit IRC
13:53:07  <Wolf01> Ok, so I could make 2 arrays
13:53:13  <Wolf01> Not a problem
13:53:40  <Wolf01> But I still can't get the idea to make it work
13:54:42  *** LadyHawk has quit IRC
13:54:49  *** LadyHawk has joined #openttd
13:57:11  *** andythenorth has joined #openttd
13:57:11  *** andythenorth has quit IRC
13: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.
13:57:23  *** andythenorth has joined #openttd
13:57:44  <andythenorth> I think alberth proposed an array with offsets per tram / road
13:57:56  <andythenorth> But I need to see if I kept notes
13:59:58  <andythenorth> Hmm, kind of had notes
14: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
14:00:14  <andythenorth> But the link to Alberth's paste expired
14: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
14:02:50  <Wolf01> Right
14:03:39  <Eddi|zuHause> so you have two different values here. invalid/valid and hidden/available
14:04:20  <andythenorth> Meh, google doesn't find much in irc logs, and logs' own search is broken :(
14:04:35  <andythenorth> This was somewhat discussed by frosch and alberth
14: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
14:06:31  *** keoz has quit IRC
14:10:40  *** andythenorth has quit IRC
14:12:06  *** andythenorth has joined #openttd
14:13:59  *** supermop_ has joined #openttd
14:14:13  <Samu> oh, DiagDirection...
14:15:09  <Samu> CommandCost EnsureNoShipOnDiagDir(TileIndex tile, DiagDirection diag_dir)
14:16:19  <Samu> how do I rotate a DiagDir 90 degrees, or actually minus 90 degrees
14:17:57  *** keoz has joined #openttd
14:18:53  *** andythenorth has quit IRC
14:19:08  *** sim-al2 has quit IRC
14:19:43  *** supermop has quit IRC
14: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
14:27:33  <Wolf01> If I remove the check in the other loop, the tram is shown
14:43:49  *** Alberth has joined #openttd
14:43:49  *** ChanServ sets mode: +o Alberth
14:46:52  *** keoz has quit IRC
14:48:18  <Alberth> hi hi
14:48:58  <Wolf01> o/
14:55:43  *** dustinm` has quit IRC
15:07:39  *** Compu has quit IRC
15:11:41  *** keoz has joined #openttd
15:14:37  *** ElleKitty has quit IRC
15:14:49  *** ElleKitty has joined #openttd
15:18:27  *** dustinm` has joined #openttd
15:30:13  *** Clockworker_ has joined #openttd
15:31:54  *** TheMask96 has quit IRC
15:32:24  *** frosch123 has joined #openttd
15:34:17  <Alberth> hola
15:37:39  *** TheMask96 has joined #openttd
15:37:58  *** Clockworker__ has quit IRC
15:43:08  <frosch123> hoi
15:43:19  <Wolf01> quak
15:43:25  <Wolf01> FOR_ALL_ENGINES_OF_TYPE(e, VEH_ROAD) {
15:43:25  <Wolf01> 		if (!HasBit(e->info.climates, _settings_game.game_creation.landscape)) continue;
15:43:25  <Wolf01> 		used_roadtypes |= GetRoadTypeInfo(HasBit(e->info.misc_flags, EF_ROAD_TRAM) ? ROADTYPE_TRAM : ROADTYPE_ROAD)->introduces_roadtypes;
15:43:33  <Wolf01> Wtf I'm doing wrong?
15:43:50  <Wolf01> I have both a tram and a bus running in the map
15:44:10  <Wolf01> FOR_ALL_ENGINE_OF_TYPE -> 1 vehicle
15:45:19  *** Progman has joined #openttd
15:49:03  *** Compu has joined #openttd
15:49:04  <Rubidium> you pass vehicle type instead of engine type?
15:49:36  <Wolf01> It's the same loop used to build the dropdown list in toolbar_gui
15:49:55  <Rubidium> oh, then ignore my comment ;)
15:54:59  <keoz> Out of curiosity, what are you coding ?
15:55:06  <Wolf01> RoadTypes
15:55:15  <Alberth> NotRoadTypes
15:55:20  *** tokai has joined #openttd
15:55:20  *** ChanServ sets mode: +v tokai
15:56:28  *** CompuDesktop has joined #openttd
15:56:36  *** Compu has quit IRC
15:58:23  *** CompuDesktop is now known as Compu
15:58:44  *** Compu has joined #openttd
16:01:28  <Samu> Wolf01: https://paste.openttdcoop.org/pfrpc7gor
16:01:53  <Samu> how to improve it further
16:01:58  <Samu> i forgot
16:02:08  *** tokai|noir has quit IRC
16:03:16  <Wolf01> It's ok
16:04:13  <Samu> the function name and explanation are a bit unclear
16:05:03  *** HerzogDeXtEr has joined #openttd
16:05:14  <Samu> those 3way tracks
16:05:21  <Samu> must have no ship
16:07:17  <Samu> EnsureNoShipOn3WayTrackBits ? lol
16:08:32  <Wolf01> Isn't track bits for trains only?
16:08:54  <Samu> nop
16:09:13  <Wolf01> Water has tracks too?
16:09:15  <Samu> they're water bits
16:09:22  <Samu> yes
16:10:31  <Samu> TrackBits tb = TrackStatusToTrackBits(GetTileTrackStatus(tile, TRANSPORT_WATER, 0));
16: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)
16:12:32  <Samu> it converts and re-converts and it's kinda messed, a bit sub-optimal but it gets the job done
16:12:51  <Wolf01> All this for?
16:13:03  <Samu> avoid ships getting blocked
16:13:43  <Wolf01> Why not doing a tile loop around the dock and just chesk if a water tile has a ship on?
16:13:50  <Wolf01> *check
16:14:08  <Wolf01> All this track bits on water is confusing
16: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
16:15:35  <Samu> a paralel ship depot being placed to a ship doesn't need to error out that there's a ship there
16:16:20  <Samu> let me find that screenshot of yesterday
16:16:31  <Alberth> @logs
16:16:31  <DorpsGek> Alberth: https://webster.openttdcoop.org/index.php?channel=openttd
16:17:02  <Samu> ah, here, thx http://imgur.com/a/RBYhH
16:17:54  <Samu> those are the places a ship cannot be
16:17:59  <Samu> those tracks
16:19:52  *** supermop has joined #openttd
16: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
16:21:07  <Samu> trackbits was a way I found to minimize the number of errors
16:21:41  *** keoz has quit IRC
16:21:55  *** Progman has quit IRC
16:23:24  *** TrueBrain has joined #openttd
16:23:34  <Samu> i'm also wondering if I can do this for the oil rig as well
16:23:45  <Samu> but oil rig is a bit more complex structure
16:24:29  *** supermop_ has quit IRC
16:25:15  <Samu> i got nonocab saves that show the problem
16:29:45  <Samu> got it
16:29:46  <Samu> http://imgur.com/a/MjNpD
16:31:11  *** CompuDesktop has joined #openttd
16:31:49  <Samu> hmm may need further checks for the dock?
16:31:59  <Samu> i got to investigate this further t.t
16:33:31  <Samu> yeh... it needs more checks... t.t
16:33:43  <Samu> back to fixing it t.t
16:36:49  *** Compu has quit IRC
16:39:09  <Wolf01> I give up until monday
16:40:39  <Alberth> fresh look often helps
16:46:08  <Samu> http://imgur.com/a/w5A9t
16:46:12  <Samu> moar checks incoming t.t
16:48:38  *** Gja has quit IRC
16:58:30  *** Gja has joined #openttd
17:00:26  *** Clockworker__ has joined #openttd
17:03:14  <Eddi|zuHause> "Track Bit" is just a way of describing which entrance to a tile is connected to which exit
17:03:50  <Eddi|zuHause> on water, all (valid) exits are also connected, so lots of track bits
17:08:08  *** Clockworker_ has quit IRC
17:08:35  *** Clockworker has joined #openttd
17:10:23  *** andythenorth has joined #openttd
17:12:35  <andythenorth> Samu are 90 degree turns disabled for ships in your test game?
17:13:17  <Samu> nop
17:13:24  <Samu> they can make 90 degrees
17:15:08  *** Clockworker__ has quit IRC
17:16:13  *** andythenorth has quit IRC
17:16:30  <Samu> https://paste.openttdcoop.org/pntsd7s9a - better checkings for docks, i believe
17:17:01  <Samu> now i need to test those rotations, tile differences and crap are not wrong
17:19:48  *** andythenorth has joined #openttd
17:22:38  *** andythenorth has quit IRC
17:22:46  *** supermop_ has joined #openttd
17:23:49  <Eddi|zuHause> why have we not removed the 90° setting for ships yet? it's totally pointless
17:24:02  <Eddi|zuHause> it's not even based on "realism"
17:24:40  <Wolf01> At least ships don't make 180° turns
17:26:21  <Eddi|zuHause> they do, when they run into a dead end
17:26:26  <Samu> they reverse direction
17:27:06  *** andythenorth has joined #openttd
17:27:21  <Wolf01> Pfff movement direction and graphics orientation should not read from the same variable :(
17:28:20  <Eddi|zuHause> most ships are not designed to run backwards :p
17:28:45  <Wolf01> And then let them stuck forever
17:28:53  *** supermop has quit IRC
17:30:27  *** glx has joined #openttd
17:30:27  *** ChanServ sets mode: +v glx
17:32:01  <Samu> dauym, a parenthesis bug, fixing, brb
17:35:11  *** andythenorth has quit IRC
17:37:03  *** Wormnest has joined #openttd
17:53:33  <Samu> alright, ship depot placement just tested, it is doing the correct checks
17:53:46  <Samu> testing lock now
18:15:15  <SpComb> frosch123: did you manage to load in the old irclogs?
18:16:00  <Samu> i just thought of a better name for the function
18:16:16  <Samu> EnsureNoVehicleFromDiagDir
18:17:04  <Samu> what you thnk?
18:20:06  *** Stimrol has quit IRC
18:30:27  *** Clockworker_ has joined #openttd
18:31:26  <frosch123> yes
18:31:33  <frosch123> i even converted the timezones
18:31:36  <SpComb> frosch123: I added a deprecation notice to irclogs.qmsk.net
18:31:51  <frosch123> @logs
18:31:51  <DorpsGek> frosch123: https://webster.openttdcoop.org/index.php?channel=openttd
18:32:28  <frosch123> well, except for 2a and 2b o'clock :)
18:32:30  <Samu> strange finding
18:32:43  <frosch123> they are both mapped to 2a, that can only be sorted manually, if someone really cares :p
18:32:48  <Samu> some half-slope tiles have water, some don't
18:32:53  <frosch123> but the rest did python for me :)
18:35:25  <SpComb> good
18:35:45  <SpComb> you should have used the irclogs LogParser code, it has full timezone support etc :P
18:36:10  <frosch123> i speak regex fluently :)
18:36:44  <SpComb> http://hg.qmsk.net/qmsk.irclogs/file/47dbaa6b13b0/qmsk/irclogs/log_parser.py#l45
18:37:53  *** Clockworker has quit IRC
18:38:07  <Samu> funny
18:38:19  <Samu> if there are trees, the tiletype no longer has waterclass
18:38:37  <Samu> if there are no trees, it's a coast and now the tile has waterclass
18:39:02  <Samu> trees are evil
18:39:57  <Samu> regardless, it doesn't ruin my function
18:43:35  <Samu> lock tested, it's doing the correct checks
18:43:42  <Samu> next is dock, but now dinner time
18:50:25  *** supermop has joined #openttd
18:56:49  *** supermop_ has quit IRC
19:00:37  *** Clockworker__ has joined #openttd
19:02:17  *** Clockworker_ has quit IRC
19:02:18  *** Clockworker__ has quit IRC
19:02:56  *** Clockworker__ has joined #openttd
19:07:36  *** Clockworker__ is now known as Clockworker
19:10:48  *** DDR has quit IRC
19:23:22  <Samu> ship depot is correct!
19:24:10  <Samu> i could perhaps improve ship depot a bit further
19:24:22  <Samu> crap, I mean ship dock
19:24:55  <Samu> when trying to place a ship dock, it wants a flat tile with water
19:25:13  <Samu> doesn't care about half-slope tiles
19:25:18  <Samu> gonna try improve this
19:25:20  <Samu> brb
19:35:11  <Samu> 	if (!IsTileType(tile_cur, MP_WATER) || !IsTileFlat(tile_cur) && !IsSlopeWithOneCornerRaised(GetTileSlope(tile_cur))) {
19:35:37  <Samu> better imo
19:35:38  *** Clockworker has quit IRC
19:35:58  *** Clockworker has joined #openttd
19:37:25  <Samu> * Ensure there is no ship coming from or going to the given diagonal direction.
19:37:32  <Samu> good english?
19:37:40  <Wolf01> Some parenthesis? "a || b && c" or "a || (b && C)"?
19:38:00  <Eddi|zuHause> i'd put them
19:38:36  <Samu> EnsureNoShipFromDiagDir is a more fitting name
19:38:44  <Eddi|zuHause> they might be redundant, but it's not immediately obvious like with + and *
19:38:56  <Wolf01> ^
19:39:02  <frosch123> every decent compiler will yell at you if you do a || b && c
19:39:25  <frosch123> oh, i remember something horrible...
19:40:10  <Samu> ah, you talking to me?
19:40:13  <Samu> ok let me fix
19:40:34  <frosch123> some infamous guy figured out a trick to detect "if (a = b)" at compile time
19:40:47  <frosch123> so that assignement inside if does not compile
19:41:32  <frosch123> the trick was to define a macro "#define if(a) if (true && a)"
19:41:44  <frosch123> since "true && a = b" does not compile
19:42:14  <Wolf01> I'm amazed
19:42:17  <frosch123> until eventually a new compiler came around that printed warning to put parentheses around &&
19:42:36  <frosch123> but noone could see the && in "if (a || b)" :)
19:43:09  <Samu> if (!IsTileType(tile_cur, MP_WATER) || (!IsTileFlat(tile_cur) && !IsSlopeWithOneCornerRaised(GetTileSlope(tile_cur)))) {
19: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
19:47:03  <Samu> just finished coding
19:47:04  <Samu> https://paste.openttdcoop.org/prgjo8rdm
19:47:08  <Samu> what do u think?
19:53:36  <Samu> the first change at line 10 should make it easier to place docks on tight passages now
19:54:26  <Samu> now, onto my next task, about towns and the way they build
19:54:40  *** sim-al2 has joined #openttd
19:54:43  <Samu> where in the code does a town build a house? must find
19:55:41  <Samu> i want to negate building on some certain tile with a given slope configuration (to prevent closing narrow water passages)
19:55:59  <Samu> do not want ships to be blocked
20:00:38  *** Clockworker_ has joined #openttd
20:02:21  <Samu> AIAI bankrupted with Easy profile, that was strange
20:02:37  <Samu> he usually crashes
20:07:18  *** Wolf01 is now known as Guest1031
20:07:18  *** Wolf01 has joined #openttd
20:08:18  *** Clockworker has quit IRC
20:10:40  *** Samu has quit IRC
20:11:05  *** Alberth has left #openttd
20:13:03  <Eddi|zuHause> need a compiler that also shows the macro expansion for that line
20:14:39  *** Guest1031 has quit IRC
20:15:46  *** Samu has joined #openttd
20:15:59  <Samu> bah windows updated ruined my testing servers
20:16:03  <Samu> updates*
20:36:21  *** Samu has quit IRC
20:38:08  *** Progman has joined #openttd
20:48:28  *** Samu has joined #openttd
20:48:47  <Samu> strange, my system crashed twice
20:49:02  <Samu> i'm wondering why
20:51:30  <Milek7_> Eddi|zuHause: gcc -E
20:51:59  <Eddi|zuHause> Milek7_: yes, but if it doesn't show it on error message directly, you're unlikely to try that
20:53:55  *** tokai has quit IRC
20:55:17  *** tokai has joined #openttd
20:55:17  *** ChanServ sets mode: +v tokai
21:00:42  *** Clockworker__ has joined #openttd
21:04:54  *** Progman has quit IRC
21:08:23  *** Clockworker_ has quit IRC
21:10:42  *** Wolf01 is now known as Guest1044
21:10:42  *** Wolf01 has joined #openttd
21:11:21  *** Guest1044 has quit IRC
21:13:54  *** supermop_ has joined #openttd
21:20:23  *** supermop has quit IRC
21:21:11  *** Hiddenfunstuff has quit IRC
21:22:47  <Samu> started all servers again, let's see if it happens again
21:23:11  *** frosch123 has quit IRC
21:26:30  <_dp_> hm, just got another random idea for fair payments...
21:26:56  *** supermop has joined #openttd
21:27:08  *** Supercheese has joined #openttd
21:27:20  <_dp_> calculate distance as 3 * min(dx, dy) + 2 * |dx-dy|  (train time)
21:27:38  <_dp_> but increase all rv speed for 50% xD
21:27:58  <Eddi|zuHause> uhm, how is that "fair"?
21:29:05  <_dp_> ok, nvm, it's not))
21:33:18  *** supermop_ has quit IRC
21:33:49  *** gelignite has joined #openttd
21:37:47  <Samu> where in the code do I deny where town houses can be built at?
21: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
21:47:16  *** Wormnest has quit IRC
21:49:34  <_dp_> apparently it's now even a new idea... https://bugs.openttd.org/task/6121
21:51:08  <Eddi|zuHause> you know how rare it is for an idea to be actually "new"?
21: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.
21: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"
21: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
21:57:43  <Eddi|zuHause> with some adjustments to rounding so you can do integer maths gets you to something like your formula
21:58:53  <_dp_> yeah, but it travels of 150% speed (using manhattan distance), not 141% or whatever it is for euclidean
21:59:20  <Eddi|zuHause> you sure? movement on diagonals is totally wonky
22:00:17  <Eddi|zuHause> it randomly applies factors of 1.5 or 0.75 at weird places
22:01:02  <_dp_> I remember seeing some dev saying it's 192 units for straight and 256 for diagonal
22:01:36  <Eddi|zuHause> i think it's the other way around
22:02:02  <Eddi|zuHause> but you also have weird stretching and shrinking effects
22:02:18  <_dp_> also videos like this confirm it https://www.youtube.com/watch?v=7ajWYJmSYhE
22:02:31  <_dp_> apparenly 256 for 2 diagonal bits
22:03:39  *** alask0ud has joined #openttd
22:03:48  <_dp_> true, its size increases differently, but that's of no importance for payments
22:09:04  *** supermop_ has joined #openttd
22:09:04  *** Clockworker__ has quit IRC
22:09:35  *** Clockworker__ has joined #openttd
22:10:16  *** seatsea has quit IRC
22:12:29  <Samu> the value is 1.5
22:13:05  <Samu> or 0.66, depending on the point of view
22:13:26  *** Supercheese has quit IRC
22:14:54  *** supermop has quit IRC
22:25:19  <Wolf01> 'night
22:25:21  *** Wolf01 has quit IRC
22:27:58  *** supermop has joined #openttd
22:30:43  *** Clockworker_ has joined #openttd
22:32:20  *** supermop__ has joined #openttd
22:33:37  *** Gja has quit IRC
22:34:23  *** supermop_ has quit IRC
22:35:32  <_dp_> return (this->direction & 1) ? 192 : 256;
22:36:08  *** Clockworker__ has quit IRC
22:36:21  <_dp_> 256 is "distance" of diagonal move which is 2 times longer in manhattan distance
22:39:39  <_dp_> somehow this doesn't add up... ok, back to code)
22:49:36  <Samu> i just discovered how towns build bridges
22:50:13  <Samu> well, at least at one of the sides
22:50:14  <_dp_> like any other piece of road
22:51:07  <Samu> slope configuration on the destination side doesn't matter :( must change that
22:51:30  <Samu> slope configuration on the source side, I am not entirely sure, must investigate it further
22:52:44  <Samu> (IsValidTile(bridge_tile) && IsWaterTile(bridge_tile)); - this check isn't sufficient
22:53:04  *** Clockworker__ has joined #openttd
22:54:50  <_dp_> ok, that formula is wrong, should be 256 * min(dx, dy) + 192 * |dx-dy|
22:55:03  <_dp_>  / smth
22:55:41  <_dp_>  / 192
22:56:28  <_dp_> so (4 * min(dx, dy) + 3 * |dx-dy|) / 4
22:57:11  <_dp_> (4 * min(dx, dy) + 3 * |dx-dy|) / 3
22:57:25  <Samu> what are you trying to do _dp_?
22:57:49  <_dp_> more fair payment calculation
22:58:42  <Samu> oh, for aircraft going on vertical/horizontal ?
22:59:19  <_dp_> or, rather, instead of rv (as it is currently) make it fair for all other vehicle types
22:59:30  <_dp_> yeah, including planes
23:00:17  <Samu> i'm not sure, seems payment rate could be abused by transfering cargo? I was told that
23:00:28  *** Clockworker_ has quit IRC
23:00:37  <_dp_> yeah, by me ;)
23:00:46  *** Clockworker_ has joined #openttd
23:01:09  <_dp_> it can be abused if it's calculated differenly for different vehicle types
23:01:42  <Samu> i would consider "virtual" vehicle speed adjustment
23:01:47  <Samu> instead of payment rate
23:04:20  <Samu> also, don't forget ships
23:04:30  <Samu> they move similar to trains
23:05:48  <Samu> as for the formula, uhm... i'm really not sure
23:06:15  <Samu> the vehicles going on those directions seem to be going 1.5x faster
23:07:39  <Samu> how to factor this speed bonus in the income formula as a penalty?
23:08:13  <_dp_> 192 / 128 = 1.5
23:08:28  *** Clockworker__ has quit IRC
23:09:00  <Samu> I wasn't really able to check the speed bonus for aircraft tough due to the different airports and place landing/departing delays
23:09:11  <Samu> i got an approximation between 1.42x to 1.50x
23:09:39  <Samu> plane* landing/departing delays
23:09:54  <Samu> tough > though
23:12:56  <Samu> for ships and trains, I really didn't get 1.50x, I got 1.496xxxx and 1.495xxxx, they still have to accelerate and turn around, tested with a distance of xy=100,100 tiles between stations
23:17:21  <_dp_> acceleration doesn't matter, I'm just using same metrics as openttd does for moving vehicles
23:22:08  <Samu> looks like I don't know what a halftile is after all
23:22:34  *** alask0ud has quit IRC
23:23:39  *** Snail has joined #openttd
23:24:19  <Samu> IsSlopeWithOneCornerRaised
23:24:28  <Samu> maybe this is what I'm looking for
23:26:54  <Samu> 	/* don't build a bridge if the tile on the other side has only one corner raised*/ 	if (IsSlopeWithOneCornerRaised(GetTileSlope(bridge_tile))) return false;
23:30:32  <Samu> bah i failed yet
23:30:49  *** Clockworker__ has joined #openttd
23:38:28  *** Clockworker_ has quit IRC
23:38:30  <Samu> I did it :)
23:38:46  <Samu> no more town bridges on slopes with one corner raised
23:39:09  <Samu> now houses, how do i deal with them?
23:39:22  <Samu> want to give them the same treatment
23:39:28  <Samu> no houses on slopes with one corner raised
23:39:44  <Samu> near water of course

Powered by YARRSTE version: svn-trunk