IRC logs for #openttd on OFTC at 2016-04-03
            
00:00:25 <FLHerne> Left-pointing arrows, shifts the bits one bit to the left
00:00:51 <Samu> IsWateredTile(TILE_ADDXY(tile, 1, 0), DIR_NE it asks if the tile located at SW of the current tile has water being directed at NE
00:02:07 *** aard has quit IRC
00:03:19 <Samu> if it does, the current tile at 0, 0 will draw water at SW, at least it's what I understand
00:07:00 <Samu> and the bits are 0100
00:07:28 <Samu> wa = 0100
00:07:42 <FLHerne> Ah, sorry, looks like you're right
00:08:15 <Samu> okay, apparently I understood this first part, now the 2nd part, the corners
00:09:39 <Samu> corners are complicating my brains
00:12:14 <Samu> I want to add additional logic
00:12:29 <Samu> distinguish elevated corner to flat corner
00:12:47 <Samu> draw the correct image sprite depending on the corner that is currently raised
00:13:45 <Samu> taking the example of 0100
00:14:49 <Samu> water is drawed at SW, but what if the N corner is raised, or lowered, or flat?
00:15:02 <Samu> what if the S corner is raised, lowered or flat?
00:15:30 <Samu> what if the W corner is raised, lowered or flat? :(
00:16:25 <Samu> (don't know where to add this logic, even)
00:20:08 <FLHerne> That's where adding up all the bits _is_ useful
00:20:36 <FLHerne> 0001, 0010, 0011, ...
00:21:10 <Samu> oh :)
00:21:36 <FLHerne> So sprite (offset) 0 is "no corners [x]", 1 is "SW? corner [x]", 2 is "NW? corner [x]", 3 is "SW and NW corners [x]", ...
00:23:12 <FLHerne> If you have two relevant bitfields, shift one left by four bits and add it to the other, then you have a unique 8-bit value for every combination
00:23:34 <FLHerne> Although 256 different states sounds like too many for a lot of things
00:24:27 <Samu> count the steep slopes too
00:24:33 <Samu> :o
00:29:53 <Samu> 8 4 2 1 then shift 4 more stuff there?
00:30:31 <Samu> 9 12 6 3 8 4 2 1?
00:31:44 <Samu> 9 12 6 3 are the corners
00:31:56 <Samu> 8 4 2 1 are the ... meh, im confused already
00:32:11 <FLHerne> No, I have no idea what that was supposed to mean
00:32:46 *** _johannes has quit IRC
00:32:56 <FLHerne> Say 0011 are your water states
00:33:07 <FLHerne> And 1010 are your height states
00:34:21 <FLHerne> Then you can shift one lot four bits up, so that 10100011 represents the particular state where both of those states are true
00:35:46 <FLHerne> If you put your sprites in the right order, then the 164th sprite (index 163) can be the sprite for that state
00:39:51 <Samu> what about steep heights?
00:40:34 <Samu> need moar bits?
00:40:37 <FLHerne> Gets even worse?
00:40:39 <Samu> t.t
00:41:18 <FLHerne> How many different states do you actually care about?
00:41:32 <Samu> all slope combinations
00:41:41 <Samu> let me check
00:42:49 <Samu> 19, or 18 if I exclude SLOPE_FLAT
00:42:52 <FLHerne> Surely steep slopes just can't have water on them?
00:43:03 <Samu> they will, if i can code this right
00:43:44 <Eddi|zuHause> there should be plenty of ways to get water(falls) on steep slopes
00:50:48 <Samu> enum Slope ... all types are here, let me find this
00:51:53 <Wolf01> 'night
00:51:55 *** Wolf01 has quit IRC
00:53:03 <Samu> http://hg.openttd.org/branches/1.6.hg/file/b23c908543e3/src/slope_type.h
00:53:54 <Samu> slope vs corner
00:54:00 <Samu> hmm, maybe i can reduce that number :8
00:55:39 <Samu> halftiles aren't needed for this
01:01:20 <Samu> it's 18
01:01:38 <Samu> that's 2 more bits?
01:02:09 <Samu> wondering if i can make it 16
01:03:31 <Samu> or if i can extrapolate bits
01:09:46 <Samu> must think
01:11:25 *** Progman has quit IRC
01:24:25 *** zeknurn` has joined #openttd
01:25:02 *** tokai has joined #openttd
01:25:02 *** ChanServ sets mode: +v tokai
01:29:29 *** zeknurn has quit IRC
01:29:29 *** zeknurn` is now known as zeknurn
01:31:48 *** tokai|noir has quit IRC
01:44:11 *** Nathan1852 has quit IRC
01:59:30 *** Eddi|zuHause has quit IRC
02:15:29 *** Quatroking has quit IRC
02:15:45 *** FLHerne has quit IRC
02:16:53 *** Hiddenfunstuff has quit IRC
02:18:02 *** Eddi|zuHause has joined #openttd
02:39:01 *** Samu has quit IRC
02:46:22 *** Eddi|zuHause has quit IRC
02:52:27 *** Eddi|zuHause has joined #openttd
03:03:00 *** Snail has joined #openttd
03:33:49 *** Snail has quit IRC
03:55:03 *** LadyHawk has quit IRC
03:56:29 *** LadyHawk has joined #openttd
04:57:26 *** glx has quit IRC
05:24:33 *** liq3 has quit IRC
05:51:19 *** HerzogDeXtEr1 has quit IRC
05:58:16 *** Snail has joined #openttd
06:04:11 *** Snail has quit IRC
06:10:47 *** Ketsuban has quit IRC
06:13:11 *** Snail has joined #openttd
06:17:03 *** Snail has quit IRC
06:21:40 *** Snail has joined #openttd
06:46:29 *** _johannes has joined #openttd
07:02:55 *** Ketsuban has joined #openttd
07:12:18 *** Snail has quit IRC
08:00:36 *** sla_ro|master has joined #openttd
08:17:21 *** Alberth has joined #openttd
08:17:21 *** ChanServ sets mode: +o Alberth
08:34:31 *** Arveen has joined #openttd
08:45:31 *** Ketsuban has quit IRC
08:50:23 *** andythenorth has joined #openttd
08:50:32 <andythenorth> o/
08:58:43 *** Progman has joined #openttd
09:04:51 *** andythenorth has quit IRC
09:05:00 *** Supercheese has quit IRC
09:07:47 <Alberth> moin andy
09:51:06 *** andythenorth has joined #openttd
09:55:03 *** Hiddenfunstuff has joined #openttd
09:57:04 *** Wolf01 has joined #openttd
09:57:37 <Wolf01> o/
10:03:02 <Alberth> hi hi
10:08:45 <_johannes> Can there be trains that are engines but have unit number 0 ?
10:10:35 <_johannes> ah, if the train has multiple engines, the others can have id 0
10:27:59 *** sla_ro|master has quit IRC
10:35:00 *** Clockworker_ has joined #openttd
10:42:20 <andythenorth> stupid alumninium plant
10:42:23 <andythenorth> is unbalanced
10:42:34 *** Clockworker__ has quit IRC
10:43:06 <andythenorth> :D
11:00:12 <Alberth> add more buildings :p
11:04:17 <Wolf01> o/
11:06:04 <Wolf01> lol andy, I got 300 more vip points as excuse reward because I just asked why the inversion switch was removed from the power functions switch
11:06:33 <Wolf01> official answer " The version of the LPF Control switch with the control direction switch on is discontinued and replaced by a newer version without this switch. The reason for removing the switch in the newer version is that it was not used often and had quite a cost overhead"
11:06:46 *** andythenorth has quit IRC
11:06:59 <Wolf01> ;_; andy
11:20:46 *** frosch123 has joined #openttd
11:21:02 *** MonkeyDrone has joined #openttd
11:28:25 *** Quatroking has joined #openttd
11:31:34 *** ConductCat has joined #openttd
11:38:21 *** ConductorCat has quit IRC
11:53:04 *** andythenorth has joined #openttd
11:54:05 <andythenorth> ho
11:54:13 * andythenorth ‘won’ Silicon Valley in 42 years
11:54:17 <andythenorth> just missed bronze :P
11:59:21 *** tokai|noir has joined #openttd
11:59:21 *** ChanServ sets mode: +v tokai|noir
12:00:37 <frosch123> cookies are the best, you can eat them :)
12:01:13 <andythenorth> so I need to get subtype into GetTileTrackStatus_Road
12:01:27 <andythenorth> seems stuffing submode parameter is better than adding another parameter?
12:01:36 <frosch123> definitely :)
12:01:46 <frosch123> because it is shared with rail and ship
12:01:51 <andythenorth> hmm
12:02:24 <frosch123> you could change all of them into a struct ofc
12:03:01 <andythenorth> that’s just words to me right now :D
12:03:16 <andythenorth> not sure if I patch veh.compatible_roadtypes (probably not)
12:03:29 <andythenorth> or find all places RVs call GetTileTrackStatus
12:03:33 <andythenorth> and patch those calls
12:03:56 <andythenorth> seems more like the latter
12:06:03 <frosch123> i think you already patched all of them :p
12:06:19 *** tokai has quit IRC
12:07:12 <andythenorth> nah, not yapf and npf ones yet
12:07:32 <andythenorth> nor overtaking :x
12:11:14 <andythenorth> hmm only 22 uses of compatible_roadtypes
12:11:24 <andythenorth> can I stuff that and leave all the other things alone? o_O
12:11:53 *** Wormnest has joined #openttd
12:11:55 <andythenorth> compatibility is a union of mode (tram / road) and subtype
12:12:07 <andythenorth> unrelated, ROADTYPE would be better renamed MODE or so :P
12:25:33 <frosch123> if you add some INVALID roadtype and tramtype, you likely do not need the RoadTypes in the submode
12:29:12 *** Nathan1852 has joined #openttd
12:35:25 *** Defaultti has quit IRC
12:36:49 *** Defaultti has joined #openttd
12:41:01 <andythenorth> hmm
12:41:13 <andythenorth> don’t I need them to get the right set of track bits?
12:42:17 <frosch123> TypeError: endswith first arg must be bytes or a tuple of bytes, not str <- i don't get that
12:42:41 <frosch123> changes = [w[3:] for w in changes if w.endswith(file_ext)] <- what is the first arg? "w" or "file_ext"?
12:45:33 <Alberth> w
12:45:45 <Alberth> x.f(y) <--> f(x, y)
12:45:58 <frosch123> to my understanding both "w" and "file_ext" should be strings
12:48:04 <frosch123> i may need to add a "universal_newlines=True" to subprocess.check_output
12:48:24 <Eddi|zuHause> the "first argument" of "x.blah(y)" is "x"
12:48:42 <andythenorth> is w bytes or string
12:48:54 <Alberth> you do, check_output has weird semantics for text-files if you don't provide that
12:49:03 <Eddi|zuHause> but that error makes not a lot of sense
12:49:16 <andythenorth> bytes.endswith() somehow?
12:49:24 <Alberth> I think it gets confused on a weird combination of bytes and str
12:50:08 <Eddi|zuHause> what if you try "str(w).endswith(...)"?
12:57:36 <frosch123> universal_newlines fixed it
12:57:49 *** Samu has joined #openttd
12:58:47 <frosch123> https://dev.openttdcoop.org/projects/openttd-android-translate/repository/diff?utf8=%E2%9C%93&rev=b01fc7c7abd2b143a63d20ef3122dc533778db39&rev_to=6cf248be5eae8a175a8285eb463715129d46fada <- eints' first git commit :)
13:00:50 <Eddi|zuHause> so that's a "it works \o/"?
13:01:29 <frosch123> i guess so
13:01:43 <frosch123> i just learned about ssh ControlMaster though, so maybe i can speed up eints scritps a lot
13:08:26 <frosch123> hmm, it slowed it down from 30s to 160s?
13:08:33 <frosch123> what :p
13:11:34 <andythenorth> biddle bobble
13:15:39 <andythenorth> compatible_roadtypes returns RoadTypes not RoadType?
13:15:50 * andythenorth assumes from reading it
13:21:18 <andythenorth> but RoadTypeToRoadTypes takes just one roadtype
13:21:22 * andythenorth confused
13:28:20 <frosch123> compatible_roadtypes makes little sense with your patch
13:28:43 <frosch123> you define compatiblity on subtype level, while road and tram are always separate
13:32:03 <andythenorth> so I can replace it
13:32:28 <andythenorth> but I need to preserve the bits for is road / is tram
13:34:40 <andythenorth> hmm if there are no compatible subtypes on the tile, that’s equivalent to ROADTYPES_NONE
13:35:20 <andythenorth> frosch123: so INVALID might be a subtype for each of roadtype and tramtype?
13:35:25 <andythenorth> 0 or so
13:36:40 <frosch123> usually 0xFF
13:43:33 *** andythenorth is now known as Guest10197
13:43:43 *** andythenorth has joined #openttd
13:44:39 <andythenorth> seems like I could patch compatible_roadtypes
13:44:54 <andythenorth> and return 1st bit as bool, road/tram, and then the subtype bits
13:45:02 <andythenorth> and that would be enough
13:45:15 <andythenorth> and for places that are looking only at road/tram, it’s a trivial fix
13:46:43 *** Guest10197 has quit IRC
13:47:18 <andythenorth> but RoadType and RoadTypes are enums, so now I am lost :D
13:47:34 <andythenorth> I know an enum is just a list, but how do I bitstuff that?
13:49:43 <Alberth> ?
13:50:52 <andythenorth> exactly :|
13:51:21 <Alberth> /me is mostly confused about "enum is a list" :)
13:51:59 <Alberth> but looking at the source, RoadType is a single roadtype, each with a number (0=road, 1=tram)
13:52:11 <Alberth> RoadTypes is the bitset already
13:52:14 *** liq3 has joined #openttd
13:53:11 <Alberth> roadtypes_road is the bitset with only road, roadtypes_tram is the bitset with only tram, and roadtypes_all is the bitset with both road and tram
13:53:13 <andythenorth> I need to patch v->compatible_roadtypes
13:53:20 <andythenorth> which expects RoadTypeToRoadTypes
13:53:51 <andythenorth> which returns RoadTypes
13:54:18 <Alberth> ok
13:54:31 <andythenorth> not sure how I extend RoadTypes :)
13:54:46 <andythenorth> I want the first bit to be the roadtype, and the remaining bits to be the subtype
13:55:04 <andythenorth> ach, maybe I just don’t use RoadTypes
13:55:35 <Alberth> roadtypes has 2 bits now, 1 for road and 1 for tram
13:55:57 <Alberth> ie 4 possible values (nothing, only road, only tram, or both)
13:56:27 <Alberth> lots of aren't used yet, there :p
13:56:36 <Alberth> +bits
13:57:02 <Alberth> but maybe code expects only 2 bits always, which must be verified
13:57:13 <Alberth> and/or fixed
13:57:35 * andythenorth tries to understand
13:57:43 <andythenorth> when working with tiles, the RoadTypes structure makes sense
13:57:56 <andythenorth> but when working with vehicles, there can only be one roadtype
13:58:04 <andythenorth> this extensible structure is a dead end
13:58:17 <andythenorth> maybe
13:59:11 <andythenorth> road or tram is just a single bit
14:00:10 <Alberth> you can use a bitset with 1 bit set (ie only road or only tram), or you can use a RoadType value
14:00:48 <andythenorth> can I pack the subtype bits into RoadTypes as well?
14:01:25 <Alberth> you can add a new field for the subtype
14:01:55 <Alberth> but existing code doesn't expect extra bits
14:02:23 <Alberth> so you need a masking function to pull just the current bitset out, and apply that everywhere
14:02:37 <Alberth> or at least check things don't break if you don't
14:02:43 <andythenorth> seems most efficient to change what compatible_roadtypes is doing
14:02:48 <andythenorth> and stop returning RoadTypes from it
14:02:59 <andythenorth> and instead return a bitset containing what I need
14:03:58 <Alberth> you can also make another bitset, but then we'll have 3 sets for road and tram :p
14:04:36 * andythenorth has brain ache :)
14:12:40 <Wolf01> if you want I can give you more :)
14:13:05 * Wolf01 waits another "connection reset by pear"
14:13:14 <Wolf01> or by beer
14:13:23 <Wolf01> sure is not peer
14:14:28 <Alberth> we'll wait for the message and see :p
14:15:07 <Wolf01> andythenorth: I've got an official response from lego about the new pf switch without the inversion switch, it's just to reduce the costs
14:15:55 <Wolf01> also I've got 300 more vip points because I only asked why they decided to change this
14:16:42 <Alberth> ask more questions :)
14:16:47 <Samu> I finally got what the hell is wrong with my research! 3 variables that I got to work with: slopes, edges and corners
14:17:25 <Samu> I was working with the slopes and corners the wrong way
14:17:54 <Wolf01> is there a right way to work with slopes and corners?
14:18:15 <Wolf01> (+5 points to griffindor)
14:18:40 <Samu> if I am seeing this right, the edge_offset has to be split into edge_offset and corner_offset
14:19:07 <Alberth> recursive splitting!
14:19:35 *** andythenorth has quit IRC
14:19:39 <Samu> it's hard to find what to do, but I'm getting somewhere
14:20:48 *** andythenorth has joined #openttd
14:24:13 *** gelignite has joined #openttd
14:24:24 <andythenorth> meh
14:24:55 <andythenorth> function_name(my_param = {tram_flag: False, subtype: 0})
14:25:00 <andythenorth> is all I want to do, but in C++
14:25:52 <Alberth> :)
14:26:18 <Alberth> where do you want that dictionary?
14:26:48 <andythenorth> in place of compatible_roadtypes
14:26:53 <Alberth> (probably not as dictionary, but in an enum or so?
14:27:27 *** HerzogDeXtEr has joined #openttd
14:27:46 <Alberth> RoadTypes compatible_roadtypes; <-- change that type?
14:28:06 <andythenorth> I think so
14:28:16 <andythenorth> can I just use a uint and shift it? :P
14:28:41 *** MonkeyDrone has quit IRC
14:29:12 <Alberth> hmm, field name would be wrong too, I guess
14:34:12 <andythenorth> the places that consume compatible_roadtypes are just looking for a bit currently
14:34:20 <andythenorth> seems over-engineered :)
14:36:29 * andythenorth biab
14:36:30 *** andythenorth has quit IRC
14:58:52 *** MonkeyDrone has joined #openttd
14:59:34 *** FLHerne has joined #openttd
15:04:56 <Eddi|zuHause> Wolf01: the best one i've seen yet is "Peer Gynt"
15:07:56 <Wolf01> hah poor guy :D
15:10:15 <Wolf01> I've never read that poem, but I think I've had it on my school book
15:11:05 <Eddi|zuHause> i only know the music...
15:16:49 <Wolf01> Yeah, the music is famous
15:23:48 <Wolf01> bah, I'm tired of making lego pantographs... need something else to do
15:27:23 *** norro_ has quit IRC
15:27:25 *** norro has joined #openttd
15:31:34 <Eddi|zuHause> get me a replacement pantograph for an old E69 model (in H0)
15:38:11 *** FLHerne has quit IRC
15:38:14 *** FLHerne has joined #openttd
15:41:59 *** norro has quit IRC
15:42:03 *** norro has joined #openttd
15:42:16 *** norro has joined #openttd
16:08:30 *** norro has quit IRC
16:16:04 *** Eddi|zuHause has quit IRC
16:23:30 *** Eddi|zuHause has joined #openttd
16:28:44 *** Eddi|zuHause has quit IRC
16:30:04 *** Eddi|zuHause has joined #openttd
16:47:39 *** andythenorth has joined #openttd
16:51:31 <Alberth> https://paste.openttdcoop.org/p3rj9kpfy hi hi, random-ish attempt to make an extended RT version, for inspiration :)
16:52:47 <Wolf01> :thumb_up:
16:53:41 * andythenorth is going to have to learn what an enum actually is
16:53:46 <andythenorth> google knows
16:56:01 * andythenorth needs a better google
16:56:09 <Wolf01> ask here
16:57:21 <andythenorth> it looks like a dumb class
16:57:35 * andythenorth struggling to see the purpose
16:59:11 <Alberth> enum does 2 things
16:59:33 <Alberth> 1: introduce names for magic numbers
16:59:58 <Alberth> sort of const, but scales better for bigger amounts of constants
17:00:20 <andythenorth> this guide starts to make sense http://www.learncpp.com/cpp-tutorial/45-enumerated-types/
17:00:42 <Alberth> 2: Introduce a type, so names are grouped under an umbrella
17:01:02 <andythenorth> is it odd to keep unrelated things in same enum?
17:01:05 * andythenorth assumes so
17:01:40 <Alberth> it is
17:01:56 <Alberth> hmm, negative numbers aren't actually allowed in an enum
17:03:54 <andythenorth> ok, so it makes sense to be able to write code using ROADTYPE_TRAM
17:04:14 <andythenorth> rather than checking a specific bit is 1 in 19 places
17:05:28 <andythenorth> so ROAD_FOO_ROAD = 1 << ROADTYPE_ROAD
17:05:32 <andythenorth> is shifting by 0 or 1?
17:05:33 <Alberth> yep, it helps a lot, I'd say
17:06:03 <Alberth> don't understand the 0/1 question
17:06:19 <Alberth> lowest bit is numbered 0
17:06:49 <Alberth> 1 == (1 << 0)
17:07:12 <Alberth> 1 == 2**0
17:08:59 <andythenorth> trying to understand what RoadFoo does :)
17:09:50 <andythenorth> seems the subtypes would need to be in an enum for sanity
17:11:10 <Alberth> yup, uint8 is a bit blunt :p
17:11:35 <Alberth> you also likely don't have 256 subtypes
17:11:38 <andythenorth> no
17:11:43 <andythenorth> but there are two types of subtype
17:11:45 <andythenorth> tram and road
17:12:01 <Alberth> and you can have both at the same time?
17:12:04 <andythenorth> yes
17:12:17 <andythenorth> tram and road are completely independent, they happen to occupy same tile
17:12:49 <Alberth> make a "no road" sub-type, and a "no-tram" sub-type, and the road and tram bits can be removed
17:13:03 <Alberth> (lack of tram bit == "no-tram" sub-type)
17:13:30 <Eddi|zuHause> andythenorth: maybe you should further separate them in the code. so you have one data type TramType and one RoadType
17:13:35 <Alberth> so you only have road sub-type and tram sub-type
17:13:49 <Eddi|zuHause> then you don't have to fiddle with weird orthogonal combinations
17:13:57 <Eddi|zuHause> every tile gets a roadtype and a tramtype
17:14:06 <Alberth> +1
17:14:19 <andythenorth> that seems counter-intuitive to me, having read the code a lot :)
17:14:34 <andythenorth> RoadType is only used to distinguish between road and tram
17:14:48 <andythenorth> if they’re split, what do you use to distinguish them?
17:15:04 <Eddi|zuHause> what i named "roadtype" here would be the subtype
17:15:20 <andythenorth> i.e. there is much code of the type (ROADTYPE_ROAD ? 1 : 0)
17:15:34 <andythenorth> which is then used for RV or tram bits, movement code, drawing etc
17:16:15 <andythenorth> I considered splitting them, but it would mean copying all the functions redundantly, afaict
17:16:19 <andythenorth> much more legible though
17:16:20 <Eddi|zuHause> you could also replace all those by (IsRoadSubtype(subtype)?1:0)
17:16:39 <Eddi|zuHause> then have all subtypes as either a road or a tram type (defined by newgrf)
17:16:44 <andythenorth> that would be appealing, but it needs some way to map subtypes back to road or tram
17:16:53 <andythenorth> which I can’t conceive how to do
17:16:57 <Eddi|zuHause> then you have 16 subtypes, which the newgrf can divide up as it wishes
17:17:55 <andythenorth> yes
17:20:47 <andythenorth> all of the is beyond me right now tbh
17:21:09 <Eddi|zuHause> this is usually the point where you stop coding and start planning
17:21:41 <andythenorth> I think I have enough prototype thrown at the wall
17:22:08 <andythenorth> but I would like to get rid of current compatible_roadtypes use before I stop
17:22:24 <andythenorth> I don’t really understand it, nor what breaks if it is changed
17:22:36 <Eddi|zuHause> i can't help you with that
17:22:46 <andythenorth> nah
17:22:58 <andythenorth> I’ve set it to 0
17:23:06 <andythenorth> for stupidity, and now I need to find how it’s used
17:23:55 <andythenorth> maybe 1 is better
17:24:07 <andythenorth> ROADTYPE_ROAD seems to be 0 sometimes, and 1 other times
17:26:57 <andythenorth> yeah ok, changing current use of compatible_roadtypes breaks a bunch of stuff
17:27:17 <andythenorth> it relies on checking multiple bits to detect if vehicle is road or tram
17:27:33 <andythenorth> moving that to a flag in one bit doesn’t work
17:32:25 <andythenorth> the simplest thing would be simply to add a subtype parameter to all the get_tile_track_status_proc functions
17:32:31 <andythenorth> but that seems like total string
17:38:56 *** Ketsuban has joined #openttd
17:39:05 *** andythenorth has left #openttd
17:49:42 *** andythenorth has joined #openttd
17:49:53 <andythenorth> how do I count how many bits an enum uses?
17:51:12 <andythenorth> stack overflow says I shouldn’t try, it’s not safe
17:51:16 <andythenorth> but I need to know
17:52:38 <Alberth> at value level, or memory storage level (ie how many bytes the compiler gave the type)
17:53:08 <andythenorth> specifically I need to know how big compatible_roadtypes is
17:53:09 <Alberth> at value level, find the biggest number of the enum, and how many bits that number needs
17:53:14 <andythenorth> so I can shift some other bits alongside it
17:53:46 <andythenorth> that will be value level
17:54:19 <andythenorth> highest value is 255?
17:54:28 <Alberth> biggest number is 0xff (INVALID_ROADTYPES), ie 8 bits
17:55:05 <andythenorth> thanks
17:55:43 <andythenorth> frosch gave me the method to implement this specific part of the patch yesterday btw, but until I understand why, I understand nothing much :)
17:55:50 <andythenorth> and as yet, I understand nothing much :P
17:55:57 <Alberth> :)
17:56:09 <Alberth> that's where it always starts
17:56:37 <Alberth> exploding into nice generic solution also always happens :p
17:56:51 <andythenorth> it now makes sense why the sub_mode parameter to GetTileTrackStatus_Road should be “road_types | road_subtype << 8 | tram_subtype << 16"
17:57:16 <Alberth> needs parentheses
17:57:30 <andythenorth> yup :)
17:57:46 <andythenorth> only needs to be added in 11 places :P
17:57:59 <Samu> I could composite the edges of river tiles on slopes, but I have bad news :( the green color combinations of the edge stripes won't match... different greens
17:58:10 <Samu> what to do?
17:58:37 <Samu> need more greens!
17:58:49 <andythenorth> nah, it must be possible
17:59:03 <andythenorth> I drew the current river sprites, I was not short of greens
17:59:29 <Alberth> blues were a bigger problem I guess :p
17:59:33 <Samu> the stripes are aligned, but the scolors doesn't really look good
17:59:37 <Samu> colors*
17:59:39 <andythenorth> screenshot?
17:59:53 <Alberth> what's the value of road_subtype if road_types has no road bit?
18:00:00 <andythenorth> meaningless
18:00:06 <andythenorth> it defaults to 0
18:00:41 <andythenorth> currently I wouldn’t bother trying to read it anywhere, I’d check the road bit first
18:00:51 <Alberth> if you redefine 0 as "no road" you don't need the road bit of road_types
18:00:58 <Alberth> and similarly for tram bit
18:00:59 <andythenorth> yes
18:01:51 <andythenorth> lots of places use it, I think it’s a refactoring goal rather than a prototype
18:02:04 * andythenorth should write a spec and plan
18:02:17 <Alberth> fair enough
18:03:02 <andythenorth> hmm Arctic Basic is as popular as cold sick apparently
18:03:14 <andythenorth> can’t win em all :(
18:03:55 <Samu> http://i.imgur.com/9GcNZIC.png
18:04:07 <Samu> i still dont have the water sprite
18:04:26 <Samu> and i didn't align corners yet
18:04:46 <andythenorth> what’s the problem with greens? o_O
18:04:48 <Samu> but the NE edge vs NW edge... the colors
18:04:59 <Alberth> ugh, "it is not realistic -> not good" :(
18:05:01 <Samu> the different greens
18:05:14 <andythenorth> it’s not lit correctly
18:05:20 <andythenorth> the greens are available in the palette
18:05:35 <andythenorth> don’t worry about that too much at that moment, as long as you have the right pieces
18:05:46 *** Snail has joined #openttd
18:05:54 <andythenorth> if I was doing this, I’d actually draw pink / red / yellow / blue sprites, to avoid looking too much at the appearance
18:06:05 <andythenorth> and instead focus on getting the right sprite in the right place :)
18:06:58 <Samu> speaking of corners
18:07:06 <andythenorth> Alberth: I can’t see past the antagonistic stuff about car industries :P
18:07:10 <Samu> I don't have a N corner sprite :(
18:07:42 <Samu> well I have many N corner sprites, but not one that aligns well given those 2 edges configurations
18:07:44 <andythenorth> I’m not nationalistic, but UK car industry is ~same size as France, bigger than Italy. Provocative assertions, based on wrong facts :|
18:08:01 <andythenorth> Samu: the sprites you need likely don’t exist yet
18:08:19 <andythenorth> if you try and composite existing riverbank sprites you’ll get the effect in the screenshot :)
18:08:43 <Alberth> it's arctic -> greenland -> has no car industries -> wrong
18:09:09 <andythenorth> they’re factually correct, maybe I just remove ‘inspired by’ :P
18:09:15 <Alberth> while in my view, it's good to have something different than the ever coal / wood thingies
18:09:40 <andythenorth> indeed :)
18:10:20 <andythenorth> so if road / tram bits went away and instead subtype 0 was “TRAM_NONE” or similar
18:10:22 <andythenorth> inline bool IsTram() { return IsRoadTT() && HasBit(RoadVehicle::From(m_veh)->compatible_roadtypes, ROADTYPE_TRAM); }
18:10:22 *** NGC3982 is now known as NGC1
18:10:25 <andythenorth> would be simpler no?
18:11:30 <Alberth> it would, less duplication of state, so simpler to manage. however I can see the point of making it work first
18:11:33 <Eddi|zuHause> that doesn't make a lot of sense
18:12:23 <andythenorth> Eddi|zuHause: as it currently exists?
18:12:26 <andythenorth> or my proposal?
18:12:40 <Eddi|zuHause> the "TRAM_NONE" thing
18:13:00 <andythenorth> does it make sense to drop the road / tram bits?
18:13:15 <Eddi|zuHause> "compatible_roadtypes" should probably be replaced by something derived from the newgrf, like for railtypes
18:13:55 <andythenorth> I don’t understand that tbh
18:14:14 <andythenorth> newgrf can’t change the definitions of ROADTYPE_ROAD and ROADTYPE_TRAM
18:14:26 <andythenorth> that’s well out of scope
18:14:36 <Eddi|zuHause> yes, but they can add more, that are either compatible to ROAD, TRAM or neither
18:14:42 <andythenorth> no they can’t
18:14:50 <andythenorth> well, not the way I’m planning to do it
18:14:52 <Eddi|zuHause> but they should become able to
18:14:55 <andythenorth> that’s a whole other ball game
18:15:17 <Eddi|zuHause> then i don't understand what you're trying to achieve
18:15:30 <andythenorth> why add more types?
18:16:01 <Eddi|zuHause> narrow gauge trams, broad gauge trams, subways, trails, whatever
18:16:12 <andythenorth> yes but that’s not what ROADTYPE does
18:16:37 <Eddi|zuHause> but maybe that's what it should do?
18:16:46 <andythenorth> I don’t see anyone ever achieving that tbh
18:16:50 <andythenorth> nobody has wanted to so far
18:17:39 <andythenorth> seems better to just stick with ROADTYPE_ROAD and ROADTYPE_TRAM as they exist
18:18:14 <Eddi|zuHause> so then what's the difference between tram subtypes?
18:19:04 <Eddi|zuHause> and why bother adding tram subtypes if you can't make them incompatible?
18:19:07 * andythenorth wonders about ROADTYPE_SUBWAY now
18:19:47 <andythenorth> doesn’t need drawing
18:19:55 <andythenorth> nothing to patch in the drawing functions...
18:20:00 <Wolf01> I have that feeling like "I should offer my help"
18:20:25 <Eddi|zuHause> you probably should cast that subway thought aside very quickly
18:20:37 <Eddi|zuHause> "subway" should simply be a tram built underground
18:20:46 <andythenorth> if I leave RoadTypes untouched, then it’s plausible that $someone can come along and add more types in future
18:21:20 * andythenorth wonders if that can be done whilst still eliminating the 2 road/tram bits
18:21:25 <Eddi|zuHause> the point was that you don't think about what types to add, but the newgrf does
18:21:32 <sim-al2> I don't know if roads can hide vehicles somehow, but subway probably wouldn't work if you can't
18:21:49 <andythenorth> just don’t draw them :)
18:22:00 <sim-al2> Ok fair enough
18:22:03 <Eddi|zuHause> sim-al2: there is a "fake subway" grf
18:22:22 <Wolf01> I also want highways
18:22:36 <andythenorth> ‘want’ :P
18:22:46 <andythenorth> my 6 year old wants ‘faster roads that cost more'
18:22:49 <Eddi|zuHause> Wolf01: that's easy, just implement objects with state machines
18:23:01 <andythenorth> I explained that speed is set by vehicle not road :P
18:23:04 <andythenorth> he still wants them
18:23:12 <Eddi|zuHause> andythenorth: i'd call that a "highway" :p
18:23:22 <Wolf01> eddi: like I never tried
18:24:20 <andythenorth> what do I rename compatible_roadtypes to if it contains both RoadTypes (first 8 bits) and subtypes (next 8 bits)
18:24:28 <Eddi|zuHause> Wolf01: well, it's done in 3 easy steps: 1) implement state machines for airports. 2) extend state machines for articulated vehicles. 3) add state machines to road stations and objects
18:24:30 <sim-al2> A roadtype with concrete barriers or guardrails might look close enough
18:24:51 <Wolf01> "easy"
18:24:55 <andythenorth> hmm I don’t know how to make the code non-specific to tram / road
18:25:08 <andythenorth> Eddi|zuHause: all the tram code is specific to trams, how would newgrf redefine that?
18:25:19 <andythenorth> or add it’s own movement code for new roadtypes?
18:25:30 * andythenorth can’t see it
18:25:31 <Eddi|zuHause> andythenorth: with a property flag "this behaves like a tram"
18:25:40 <andythenorth> but that’s still tied to trams
18:25:51 <Eddi|zuHause> andythenorth: look at how maglev is treated differently for rails (acceleration model)
18:26:03 <andythenorth> yes, but how to add arbitrary types?
18:26:20 <Eddi|zuHause> andythenorth: just reserve the bits, let the newgrf fill them with meaning
18:26:51 <andythenorth> still has to resolve to road or tram though?
18:26:58 * andythenorth is confused
18:27:21 <Eddi|zuHause> yes. every newgrf-defined type will have a flag "behaves like tram" set or unset
18:27:34 <Alberth> think so, or you cannot have a road and a tram at a single tile
18:27:51 <Eddi|zuHause> so every "roadtype == ROADTYPE_TRAM" will become "hasroadtypetramflagset(roadtype)"
18:29:01 <andythenorth> that is more pleasing tbh
18:29:24 *** HerzogDeXtEr1 has joined #openttd
18:30:11 <andythenorth> the current implementation has the overhead of unused extensibility, whilst not delivering much that can be built on for subtypes :)
18:32:53 <frosch123> andythenorth: don't listen to eddi :)
18:33:10 <frosch123> you made a spec with separate roadtypes and tramtypes
18:33:29 <frosch123> don't start over :p
18:33:46 <andythenorth> I am not sure if I have understood Eddi|zuHause or not :)
18:34:02 <frosch123> nah, eddi is just adding bs
18:34:04 <andythenorth> either he has a completely different idea, or he’s just filling in the gaps on how to implement subtypes
18:34:18 <Eddi|zuHause> i likely have 3 different different ideas
18:34:21 <andythenorth> all this roadtype == foo stuff in current code is…unhelpful :P
18:34:23 <frosch123> i doubt he even followed the earlier discussion
18:34:28 <Wolf01> why 2 specs for the same thing?
18:34:44 *** HerzogDeXtEr has quit IRC
18:35:09 <Eddi|zuHause> but what i said about refactoring the == into a function call is independent from my ideas
18:35:13 <andythenorth> yes
18:35:14 *** Clockworker_ has quit IRC
18:35:16 <andythenorth> that seemed useful
18:35:18 <andythenorth> anyway, I am stuck on GetTileTrackStatus_Road
18:35:37 *** Clockworker_ has joined #openttd
18:35:38 <andythenorth> I only have one parameter for sub_mode, and I don’t have the vehicle in scope in that function
18:35:49 <andythenorth> so I can’t get the subtype from the vehicle, unless I stuff it into sub_mode
18:36:02 <andythenorth> that means changing 11 callers, adding an ugly || to each
18:36:17 <Eddi|zuHause> add a parameter?
18:36:17 <andythenorth> or I change the meaning of compatible_roadtypes, and fix a few places that expect the old meaning
18:36:34 <andythenorth> adding a parameter means changing 13 tile functions, almost totally unrelated to roads
18:36:35 <Eddi|zuHause> i really don't know what that function is doing
18:37:12 <andythenorth> ^ this exposes that compatible_roadtypes is nearly useless for a subtype-based idea, and could be refactored away
18:38:01 <andythenorth> I was hoping I could get rid of RoadTypes entirely, and the associated road / tram bits, and rely on the subtype bits
18:38:07 * andythenorth can’t eat that elephant in one go :(
18:38:35 <andythenorth> not good topic for My First C++ Patch
18:39:16 <frosch123> andythenorth: i believe you want to replace RoadTypes with albert's RoadFoo
18:40:19 <andythenorth> probably :)
18:40:24 <andythenorth> but I just don’t understand :)
18:41:38 * andythenorth keeps the link handy
18:44:31 <Alberth> you want how many road_subtypes and how many tram_subtypes?
18:45:30 <Alberth> do you also still need the road and tram bits?
18:46:45 <andythenorth> the use of road and tram bits could be replaced by putting a subtype like 0xFF in to provide the same information
18:46:57 <andythenorth> and patching the functions that look at those bits…
18:47:25 <andythenorth> I think that 3 or 4 road_subtypes and 3 or 4 tram_subtypes is enough for any game
18:47:32 <Alberth> yep, so the latter question is "no" :)
18:47:34 <andythenorth> experience suggests we’ll want to use 8 :P
18:47:40 <andythenorth> "no"
18:47:47 <andythenorth> :)
18:48:43 <Samu> crap :( why are the OpenGFX river files split into 5000 or so :(
18:48:46 <andythenorth> it’s easy to find 2 lots of 2 bits in the map currently
18:48:59 <andythenorth> finding more bits without splitting them looked hard when I tried
18:49:18 <andythenorth> and who needs more than 3 tramtypes in a game? :P
18:50:07 <Alberth> likely, every newgrf needs it own 3 tram types :p
18:50:20 <Samu> I'm getting a headache :( looking at sprites and having 30~ windows open
18:50:43 <andythenorth> if authors make types incompatible, that’s going to be hell routing through towns :D
18:51:28 <Eddi|zuHause> didn't road tiles already have 2x4 bits for the road/tram type reserved?
18:52:08 <Samu> why did you make the river sprites split into 105 files?
18:52:18 <Eddi|zuHause> iirc the problem was always road/rail crossings, which were too crammed
18:52:19 <Samu> makes it so much harder to follow
18:52:44 *** sla_ro|master has joined #openttd
18:52:58 <andythenorth> problem was bridge ramps afaict
18:53:16 <andythenorth> I didn’t spend very long on it, I had enough bits to prototype with
18:53:17 <Eddi|zuHause> andythenorth: i always wanted a tram type that was faster, but cannot be combined with roads (in the same direction)
18:53:44 <andythenorth> m4 looks free, but I think level crossings spank it
18:53:50 <Eddi|zuHause> and road types that are faster, but cannot be used for town growth
18:54:07 <andythenorth> m6 has 2 blocks of 2, which I’m using for road / tram
18:54:17 <frosch123> Samu: you didn't decode it using grfcodec, did you :p
18:54:35 <andythenorth> we can release the current 2 roadtype bits
18:56:17 <Eddi|zuHause> m4 should also be free for level crossings, as far as i gather
18:56:31 <andythenorth> Eddi|zuHause: your ideas w.r.t town growth etc sound like newgrf props or cbs
18:56:42 <Eddi|zuHause> yes
18:56:51 <Eddi|zuHause> props should be fine
18:57:13 <andythenorth> doesn’t level crossing inherit rail, with 0-3 used?
18:57:45 <Eddi|zuHause> no, level crossings are road tiles with some special bits
18:58:03 <Eddi|zuHause> so "inherit" means "from road tiles"
18:58:43 <andythenorth> so m4 might be free
18:59:07 * andythenorth tests
19:02:58 <Eddi|zuHause> i think level crossings had a problem which did not allow having tram without road
19:03:13 <Eddi|zuHause> not sure if that was a map limitation or a graphical limitation
19:03:20 <andythenorth> graphical
19:03:23 <andythenorth> I tried to fix it :)
19:03:31 <andythenorth> PBS overlays spanked it
19:03:35 <andythenorth> also monorail :P
19:04:04 <andythenorth> 4 bits for tram subtype, 4 bits for road subtype
19:04:15 <Eddi|zuHause> that sounds fine
19:04:20 <andythenorth> that’s 15 types (assuming one is NONE or INVALID or so)
19:04:25 <andythenorth> way more than is needed
19:04:38 <andythenorth> said everyone who is wrong ever :P
19:05:01 <Eddi|zuHause> i really wouldn't put "none" in there
19:05:20 <Eddi|zuHause> even if that would free up a bit or two elsewhere
19:05:29 <andythenorth> you’d keep the separate road / tram bits?
19:05:41 <Eddi|zuHause> yes
19:06:12 <Alberth> http://devs.openttd.org/~alberth/rt.h
19:07:47 * andythenorth reads :)
19:07:52 <Samu> I am confused
19:08:14 <Alberth> close a few of the 30 windows?
19:08:28 <Samu> i closed several Pain windows
19:08:30 <Samu> Paint
19:08:36 <Eddi|zuHause> seeing how people already complain about 16 railtypes not being enough?
19:09:09 <Alberth> well, if you give them 256, it's still not enough
19:09:39 <Alberth> they just use bits instead of sequences of values :)
19:10:01 <Alberth> only 8 features available :p
19:10:11 <Samu> frosch123: where can i find the images with the spriteIDs numbered?
19:10:36 <Samu> like a big spreadsheet of images
19:11:09 * andythenorth must now read about enums again
19:11:32 *** Snail has quit IRC
19:11:36 <Alberth> you may want special functions for testing "invalid"
19:12:07 <andythenorth> first I have to take baby steps :)
19:12:28 <Alberth> yeah, just saying
19:12:54 <Samu> riverbank_temperate_ne.gimp.png riverbank_temperate_nw.gimp riverbank_temperate_se.gimp riverbank_temperate_sw.gimp
19:13:05 <Samu> .gimp.png
19:13:14 <Alberth> after you wrote too many GetRoadType(rt) == ROAD_TYPE_INVALID :)
19:13:19 <andythenorth> so given an instance of RoadFoo, I can now get RoadType or Subtype out?
19:13:50 <Alberth> that's the idea, you have function to query or set the road type
19:14:08 <Alberth> maybe not the roadtype bit, I don't remember exactly
19:14:10 <andythenorth> so vehicles and tiles now instantiate RoadFoo when I want to work with those
19:14:31 <andythenorth> ok
19:14:47 <Alberth> a single tramtype is a uint8 (in both my files iirc)
19:14:57 <andythenorth> yes, in my patch also
19:15:04 * andythenorth patches v->compatible_roadtypes to v->compatible_foos :P
19:15:11 <Alberth> so if you only want that, a uint8 will work
19:15:36 <Alberth> RoadTypes or RoadFoo is more about storing or transporting a combination, eg for a tile
19:15:41 <andythenorth> yup
19:15:55 <andythenorth> this saves me messing around shifting bits in and out of a uint32 or so?
19:16:27 <Alberth> it mostly saves you writing all the shifts, as the SB and GB functions handle it
19:16:32 <andythenorth> great
19:16:45 <Alberth> the compute will still do it :p
19:16:51 <Alberth> *computer
19:17:17 <Alberth> sorry to take away your exercise :p
19:18:05 <andythenorth> I’ll live with that
19:19:23 <andythenorth> I can replace current RoadTypes with this? It has some magical template stuff under it
19:19:42 <andythenorth> obviously I’d patch all things that consume it
19:19:45 <Alberth> the BEGIN/END are missing
19:20:03 <Alberth> so I suspect it will break, but don't know where
19:20:43 <Alberth> I removed all extras
19:21:31 *** smoke_fumus has joined #openttd
19:21:34 <andythenorth> yes, compiler hates it :D
19:21:42 <Alberth> so it will break while compiling, instead of doing something fuzzy without telling
19:23:01 <Wolf01> mmmh, I get a bunch of errors in the road_type.h enums : expression must have a constant value
19:23:23 <andythenorth> 'ROADTYPES_ALL'; did you mean 'ROADTYPE_END'?
19:23:31 <andythenorth> road_func.h:72:21: error: use of undeclared identifier
19:23:32 <andythenorth> 'ROADTYPES_ALL'; did you mean 'ROADTYPE_END'?
19:24:02 <andythenorth> that’s an interesting function, gets the missing types
19:24:23 <andythenorth> used during construction iirc
19:25:20 <andythenorth> yup, used during removal of road or level crossing
19:25:37 <Alberth> could make a subtype "any valid"
19:25:46 <andythenorth> return (RoadTypes)(ROADTYPES_ALL ^ r);
19:25:48 <Alberth> but that's sort of complicated too
19:25:55 <andythenorth> ^ very elegant but there’s probably another way
19:26:20 <andythenorth> it comes to ‘does the tile have tram or road on it'
19:26:39 <Alberth> !HasRoadType(rt) !HasTramType(rt) ?
19:27:01 <andythenorth> pretty much
19:27:12 <andythenorth> it’s used to rebuild the tram or road on a tile when removing the other type
19:27:20 *** Arveen has quit IRC
19:27:34 <andythenorth> all the construction code is fun
19:27:56 <Alberth> static inline bool HasTramType(rt) { return GetTramType(rt) != ROADTYPES_TRAM_INVALID; }
19:28:30 <argoneus> anyone here has experience writing libraries?
19:28:39 <argoneus> I just have a tiny offtopic question :<
19:28:43 <andythenorth> only UI libraries :P
19:29:05 <Alberth> is it possible to ask offtopic things here? :p
19:29:05 <argoneus> I'm not sure if I should try and separate my classes into "internal" and "what the external user can use"
19:29:14 <argoneus> or just have them together
19:29:22 <argoneus> as the external ones call the internal ones anyway
19:29:31 <Eddi|zuHause> is it possible to ask metaquestions in here?
19:29:47 <andythenorth> I think you just did that, definitionally :D
19:29:59 <Eddi|zuHause> thats. the. joke.
19:30:03 <andythenorth> orl?
19:30:06 <Alberth> only of the type "can anyone help me?"
19:30:17 <andythenorth> argoneus: my experience is (1) provide public and private classes (2) people will read your source and abuse that
19:30:56 <andythenorth> it’s pretty common in python libraries to have do_foo() and _do_foo() or bar and _bar or so
19:31:16 <Eddi|zuHause> python doesn't really have "private"
19:31:27 <andythenorth> “by convention"
19:31:45 <andythenorth> anyone importing _foo had better know why
19:32:08 <Alberth> C++ and Java don't have private other than the compiler, at runtime you can do anything
19:32:22 <argoneus> well, it's more like
19:32:27 <argoneus> my internal code works with entities
19:32:32 <andythenorth> maybe private was the wrong term :)
19:32:35 <argoneus> and the user should be able to use entities as well
19:32:43 *** Compu has quit IRC
19:32:44 <argoneus> and I'm not sure if I should put the Entity class in the public or internal package
19:32:47 <argoneus> or folder, or whatever
19:33:06 *** Compu has joined #openttd
19:33:20 <argoneus> or have two of them, and one of them just calls the other
19:33:21 <Alberth> so how can I have an entity? only by Entity * ?
19:33:28 <argoneus> yeah
19:33:31 <argoneus> and it has methods
19:33:37 <Eddi|zuHause> making them all public should be easier
19:33:57 <Eddi|zuHause> don't add layers of indirection just for having layers of indirection
19:33:58 <argoneus> so make it public and let the lib users figure out how to use it?
19:34:21 <Alberth> Entity e; has great benefits in not leaking etc
19:34:23 <argoneus> without trying to hide things for no reason
19:34:23 <Eddi|zuHause> yes. just document it properly what the use conditions are
19:34:34 <argoneus> I see, thanks
19:34:38 *** sim-al2 is now known as Guest10234
19:34:39 *** sim-al2 has joined #openttd
19:35:13 <Eddi|zuHause> just make things private that you have a clear reason to be private. otherwise people will just try to get around your arbitrary limitations
19:35:45 <argoneus> right
19:35:45 <Alberth> don't make it more complicated than it has to be
19:36:10 <andythenorth> just declare major version change at v2 :)
19:36:17 <andythenorth> and break backwards compatibility
19:36:35 <andythenorth> whatever you got wrong, you can change, and get wrong in new ways
19:36:36 <argoneus> tfw you study software engineering but you never learn how to actually engineer programs
19:36:44 <argoneus> thanks uni
19:37:20 <Alberth> you can't learn that, really
19:37:30 <andythenorth> only by doing, over a long time
19:37:35 <andythenorth> and then you die
19:37:38 <Eddi|zuHause> you can only learn that by doing an actual project
19:37:43 <argoneus> I suppose that's true
19:37:44 <Alberth> it needs a bigger amount of code than you can handle in a course
19:37:49 <argoneus> even in a large project with many experienced people
19:37:52 <argoneus> they refactor all the time, right
19:37:57 <andythenorth> nope
19:38:00 <argoneus> o-oh
19:38:06 *** Guest10234 has quit IRC
19:38:19 <Eddi|zuHause> "usually" it's "we *should* refactor that, but time-constraints..."
19:38:22 <argoneus> well, actually
19:38:22 <Alberth> they likely *should* refactor a lot
19:38:28 <argoneus> from my experience at a company
19:38:29 *** Clockworker_ has quit IRC
19:38:33 <argoneus> it's usually "we should change this one method"
19:38:35 <andythenorth> or “that works, and we don’t have sufficient tests, don’t touch it"
19:38:41 *** Clockworker_ has joined #openttd
19:38:43 <argoneus> "time to write up a report about why and how and have it reviewed"
19:38:52 <argoneus> "then two other engineers have to review the code where I change three lines"
19:38:57 <argoneus> "then we need to run all the tests again"
19:38:59 <argoneus> hnng
19:39:06 <andythenorth> yup
19:39:20 <Eddi|zuHause> sure way to build up loads of technical debt until it all falls apart
19:39:36 <andythenorth> that’s like positing world economy is going to fail due to debt
19:39:41 <Eddi|zuHause> working against a bureaucracy is hard
19:39:46 <andythenorth> which o/c many people are worried about
19:39:49 <andythenorth> also, Has OpenTTD 1.6.0 Been Official Released
19:39:51 <andythenorth> ?
19:39:54 <Eddi|zuHause> yes
19:40:07 <argoneus> that's kind of depressing
19:40:12 <Eddi|zuHause> see topic
19:40:20 <argoneus> it almost makes me want to work as a web developer at a startup
19:40:30 <argoneus> at least no hard bureaucracy there, just fun new tech
19:40:32 <argoneus> (or is it fun)
19:40:33 <Eddi|zuHause> that sounds unhealthy :p
19:40:44 <andythenorth> and that, ladies and gentlemen, is where the debt originates :D
19:41:12 <argoneus> well, what kind of software job do you think is the most fun?
19:41:26 <argoneus> fun meaning
19:41:34 <argoneus> you work with cool technologies and don't spend 10 years on the same project
19:41:38 <Eddi|zuHause> job is not supposed to be "fun". hobby is for "fun"
19:41:46 <andythenorth> Eddi|zuHause: scandalous :)
19:42:01 <argoneus> Eddi|zuHause: I'd kind of like to disagree
19:42:04 <Eddi|zuHause> job isn't supposed to be "miserable" either
19:42:10 <argoneus> traditionally people gave others jobs because they didn't want to do it themselves
19:42:21 <argoneus> but in programming it's more "we should split it" than "do my dirty work"
19:42:22 <argoneus> no?
19:42:33 <andythenorth> http://www.bbc.co.uk/news/technology-35940300
19:42:38 <andythenorth> "My advice to young people is always this - find something you enjoy doing so much that you'd be willing to do it for nothing… and you'll never work a day in your life."
19:43:09 <Eddi|zuHause> yeah. that's what i did, and i get paid like i never worked a day in my life
19:43:23 <argoneus> heh
19:44:49 <Samu> # sprites/png/terrain/rivercorner_Temperate_n.gimp.png - where are these files?
19:45:00 <Samu> north,east,south,west
19:45:09 <Samu> it's not in the folder it mentions
19:46:08 * andythenorth back to trying to make this patch compile :)
19:46:47 <Samu> i can't code without visualizing the end result :( i wouldn't even know if I am failing
19:47:06 <Samu> i'm stuck, can't draw the rivercorners
19:48:05 <Alberth> they don't have to look like proper corners
19:48:29 <Alberth> you only need to differentiate whether you have the right sprite at the screen
19:49:25 <Alberth> once the programming is done, a graphics artist can make proper sprites, and use your code to see how it looks
19:49:42 <Samu> poor guy
19:50:05 <Samu> it's probably gonna look bad
19:50:13 <Samu> i don't even know if it would look correct
19:50:18 <andythenorth> doesn’t matter yet
19:50:38 * andythenorth will try to avoid getting that job again though :)
19:51:50 <Samu> how would I know if I position the rivercorner sprites in the correct manner, without rivercorners:(
19:52:49 <Eddi|zuHause> so, i should be reinstalling my system from scratch...
19:53:02 <Alberth> you don't, that's why sprites have offsets
19:53:07 <Eddi|zuHause> just thinking about whether i should also do a clean home directory
19:53:52 <Samu> i better show you what I coded so far, because I'm not getting what you're telling me
19:53:58 <Alberth> that's pretty simple, just make a 2nd /home/eddi directory while installing
19:54:21 <Alberth> then afterwards move things from old home to new
19:54:28 <Eddi|zuHause> my current /home is a fairly small partition, need to clean things out anyway
19:54:53 <Eddi|zuHause> big things like wine prefixes are already elsewhere anyway
19:55:49 <Eddi|zuHause> which are also a mess crufted up over 10 years
19:57:22 <Samu> https://paste.openttdcoop.org/p1rsgdcxb
19:58:43 <Samu> i've added lines 102 to 105
19:58:55 <Samu> and
19:59:23 <Samu> lines from 30 to 49 were modified
19:59:37 <andythenorth> Alberth: think I need to patch GetRoadTypes to look at different bits?
19:59:47 <andythenorth> L166 in road_map.h
19:59:51 <Samu> didn't start the corners yet
20:00:14 <Samu> i still don't quite get the offsets
20:01:01 <Samu> and still didn't finish the edges either
20:01:19 <Samu> but i dont know if I'm editing the correct things
20:02:26 <Samu> in short, i have no idea what I'm doing if I can't observe the results immediately ;(
20:12:09 <Samu> uhm any idea
20:12:36 <andythenorth> hmm HasTileRoadType already exists
20:12:53 <andythenorth> HasTramType and HasRoadType seem to overlap that
20:14:14 <Alberth> andythenorth: road_map.h is about storing the numbers in the map array
20:14:19 <andythenorth> yes
20:14:53 <andythenorth> so that gets the types on the tile
20:15:43 <andythenorth> but it’s returning an instance of RoadTypes (I think)
20:15:43 <Alberth> Samu: either print the relevant numbers so you can reconstruct, or make graphics and paint those at the screen
20:15:57 <Eddi|zuHause> andythenorth: one is for all tiles, and one is specifically for road tiles?
20:16:01 <andythenorth> I have been googling to understand this foo = (enumtype) syntax
20:16:06 <andythenorth> but can’t find anything
20:16:14 <Eddi|zuHause> that's a typecast
20:16:20 <andythenorth> e.g. return (RoadTypes)GB(_me[t].m7, 6, 2)
20:16:21 <Alberth> yes, bits are one-to-one copied to the map in general (as much as possible)
20:16:41 <Eddi|zuHause> a typecast is "interpret this random stream of bits as a certain type"
20:16:43 <andythenorth> that gets me a RoadTypes instance masked by the pattern of those bits?
20:16:55 <Alberth> GN () returns an uint, and you need an enum type
20:17:33 <Alberth> (X)foo says to the compiler, "I want you to consider foo as a thing of type X"
20:17:59 <Alberth> where I have to make sure the bits match
20:18:01 * andythenorth googles some more
20:18:19 <Samu> https://paste.openttdcoop.org/pjv9sddlf
20:18:47 <Alberth> return GN(...); will fail with a type error "uint is not an enum type"
20:19:12 <Alberth> Samu: is it correct?
20:19:40 <Samu> I'm not sure
20:20:00 <Samu> SE, SW, NE, NW are correct
20:20:01 <Alberth> find out, would be my suggestion :)
20:20:04 <Samu> the others, i dont know
20:20:25 <Samu> SLAT, is also correct
20:20:30 <Samu> FLAT*
20:21:59 <frosch123> apparently all mainboards have on-board graphic these days
20:22:40 <andythenorth> aren’t they integrated with the Northbridge, or other outdated terms I don’t recall?
20:22:54 * andythenorth remembers some big hoo ha about this 10 years ago :)
20:24:28 <frosch123> what's the point of mainboards having on-board graphics, when they are targeted to support multi gpu?
20:24:34 *** Wormnest_ has joined #openttd
20:25:02 <Eddi|zuHause> you can multi the onboard gpu with another one
20:25:27 <frosch123> well, the on-board gpu is limited to 4kx2k@24hz :)
20:25:30 * andythenorth thought it pretty much came for free, due to way commodity chips are bought and sold
20:25:32 <frosch123> so, obviously no :)
20:25:50 <andythenorth> do you still get an onboard speaker? o_O
20:26:01 <andythenorth> it is years since I saw the inside of a computer, except laptops
20:26:14 <frosch123> no idea :)
20:26:19 <andythenorth> ‘beep’
20:26:32 <frosch123> whenever i look for pc hardware, mainboard is the most puzzling thing
20:26:40 <Eddi|zuHause> there's still a speaker port on most boards, sometimes there's also a speaker attached
20:27:27 <Eddi|zuHause> it's not like a piezo-element is the most expensive thing ever
20:28:07 <Eddi|zuHause> i mean, they put these in EVERYTHING
20:28:17 <Eddi|zuHause> like water heaters
20:28:21 <andythenorth> Alberth: 3 bits per tram and road in your RoadTypes enum? o_O
20:28:36 * andythenorth is adjusting the map stuff
20:28:38 <Alberth> someone told me 8 types was enough :p
20:28:50 <Alberth> you can easily have more :p
20:28:51 <Eddi|zuHause> it's ready->it beeps. you press a button->it beeps. you put the can in->it beeps
20:29:06 <andythenorth> I just need to pick the right number of bits out of m4 :)
20:29:17 <Eddi|zuHause> i think 4 bits is the most natural
20:29:21 <andythenorth> agreed
20:31:01 <Eddi|zuHause> great, i have 2-5 year old directories called things like "blah", "blah~", "blah~~", "blah~~~"
20:31:10 <Eddi|zuHause> which one of those do i want to keep?
20:31:14 <andythenorth> I have ~tidy and it contains ~tidy
20:31:20 <Alberth> rm -rf blah*
20:31:24 *** Wormnest has quit IRC
20:31:35 <Eddi|zuHause> do i ever remember why i made these backup copies?
20:31:48 <Alberth> unlikely, so nothing will be lost :p
20:31:48 <andythenorth> you’ve cloned your entire HD right? Before doing this?
20:31:51 <Eddi|zuHause> usually, when i rm those, 2 days later i remember why i needed them
20:32:03 <andythenorth> clone, put clone in cupboard, lay waste
20:32:07 <andythenorth> scorched earth
20:32:25 <Alberth> mv blah delete_after_20160405
20:32:31 <Eddi|zuHause> andythenorth: in all likelyhood, all those ~~~ are the clones of some previous undertaking :p
20:34:01 <Eddi|zuHause> blah... i tried to move blah~* into blah, and it complained that there's already another set of blah~* in there :p
20:34:52 <Alberth> http://devs.openttd.org/~alberth/rt.h updated for 4 bits
20:35:09 <Alberth> automagic backup generation is evil :p
20:35:27 <Alberth> if you want to revert, use a VCS
20:35:44 <andythenorth> Alberth: thanks :)
20:35:53 * andythenorth wonders
20:36:05 <andythenorth> can I cast a RoadTypes enum back to a bit pattern? o_O
20:36:11 <andythenorth> or do I just pick them out with GB
20:36:34 <Alberth> GB is the safer way
20:37:07 <Alberth> but RoadTypes enum is just the bit pattern, only the compiler differentiates between the types
20:37:09 <Eddi|zuHause> i should at some point make an alias for "move a to b/ and then symlink b/a to a"
20:37:37 <Alberth> why do you do that?
20:38:07 <Eddi|zuHause> for keeping track what i moved to which disk
20:38:41 <Eddi|zuHause> so ~ is a collection of symlinks to stuff that i moved away from ~ for being too large
20:38:56 <andythenorth> so ROADTYPES_INVALID_ROAD = all 4 bits set?
20:39:08 <Alberth> yes
20:39:35 <Alberth> 1+2+4+8==15==0xF
20:40:03 <Alberth> assuming you like starting with roadtype 0 :p
20:40:21 <Alberth> also openttd uses all 1 to express invalid, everywehere
20:41:03 <Eddi|zuHause> except where it represents other stuff, like OWNER_TOWN :p
20:41:32 <Alberth> you need exceptions to all rules :p
20:42:31 <Eddi|zuHause> now... should i attempt to find a DVD to burn, or should i try booting from usb stick?
20:44:05 <Samu> i don't understand what I have to do... the more I look, the less I knwo
20:46:56 <Eddi|zuHause> you find weird and strange things tucked away in directories you don't ever visit...
20:47:41 <Alberth> it's never a brilliant solution to a problem that you have :p
20:49:36 <Eddi|zuHause> also, loads of chained symlinks that point to disks that are not there anymore :p
20:52:37 <LordAro> guize
20:52:40 <LordAro> hi
20:52:50 <LordAro> you forgot the title game - https://www.reddit.com/r/openttd/comments/4d5pla/only_me_that_thinks_its_a_poor_choice_60_trees/
20:54:29 <Eddi|zuHause> i suppose nobody had the energy to run a competition
20:56:58 <Samu> why is the game computing the correct corner height for some river tiles and not the others? what am I missing? I don't follow how the code decides this
21:10:20 * andythenorth bbl
21:10:21 *** andythenorth has quit IRC
21:15:11 *** Myhorta has joined #openttd
21:16:57 <Eddi|zuHause> i'm probably back... never :p
21:17:36 *** Eddi|zuHause has quit IRC
21:32:15 *** Wili has joined #openttd
21:32:37 <Wili> Hi is it possible to change autorenew settings during game? (with specific savegame? - miltuplayer game)
21:33:07 <frosch123> autorenew settings are company specific
21:33:14 <frosch123> every company can set their own values
21:33:14 <Wili> I've changed it already in conf file of server
21:33:20 <Wili> oh really?
21:33:33 <frosch123> you need to change them in game
21:33:37 <frosch123> config file only affects new games
21:33:38 <Wili> I mean change old car for the same one
21:34:50 <Alberth> you need to change it in-game
21:35:00 *** glx has joined #openttd
21:35:00 *** ChanServ sets mode: +v glx
21:35:44 <Wili> in the client? I will try it :)
21:36:10 <frosch123> changing it affects the company you have joined
21:36:42 <Wili> so I have enabled change odl vehicle (now I have some red one) so I will send them to the garage and they will be swaped?
21:39:01 <Wili> I am reading here that these settiings will affect save games and onle new games
21:39:34 <frosch123> you are probably in main menu
21:39:39 <Wili> correct
21:39:41 <frosch123> you need to join the game and the company
21:39:45 <Wili> I am
21:39:47 <frosch123> and then change them *in game*
21:39:50 <Wili> but idk where is the settings
21:39:57 <frosch123> in the toolbar
21:39:59 <Wili> AAAAH
21:40:00 <Wili> here
21:40:04 <Wili> thanks!
21:47:51 <Wili> Is it possible to upgrade normal trains to monorail?
21:48:04 <Alberth> nope
21:48:13 <Wili> th
21:48:14 <Wili> x
21:48:34 <Alberth> my strategy is to build new connections instead of simple/dumb replace
21:48:48 <Wili> understand
21:48:50 <Alberth> much more fun :)
21:49:16 <Alberth> ie build a faster network "on top" of the existing network
21:49:35 <Alberth> using the existing network as local transport
21:50:10 <Alberth> if you have cargo-dist switched on, prepare for chaos :p
21:50:19 <Wili> :D
21:51:46 <Alberth> another option is not to use the default train set, but get a newgrf instead, that doesn't force you into upgrading
21:52:24 <Alberth> but you need to start a new game for that
21:53:09 *** efess has quit IRC
22:16:36 *** drac_boy has joined #openttd
22:16:38 <drac_boy> hi
22:18:01 *** Hiddenfunstuff has quit IRC
22:19:34 <drac_boy> anyone want trade -10C for maybe like 6C or better? :p
22:20:18 <frosch123> i just traded 30C for 15C
22:20:37 *** andythenorth has joined #openttd
22:24:49 <drac_boy> heh, weird weather for april here so far anyhow :-s
22:29:07 <Wili> whats "C"? :)
22:30:06 <frosch123> °C
22:31:03 *** Wormnest__ has joined #openttd
22:32:32 *** Wili has quit IRC
22:32:52 * drac_boy also wishes there was somewhere to find a decent photo of station trackworks too
22:35:02 *** Clockworker__ has joined #openttd
22:35:41 *** andythenorth has left #openttd
22:37:56 *** Wormnest_ has quit IRC
22:40:26 *** frosch123 has quit IRC
22:42:41 *** Clockworker_ has quit IRC
22:47:16 *** _johannes has quit IRC
22:51:24 *** Stimrol has quit IRC
22:52:33 *** Stimrol has joined #openttd
22:55:43 *** Alberth has left #openttd
22:58:10 *** Samu has quit IRC
23:17:33 <drac_boy> going make some supper now :->
23:17:35 *** drac_boy has left #openttd
23:19:45 *** sla_ro|master has quit IRC
23:32:30 *** Biolunar has joined #openttd
23:45:18 *** efess has joined #openttd
23:48:26 *** Birko has joined #openttd
23:50:23 <Birko> Hi everyone, I have a station with bus and train under one name. How can I get location of rail station if the bus station is base station of whole station. Function AIBaseStation.GetLocation() is only for base station. Thanks
23:51:36 *** Samu has joined #openttd
23:51:51 <Samu> hello
23:55:13 *** gelignite has quit IRC