Log for #openttd on 25th December 2018:
Times are UTC Toggle Colours
00:12:15  *** Wolf01 has quit IRC
00:38:31  *** gelignite has joined #openttd
00:58:03  <DorpsGek_II> [OpenTTD/OpenTTD] glx22 opened pull request #6989: Change: use vcpkg integration in Visual Studio
01:14:03  *** lugo has quit IRC
01:28:41  *** gelignite has quit IRC
02:04:14  <DorpsGek_II> [OpenTTD/OpenTTD] glx22 updated pull request #6989: Change: use vcpkg integration in Visual Studio
02:50:27  *** glx has quit IRC
03:00:51  *** cboyd_ is now known as wodencafe
03:16:14  <Samu>
03:16:56  <Samu> pretty stuff. I wonder if there are more questions that could be asked around Company Value
03:25:10  *** Samu has quit IRC
06:34:03  *** Laedek_ has joined #openttd
06:34:16  *** Laedek has quit IRC
06:34:21  *** Laedek_ has quit IRC
06:51:19  *** peter1138 has quit IRC
07:27:04  *** sla_ro|master has joined #openttd
08:07:36  *** tokai|noir has joined #openttd
08:07:36  *** ChanServ sets mode: +v tokai|noir
08:14:32  *** tokai has quit IRC
08:15:48  *** Wacko1976 has joined #openttd
08:16:56  *** nielsm has joined #openttd
08:35:55  *** lugo has joined #openttd
08:36:04  *** Wacko1976 has quit IRC
08:43:18  *** Wacko1976 has joined #openttd
08:51:04  *** Progman has joined #openttd
09:03:28  *** Wolf01 has joined #openttd
09:03:37  <Wolf01> Moin
09:13:54  <DorpsGek_II> [OpenTTD/OpenTTD] TrueBrain requested changes for pull request #6989: Change: use vcpkg integration in Visual Studio
09:14:24  <DorpsGek_II> [OpenTTD/OpenTTD] TrueBrain commented on pull request #6989: Change: use vcpkg integration in Visual Studio
09:36:37  *** Wolf01 is now known as Guest945
09:36:39  *** Wolf01 has joined #openttd
09:38:50  *** sla_ro|master has quit IRC
09:44:18  *** Guest945 has quit IRC
09:45:02  <Wolf01> Ho ho ho, merry Brianmas
09:50:26  <Eddi|zuHause> you mean Winteryolo?
09:54:52  *** sla_ro|master has joined #openttd
09:55:38  <Wolf01> I mean to look on the bright side of life
10:00:32  <TrueBrain> now I have a whistle in my head
10:03:50  *** gelignite has joined #openttd
10:05:29  <Eddi|zuHause> <- concerning Winteryolo [german]
10:16:47  <TrueBrain> whoho, I can produce 32bit/64bit Windows binaries; one is 4 MiB, the other 5 MiB :D That is much better than the 20 MiB of last time :D
10:16:55  <Wolf01> :o
10:17:39  <nielsm> ICU was quite problematic for binary sizes :)
10:17:57  <TrueBrain> yes it was
10:18:06  <TrueBrain> and with glx's PR, vcpkg works perfectly now too :D
10:18:07  <LordAro> TrueBrain: nice
10:18:24  <TrueBrain> meaning no more magic precompiled binaries that are .. some version :D
10:19:07  <TrueBrain> next step is to get the CI working via Azure Pipelines. That should be easy.
10:19:26  <TrueBrain> After that ... I need to start a very old machine to find out how we did the Windows stuff again :D
10:19:29  <TrueBrain> (for releases)
10:20:14  <TrueBrain> if the CI is done, also means I can shut down Jenkins :D \o/
10:26:09  *** andythenorth has joined #openttd
10:26:14  <andythenorth> moin
10:28:01  <Wolf01> o/
10:29:09  <TrueBrain> howdy andythenorth
10:39:58  <nielsm> hmm, thinking about nml industry feature cargo_types table again, maybe the accept_cargo() expression shouldn't take an array as 2nd parameter, but instead just take 1+ parameters
10:40:06  <nielsm> so instead of:
10:40:08  <nielsm> accept_cargo("COAL", [produce_cargo("MAIL", 1), produce_cargo("GOOD", 1), produce_cargo("STEL", 1), produce_cargo("VALU", 1)])
10:40:09  <nielsm> you'd do:
10:40:15  <nielsm> accept_cargo("COAL", produce_cargo("MAIL", 1), produce_cargo("GOOD", 1), produce_cargo("STEL", 1), produce_cargo("VALU", 1))
10:45:03  <TrueBrain> @calc 0.01 * 3000 + 5
10:45:03  <DorpsGek> TrueBrain: 35
10:45:09  <TrueBrain> (I am lazy)
10:49:59  <Eddi|zuHause> nielsm: how do you think this unpacking of a list helps anyone understand or write the code better?
10:50:33  <Eddi|zuHause> (i'm not finding a strong argument for or against either version)
10:50:56  <nielsm> maybe it doesn't, but I think it would make implementation more regular
10:52:20  <Eddi|zuHause> <TrueBrain> (I am lazy) <-- i think anyone who isn't lazy doesn't end up working with programming/automation/...
10:52:53  <Eddi|zuHause> it is that very laziness that sparks the sense of "there must be a better way"
11:04:23  *** chomwitt has joined #openttd
11:10:55  *** peter1138 has joined #openttd
11:10:55  *** ChanServ sets mode: +o peter1138
11:11:18  <andythenorth> I am +/-0 to the syntax there nielsm :)
11:11:26  <andythenorth> it's all potatoes to me on that one
11:12:47  *** tycoondemon has joined #openttd
11:13:22  * nielsm adds a tomato to the mix
11:13:40  <Eddi|zuHause> potato salad was yesterday...
11:22:09  * andythenorth considers moving all of nml to python syntax :P
11:22:17  <andythenorth> industry.add_callback()
11:22:23  <andythenorth> callback.add_switch()
11:22:25  <andythenorth> blah blah
11:22:39  <andythenorth> probably horrid
11:23:09  <Eddi|zuHause> i don't think i like that approach (it's not "syntax", btw)
11:23:46  <andythenorth> what is it? interface?
11:24:05  <Eddi|zuHause> a design pattern?
11:24:06  <andythenorth> "it's just declared in python"?
11:24:10  <andythenorth> words
11:24:58  <andythenorth> Eddi|zuHause: wasn't CETS a pure python interface, using nlmc to write out the grf?
11:25:33  <Eddi|zuHause> yeah
11:25:36  <nielsm> and are we going forward with this syntax for the prod cb?
11:25:36  <nielsm> produce(test_produce, [COAL: 5; IORE: 7;], [STEL: 5;], 1)
11:26:28  <Eddi|zuHause> but you won't find a "callback.add_switch()" in there
11:27:01  <andythenorth> Eddi|zuHause: imho object.add_anything is weird anyway
11:27:05  <andythenorth> I just didn't find a better way
11:27:08  <andythenorth> seems clunky
11:27:13  <andythenorth> nielsm: I would like to please
11:27:25  <nielsm> mmk
11:27:28  <andythenorth> the numbers in the array are expressions?
11:27:45  <nielsm> the numbers should be register expressions
11:29:58  <nielsm> I'm basically just going to cargo-cult the v0/v1 code but update it to generate the new grf syntax
11:30:55  <andythenorth> +1
11:40:48  <nielsm> I don't think it would make sense to have a produce block with zero inputs and zero outputs?
11:40:58  <nielsm> or what?
11:49:56  <andythenorth> nielsm: zero inputs OR zero outputs is fine
11:50:02  <andythenorth> AND seems redundant
12:00:06  *** Progman_ has joined #openttd
12:03:34  *** Progman has quit IRC
12:03:47  *** Progman_ is now known as Progman
12:13:50  *** Progman has quit IRC
12:24:48  <nielsm> partway there...
12:25:15  <nielsm> produce(test_produce1, [COAL: 5; IORE: 7;], [STEL: 5;], 1)
12:25:15  <nielsm> produce(test_produce2, [COAL: 5; IORE: 7;], [STEL: 5;])
12:25:15  <nielsm> produce(test_produce3, [], [], 0)
12:34:09  <planetmaker> moin
12:34:33  <nielsm> I'm going to need some help understand what's going on here:
12:35:31  <nielsm> as far as I understand, the general idea is to take the expressions given and produce a chain of actions that load the parameter values into registers and chain those in front of the real prod cb
12:37:54  <planetmaker> yep
12:42:29  <planetmaker> shall we try jointly?
12:44:53  *** Samu has joined #openttd
12:45:29  <nielsm> pushed my WIP code:
12:47:13  <nielsm> since there are now two lists of assignments (name: expression pairs) and a stand-alone expression, I'm thinking first assembling a single master list of expressions, generating evaluators for those, then ??? to get the final prod cb register numbers
12:48:46  <nielsm> or maybe I need some intermediate representation for this
12:49:32  <nielsm> also need to resolve the cargo labels to cargotypes list index
12:49:58  <planetmaker> the latter can be done by using the cargotype() thing.
12:51:06  <planetmaker> I'd think you first try to reduce the expressions as much as they need to be. So yes... a master list.
12:51:07  <nielsm> have you seen the builtin_cargotype() function implemented in expression/ ? :)
12:51:17  <nielsm> it's not really suited for calling from inside other code
12:51:35  <planetmaker> indeed not yet. But that's what I mean. But we need sth like that
12:57:16  <planetmaker> but we could postpone that problem - and argue that the player must provide cargotype('LABL'), cargotype('FRUT'),...
12:59:01  <nielsm> that would change the syntax completely
13:02:06  <planetmaker> hm... ok, yes-ish
13:02:37  <planetmaker> let's stick with the labels. It's the much nicer syntax. So we need our own cargotype thing for internal use
13:05:50  <planetmaker> ctt_list in
13:08:23  <nielsm>
13:08:53  <nielsm> (I made the gist with the previous wip version first, then edited with the new, so there's a revision with diff)
13:10:26  <nielsm> the act6 thing seems to only be relevant for version 0 of the prod cb, so I can skip everything with that?
13:10:55  <planetmaker> in principle action6 can overwrite any action
13:11:34  <nielsm> but it only gets filled for the v0 case here
13:12:17  *** synchris has joined #openttd
13:17:22  <nielsm> hmm, maybe like this
13:21:17  <planetmaker> action6... they are actually *written* / generate there, aren't they? in action2production:80 and :113-114?
13:26:30  <nielsm> updated gist again
13:31:19  *** andythenorth has quit IRC
13:32:33  <nielsm> and again
13:32:37  <nielsm> now it runs!
13:33:00  <nielsm> but I have no idea if it's correct :D
13:36:41  <nielsm> pushed this
13:36:45  <nielsm> "maybe it works"
13:36:54  <planetmaker> :D
13:38:37  <nielsm> of course andy leaves just as you need him
14:04:27  <Eddi|zuHause> usually 3 seconds before i finished typing my reply to him
14:05:50  <planetmaker> he's genius in that respect
14:07:56  <Eddi|zuHause> ships in TF are awesome, but i have trouble upping their capacity... just buying more ships will just make them queue up at the port
14:08:36  <nielsm> does it work adding more docks?
14:09:24  <nielsm> although I guess you can't share routes then since you have to points to a specific dock
14:20:53  *** Flygon has quit IRC
14:40:26  <Eddi|zuHause> i've currently opted to send some routes A-B-A-B with different terminals at each stop
14:40:50  <Eddi|zuHause> it's a bit awkward as this also seemingly randomly distributes the cargo between the different halves of the route
14:41:42  <Eddi|zuHause> next problem is that you don't see capacity upgrades working for quite a while
14:41:48  <nielsm> yeah it's a shame there isn't a solution to multiple platforms serving the same destination, so just pick the one with the next expected departure (or less crowded one)
14:42:19  <Eddi|zuHause> and 3rd problem is that if many different types of cargo get sent along you don't have much influence on what cargos are picked, as a ship can only load 2 different kinds of cargo at a time
14:49:52  *** seatsea has quit IRC
14:50:25  <Eddi|zuHause> yeah, this lack of dynamic platform reservation means you effectively need one platform per line
14:51:32  *** seatsea has joined #openttd
15:04:40  <Eddi|zuHause> problem with multiple docks is you need them to be in range of each other, otherwise you'd have to do awkward truck shuttles
15:05:56  <Eddi|zuHause> or worse: ship shuttles
15:10:05  <Eddi|zuHause> you can usually do that with 2 docks, but 3 docks is tricky, as the 1-3 connection usually doesn't work (too far)
15:12:12  <Eddi|zuHause> i definitely need better ships
15:32:57  <nielsm> time to look at that issue with found industry strings being wrong
15:40:29  <nielsm> yeah it's definitely present:
15:41:52  <nielsm>
15:57:48  *** Wormnest has joined #openttd
16:00:50  *** Wormnest_ has joined #openttd
16:04:38  <Samu> buy exclusive transport rights mechanics are flawed
16:05:07  <Samu> if company 1 buys it, it doesn't stop other companies from buying it either
16:05:33  <Samu> company 2 can buy it even if company 1 is currently under the effect
16:05:39  <Samu> is that intended?
16:05:59  <Samu> it even costs the same
16:06:45  <nielsm> that's probably not intended
16:07:20  <Samu> or is this because im playing in single player? haven't tried in multiplayer
16:07:36  *** Wormnest has quit IRC
16:07:42  <Samu> brb gonna try
16:14:12  <Samu> yeah, it's available too
16:14:45  <nielsm> hmm, it's this:
16:15:10  <nielsm> two ways to solve this problem, either extend that list to 16 strings with different number of cargos
16:15:22  <nielsm> or rework it to generate a list instead in code
16:15:27  <nielsm> (I'm voting for second option)
16:15:43  <Samu> for a moment, i thought you were talking to me :(
16:17:10  <Samu> reduce it to _C_C_C?
16:17:13  <Samu> :p
16:21:22  <nielsm> thinking of changing the layout to something like this:
16:23:46  <Samu> oh, nice
16:34:01  <planetmaker> that looks like a nice layout for such varying number of cargoes @ nielsm
16:36:40  <nielsm> I'll have to calculate a new min size based on max number of cargoes
16:37:23  <nielsm> and not sure what to do about window min width
16:50:08  <nielsm> hmm is there a way for a newgrf to add even more text to the build industry window? apart from just cargo suffixes
16:50:22  <nielsm> or are cargo suffixes exactly the way to do it?
16:50:33  <nielsm> because I think this might break it then :s
16:51:01  <planetmaker> cargo subtypes?
16:51:27  <planetmaker> not sure whether industries can do that. Vehicles can for sure
16:52:27  <nielsm> yeah like the Location text here from FIRS 3:
16:52:46  <nielsm> I think that text might actually be a cargo suffix for Livestock (produces)
16:53:04  <planetmaker> Ah, the extra info
16:53:34  <Eddi|zuHause>  <nielsm> or rework it to generate a list instead in code <-- there certainly are places that display a list of cargos already
16:53:56  <Eddi|zuHause> like the refit list
16:54:17  <Eddi|zuHause> and other places that maybe should display one, like the town cargo delivery
16:58:22  <nielsm> ah the joy of keeping birds... finding dried poop in your hair
17:01:50  <nielsm> anyway, this "abuse" of cargo suffixes kills the two column idea
17:10:29  *** Wormnest_ has quit IRC
17:11:19  <nielsm> and the string system doesn't really provide a good/simple way to chain multiple strings does it...
17:12:37  <planetmaker> "{STRING} {STRING}"
17:13:10  <planetmaker> or {RAW_STRING}
17:13:17  <nielsm> yes but in the infinite
17:13:32  <planetmaker> yes, you need to know how many to chain
17:13:34  <nielsm> arabic_egypt.txt:
17:13:39  <nielsm> STR_INDUSTRY_VIEW_REQUIRES_CARGO_CARGO                          :{BLACK}يحتاج: {YELLOW}{STRING}{STRING}، {STRING}{STRING}
17:13:45  <nielsm> the two strings use different commas...
17:14:20  <planetmaker> hm? How 'different'?
17:14:55  <nielsm> different codepoints, different glyphs
17:15:24  <planetmaker> ah. Well. An arabic-speaking person might know
17:15:44  <nielsm>
17:16:11  <planetmaker> the upper one is no comma. It's a quotation mark
17:16:21  <planetmaker> a single one
17:16:40  <Eddi|zuHause> that sounds wrong
17:16:42  <planetmaker> At least that's what it looks to me
17:16:58  <planetmaker> however... that's translator task
17:17:13  <Eddi|zuHause> yes, it's a different character, but it sounds wrong that it should be different
17:17:29  <nielsm> THANK YOU japanese for ruining my plan
17:17:30  <nielsm> STR_INDUSTRY_VIEW_REQUIRES_CARGO_CARGO                          :{BLACK}必要資源: {YELLOW}{STRING}{STRING}と{STRING}{STRING}
17:17:40  <nielsm> "A and B" and then "A, B, C"
17:18:06  <Eddi|zuHause> really, {CARGOLIST}
17:18:30  <nielsm> Eddi|zuHause no, that does not support cargo suffixes
17:18:47  <Eddi|zuHause> then that's the thing to improve
17:18:58  <nielsm> cargo suffixes being arbitrary formatted strings that a newgrf industry can tack on the end of each cargo it handles
17:24:01  <nielsm> spanish.txt:
17:24:20  <nielsm> STR_INDUSTRY_VIEW_REQUIRES_CARGO                                :{BLACK}Requiere:...
17:24:20  <nielsm> STR_INDUSTRY_VIEW_REQUIRES_CARGO_CARGO                          :{BLACK}Necesita:...
17:24:20  <nielsm> STR_INDUSTRY_VIEW_REQUIRES_CARGO_CARGO_CARGO                    :{BLACK}Requiere:...
17:25:27  <nielsm> ah there was what I was looking out for, in turkish.txt:
17:25:28  <nielsm> STR_INDUSTRY_VIEW_REQUIRES_CARGO                                :{BLACK}İstenen: {YELLOW}{STRING}{STRING}
17:25:28  <nielsm> STR_INDUSTRY_VIEW_REQUIRES_CARGO_CARGO                          :{BLACK}İstenenler: {YELLOW}{STRING}{STRING}, {STRING}{STRING}
17:25:45  <nielsm> what looks like singular/plural differences in the translation of "Requires" itself
17:27:18  <Samu> Requirement, Requirements
17:29:14  <nielsm> hmm does the string system have a way to form a plural towards a numeric value that isn't actually printed in the string?
17:29:57  <nielsm> I was thinking of making a base string "Requires{optionally plural}: {STRING:first cargo}
17:30:33  <nielsm> and then in code concatenate it with any number of additional ", {STRING:next cargo}{RAW_STRING:cargo suffix}"
17:31:28  *** andythenorth has joined #openttd
17:31:56  <nielsm> hi andy, update your nml and make some production cb's
17:31:59  <Samu> wow, advertisement campaign radius only considers the main tile of the station.... DistanceManhattan(tile, st->xy) <= radius)
17:32:16  <Samu> seems wrong
17:32:31  <Samu> not what I expected
17:32:51  <nielsm> I have come to expect the station sign to be all that matters for most economic purposes
17:33:30  <Samu> i was expecting all stations found within a radius of "radius"
17:33:31  <andythenorth> hi hi
17:33:37  <planetmaker> \o
17:33:39  <Samu> station parts*
17:34:43  <Samu> oh well, this makes my AI decisions require less code
17:34:44  <planetmaker> nielsm, but what about what Eddi|zuHause said before? {CARGO_LIST} exists
17:34:59  <planetmaker> STR_JUST_CARGO_LIST
17:35:58  <Eddi|zuHause> <nielsm> hmm does the string system have a way to form a plural towards a numeric value that isn't actually printed in the string? <-- yes, but if you make it a {CARGOLIST}-ish thing, the plural could be chosen from the number of items in the list
17:36:50  <nielsm> CARGO_LIST takes a bitset of cargoes and puts them in definition order
17:36:53  <Eddi|zuHause> as for the not-printed part, there is {SKIP}, but i think we tried to eliminate that
17:37:26  <nielsm> what industry windows wants is to take a list of cargoes and an optional attached suffix string and list them in supplied order
17:37:47  <nielsm> so completely different from CARGO_LIST
17:38:23  * andythenorth faffing about with failed rebase, again
17:38:43  <Eddi|zuHause> how about trying for a successful rebase for a change?
17:38:48  <nielsm> i.o.w. the inpur to CARGO_LIST is an uint64, the input to hypothetical INDUSTRY_CARGO_LIST is vector<pair<StringID,const char*>>
17:38:58  <nielsm> input*
17:39:38  <planetmaker> sounds to me really like it also should become an uint64
17:39:54  <planetmaker> otherwise it's re-inventing the wheel. Just differently
17:40:21  <planetmaker> speaking of INDUSTRY_CARGO_LIST
17:41:08  <andythenorth> produce is weird eh?
17:41:13  <andythenorth> it's not specifically scoped
17:41:18  <andythenorth> reminds me of nfo :P
17:43:35  * andythenorth has rebased, with manual merge resolution
17:44:18  <andythenorth> Eddi|zuHause: can you provide a url to a guide for successful rebase? o_O
17:44:20  <andythenorth> I googled
17:44:33  <andythenorth> the only thing I found said "don't work with upstream contributors"
17:46:09  <Eddi|zuHause> andythenorth: "try smaller steps"?
17:46:39  <nielsm> lol, misplaced hands on keyboard and typed "tid fiff" instead of "git diff"
17:47:01  <nielsm> (have relocated my hands again)
17:48:00  <andythenorth> Eddi|zuHause: I could ask the other contributors to not touch the same lines of code as me?
17:48:06  <andythenorth> maybe some kind of lock system on the files?
17:48:09  <andythenorth> webdav? o_O
17:48:22  <Eddi|zuHause> playing the "where the hell is the missing piece of electrification" game currently
17:48:29  <andythenorth> TF?
17:48:39  <nielsm> yes let's use MS SharePoint for source control
17:51:08  <andythenorth> I am +1
17:51:24  <andythenorth> we could use an excel sheet to track who's working on what
17:53:12  <Eddi|zuHause> yes, TF
17:53:53  <Eddi|zuHause> andythenorth: approaching ?
17:58:14  <nielsm> Requirement{P 2 "" s}: {0:STRING}{1:RAW_STRING}
17:58:18  <nielsm> that could work I suppose
17:59:11  <nielsm> Necessit{P 2 y ies}: {0:STRING}{1:RAW_STRING}
18:09:56  <nielsm> argh does not work ;_;
18:10:14  <nielsm> strgen does not want a plural for an insert that does not actually get inserted
18:10:35  <nielsm> and there is no {SKIP}
18:17:14  <Eddi|zuHause> well, there used to be {SKIP}
18:34:22  <Eddi|zuHause> i need a bigger boat...
18:35:07  *** Samu has quit IRC
18:43:27  *** Wacko1976 has quit IRC
18:45:02  <nielsm> let's see if this works...
18:51:01  <nielsm>
18:51:03  <nielsm> that's better
18:51:16  <nielsm> just need a way to get rid of the number :)
18:54:18  *** Samu has joined #openttd
18:55:44  <nielsm>
18:56:54  <nielsm> ideas to not print the number: don't support plurals? re-add {SKIP}?
19:03:25  <andythenorth> Eddi|zuHause: if you ever want to make corporate ransomware
19:03:38  <andythenorth> just target holiday_calendar.xlsx
19:04:00  <andythenorth> you can get a lot of bitcoins for ransoming that
19:04:47  *** Progman has joined #openttd
19:05:47  <andythenorth> nielsm: are you trying to remove the plural entirely, or just handle the singular case? o_O
19:06:37  <nielsm> I'm trying to support plurals without the number the pluralization is based on being printed
19:07:16  <DorpsGek_II> [OpenTTD/OpenTTD] nielsmh opened pull request #6990: Fix: Correct display of industry requires/produces in Build Industry window
19:07:58  <andythenorth> in GB english, 'requires' is correct for both plural and non-plural
19:08:03  <andythenorth> dunno about other languages
19:08:13  <nielsm> yeah it's other languages that need support
19:08:43  <nielsm> right now, turkish is the lone language that has a separate singular form for "requires"
19:09:43  <planetmaker> nielsm, you can re-use the same code as used for the CARGO_LIST, if you don't query the name, but CargoSpec->bitnum
19:10:22  <planetmaker> instead of composing a string from all CargoSpec->name
19:10:36  <nielsm> planetmaker, no, because of cargo suffixes
19:13:18  *** wodencafe has quit IRC
19:14:47  <planetmaker> §$%&DJ$ cargo suffixes :P
19:16:11  *** wodencafe has joined #openttd
19:23:11  *** wodencafe has joined #openttd
19:25:00  <Samu> is Zuu around?
19:25:04  <Samu> someone call him
19:25:32  <Samu> im getting weird behaviour with SCP in the master version
19:25:38  <Samu> that dont happen in 1.8.0
19:27:42  <Samu> weird
19:27:50  <Samu> doesn't happen in the non-debug version
19:27:54  <Samu> only in the debug version
19:29:09  <Samu> in debug version, SCP is spamming signs
19:32:53  *** Wacko1976 has joined #openttd
19:41:15  <Samu> Zuu, come online ploz
19:48:47  <Samu> in english what is correct? "Found Town X" or "Founded Town X"?
19:49:27  <nielsm> "found" is "discovered the location of", while "founded" is "laid the ground stone for"
19:49:54  <Samu> thx, then I had it wrong, fixed
19:50:33  <Samu> AILog.Warning("Founded town " + AITown.GetName(AITile.GetTownAuthority(town_tile)) + ".");
20:01:04  <gelignite> why is that a warning?
20:12:00  <Samu> to stand out
20:12:21  <Samu> i can't pick colours
20:14:23  <Samu> AILog.Warning("Funded the construction of new buildings in " + AITown.GetName(town) + ".");
20:14:34  <Samu> funded is correct in this context?
20:18:05  <nielsm> that's "paid for", so yes
20:18:45  <Samu> im still surprised my AI still has money in the bank
20:18:50  <Samu> with all this spendings
20:24:11  *** Thedarkb-T60 has joined #openttd
20:25:05  *** sla_ro|master has quit IRC
20:30:36  <Samu> this is actually interesting
20:31:01  <Samu> 5 LuDiAI AfterFix's competing for company value
20:31:28  <Samu> the one at the stop will perform these fundings, foundings or whatnot
20:31:38  <Samu> the others restrain themselves from doing so
20:31:55  <Samu> the balance
20:32:03  <Samu> between them
20:32:09  <Samu> hmm it's interesting
20:32:25  <Samu> the one at the top*
21:02:50  <DorpsGek_II> [OpenTTD/OpenTTD] nielsmh commented on pull request #6990: Fix: Correct display of industry requires/produces in Build Industry window
21:23:53  <DorpsGek_II> [OpenTTD/OpenTTD] nielsmh updated pull request #6990: Fix: Correct display of industry requires/produces in Build Industry window
21:24:29  <nielsm> TrueBrain, random note: Remember to also publish the PDB files from windows CI builds, for debuggability :)
21:52:27  <Eddi|zuHause> nielsm: really, if it's such an issue, scrap the feature of cargo subtypes...
21:53:41  <nielsm> I don't know what uses suffixes if anything
21:53:42  <Eddi|zuHause> nielsm: you can count the people who would even notice on one hand.
21:58:16  <planetmaker> I'm sure it's two hands :P
21:58:25  <planetmaker> but not really many more
21:59:06  <planetmaker> the train set creators for german, french, russian, british and japanese sets would notice ;)
22:03:29  *** Thedarkb-T60 has quit IRC
22:08:13  *** glx has joined #openttd
22:08:13  *** ChanServ sets mode: +v glx
22:10:52  *** Zuu has joined #openttd
22:17:55  <Zuu> nielsm: Is "requires" a good word for industry window? Maybe it is used today already, but to me it imposes that all the input cargoes are required, while from what I unedrstand usualyl it is enough to supply one of them.
22:18:18  <Samu> ah, zuu is online
22:18:21  <nielsm> it's the current wording yes
22:18:47  <nielsm> and yes I agree it should not be "requires" when for some newindustries they are strictly optional
22:18:49  <Zuu> sourc/input seems more neutral in that the cargoes are inputs but not neccessary.
22:19:03  <Zuu> source*
22:19:16  <planetmaker> Accepts
22:19:21  <nielsm> Accepts or Takes
22:19:27  <Zuu> But well, if the window uses it already then it is not in the scope of the change you are working on.
22:19:27  <planetmaker> is the word used in other context with the same meaning in OpenTTD
22:19:42  * Zuu accepts Accepts :-p
22:19:47  <planetmaker> :D
22:20:04  <Samu> Accepts seems correct
22:20:45  <Samu> (industry) requires
22:20:51  <Samu> (industry) accepts
22:20:53  <Samu> meh
22:20:54  <Samu> maybe not
22:21:57  <Zuu> But then yes, requires make it more clear that at least one need to be supplied in order for the industry to produce any output.
22:22:18  <planetmaker> I think that is self-explanatory
22:22:44  <planetmaker> if you want to go to that level, you need to call some more details which a NewGRF can supply in the industry's "extra text"
22:22:44  <Samu> zuu, i have a new list of functions, let me copy paste
22:23:23  <nielsm> that's one of the things a newgrf could use the cargo suffixes for, to call attention to what cargoes are strictly required and what is optional
22:23:33  <Samu>
22:23:53  <planetmaker> not really. Suffixes are just eye candy which help differentiate a cargo
22:24:39  <planetmaker> and the same suffix should work for vehicles, too.
22:24:51  <nielsm> it's specifically a callback on industries
22:24:53  <nielsm> not on cargo types
22:25:29  <nielsm> and the industry receives a flag for whether the suffix is requested for an industry window or the build industry window
22:25:30  <planetmaker> easier in the extra text
22:26:14  <planetmaker> or let's say: I've never seen it used in that way in any NewGRF
22:28:08  <planetmaker> but would make an interesting use case for them
22:29:45  <Zuu> Samu: Looks good. No need to add more methods than these which is already quite many. One thing I notice on lire 344-357 you build a string s, but it is only used when the if-statement on line 359 is true. So perhaps move the calculation on line 344-357 into the if-block so that you don't execute it and then throw away the result when the if-stamement doesn't yields true.
22:30:31  <Samu> there could be some more questions. now that i'm implementing it on my AI, i'd like to get the difference in value to the company that is after me in rank or before me in rank
22:30:54  <Samu> so that i could decide to perform some money wasting
22:31:00  <Samu> and still keep the lead
22:31:27  <Samu> ok let me fix that part
22:32:16  <Zuu> IMHO you should offer GetRankingList, but then keep the amount of methods that parse it to a minimum. If AIs want something further than mimimum/standard, they can parse the rank list into their variant.
22:33:04  <Zuu> If you offer 10 different variants, the AI authors will have to figure out which one maches their need and you get more code to maintain.
22:38:31  <Samu> was thinking of... GetCompanyIDDiffToMine
22:38:35  <Samu> hmm
22:38:54  <Samu> less is better, what would you do at this point?
22:39:07  *** synchris has quit IRC
22:40:22  <TrueBrain> nielsm: ack; also I have to remember running NSIS ... somehow :D
22:40:26  <TrueBrain> we will get there :)
22:41:08  <Samu> i guess the AIList would have to suffice
22:42:24  <Zuu> Samu: If it is ready, release it. Ready being usable to others. Not necessary complete. Once released you will want to maintain basic compability and not break AIs using v1 of your client lib on newer versions of your GS and the other way around. So if you think you might want to have a 3rd mode it may be a good idea to already now not use a boolean for modes but actually use a enum/integer for that in  data communication.
22:42:44  <Zuu> I see your AI interface is arleady prepared for a 3rd mode.
22:43:45  <Zuu> Of course, it is your thing, so if you want to break compability you are free to do so, but it is a good idea to strive towards not having to do so when it is possible to avoid it.
22:45:03  <Zuu> Of course AIs using v1 of the client lib will need to update to v2 of the lib to be able to get the ability to support your future functionality.
22:46:23  <Samu> what 3rd mode do you have in mind?
22:46:44  <Zuu> I don't know.
22:47:08  <Samu> be the most valuable before the end of xxxx?
22:47:12  <Zuu> But you have two already. Rank and goal. So I suppose you could come up with a third one?
22:47:22  <Samu> ah, i see what you mean
22:47:59  <Samu> boolean is bad idea if i then create a 3rd mode, due to compatibility with the previous version
22:48:01  <nielsm> largest profit or largest revenue over last 12 months?
22:48:43  <Zuu> It is no problem if old AIs cannot play the new third mode, but it is nice if they can still function in the old modes assuming they are unchanged.
22:49:43  <Samu> btw, here's my AI testing the functions
22:50:41  <Zuu> *thumbs up*
22:54:35  <Samu> okay, gonna change the boolean into int
22:54:46  <Samu> i may yet create more modes indeed
22:54:55  <Samu> just not atm
22:55:56  <Samu> oh, and the scp.nut on the GS side, let me copy paste that too
22:56:47  <Samu>
22:56:49  <Zuu> Btw, if you want to summon a Zuu in the future, it is a good idea to leave out 'him'.
22:57:31  <Zuu> Do you have a quesiton on scp.nut?
22:57:46  <Samu> i actually have
22:58:14  <Samu> the command i have is AI > GS > AI but also GS > AI
22:58:26  <Samu> it works both ways, apparently
22:59:52  <Samu> sometimes this doesn't work, i have to use self, it's rather confusing
22:59:59  <Samu> 'this' vs 'self'
23:00:09  <Zuu> It might be possible to add a command for both AI -> GS and GS -> AI. But I find it less confusing to have different names eacch way.
23:00:24  *** andythenorth has quit IRC
23:01:06  <Zuu> this is the normal pointer to the instance of the current class. But in the callback methods this would refer to some SCP internal class (I think), so instead there is a parameter self which is passed along that points to your "this".
23:02:13  <Zuu> When you register comands you have "local self = this;" that is not required you could instead just pass this as parameter I think. But the NoCarGoal code may have it that way with the intention to document the purpose of it.
23:06:18  <Samu> i can eliminate that line then?
23:07:04  <Samu> SCPLib.AddCommand("CurrentGoal", COMMAND_SET, this, SCPManager.ReceivedCurrentGoalCommand);
23:07:15  <Samu> that 'this' in there instead of 'self'
23:08:42  <Samu> uh oh, line 112 is wrong, let me fix
23:09:10  <Samu> local result = [to_company, goal_mode, response_value];
23:12:29  <Samu> could I remoe the to_company variable at all?
23:12:38  <Samu> it's not really needed come to think of it
23:13:32  <Samu> I wonder...
23:23:00  <Samu> on the SCPClient_CompanyValueGS side, is there a way to customize the displaying of AILog.Info message at all?
23:24:38  *** Wolf01 has quit IRC
23:25:43  <Zuu> <Samu> that 'this' in there instead of 'self'  <-- looks good
23:27:01  <Zuu> In NoCarGoal to_company is useful as somethimes the AI get information about other companies than themself. If it is due to limitations of scp/openttd or how NoCarGoal GS sends messages I don't know.
23:27:09  <Samu> I tried: if (self._scp._SCPLib_Client.Configuration[4]) AILog.Info("SCP: Reveived CurrentGoal command with data: " + s);
23:27:24  <Samu> says _SCPLib_Client is invalid
23:27:38  <Samu> but in the main.nut it's there
23:28:43  <Zuu> So self is your SCPManager?
23:28:58  <Zuu> It doesn't have a _scp member what I can see.
23:29:14  <Samu> this._scp = scp_ptr;
23:29:25  <Samu> the scp_ptr is... hmm let me check
23:29:37  *** nielsm has quit IRC
23:29:56  <Samu> this.scp = SCPLib("LDAF", 8);
23:30:02  <Samu> this.cvgs = SCPClient_CompanyValueGS(this.scp);
23:30:21  <Zuu> Ah.. you are back in the AI again, and not in SCPManager, but in SCPClient_CompanyValueGS?
23:30:24  <Samu> this._scp = SCPLib("LDAF", 8); thus
23:31:03  <Zuu> Well, make sure the path you try to go via exist and that self points to what you think it points.
23:31:22  <Zuu> When in doubt you could foreach a node and print its members.
23:31:40  <Samu> oh, that would come useful, how do i do it?
23:33:14  <Samu> in my AI, i have this.scp = SCPLib("LDAF", 8); this.cvgs = SCPClient_CompanyValueGS(this.scp);
23:34:11  <Samu> in the AI library SCPClient_CompanyValueGS I got this._scp = scp_ptr
23:34:45  <Samu> meh, it's confusing, it's like the 'this' is pointing to 3 entities at the same time
23:35:37  <Zuu> Usually (no callbacks involved) this points to the curernt instance of the class you are in.
23:36:11  <Zuu> I suggest reading up on classes and instances in some object oriented programming language.
23:36:31  <Zuu> (not JavaScript if you can avoid)
23:38:12  <Zuu> With some improved knowledge on object oriented programming, this will be easier for you to sort out. Squirrel is not the most newbie friendly environment. I mean it is good because it is high in motivation because you can create cool stuff within OpenTTD, but your code run inside OpenTTD an is hard to inspect what it is doing and not.
23:39:08  <Zuu> You can use AIController.Break() and log messages etc. of course, but there is no interactive code interpeter or similar like for many other script languages.
23:39:51  <DorpsGek_II> [OpenTTD/OpenTTD] glx22 updated pull request #6989: Change: use vcpkg integration in Visual Studio
23:42:09  <Zuu> Regarding JavaScript, I'm not against learning it, instead it is quite a useful language to know, but it is not the language I would recommend for learning basics of object oriented code. Classen, instances etc. as JS doesn't have classes in the traditional way.
23:42:35  <Zuu> s/Classen/Classes/
23:43:19  <DorpsGek_II> [OpenTTD/OpenTTD] glx22 updated pull request #6989: Change: use vcpkg integration in Visual Studio
23:43:22  <Samu>
23:43:38  <Samu> that's where i found the log
23:44:18  <Samu> _SCPLib_Client.Configuration[4]=setting;
23:45:28  <Samu> gonna try something, brb
23:46:17  <Zuu> _SCPLib_Client is clearly a private name you shouldn't access directly.
23:47:13  <Zuu> You should access SCP library using SCPLib main class that you import.
23:48:57  <DorpsGek_II> [OpenTTD/OpenTTD] glx22 commented on pull request #6989: Change: use vcpkg integration in Visual Studio
23:52:03  <Zuu> Libraries in OpenTTD can only have one class that is imported in the name you decide with import() command. Any other classe that libraries include will be included in yoru global scope in their literal name. Therefore libraries should in general only contain one class. But if they need more, they are in general named something obsucre starting on _ as a clear indication that it is a private name, and AIs/GS:es should consume the library via its
23:52:03  <Zuu> public interface provided via the library main class.
23:53:26  <Zuu> Obviously it would be best if libraries could have their private classes in their own scope isolated from the AI/GS, but that is technically not possible in Squirrel2/OpenTTD and thus we need to have to follow a resonable practice.
23:56:05  <Samu> experimenting this: if (enable == null) return _SCPLib_Client.Configuration[4] == 1;
23:56:24  <Samu> between line 232 and 233
23:59:26  <Samu> and on my library, i'm now trying

Powered by YARRSTE version: svn-trunk