Times are UTC Toggle Colours
00:08:47 *** HerzogDeXtEr has quit IRC 01:36:46 *** Gustavo6046 has quit IRC 01:37:20 *** Gustavo6046 has joined #openttd 02:11:57 *** Wormnest has quit IRC 02:30:26 *** _aD has quit IRC 02:37:13 *** colde_ has joined #openttd 02:37:43 *** reldred has quit IRC 02:38:02 *** gregdek has quit IRC 02:39:08 *** mindlesstux has quit IRC 02:39:47 *** innocenat__ has joined #openttd 02:39:53 *** colde has quit IRC 02:39:53 *** colde_ is now known as colde 02:40:17 *** innocenat_ has quit IRC 02:40:17 *** innocenat__ is now known as innocenat_ 02:40:40 *** twpol has quit IRC 02:45:35 *** mindlesstux has joined #openttd 02:55:44 *** D-HUND has joined #openttd 02:58:15 *** reldred has joined #openttd 02:59:08 *** debdog has quit IRC 02:59:39 *** twpol has joined #openttd 03:03:47 *** gregdek has joined #openttd 03:07:43 *** glx has quit IRC 03:44:22 *** Gustavo6046 has quit IRC 03:44:37 *** Gustavo6046 has joined #openttd 03:45:24 *** Flygon has joined #openttd 04:18:37 *** Gustavo6046 has quit IRC 04:19:26 *** Gustavo6046 has joined #openttd 04:39:27 *** Gustavo6046 has quit IRC 04:39:43 *** Gustavo6046 has joined #openttd 05:56:58 *** tokai|noir has joined #openttd 05:56:58 *** ChanServ sets mode: +v tokai|noir 06:04:00 *** tokai has quit IRC 06:44:04 *** andythenorth has joined #openttd 07:28:28 *** HerzogDeXtEr has joined #openttd 07:36:15 *** sla_ro|master has joined #openttd 07:40:43 * andythenorth wonders if PBS could be changed :P 07:40:52 <andythenorth> so signals aren't default red 07:41:08 *** Gustavo6046_ has joined #openttd 07:41:46 *** Gustavo6046 has quit IRC 07:41:46 *** Gustavo6046_ is now known as Gustavo6046 07:42:07 <andythenorth> oh 07:42:10 <andythenorth> I should just use block? 07:42:17 <andythenorth> is that why block is recommended practice? 07:42:46 *** jottyfan has joined #openttd 07:56:04 *** nielsm has joined #openttd 08:27:07 <DorpsGek> [OpenTTD/bananas-api] James103 commented on issue #24: Restrict dependencies between content-type https://git.io/JfktY 09:13:16 *** Gustavo6046 has quit IRC 09:13:31 *** Gustavo6046 has joined #openttd 09:41:21 *** Samu has joined #openttd 09:49:46 *** andythenorth has quit IRC 10:27:45 *** WormnestAndroid has quit IRC 10:33:17 *** andythenorth has joined #openttd 10:46:34 *** WormnestAndroid has joined #openttd 10:52:16 <FLHerne> andythenorth: It is in my book 10:52:21 <FLHerne> among other visual things 10:54:26 *** Samu has quit IRC 11:13:22 *** Samu has joined #openttd 11:26:19 <andythenorth> hmm 11:26:21 <andythenorth> new signals 11:26:23 <andythenorth> moar signals 11:26:31 <andythenorth> PBS, but block 11:26:44 <andythenorth> PBS that can be reserved through until next junction or red 11:27:47 *** andythenorth has quit IRC 11:49:15 *** Speeder has quit IRC 11:50:23 *** andythenorth has joined #openttd 11:58:26 *** andythenorth has quit IRC 12:08:34 *** glx has joined #openttd 12:08:34 *** ChanServ sets mode: +v glx 12:09:17 *** andythenorth has joined #openttd 12:09:21 <andythenorth> ha do we even know how PBS works? 😊 12:09:24 <andythenorth> or is it magic? 12:09:55 <DorpsGek> [OpenTTD/team] glx22 commented on issue #259: [ru_RU] Translator access request https://git.io/Jr36W 12:29:07 *** WormnestAndroid has quit IRC 12:31:04 <glx> ok the funny part is stuck ship is not lost 12:31:21 *** jottyfan has quit IRC 12:32:42 *** Samu_ has joined #openttd 12:38:30 *** Samu has quit IRC 12:39:30 <glx> oh it's not lost because it doesn't even try to pathfind 13:05:52 *** virtualrandomnumber has joined #openttd 13:06:38 *** virtualrandomnumber has quit IRC 13:11:23 *** LouWestin has quit IRC 13:12:44 *** LouWestin has joined #openttd 13:31:07 *** WormnestAndroid has joined #openttd 13:40:28 *** Wormnest has joined #openttd 13:43:04 *** frosch123 has joined #openttd 13:47:54 *** sla_ro|master has quit IRC 13:58:03 <andythenorth> quak? 14:08:51 <Samu_> hi 14:15:38 <frosch123> moo 14:38:42 *** Gustavo6046_ has joined #openttd 14:39:20 *** Gustavo6046 has quit IRC 14:39:20 *** Gustavo6046_ is now known as Gustavo6046 14:46:27 *** sla_ro|master has joined #openttd 15:14:57 *** Samu_ has quit IRC 15:20:24 *** Beer has joined #openttd 15:38:17 *** Samu has joined #openttd 16:10:01 *** Gustavo6046 has quit IRC 16:14:23 *** Etua has joined #openttd 16:23:42 *** Gustavo6046 has joined #openttd 16:49:50 <glx> ok I think https://github.com/OpenTTD/OpenTTD/compare/master...glx22:smarter_ships is the best solution 16:50:41 <glx> (includes the alternate version for #9567) 17:06:00 *** Flygon has quit IRC 17:09:30 <andythenorth> debugging a set of industries all writing to the same town storage 17:09:32 <andythenorth> is not fun 17:09:59 <glx> add debug lines in openttd 17:11:24 <andythenorth> that would require me to learn how to be a programmer :) 17:11:28 <andythenorth> oh dear :) 17:11:47 <andythenorth> also I'm caching a calculated value, which means I have 2 problems 17:12:05 <andythenorth> but I need to cache it so other grfs can read it without needing to encode the calculation 17:12:24 <andythenorth> even though it's a derivative of values in two other registers :) 17:12:34 * andythenorth learns about cache invalidation 17:12:51 *** Etua has quit IRC 17:14:31 <andythenorth> this only runs monthly, and I've nerfed ffwd performance by somehow compiling a debug build of openttd :D 17:14:36 <andythenorth> 'such andythenorth' 17:16:25 <andythenorth> is '-DCMAKE_BUILD_TYPE=RelWithDebInfo' what I need? 17:17:27 *** D-HUND is now known as debdog 17:19:09 <Timberwolf> Yes, relwithdebuginfo.is the "fast, but prints stuff" option. 17:19:56 <andythenorth> thanks 17:20:06 <Timberwolf> Or rather, when it crashes you get a useful stack dump. 17:20:12 <andythenorth> :) 17:20:30 <andythenorth> hmm what if I just repaint PBS signal sprites to show green by default, not red? 17:20:36 <andythenorth> or maybe yellow by default? 17:21:04 <andythenorth> I can't unsee how the 'PBS is always red' thing now :) 17:21:28 <Timberwolf> I've got used to it. 17:22:09 <andythenorth> today was first time I noticed it :) 17:22:14 <Timberwolf> I think it's vaguely realistic? 17:23:06 <Timberwolf> Pretty sure I've used the "platform exit signal has gone from red to green" as early warning a Tube train is approaching. 17:23:52 <Timberwolf> Of course Tube signallimg != National Rail signalling. 17:26:41 <andythenorth> I think it depends on blocks vs route setting 17:26:44 <andythenorth> but that's a pure guess 17:26:56 <andythenorth> track circuit blocks will tend to green if not occupied 17:27:04 <andythenorth> if only we had...block signals :P 17:29:28 *** kaomoneus has joined #openttd 17:31:30 <kaomoneus> Hi fold! I'm trying to understand whe commands from commands.cpp are called? Week ago nielsm hinted me, that it is used for network interaction. But I can't find how it is called on client side.. 17:32:44 <kaomoneus> E.g. I have CmdSetTimetableStart, and I want to change "day" with "hour". I can't fix all possible custom scripts, but at least I would like to fix network. But I can't find a client call for it. 17:33:22 <kaomoneus> .. I meant "hi folks" :-) 17:35:02 <frosch123> https://github.com/OpenTTD/OpenTTD/blob/master/docs/desync.md#11-openttd-multiplayer-architecture <- read that 17:38:31 <andythenorth> not sure I understand the results of industry_town_count 17:38:39 <glx> Timberwolf> Or rather, when it crashes you get a useful stack dump. <-- useful stackdump and apple don't work very well 17:39:19 <andythenorth> var 67 with bit 8 set 17:39:28 <andythenorth> it seems to under-count by one sometimes 17:39:58 <andythenorth> I wondered if it discounts 'self' in the case where queried industry ID is same as ID of caller 17:41:54 <andythenorth> the lack of a monthly town cb for grf :) 17:42:00 <andythenorth> means I have to fake it from industries 17:42:09 <andythenorth> which means counting how many industries there in the town 17:42:41 <andythenorth> and then having the last one called do the monthly town stuff 17:43:12 <andythenorth> maybe I should just copy the production code into GS? 17:43:51 <andythenorth> GS can run a monthly callback fine 17:44:01 <andythenorth> 'not a callback andythenorth' 17:44:13 <andythenorth> monthly event loop walking all towns 17:44:19 <kaomoneus> frosch123: ok, thanks, now I see. 17:49:19 <andythenorth> var 67 'probably fine' 17:49:24 <andythenorth> just add 1 every time :P 17:57:37 <andythenorth> lol I tried a monthly random industry production increase 17:57:46 <andythenorth> it works on a per-town basis 17:57:49 <andythenorth> but 17:58:06 <andythenorth> order industries are handled is deterministic :D 17:58:11 <andythenorth> so only potash mines are increasing 17:58:36 <andythenorth> (there's a flag to limit increases to one in any month) 18:01:26 *** sla_ro|master has quit IRC 18:01:31 *** kaomoneus has quit IRC 18:03:19 *** sla_ro|master has joined #openttd 18:05:07 *** gelignite has joined #openttd 18:18:32 *** kaomoneus has joined #openttd 18:22:16 <andythenorth> oof maybe I can patch GS to read the internal state of industries 18:22:24 <andythenorth> lol, probably beyond my skills 18:22:28 *** Beer has quit IRC 18:28:36 <andythenorth> hmm 18:28:48 <andythenorth> random production change cb anyone? :P 18:28:54 <andythenorth> is that broken with smooth economy? 18:29:21 *** gelignite has quit IRC 18:35:47 *** Wormnest_ has joined #openttd 18:37:50 *** WormnestAndroid has quit IRC 18:41:18 *** Wormnest has quit IRC 18:44:49 *** WormnestAndroid has joined #openttd 18:51:12 <andythenorth> could newgrf debug windows refresh when dirty? 18:51:29 <andythenorth> currently they have to be open/closed or windowshaded to update register values reliably 19:02:01 *** Wormnest_ has quit IRC 19:06:39 *** gelignite has joined #openttd 19:12:59 *** kaomoneus has quit IRC 19:15:26 *** Samu has quit IRC 19:26:27 *** WormnestAndroid has quit IRC 19:26:43 *** WormnestAndroid has joined #openttd 19:32:32 *** Samu has joined #openttd 19:36:02 <andythenorth> ouch really can't get a monthly town loop working 19:36:11 <andythenorth> maybe I do have to reimplement FIRS in GS 19:36:16 <andythenorth> this will be...weird 19:44:48 <andythenorth> hmm 19:44:49 <andythenorth> LOAD_PERM(${get_perm_num("this_cycle_industry_counter")}) < count_industries_in_town() 19:45:03 <andythenorth> the values for that are 18 and 9 19:45:08 <andythenorth> nml thinks 18 < 9 19:46:08 <glx> nml can't think, unless they are compile time constants 19:47:24 <andythenorth> I should be able to evaluate a storage and procedure result though? :) 19:48:03 <andythenorth> https://gist.githubusercontent.com/andythenorth/64f3532ee4c148c5d7f9bf21ba36cda1/raw/43a4bf0deb726a63e0b6eba0e1729876a15ade14/gistfile1.txt 19:48:57 <andythenorth> this just keeps counting up, it should end at 9 in my test case which is the current value of count_industries_in_town() :) 19:56:56 <glx> nml seems right, what's the corresponding nfo ? 20:01:39 * andythenorth looks 20:01:49 <andythenorth> I'm sure the bug is in my logic 20:01:58 <andythenorth> but I've stared at it for an hour or so 20:02:09 <andythenorth> this isn't the actual code, this is the attempt to debug 20:02:18 <andythenorth> but the debug code also needs debugging :P 20:03:41 <andythenorth> glx https://gist.github.com/andythenorth/64f3532ee4c148c5d7f9bf21ba36cda1 20:21:02 <glx> except some weird r 1A 20 \dxFFFFFFFF sto 1A 20 \dx00000100, nfo seems correct 20:26:14 <andythenorth> hmm 20:27:05 <andythenorth> newgrf monthly cb is synchronous? There's no chance of industries writing to storage whilst others are trying to read it? 20:27:17 <andythenorth> openttd code looks like a simple iterator to me 20:27:30 <glx> everything is sequential in openttd world 20:27:38 <glx> because determinism 20:30:21 <andythenorth> this is only called once per industry 20:30:22 <andythenorth> hmm 20:30:25 * andythenorth tries more things 20:31:36 <glx> but I still don't get why there are temp[256]=-1 in the middle of ?: nfo 20:34:26 <frosch123> that is for the town-storage access 20:34:29 <andythenorth> emoji 20:34:34 <frosch123> "-1" is for "this grf" 20:34:40 <glx> oh ok 20:39:25 <andythenorth> ha ha 20:39:38 <andythenorth> I have to compile once with a version to put storage back to 0 in my savegame 20:39:47 <andythenorth> then compile again with the actual code 20:39:49 <andythenorth> this is lol :) 20:40:05 <glx> store_perm translation feels weird in this case temp[256]=-1; temp[256]=-1; load_perm[1]; add 1; store_perm[1]=res 20:40:31 * andythenorth saves a savepoint 20:42:37 <andythenorth> I have simplified my conditional to `LOAD_PERM(${get_perm_num("this_cycle_industry_counter")}) < 9` 20:42:59 <andythenorth> to avoid the procedure call 20:43:23 <andythenorth> but still evaluating 'true' for 12 < 9' 20:49:20 <andythenorth> this gets me 101 in the register https://gist.github.com/andythenorth/64f3532ee4c148c5d7f9bf21ba36cda1#gistcomment-3921760 20:49:42 <andythenorth> which suggests that 100 < 9 20:50:48 *** Gustavo6046_ has joined #openttd 20:52:07 *** Gustavo6046 has quit IRC 20:52:37 <glx> but nfo looks correct 20:54:08 <glx> cmp(100, 9) should be 2, transformed to 1 by min(2,1), then transformed to 0 by xor 1 20:54:32 <andythenorth> hmm 20:54:44 <andythenorth> scope here is town 20:54:48 <nielsm> reading this conversation gives me two thoughts: first, it'd (still) be good to have NML write a map file, giving a two-way mapping from NML source lines to GRF sprite numbers 20:55:13 <andythenorth> maybe I should test with scope SELF 20:55:37 <nielsm> and second, it would probably be useful to have a way to at least get detailed dumps of callback evaluation 20:55:40 *** Wormnest has joined #openttd 20:55:57 *** Gustavo6046_ is now known as Gustavo6046 20:56:20 <nielsm> disadvantage of the latter: stuffing more code into the callback evaluation, that would be skipped most of the time, probably slowing everything down all the time 20:56:22 <glx> oh I know what happens, it's a side effect 20:56:33 *** WormnestAndroid has quit IRC 20:57:09 <frosch123> nielsm: https://github.com/frosch123/OpenTTD/tree/feature_newgrf_backtrace <- the backtrace code is not that bad 20:57:15 <frosch123> but the gui is too complicated 20:57:30 <glx> of (!guard*0)+(guard*store_perm) 20:57:34 <nielsm> "4712 commits behind OpenTTD:master" ouch 20:57:48 <glx> with guard being 0 here 20:57:56 *** Samu has quit IRC 20:58:00 <glx> but the store_perm is still executed 20:58:14 <frosch123> nielsm: https://gist.githubusercontent.com/frosch123/889b6478a6d5d7b10f89d9b014845331/raw/b11d0d479c773153722a617b3d7b8c1d0041f57a/inspect_backtrace.png 20:58:35 <andythenorth> o_O 20:58:35 *** Gustavo6046 has quit IRC 20:58:54 <glx> andythenorth: I think you should rewrite it to not use ?: 20:59:25 <frosch123> the premium solution would be a rest interface to ottd, so some external program could trigger callbacks, provide the GUI, visualize stuff, and read map files from NML 20:59:26 <glx> keep the < in expression, but the decision with 0: and 1: 20:59:43 <glx> or just 1: and default 20:59:54 <frosch123> nielsm: my master is not upstream master :p 21:00:01 <frosch123> it may be thousands more revisions behind :p 21:00:45 *** WormnestAndroid has joined #openttd 21:01:02 <andythenorth> I can't put an expression into a result, I have to chain to another switch or return a constant? 21:01:10 * andythenorth never really understood nml 21:01:16 <nielsm> yep that branch looks like it's on top of not-quite-1.4 21:01:35 <glx> you can put an expression, nml will generate the switch if needed 21:01:36 <andythenorth> e.g. can't do `1: STORE_PERM(100, 230);` or similar 21:01:41 <andythenorth> oh I can? 21:02:27 * andythenorth wonders if `return` is mostly superfluous 21:03:02 <glx> maybe nml could detect if ?: may have side effects and at least warn about it 21:03:46 *** Gustavo6046 has joined #openttd 21:04:07 <glx> I think detection is possible thanks to is_read_only 21:04:26 <andythenorth> :) 21:05:01 <andythenorth> nmlc seems quite happy with this https://gist.github.com/andythenorth/64f3532ee4c148c5d7f9bf21ba36cda1#gistcomment-3921774 21:05:08 * andythenorth has never tried this before 21:05:18 <andythenorth> I guess it just expands a switch then 21:05:41 <glx> return is useless here :) 21:06:56 <andythenorth> I should learn nml 21:09:56 *** Samu has joined #openttd 21:10:13 <andythenorth> ok so that's the debugging code fixed :) 21:10:27 <andythenorth> now I just need to find out why the actual code doesn't work 21:13:49 <glx> and I think I spotted a small bug in is_read_only() for ternary 21:13:59 <glx> it doesn't check guard 21:17:13 *** Gustavo6046_ has joined #openttd 21:19:32 <andythenorth> hmm 21:20:16 *** _aD has joined #openttd 21:20:50 *** Gustavo6046 has quit IRC 21:20:50 *** Gustavo6046_ is now known as Gustavo6046 21:25:46 <andythenorth> I would very like to be able to inspect a backtrace right now :P 21:27:01 <Samu> just found a miniscule bug in my airport building code 21:27:01 *** Gustavo6046 has quit IRC 21:28:13 *** frosch123 has quit IRC 21:28:58 <Samu> basically, if it finds no space to build an airport of type A, it was skipping testing the next airport type 21:29:17 <Samu> it should be testing all types 21:29:24 <Samu> it's fixed now :) 21:30:26 <Samu> on a map with huge towns and tiny islands, this was happening quite often, nearly no airports were being built, because the first thing it tests is intercontinental 21:30:50 <Samu> and the ai is able to build heliports 21:31:16 <Samu> but wasn't even trying 21:31:41 <Samu> gotta go sleep, take care 21:33:57 *** Samu has quit IRC 21:35:34 *** Gustavo6046 has joined #openttd 21:40:02 <andythenorth> hmm another odd result 21:41:14 <glx> andythenorth: https://github.com/OpenTTD/nml/compare/master...glx22:ternary 21:41:30 <andythenorth> :) 21:41:30 <glx> warning message may not be the best 21:42:02 <glx> but at least it should tell something won't do what you expect 21:43:09 <andythenorth> thanks :) 21:43:30 <glx> ternary implementation is weird and smart at the same time, because NFO limitations 21:44:06 <andythenorth> should we merge it :) 21:47:35 <andythenorth> ok got another weird result :) 21:48:47 <glx> and after looking at the nfo generated in your "broken" test case, I can imagine a potential issue for things like store_perm(procedure_setting_temp0x100(), reg_num) 21:49:04 <andythenorth> got a procedure called in an expression, doesn't seem to be called unless I add more things to the expression 21:49:10 <andythenorth> hard to explain, and code is large 21:49:16 * andythenorth trying to isolate the failure 21:51:36 <andythenorth> glx is that where 0x100 gets over-written? 21:51:48 <glx> yes 21:51:58 <andythenorth> there are similar cases with 0x101 elsewhere (parameter to multiple vars) 21:52:19 <andythenorth> can't remember the details but I encountered it before 21:55:24 <andythenorth> https://gist.github.com/andythenorth/64f3532ee4c148c5d7f9bf21ba36cda1#gistcomment-3921799 21:56:11 <glx> lol even regression test 039 shows the issue 21:56:32 <andythenorth> ^ if I don't include the `STORE_TEMP` after call to monthly_town_loop(), the procedure call appears to fail 21:57:02 <glx> https://github.com/OpenTTD/nml/blob/master/regression/039_storage.nml and https://github.com/OpenTTD/nml/blob/master/regression/expected/039_storage.nfo 21:59:15 <glx> fail or optimised ? 21:59:53 <glx> IIRC procedure calls should not be optimised in case of constant result 22:01:56 <glx> hmm seems it's the default result only case, so yeah probably optimised 22:02:06 <glx> you disabled the warnings ? 22:03:19 <andythenorth> yes, there are a lot :) 22:03:39 <glx> if the procedure is read only, it will be skipped 22:03:53 <glx> because you return a fixed constant 22:03:56 <andythenorth> ok 22:04:15 <andythenorth> so I just work around that in this case :) 22:04:55 <andythenorth> ok that explains why `monthly_town_loop(), 1` makes no difference 22:05:03 <andythenorth> but a store temp does 22:05:36 <glx> if monthly_town_loop() only reads stuff it's useless 22:06:17 <andythenorth> well it does store perm 22:06:30 <andythenorth> but it's several layers of procedure 22:06:44 <glx> hmm in this case it may be a bug somewhere 22:07:07 <andythenorth> :) 22:10:11 <glx> https://github.com/OpenTTD/nml/blob/master/nml/ast/switch.py#L96 <-- I think it's this optimisation, but is_read_only() should recurse 22:10:49 * andythenorth bug-finding-as-a-service :) 22:10:51 <glx> https://github.com/OpenTTD/nml/blob/master/nml/ast/switch.py#L130-L131 22:11:00 <glx> maybe there's a bug here 22:13:08 <glx> I guess it should probably do something similar to collect_references 22:17:24 <andythenorth> :) 22:18:42 <andythenorth> ha well now I know what the issue is :) 22:18:50 <andythenorth> I've worked around it and can test more code 22:18:51 <andythenorth> thanks 22:20:15 <glx> I added a possible solution to your gist 22:20:38 <andythenorth> cool 22:20:44 <glx> not having a test case locally 22:22:23 * andythenorth tests 22:24:11 <andythenorth> maybe `False` not `false` :) 22:24:41 <glx> hey regression pass here :) 22:25:11 <glx> because I don't have a valid test case which could enter in this branch 22:25:56 <glx> but that means it detected a non read only thing 22:26:12 <andythenorth> seems to work 22:33:08 *** Gustavo6046_ has joined #openttd 22:34:56 <andythenorth> merge? :) :P 22:35:37 *** Gustavo6046 has quit IRC 22:35:37 *** Gustavo6046_ is now known as Gustavo6046 22:40:54 * andythenorth must to sleep 22:41:12 <glx> I think I need to add some test cases 22:41:22 <andythenorth> thanks for the help glx 22:41:32 *** andythenorth has quit IRC 22:41:35 *** sla_ro|master has quit IRC 22:53:38 *** Gustavo6046_ has joined #openttd 22:57:00 *** Tirili has joined #openttd 22:57:49 *** Gustavo6046 has quit IRC 23:03:38 *** Gustavo6046_ has quit IRC 23:09:47 *** nielsm has quit IRC 23:10:38 *** Gustavo6046 has joined #openttd 23:20:35 *** WormnestAndroid has quit IRC 23:20:36 *** WormnestAndroid has joined #openttd 23:32:43 *** WormnestAndroid has quit IRC 23:33:14 *** WormnestAndroid has joined #openttd