Back to Home / #openttd / 2019 / 02 / Prev Day | Next Day
#openttd IRC Logs for 2019-02-06

---Logopened Wed Feb 06 00:00:52 2019
00:54-!-keoz [~keikoz@2a01:e35:2fd5:51e0:d790:795d:2cc7:b53d] has joined #openttd
00:54-!-keoz is "Grmph" on #openttd
01:57-!-andythenorth [] has joined #openttd
01:57-!-andythenorth is "andythenorth" on #openttd
02:16-!-keoz [~keikoz@2a01:e35:2fd5:51e0:d790:795d:2cc7:b53d] has quit [Ping timeout: 480 seconds]
02:20-!-sla_ro|master [] has joined #openttd
02:20-!-sla_ro|master is "slamaster" on #sla #openttd
02:40<DorpsGek_II>[OpenTTD/OpenTTD] PeterN merged pull request #7118: Add #5006: Flag to hide rail type from construction.
02:46<andythenorth>now how can I abuse that? :D
02:47<andythenorth>universal rail vehicle? o_O
02:47<@planetmaker>Moin. That existed before :)
02:47<@planetmaker>To the dismay of some other authors :P
02:48<andythenorth>hmm, can I connect NG to RAIL, and have a vehicle go between them?
02:48<@planetmaker>label is label. If a vehicle says it can run on both: fine
02:48<@peter1138>You can now do it the other way.
02:49<@peter1138>Universal rail type that is compatible with everything.
02:49<@peter1138>Hmm, no
02:49<@peter1138>Yeah that was the oroginal way
02:49<@peter1138>I dunno :p
02:49<andythenorth>one day we'll have a spec :D
02:50<@peter1138>Yeah I need to update the wiki. Where is the wiki?
02:50<andythenorth>and stuff
02:50<@planetmaker>There definitely should be an OpenTTD 1.10 next year. Not 2.0 ;)
02:50<andythenorth>you probably want the railtypes page
02:50<andythenorth>not the vehicle track type page
02:50<andythenorth>it's nice that they're different
02:50<@peter1138>planetmaker, we should never do 2.0 :-)
02:51<andythenorth>I think we should keep the threat of 2.0 alive
02:51<@peter1138>Hmm, needs a login to edit.
02:51<andythenorth>forums login should do it
02:51<@peter1138>Is it the same as the other logins or separate?
02:51<andythenorth>should be same as forums, but it breaks sometimes
02:51<andythenorth>I couldn't edit for ~2 years, then I could
02:52<@peter1138>" Auto-creation of a local account failed: Automatic account creation is not allowed. "
02:52<@peter1138>Hmm, well.
02:52<@peter1138>So, er, can someone else add it? :p
02:52<andythenorth>yeah for 2 years I had to request edits via forum threads
02:53<@peter1138>Is it orudge who looks are that site?
02:53<andythenorth>I don't thnk anyone looks after it afaict
02:54<@peter1138>Somebody hosts it and set that account linking up.
02:55<andythenorth>yes, I don't even know if that one's on ottd or coop hosting though
02:56<andythenorth>I know that getting anybody to answer questions about it is ~impossible
02:56-!-m3henry [] has joined #openttd
02:56-!-m3henry is "Android IRC Client" on #openttd
02:56*andythenorth wonders about sacking that wiki
02:57<andythenorth>and distributing the docs with nml or grfcodec using readthedocs
02:58<@peter1138>No, it's a useful reference.
02:58<@peter1138>github :p
02:59<andythenorth>yeah, AIUI, readthedocs just publishes from a github repo, and edits are via PR
02:59<andythenorth>and we have one less web service to run
03:00<andythenorth>oof I have to go in the office for Risk Register meeting
03:01<andythenorth>much rather stay at home and make enterprise software
03:01<@peter1138>Hmm, I need to change my tt-forums password.
03:02<@peter1138>"Must be between 6 characters and 30 characters."
03:02<m3henry>Is the wiki difficult to maintain?
03:02<@peter1138>Limits, lol
03:02-!-m3henry [] has quit [Read error: Connection reset by peer]
03:04-!-m3henry [] has joined #openttd
03:04-!-m3henry is "Android IRC Client" on #openttd
03:04<andythenorth>nobody knows if the wiki is difficult to maintain :P
03:04<andythenorth>I think frosch has tried to keep the lights on for it sometime
03:05<@peter1138>In my experience once installed they generally just run by themselves. Moderators deal with junk edits.
03:06-!-m3henry [] has quit [Read error: Connection reset by peer]
03:06<@peter1138>Of course, it's likely to be out of date, security patch wise.
03:07<andythenorth>it would be nice to make newgrf less generally shit to develop for
03:07<DorpsGek_II>[OpenTTD/OpenTTD] PeterN commented on issue #5006: Railtypes: 'hide railtype' flag
03:07<DorpsGek_II>[OpenTTD/OpenTTD] PeterN closed issue #5006: Railtypes: 'hide railtype' flag
03:07<andythenorth>it's kinda un-fun right now
03:07<@peter1138>Okay, I must remember to squash and retitle commits to include the PR :/
03:08<andythenorth>remember that
03:08-!-m3henry [] has joined #openttd
03:08-!-m3henry [] has quit []
03:08-!-m3henry is "(unknown)" on (unknown)
03:09-!-m3henry [] has joined #openttd
03:09-!-m3henry is "Henry" on #openttd
03:09<m3henry>Would having to raise a PR discourage users from editing?
03:10-!-m3henry [] has quit [Read error: Connection reset by peer]
03:11-!-m3henry [] has joined #openttd
03:11-!-m3henry is "Henry" on #openttd
03:11<m3henry>Phone is not the best IRC client :v
03:12<Eddi|zuHause><m3henry> Would having to raise a PR discourage users from editing? <-- almost definitely
03:12<andythenorth>I wondered
03:12<andythenorth>but compared to this?
03:12<Eddi|zuHause>but so would not being able to make an account
03:13<andythenorth>from 2016-2018 I could only edit via request in forums
03:13<andythenorth>and nobody gave a fuck to fix it
03:13<andythenorth>and I made new accounts that also don't work
03:13<andythenorth>so eh, yeah, I'm somewhat biased agains the wiki
03:13-!-m3henry [] has quit [Read error: Connection reset by peer]
03:14<andythenorth>standard example of 'we must do it this way, it's the most technically correct'
03:14<andythenorth>but also broken
03:15-!-m3henry [] has joined #openttd
03:15-!-m3henry is "Henry" on #openttd
03:15<andythenorth>oh George has done AC-DC engines
03:18-!-m3henry [] has quit []
03:22<andythenorth>nice use of the feature
03:23*andythenorth must finish Horse, then make an NRT grf
03:27-!-andythenorth [] has quit [Quit: andythenorth]
03:47-!-tokai [] has quit [Quit: c('~' )o]
03:55<Eddi|zuHause><peter1138> "Must be between 6 characters and 30 characters." <-- what? you can't have the entirety of "war and peace" as your password?
03:57-!-andythenorth [] has joined #openttd
03:57-!-andythenorth is "andythenorth" on #openttd
04:03<@peter1138>Sadly not.
04:16<@peter1138>Bah, my password DB is not synced :/
05:32-!-andythenorth [] has left #openttd []
05:37<DorpsGek_II>[OpenTTD/OpenTTD] andythenorth commented on pull request #7184: Change: Distribute cargo to multiple stations or industries
05:44-!-sla_ro|master [] has quit []
05:55<DorpsGek_II>[OpenTTD/OpenTTD] PeterN commented on pull request #7184: Change: Distribute cargo to multiple stations or industries
06:00<DorpsGek_II>[OpenTTD/OpenTTD] PeterN commented on pull request #7184: Change: Distribute cargo to multiple stations or industries
06:44-!-m3henry [~oftc-webi@] has joined #openttd
06:44-!-m3henry is "OFTC WebIRC Client" on #openttd
06:47-!-keoz [~keikoz@2a01:e35:2fd5:51e0:d790:795d:2cc7:b53d] has joined #openttd
06:47-!-keoz is "Grmph" on #openttd
07:02<@peter1138>Hmm, need a matrix with lowered entries :/
07:02<@peter1138>Or... inheritence and custom drawing, maybe.
07:06-!-supermop_Home [] has joined #openttd
07:06-!-supermop_Home is "Guest" on #openttd
07:36<supermop_Home>Pikka is new tai just the color wireframe shapes for now?
07:53-!-m3henry [~oftc-webi@] has quit [Remote host closed the connection]
07:53<@peter1138>supermop_Home, yes
08:02<Eddi|zuHause>is that an upgrade or downgrade from flat scrabble tiles?
08:09<@peter1138>Ok, the chocolate cake is now gone.
08:16<Eddi|zuHause>how dares it
08:17-!-Flygon [] has quit [Read error: Connection reset by peer]
08:37-!-Samu [] has joined #openttd
08:37-!-Samu is "OFTC WebIRC Client" on #openttd
08:39<Samu>what is pikka's basic industries named?
08:46<Samu>round-robin too hard for my understanding
08:55-!-supermop_work [~supermopw@] has joined #openttd
08:55-!-supermop_work is "A CIRC user" on #openttd
08:56-!-supermop_work_ [~supermopw@] has joined #openttd
08:56-!-supermop_work_ is "A CIRC user" on #openttd
09:01<Samu>google is useless
09:02<Samu>all i can find is cpu scheduling
09:03<Samu>not helpful
09:03<Samu>and round robin tournaments
09:04-!-supermop_work [~supermopw@] has quit [Ping timeout: 480 seconds]
09:04<LordAro>the fact that it's on a cpu is irrelevant, use it
09:06<Samu>I don't see the connection
09:08<Samu>i'm not dealing with time
09:08<Samu>I don't get it
09:08<LordAro>you can treat time as just a other resource
09:18<Samu>i don't get it
09:19<Samu>dont know what round robin is nor what is supposed to do in this case
09:19<Samu>i send 1 piece of cargo to an industry at random
09:19<Samu>sometimes there's less cargo than industries
09:20<Samu>if I send it in turns, some industries get 0
09:21<Samu>if I send it at random, there's a chance every industry get it
09:21<Samu>cargo packets fragmentates amounts in many small pieces
09:21<Samu>usually 5
09:22<Samu>depending on vehicle
09:22<Samu>ships get 20 at times
09:23<Samu>trains and road vehicles get 5
09:23<Samu>and unsure about aircraft
09:24<Samu>cargo age may also dictate how many pieces are in a packet
09:24-!-tokai [] has joined #openttd
09:24-!-tokai is "Christian Rosentreter" on #openttd
09:25-!-mode/#openttd [+v tokai] by ChanServ
09:25<Samu>can fragment 1 packet of 5 pieces into up to 5 packets
09:25<Samu>then that function is only distributing 1 piece
09:25<Samu>distributing at random was the best solution I could find
09:26<Samu>avoids save game conversion
09:26<Samu>avoids some industries getting more than the others
09:26<Samu>avoids "bias"
09:27<Samu>round robin, no idea what would it do here
09:29<Samu>there was some other different implementation by someone
09:30<Samu>which requires savegame conversion, saving the data into the save for sync
09:30<Samu>let me find
09:39<DorpsGek_II>[OpenTTD/OpenTTD] btzy commented on pull request #7005: Fix #7004: Redraw linkgraph overlay correctly after zoom
09:41<Samu>where do I get Pikka's Basic Industries grf
09:43-!-nielsm [] has joined #openttd
09:43-!-nielsm is "Niels Martin Hansen" on #openttd
09:43-!-sla_ro|master [] has joined #openttd
09:43-!-sla_ro|master is "slamaster" on #sla #openttd
09:44<Samu>Is it Tal Industries?
09:49<Samu>bah i always get a crash in debug mode when i download something from bananas
09:50<nielsm>well, crash where?
09:50<Samu>when exiting openttd
09:56<Samu>launch openttd
09:56<Samu>check online content
09:56<Samu>download something
09:56<Samu>exit openttd
09:57<Samu>--------------------------- Microsoft Visual C++ Runtime Library --------------------------- Debug Assertion Failed! Program: ...OpenTTD GitHub\OpenTTD\projects\..\objs\x64\Debug\openttd.exe File: minkernel\crts\ucrt\src\appcrt\lowio\close.cpp Line: 49 Expression: (_osfile(fh) & FOPEN) For information on how your program can cause an assertion failure, see the Visual C++ documentation on asserts. (Press Retry to debug the application) -------
10:02<@peter1138>it's TaI Town.
10:04<nielsm>yeah that's saying it's trying to close a file twice
10:04<nielsm>what is trying to close what file?
10:04<@peter1138>"download something from bananas"
10:05<Samu>tick some content to download, download it
10:05<Samu>then exit
10:06<nielsm>it's a stdio handle it's trying to close
10:08<nielsm>oh well actually just closing all file handles opened with stdio.h
10:09<@peter1138>So closing an already closed file is an issue, I suppose.
10:09<nielsm>indicating something is closing file handles behind its back
10:12-!-octernion [~octernion@] has joined #openttd
10:12-!-octernion is "octernion" on #openttd
10:24<LordAro>windows specific?
10:28-!-Wormnest [~Wormnest@] has joined #openttd
10:28-!-Wormnest is "Wormnest" on #openttd
10:29-!-cHawk [] has joined #openttd
10:29-!-cHawk is "realname" on #openttd
10:31<nielsm>unknown, but may also be a problem on other platforms
10:31<nielsm>I'm not sure how to approach debugging this
10:34<@peter1138>Add a wrapper around fclose :/
10:39-!-Thedarkb-T60 [] has joined #openttd
10:39-!-Thedarkb-T60 is "realname" on #openttd #oolite
10:41<Samu>about industry stopping acceptance
10:41<Samu>it's handled
10:41<Samu>if every industry is rejecting, the while loop returns false
10:42<Samu> if (IndustryTemporarilyRefusesCargo(ind, cargo_type)) { rejected.Include(ind);
10:43<Samu>} while (num_pieces != 0 && rejected.Length() != st->industries_near.Length());
10:43<Samu>if all are rejecting, then rejected.Length will equal industries_near.Length
10:43<Samu>the loop breaks
10:44<Samu>i don't think an infinite loop will happen
10:46<@peter1138>What are you refering to?
10:47<@peter1138>I don't see him saying anything about infinite loops.
10:47<Samu>just tested pikka's grf
10:48<Samu>what is he referring to then
10:49<Samu>the tiles themselves stopping acceptance
10:49<@peter1138>He just says there may be bugs to take care of.
10:50<@peter1138>He doesn't say "this stuff happens so you'll have an infinite loop"
10:51<Samu>st->always_accepted ?
10:52<@peter1138>He doesn't refer to anything specific.
10:52<Samu>yeah, I have to guess
10:53<Samu>the part I'm touching is just the industry, the industry tiles are handled elsewhere, and I didn't touch it
10:54<@peter1138>Nothing about guessing.
10:54<Samu>unless he refers to my other PR
10:54<@peter1138>It's about making a note that things need to be fully tested, not just "i ran it and it's okay"
11:02<Samu>dont know how to implement the robin-hood thing
11:02<@peter1138>robin-hood lol
11:05<nielsm>many files are opened and closed, certainly...
11:06-!-Thedarkb-T60 [] has quit [Ping timeout: 480 seconds]
11:06<@peter1138>Samu, basically instead of using random, use a counter.
11:07<@peter1138>Store that counter inside the station struct.
11:07<@peter1138>(And it needs to be saved)
11:07<@peter1138>When you come to deliver cargo, it will be given to the next nearby industry as indicated by the counter, instead of a random one.
11:08<@peter1138>You may want a separate counter per cargo type.
11:08<DorpsGek_II>[OpenTTD/OpenTTD] SamuXarick updated pull request #7184: Change: Distribute cargo to multiple stations or industries
11:08<@peter1138>(And it needs bounds checking in case industries are added to removed)
11:09<DorpsGek_II>[OpenTTD/OpenTTD] PeterN commented on pull request #7184: Change: Distribute cargo to multiple stations or industries
11:11<nielsm>why must openening the online content browser open/close a zillion files?
11:11<@peter1138>Does it check what's available locally?
11:13<nielsm>yeah, it seems to be checking locally available files very muchj
11:13-!-Thedarkb-T60 [] has joined #openttd
11:13-!-Thedarkb-T60 is "realname" on #openttd #oolite
11:29<nielsm>that's from downloading the new content to pressing Exit and getting the assert
11:30<nielsm>(nothing happens if you get the list of content available and do not download any new items, so didn't start logging until just before clicking Download)
11:34<nielsm>okay, turns out it's actually the very first stream it attempts to close in the stdio shutdown that fails here, everything before it is called from ottd code or freetype code
11:35-!-Gja [] has joined #openttd
11:35-!-Gja is "Martin" on #ceph #bcache #openttd
11:36<Samu>the amount could be 0 if the industry doesn't want to process more cargo, not sure, have to recheck
11:37<Samu>industry is full
11:40-!-octernio_ [~octernion@] has joined #openttd
11:40-!-octernio_ is "octernion" on #openttd
11:40-!-octernion [~octernion@] has quit [Ping timeout: 480 seconds]
11:42<nielsm>ahh, I have a suspicion on the fclose assert
11:42<nielsm>might be related to gzopen/gzclose, those seem to not use fopen/fclose with FILE* streams but open/close with os handles
11:43<Samu>i guess the max stockpiled cargo could be 65535 :P
11:44<Samu>need to test this better
11:52<@peter1138>Samu, when could "min(1, xxx)" ever be less than 1?
11:52<Samu>when stockpilled cargo is 65535, if that is even possible, i'm checking
11:53<@peter1138>How so?
11:54<nielsm>why... why is zlib K&R C
11:54<Samu>i think a way to force this test would be to have a cargo packet of 65535 units
11:55<@peter1138>Samu, oh fudge, ignore me, I confused max and min :p
11:55<Samu>have a vehicle unload 65535 at a time
11:55<@peter1138>Deleted comment.
11:55<Samu>ok :|
12:05-!-Progman [] has joined #openttd
12:05-!-Progman is "Peter Henschel" on #openttd
12:08<LordAro>nielsm: ha
12:08<LordAro>presumably because it has to be compatible with *everything*
12:08<LordAro>or just because it's ancient
12:10<nielsm>anyway I should probably make a test case that tries to gzopen("file.gz", "r"); gzclose(fh); fopen("file", "r"); fclose(fp);
12:10<@peter1138>Definitelky just ancient.
12:10<nielsm>such that the two would use the same file handle in the stdlib
12:10<nielsm>then see if it triggers the bug
12:10<nielsm>because I'm really not sure why else it would fail like this
12:17-!-synchris [~synchris@] has joined #openttd
12:17-!-synchris is "Synesios Christou" on #openttd
12:27-!-supermop_work_ [~supermopw@] has quit [Ping timeout: 480 seconds]
12:36<nielsm>what it looks like is happening is that someone/something is doing the equivalent of FILE *fh = fopen(...); close(fileno(fh)); and leaving the FILE* dangling
12:40<Samu>testing copper mill
12:41<Samu>maximum copper that is stockpilled is said to be 1000, but it only starts rejecting at 1001
12:41<Samu>intended or bug?
12:42<Samu>if (IndustryTemporarilyRefusesCargo(ind, cargo_type)) { came out false and was already at 1000
12:43<Samu>this goes into newgrf code which is a complete mess for me
12:43<Samu>scope resolvers, callbacks, hex numbers, mess!
12:44<@peter1138>You don't need to care about that.
12:45<@peter1138>You only care if it's rejected or not.
12:48<Samu>pikka is the author?
12:49<Samu>it looks wrong imo
12:49<Samu>if it's 1000, it's not 1001
12:51<Samu>who's at fault here? newgrf author or openttd code?
12:54<Pikka>afaia the opt out of accepting cargo callback either accepts a cargo unload or doesn't. accepting part of the unload up to a limit isn't an option.
12:55<Pikka>I guess if there's a "fault" it's in my description of the limit.
12:55<Samu>but it's unloading 1 piece at a time
12:55<Samu>didn't stop at 1000
12:56<Pikka>then I guess it's off by one in the grf
12:57<Samu>if (HasBit(indspec->callback_mask, CBM_IND_REFUSE_CARGO))
12:57<Samu>this is hard to follow :|
12:58<Samu>GetIndustryCallback(CBID_INDUSTRY_REFUSE_CARGO, 0, indspec->grf_prop.grffile->cargo_map[cargo_type], ind, ind->type, ind->location.tile);
13:02<Samu>returns 0
13:02<Samu>when it's already at 1001
13:06<@peter1138>That's not your problem.
13:06<@peter1138>You only care that it refuses or doesn't refuse.
13:06<@peter1138>Beyond that callback is not your concern.
13:06<Samu>i want to be sure it's not openttd problem
13:07<nielsm>if the GRF callback evaluation engine mis-evaluated this, it would be a grave error that would mean every NewGRF using callbacks would fail in strange ways
13:07<nielsm>and they are not all failing
13:08<nielsm>hence it's a problem with the specific GRF in question
13:09-!-Wolf01 [] has joined #openttd
13:09-!-Wolf01 is "Wolf01" on #openttd
13:11-!-HerzogDeXtEr [] has joined #openttd
13:11-!-HerzogDeXtEr is "purple" on #openttd
13:12<nielsm>hmm yeah, GunzipFile in network_content.cpp does do some suspicious things with mixing fopen and gzclose
13:20<nielsm>ahh, nice, it's a 10 year old bug:
13:20<nielsm>well, 9 years and 15 days
13:20<nielsm>uh 9 years and 350 days
13:21-!-supermop_work [~supermopw@] has joined #openttd
13:21-!-supermop_work is "A CIRC user" on #openttd
13:22-!-gelignite [] has joined #openttd
13:22-!-gelignite is "gelignite" on #openttd
13:23<@peter1138>gzclose already closes it, right?
13:23-!-supermop_work_ [~supermopw@] has joined #openttd
13:23-!-supermop_work_ is "A CIRC user" on #openttd
13:23<nielsm>gzclose closes the file handle
13:23<nielsm>not the FILE* object
13:24<nielsm>this leaves a FILE* object hanging around the stdio library with an invalid OS file handle
13:24<nielsm>and that's why it asserts during shutdown
13:26<@peter1138>Hmmm why is my widget the wrong height :s
13:27<nielsm>either the fopen() on the input file needs to be replaced with _open(), or somehow the FILE* object needs to be destroyed without closing the file handle
13:29<@peter1138>" If you are using fileno() to get the file descriptor from a FILE *, then you will have to use dup() to avoid double-close()ing the file descriptor."
13:29-!-supermop_work [~supermopw@] has quit [Ping timeout: 480 seconds]
13:29<@peter1138>^ in the zlib docs.
13:30<@peter1138>dup(fileno()) ?
13:34-!-Thedarkb-T60 [] has quit [Ping timeout: 480 seconds]
13:34-!-Wormnest [~Wormnest@] has quit [Ping timeout: 480 seconds]
13:36-!-Thedarkb-T60 [] has joined #openttd
13:36-!-Thedarkb-T60 is "realname" on #openttd #oolite
13:37<Samu>return min(this->industry->incoming_cargo_waiting[variable - 0x40], (uint16)0xFFFF);
13:37<Samu>min(1000, 65535)
13:38<nielsm>pointless, Samu
13:38<nielsm>since incoming_cargo_waiting is uint16
13:38<nielsm>0xFFFF is its max value, the first argument to min() can never be larger than the second
13:43<nielsm>WSL session has lost its network ability again
13:43<Samu> if (this->ranges[i].low <= value && value <= this->ranges[i].high) {
13:44<Samu>.low is 0
13:44<Samu>.high is 1000
13:44<@peter1138>Well then.
13:44<@peter1138>18:06 <@peter1138> That's not your problem.
13:44-!-andythenorth [] has joined #openttd
13:44-!-andythenorth is "andythenorth" on #openttd
13:48<DorpsGek_II>[OpenTTD/OpenTTD] andythenorth commented on pull request #7184: Change: Distribute cargo to multiple stations or industries
13:48<DorpsGek_II>[OpenTTD/OpenTTD] nielsmh opened pull request #7185: Fix fdc2e85: Double close of file handles
13:48-!-Progman [] has quit [Remote host closed the connection]
13:49<nielsm>I hope the code is not too fancy :P
13:49-!-Progman [] has joined #openttd
13:49-!-Progman is "Peter Henschel" on #openttd
13:50<supermop_work_>hi andythenorth
13:50<andythenorth>lo supermop_work_
13:50<Samu>i think Pikka needs to change something on the grf side
13:50<Samu>that makes .high to be 999
13:50<Samu>not 1000
13:50<Samu>which is kinda weird
13:50<Samu>999 means 1000 in this case
13:51<nielsm>"the largest stockpile where you will still accept more cargo"
13:51<Samu>oh, where did u find that
13:52<DorpsGek_II>[OpenTTD/OpenTTD] PeterN commented on pull request #7185: Fix fdc2e85: Double close of file handles
13:52<nielsm>I just typed it
13:53<DorpsGek_II>[OpenTTD/OpenTTD] nielsmh commented on pull request #7185: Fix fdc2e85: Double close of file handles
13:54*andythenorth has been busy brexit planning
13:55<@peter1138>andythenorth, phew, nobody else has.
13:57<DorpsGek_II>[OpenTTD/OpenTTD] LordAro commented on pull request #7185: Fix fdc2e85: Double close of file handles
13:58<andythenorth>peter1138: I'm getting customer questions about it
13:58<andythenorth>I had to assess supply chain disruptions
13:58<andythenorth>so I had a look at the electricity interconnects between UK, and European mainland
13:58<andythenorth>also the island of Ireland, both political parts
13:58<andythenorth>also we kind of need to know if there will be food in the ships
13:59<andythenorth>or shops :P
13:59<andythenorth>but the typo is probably equally accurate there
13:59<DorpsGek_II>[OpenTTD/OpenTTD] nielsmh updated pull request #7185: Fix fdc2e85: Double close of file handles
13:59<andythenorth>the thing is, the customer is one of the organisations we're relying on to ensure there's food in the shops
13:59<andythenorth>so it's a bit circular
13:59<andythenorth>'you tell us'
13:59<andythenorth>'no you'
13:59<andythenorth>'no you'
14:00<andythenorth>such lolz
14:00<LordAro>sounds about right
14:03<andythenorth>so how many PRs are left?
14:03<Samu>what does the documentation say, if there's any
14:03<Samu>newgrf doc
14:04<Samu>nielsm: was it documented?
14:05<nielsm>I don't know
14:06<@peter1138>nielsm, looks better
14:06<nielsm>is it this one?
14:06<nielsm>because it documents that the callback must return 0 or 1 to indicate whether the cargo is accepted
14:07<nielsm>and nothing about how it can reach that return value
14:07<nielsm>except presumably do some range checks of its stockpile variables
14:08-!-m3henry [] has joined #openttd
14:08-!-m3henry is "OFTC WebIRC Client" on #openttd
14:08<Samu>it's 0x40
14:08<andythenorth>I read the logs, PBI is probably just an obiwan by pikka in nfo
14:08<Samu>whatever it is
14:08<andythenorth>or it's integer maths
14:08-!-Progman [] has quit [Remote host closed the connection]
14:09<andythenorth>classic derailment :)
14:09-!-Thedarkb-T60 [] has quit [Ping timeout: 480 seconds]
14:09<nielsm>there is no callback 0x40
14:11<Samu>in hex
14:11<Samu>it's something else
14:13<nielsm>3D is exactly the one I linked
14:13<Samu>looks like it
14:13<nielsm>and the minimum and maximum in action 2 switches are inclusive, exactly as defined
14:15<nielsm>so if the callback is defined as checking the industry variable for stockpiled cargo against range 0 to 1000, and return 1 if it is in that range, then yes it works exactly as designed
14:15<nielsm>and a stockpile equal to 1000 will mean it accepts
14:16<Samu>Maximum (inclusive) of the range I see
14:17-!-frosch123 [] has joined #openttd
14:17-!-frosch123 is "frosch" on #openttd
14:17<Samu>then there's nothing to do on openttd side :)
14:17<Samu>it's newgrf's fault
14:18<Samu>or design
14:18<nielsm>yes, you have reached the conclusion that callback resolution in openttd does indeed work
14:19<nielsm>imagine if the only reason it had worked for the past 10 (?) years was because everyone believed it should work, and it would have stopped working the instant you discovered it was supposed not to
14:19<andythenorth>nielsm that's a bit quantum information :P
14:20<andythenorth>also what am I doing?
14:20<Samu>the thing only returns 1 or 0, can't even compare amounts
14:20<andythenorth>diligently working on Horse issues for a Beta?
14:20-!-Progman [] has joined #openttd
14:20-!-Progman is "Peter Henschel" on #openttd
14:20<andythenorth>playing tanks?
14:20<andythenorth>figuring out why extending newgrf sucks so much, and persuading us to fix it?
14:20-!-supermop_work [~supermopw@] has joined #openttd
14:20-!-supermop_work is "A CIRC user" on #openttd
14:22-!-supermop_work__ [~supermopw@] has joined #openttd
14:22-!-supermop_work__ is "A CIRC user" on #openttd
14:25<nielsm>and btw Samu, thanks for noticing that this assert failure on exit happened specifically when you had downloaded content and not in other situations
14:25<nielsm>it was a big help in tracing down the root cause
14:25<Samu>oh, really? well no problem
14:27-!-Gja [] has quit []
14:28<Samu>it was happening since ever I started messing with virtual studio
14:28-!-supermop_work_ [~supermopw@] has quit [Ping timeout: 480 seconds]
14:28<Samu>visual* studio
14:29<nielsm>I'm guessing lots of people have encountered it since the bug was introduced but nobody noticed the cause before
14:29-!-supermop_work [~supermopw@] has quit [Ping timeout: 480 seconds]
14:31<Samu>andythenorth, it doesn't need savegame conversion if it's implemented like this
14:31<Samu>but if you want to add an option, then yes, it needs
14:32-!-supermop_work [~supermopw@] has joined #openttd
14:32-!-supermop_work is "A CIRC user" on #openttd
14:33-!-supermop_work_ [~supermopw@] has joined #openttd
14:33-!-supermop_work_ is "A CIRC user" on #openttd
14:38-!-Progman [] has quit [Remote host closed the connection]
14:39-!-supermop_work__ [~supermopw@] has quit [Ping timeout: 480 seconds]
14:39-!-Progman [] has joined #openttd
14:39-!-Progman is "Peter Henschel" on #openttd
14:40-!-supermop_work [~supermopw@] has quit [Ping timeout: 480 seconds]
14:50<Samu>and if you want a savegame conversion, I guess that also means you want the robin-round thing
14:52<@peter1138>Samu, 19:20 < Samu> the thing only returns 1 or 0, can't even compare amounts
14:52<@peter1138>Samu, yeah, that's the point of callbacks. It's the NewGRF's job to do the comparing :-)
14:53<@peter1138>round-robin would be more deterministic, which might be better.
14:53<@peter1138>Might be wasteful of space, though.
14:54<Samu>isn't random also deterministic
14:54<Samu>pseudo-random or so
14:55<Samu>i tested in a network game, it doesn't desync
14:55<Samu>let me test again, I guess, things may have changed since back then
14:58-!-supermop_work [~supermopw@] has joined #openttd
14:58-!-supermop_work is "A CIRC user" on #openttd
14:58<@peter1138>Yes but...
14:58<@peter1138>Hmm, how do you the weighting?
14:59<Samu>the what?
14:59-!-HerzogDeXtEr [] has quit [Read error: Connection reset by peer]
14:59-!-supermop_work__ [~supermopw@] has joined #openttd
14:59-!-supermop_work__ is "A CIRC user" on #openttd
14:59<DorpsGek_II>[OpenTTD/OpenTTD] PeterN opened pull request #7186: Fix #7108: Missed generate_widget script run for livery changes.
15:00<@peter1138>"it splits to all nearby stations, while still considering station rating from highest to lowest"
15:00<Samu>that's not industry
15:00<@peter1138>Oh right, that's station rating, there's no such thing as industry rating :-)
15:01<Samu>of, that's the weighting?
15:01<Samu>could be based on industry proximity to station
15:01<Samu>but currently it's just random
15:01<@peter1138>No, forget it, I was confused again.
15:04<nielsm>round-robin delivery of cargo to industries would absolutely help with things like FIRS supplies
15:04<@peter1138>nielsm, samu's patch will help, it just does it randomly.
15:04<nielsm>yeah, round-robin would be better imo
15:04<@peter1138>Which statistically may work fine.
15:05<@peter1138>RR guarantees each industry will see a bit.
15:05-!-supermop_work_ [~supermopw@] has quit [Ping timeout: 480 seconds]
15:05<nielsm>I suppose you could do a middle path
15:06-!-supermop_work [~supermopw@] has quit [Ping timeout: 480 seconds]
15:06<nielsm>each delivery takes one random value, which is used for the first industry to get any cargo, and the following are done RR
15:07<DorpsGek_II>[OpenTTD/OpenTTD] PeterN commented on pull request #7185: Fix fdc2e85: Double close of file handles
15:07<DorpsGek_II>[OpenTTD/OpenTTD] PeterN approved pull request #7185: Fix fdc2e85: Double close of file handles
15:07<@peter1138>That's quite a good idea.
15:08<@peter1138>As I understand it, the first industry will take as much as it can, or is it one at a time?
15:08<DorpsGek_II>[OpenTTD/OpenTTD] LordAro approved pull request #7186: Fix #7108: Missed generate_widget script run for livery changes.
15:08<Samu>the num_pieces is a low value
15:09<DorpsGek_II>[OpenTTD/OpenTTD] nielsmh merged pull request #7185: Fix fdc2e85: Double close of file handles
15:09<Samu>5, 10 or 20
15:09<Samu>road vehicles unload 5 at a time
15:09-!-Progman [] has quit [Remote host closed the connection]
15:09<Samu>trains too
15:09<Samu>ships can unload 20
15:09<@peter1138>Per wagon, though, no?
15:10<Samu>5 per wagon, the function is called per wagon
15:10<nielsm>each unload generates one cargo packet
15:10-!-Progman [] has joined #openttd
15:10-!-Progman is "Peter Henschel" on #openttd
15:12<@peter1138>So it looks until every industry rejects it. Makes sense.
15:13<@peter1138>And you deliver 1 piece at a time. Hmm.
15:13<@peter1138>I wonder how this affects performance on a map with lots of deliveries.
15:13<@peter1138>You are calling the NewGRF calling 5, 10 or 20 times instead of once or twice.
15:14<DorpsGek_II>[OpenTTD/OpenTTD] michicc commented on pull request #7184: Change: Distribute cargo to multiple stations or industries
15:14<andythenorth>I am broken
15:14<@peter1138>In which case it may be better to distribute min_pieces every time, and do full round-robin to ensure distribution.
15:14<andythenorth>I went climbing, everything hurts now
15:14<andythenorth>also I had a kebab
15:15<DorpsGek_II>[OpenTTD/OpenTTD] michicc merged pull request #7186: Fix #7108: Missed generate_widget script run for livery changes.
15:16<DorpsGek_II>[OpenTTD/OpenTTD] PeterN commented on pull request #7184: Change: Distribute cargo to multiple stations or industries
15:16<@peter1138>I had dinner, and then went out on a bike. But the bike is too small, so I came back before I killed my knees.
15:16<@peter1138>My MTB is dead :(
15:19<@peter1138>Who can create newgrf-specs wiki accounts?
15:20<@peter1138>LordAro, I'm gutted.
15:20<LordAro>what happened to it?
15:20<@peter1138>LordAro, it was in my garden
15:20<@peter1138>and it fell over
15:20<@peter1138>and it cracked the frame
15:20<@orudge>peter1138: They're just accounts
15:20<@peter1138>LordAro, think it must have bounced off a corner.
15:20<@peter1138>" Auto-creation of a local account failed: Automatic account creation is not allowed. "
15:20<@peter1138>orudge, I get that
15:21<andythenorth>I got that for a while
15:21<andythenorth>then I didn't
15:22<@peter1138>I even changed my tt-forums password in case is was something like it being ancient.
15:22<@peter1138>And lol, that password was bad.
15:22<andythenorth>yeah I did all this
15:22<@peter1138>And then I discovered by dropbox isn't syncing.
15:22<@orudge>peter1138: interesting
15:22<andythenorth>then one day it started working again
15:22<@peter1138>So I had to a password reset anyway.
15:22<@orudge>It could be that it has been broken for years and nobody's complained
15:22<andythenorth>on my original account and password
15:22<andythenorth>I complained a lot :)
15:22<@peter1138>Well, I need to update the wiki else someone will complain at me :D
15:22<nielsm>I think I don't have a working login for newgrf-wiki either
15:23<andythenorth>post your wiki updates in a thread on tt-f
15:23<andythenorth>and the community will update the wiki for you
15:23<nielsm>[citation needed]
15:23<nielsm>[quote]this good enough?[/quote]
15:24<@peter1138>garryg seems an interesting fellow
15:24<andythenorth>he is
15:24<@peter1138>Can't seem to decide if his industry newgrf should be 32 or 64 cargos :p
15:24<@orudge>peter1138: Were you at one point "petern" on the wiki?
15:24<andythenorth>he has a brain injury of some kind, but he makes loads of nice grfs
15:24<@peter1138>orudge, erm, possible.
15:24<@peter1138>andythenorth, yeah, I figured. He's not unpleasant at all.
15:24<@orudge>There's a petern user there, I wonder if we changed your username on the forums and it hasn't changed here, or similar
15:25<@peter1138>" The supplied credentials could not be authenticated. "
15:25<@peter1138>Think you've got it.
15:25<@peter1138>Stupid me, changing my name.
15:25<@orudge>I'll get the wiki account renamed
15:26<@peter1138>Thanks <3
15:27<Samu>testing for a desync while having dinner, afk
15:27<@peter1138>I don't think it'll desync.
15:28<@orudge>"The user "Petern" does not exist." while trying to rename, helpful
15:43-!-supermop_work [~supermopw@] has joined #openttd
15:43-!-supermop_work is "A CIRC user" on #openttd
15:47-!-glx [] has joined #openttd
15:47-!-mode/#openttd [+v glx] by ChanServ
15:47-!-glx is "Loïc GUILLOUX" on +#openttd
15:49<@orudge>peter1138: can you try to log in to the grfspecs wiki now?
15:50-!-supermop_work__ [~supermopw@] has quit [Ping timeout: 480 seconds]
15:51<nielsm>orudge, I can't log in either :) username on forums jfs, might have been G4S once upon a time
15:52<@orudge>nielsm: what error do you get? Is it the "auto-creation" error?
15:53<nielsm>Auto-creation of a local account failed: Automatic account creation is not allowed.
15:53<@planetmaker>hm... I got previously an SSL_ERROR_NO_CYPHER_OVERLAP on tt-f. But that's gone now
15:56<@orudge>nielsm: can you try again now?
15:56<nielsm>nope still not
15:57<nielsm>and just logged out and back in on forums to confirm password :P
16:01<@orudge>nielsm: could you try one more time?
16:02<nielsm>still not :(
16:04-!-octernion [~octernion@] has joined #openttd
16:04-!-octernion is "octernion" on #openttd
16:05-!-gelignite [] has quit [Quit: Good fight, good night!]
16:09-!-octernio_ [~octernion@] has quit [Ping timeout: 480 seconds]
16:15-!-Thedarkb-T60 [] has joined #openttd
16:15-!-Thedarkb-T60 is "realname" on #openttd #oolite
16:20<@peter1138>orudge, works, thanks :-)
16:22<@peter1138>Hmm, the wiki wants ottd svn revision :p
16:23<@orudge>nielsm: can you try now, perhaps in a different browser/fresh browsing session?
16:24<@orudge>I was just able to log in with a brand new user
16:24<nielsm>yep worked now
16:24<@orudge>No problem, thanks for letting me know
16:25<@peter1138>Sorry to have mess you around.
16:25<@orudge>No, sorry it was broken!
16:28<@peter1138>" Initial planning for the Transport Tycoon Forums Meet 2017, which is taking place in Birmingham, UK "
16:28<@peter1138>Did it?
16:28<@orudge>It did!
16:28<@orudge>And some people even turned up
16:28<@orudge>We had cake
16:28<@peter1138>And I wasn't around at that point.
16:29<@peter1138>Also I'm about twice the age of everyone else :p
16:29<@peter1138>Well, not any more, heh.
16:29<@orudge>Some of our younger users are probably half my age now, at any rate
16:30*andythenorth wonders about cleaning up some forum stickies :)
16:30<andythenorth>this one is quite dead :)
16:31<andythenorth>this one should really just delegate to github :)
16:32<@peter1138>Is it stickied?
16:33<andythenorth>this one could do with going to github too
16:33<@peter1138>OS X fonts?
16:33<andythenorth>I have some
16:33<@peter1138>Strange, I don't see stickied posts then.
16:35<@peter1138>Ah, cos my settings don't show older posts by default.
16:35<@peter1138>And stickied posts apparently still count as threads. Nice.
16:40-!-frosch123 [] has quit [Quit: be yourself, except: if you have the opportunity to be a unicorn, then be a unicorn]
16:40-!-synchris [~synchris@] has quit [Quit: yeeha!]
16:47-!-supermop_work [~supermopw@] has quit [Ping timeout: 480 seconds]
16:56<@planetmaker>adjusted as of your reply @ andy
17:03<andythenorth>thanks :)
17:03<DorpsGek_II>[OpenTTD/OpenTTD] SamuXarick updated pull request #7184: Change: Distribute cargo to multiple stations or industries
17:08-!-nielsm [] has quit [Ping timeout: 480 seconds]
17:09-!-sla_ro|master [] has quit []
17:12<DorpsGek_II>[OpenTTD/OpenTTD] PeterN opened pull request #7187: Change: Add scrollbar to cargo legend in cargo payment rates window.
17:16-!-Progman [] has quit [Remote host closed the connection]
17:20-!-Flygon [] has joined #openttd
17:20-!-Flygon is "Flygon" on #openttd
17:33-!-andythenorth [] has quit [Quit: andythenorth]
17:36<+glx>hey #7186 was squirrel_export, not generate_widgets
17:37<+glx>but I guess you ran both anyway
17:38<LordAro>really need to add both of those to the commit hooks somehow
17:38<@peter1138>It proves I should continue my build changes to always build them.
17:38<+glx>yes better to integrate in the flow
17:39<@peter1138>I have most of it working, anyway.
17:39<@peter1138>At least for Makefile, I don't remember if I got anywhere with MSVC :-)
17:41-!-octernion [~octernion@] has quit [Quit: octernion]
17:43-!-Wolf01 [] has quit [Quit: Once again the world is quick to bury me.]
17:46-!-keoz [~keikoz@2a01:e35:2fd5:51e0:d790:795d:2cc7:b53d] has quit [Ping timeout: 480 seconds]
17:50-!-Thedarkb1-T60 [] has joined #openttd
17:50-!-Thedarkb1-T60 is "realname" on #openttd #oolite
17:51<Samu>peter1138: there's still problems with multiple AIs in multiplayer :(
17:52<+glx>hehe indeed you ran generate_widgets in #7108 :)
17:52<Samu>i clicked reload AI in one of the AIs
17:52<Samu>got that error on the left
17:52<+glx>but it would be better to just run both script in one command
17:53<Samu>the other on the right which was connected to the server, timed out after 20 seconds, and i guess it crashes when heading to main meny
17:53<@peter1138>^ I dunno, that might be fixed by the last commit?
17:54<@peter1138>Or it's just somethign that's always happened.
17:54<@peter1138>And I should just ignore you.
17:55-!-Thedarkb-T60 [] has quit [Ping timeout: 480 seconds]
17:57<Samu> the error on the client wasn't in that last image
17:57<@peter1138>Why are you telling me?
17:58<+glx>but you should do the testing in clean master
17:59<Samu>the one with 1 day per company?
17:59<Samu>1 company per day
18:00<@peter1138>No, clean master.
18:02-!-octernion [~octernion@] has joined #openttd
18:02-!-octernion is "octernion" on #openttd
18:03-!-octernion [~octernion@] has quit []
18:03<Samu>shouldn't do any different
18:03<Samu>but let's see
18:03<@peter1138>Probably but that's not the point.
18:04<@peter1138>Then I suggest posting an issue to github.
18:04<@peter1138>Following the template.
18:04<@peter1138>Then maybe someone else can replicate it.
18:04<Samu>steps to reproduce
18:04<@peter1138>But I'm going to bed.
18:04<Samu>needs a server and a client
18:04<Samu>gonna be tough
18:05<+glx>always check if issue happens in master before reporting :)
18:05<+glx>that's rule number 1
18:05<@peter1138>Just document your steps.
18:09<Samu>got it!
18:11<Samu>it doesn't always happen
18:11<Samu>only sometimes
18:12<Samu>i get two crash reports, do I send them in?
18:12<+glx>txt may help, dmp is useless
18:13<+glx>because dmp requires your exe and pdb as you built yourself
18:13<LordAro>glx: should it not be the same as one that you built on your system?
18:14<LordAro>(assuming clean master, etc etc)
18:14<+glx>no msvc can do things differently on each build
18:14<LordAro>that's rather irritating
18:15<+glx>but pdb always match the generated exe :)
18:22-!-m3henry [] has quit [Quit: Page closed]
18:28<DorpsGek_II>[OpenTTD/OpenTTD] SamuXarick opened issue #7188: Both server and client crash, AI related
18:35<Samu>oops, the crash logs are equal :(
18:47-!-Gustavo6056 [~Gustavo60@2804:14d:4cd8:81a4:8dc5:b2ea:7366:705c] has joined #openttd
18:47-!-Gustavo6056 is "Non dico nomen." on #openttd #oftc #moocows
18:52-!-Gustavo6046 [~Gustavo60@] has quit [Ping timeout: 480 seconds]
18:52-!-Gustavo6056 is now known as Gustavo6046
19:00<Samu>for the client crash, I think the problem is here at network_client.cpp line 1176 and 1174 should be switched
19:01<Samu>CloseConnection makes _networking = false, and when the save occurs, it is already saving with no network
19:01<Samu>there is no instance running on the client, only on the server
19:01<Samu>should save empty
19:01-!-supermop_work [~supermopw@] has joined #openttd
19:01-!-supermop_work is "A CIRC user" on #openttd
19:01-!-tokai|noir [] has joined #openttd
19:01-!-mode/#openttd [+v tokai|noir] by ChanServ
19:01-!-tokai|noir is "Christian Rosentreter" on +#openttd
19:03-!-supermop_work_ [~supermopw@] has joined #openttd
19:03-!-supermop_work_ is "A CIRC user" on #openttd
19:06<+glx>oh add that to the issue
19:07<DorpsGek_II>[OpenTTD/OpenTTD] SamuXarick commented on issue #7188: Both server and client crash, AI related
19:08-!-tokai [] has quit [Ping timeout: 480 seconds]
19:08<Samu>i actually wonder
19:08<Samu>save empty
19:09<Samu>gonna test brb
19:10-!-supermop_work [~supermopw@] has quit [Ping timeout: 480 seconds]
19:11<Samu>weird, there are two emergency saves
19:11<Samu>shouldn't 1 be enough?
19:12<Samu>CloseConnection does an emergency save
19:12<Samu>then another is done after the error message
19:13<Samu>is that the intention?
19:13<+glx>I edited your comment to link to the code
19:14<+glx>indeed seems there's too much saving
19:15<Samu>even the error message is repeated
19:17<LordAro>make a note of it in the issue
19:17-!-Thedarkb1-T60 [] has quit [Ping timeout: 480 seconds]
19:17<LordAro>it's not directly related, but can probably be fixed easily at the same time
19:17<LordAro>not worth an extra issue
19:19<+glx>anything useful must go in the issue :)
19:20-!-Thedarkb1-T60 [] has joined #openttd
19:20-!-Thedarkb1-T60 is "realname" on #openttd #oolite
19:21<LordAro>Samu: please try to write things properly, don't just copy irc logs
19:21<LordAro>there's so much extra crap in that text
19:23<Samu>ok edited
19:24<DorpsGek_II>[OpenTTD/OpenTTD] glx22 commented on issue #7188: Both server and client crash, AI related
19:24<+glx>that's the useful info :)
19:27<+glx>and maybe other calls should be checked too
19:27<Samu>May 24 2018, it's recen
19:29<+glx>yes it's recent, but rare enough so it was not reported yet
19:36<Samu>no more crash for client
19:36<Samu>this was indeed the problem
19:37<Samu>as for server, gonna investigate now
19:38<DorpsGek_II>[OpenTTD/OpenTTD] nikolas updated pull request #7086: Change #6173: Update SDL driver to use SDL 2.0
19:40-!-supermop_work_ [~supermopw@] has quit [Ping timeout: 480 seconds]
19:40<Samu>company 2 is the exact one i told to reload ai
19:46<Samu>assert(this->suspend < 0);
19:46<Samu>this->suspend is 0
19:46<Samu>0 < 0 false, and asserts
19:46<Samu>int suspend; ///< The amount of ticks to suspend this script before it's allowed to continue.
19:47<Samu>it was never suspended, it's not even started
19:47<Samu>it's right about to start a new one
19:48<Samu>it's trying to execute an out of date DoCommand?
19:49<Samu>the script that was removed before the Reload was probably suspended
19:49<Samu>the script that is about to start is fresh
19:49<Samu>how to solve
20:21<DorpsGek_II>[OpenTTD/OpenTTD] glx22 commented on issue #7188: Both server and client crash, AI related
20:21<+glx>that's where to solve
20:23<Samu>heh I figured as much
20:23<Samu>was also eyeing that
20:25<Samu>the company exist
20:25<Samu>the instance exists
20:25<Samu>both company and instance are already post reload
20:25<+glx>yes but it then assumes it's the AI that called the command
20:26<Samu>but it wasn't
20:26<+glx>and of course it expect it to be suspended and waiting for the Continue() call
20:26<Samu>it was the one pre-reload
20:27-!-Wormnest [~Wormnest@] has joined #openttd
20:27-!-Wormnest is "Wormnest" on #openttd
20:27<Samu>what kind of test to put there :|
20:29<+glx>try adding || !c->ai_instance->is_started
20:31<Samu>it is started
20:32<+glx>are you sure ?
20:32<Samu>but let's try
20:32<+glx>is_started means fully initialised
20:33<Samu>is_started = true
20:33<Samu>can't access is_started anyway
20:34<+glx>ah yes it's private
20:38<Samu>it's protected, not sure if it's the same as private
20:39<+glx>not accessible from outside in both case
20:39<Samu>IsSleeping is public
20:40<Samu>bool IsSleeping() { return this->suspend != 0; }
20:40<Samu>gonna try this
20:40<Samu>if (c == NULL || c->ai_instance == NULL || !c->ai_instance->IsSleeping() ) return;
20:41<+glx>should prevent the crash I think
20:45-!-Thedarkb-X40 [] has joined #openttd
20:45-!-Thedarkb-X40 is "realname" on #openttd #/r/openttd #oolite
20:50<Samu>still crash
20:51<Samu>gonna rebuild again just to make sure
20:52-!-Thedarkb1-T60 [] has quit [Ping timeout: 480 seconds]
21:00<Samu>assert(this->suspend < 0);
21:00<Samu>1 < 0
21:01<+glx>hmm for network games it should never be >0 IIRC
21:01<Samu>that IsSleeping only checks this->suspend != 0
21:02<+glx>yes because for single player suspend is >0 when suspended
21:02<+glx>but for network it's <0
21:03<+glx> if (this->suspend < -1) this->suspend++; // Multiplayer suspend, increase up to -1.
21:03<+glx> if (this->suspend < 0) return; // Multiplayer suspend, wait for Continue().
21:03<+glx> if (--this->suspend > 0) return; // Singleplayer suspend, decrease to 0.
21:03<+glx>that's how it works
21:03<+glx>if it's >0 in network, something is wrong
21:04<Samu>the command was queued 2 ticks away?
21:04<Samu>erm, behind*
21:05<+glx>or Continue() has been called when suspend was < -1
21:05<Samu>could 250000 #opcodes be part of it?
21:05<Samu>there can be only too many commands queued, right?
21:05<Samu>just wondering
21:06<+glx>no, once your AI did a DoCommand it will be suspended until it get the result
21:07<Samu>but the command is not yet sent
21:07<Samu>it's queued first
21:07<Samu>next tick is executed, unless the queue is full or something that it makes it require 2 ticks?
21:08<Samu>i don't know, just trying to figure out
21:08<+glx>script_object.cpp:310 the command is "sent"
21:08<+glx>line 342 the script is suspended, and will wait for Continue()
21:12<Samu>delay = 1
21:12<Samu>which should turn to -1
21:12<Samu>according to that line
21:12<+glx>yes but that's working correctly
21:13<Samu>seems to be the new instance starting that's setting it to 1?
21:13<+glx>the problem is the new AI yes
21:14<Samu>during initialization?
21:14<+glx>no on creation it's 0
21:14<Samu>that's strange
21:14<Samu>then what sets it to 1?
21:22<+glx>script_instance:192 add assert(!_networking || this->suspend <= 0); same lines 222 and 243
21:25<+glx>but I think the AI called Sleep()
21:26<+glx>then the command from the old AI returned
21:27<Samu>_networking is undefined :|
21:28-!-Wormnest [~Wormnest@] has quit [Quit: Leaving]
21:29<+glx>add #include "../network/network.h"
21:29<+glx>around line 31
21:30<Samu>assertion failed right away
21:30<+glx>I think it may assert even before you restart the AI
21:31<Samu>game was just starting
21:31<+glx>an AI called Sleep() probably
21:31<Samu>line 222
21:32<+glx>but that's for constructor and Start
21:32<Samu>this->suspend = 1
21:32<Samu>1 <= 0
21:32<+glx>there's a Sleep(1) in Start() ?
21:33<Samu>how would I know?
21:33<+glx>check the AI source
21:34<Samu>heh, i dont even know which ai started, it picked randomly
21:34<Samu>the GS started
21:35<+glx>yes makes sense the GS use Sleep()
21:35<Samu>i think the GS is NoCarGOal
21:36<Samu>yep, NoCarGoal
21:36<+glx>but indeed the only reason suspend can be > 0 is Sleep
21:37<+glx>and it's usually ok, except in case the AI is restarted with pending commands
21:37<Samu> // Wait for the game to start this.Sleep(1);
21:37<Samu>yes, it has a Sleep
21:38<+glx>you can remove the asserts and the include
21:41<+glx>I think we need to add IsWaiting()
21:42<+glx> bool IsWaiting() { return this->suspend < 0; } after IsSleeping() in script_instance.hpp
21:42<+glx>and use it in CcAI
21:45<+glx>we want to care about the command result only if we are waiting for it
21:46<+glx>hmm but that could go wrong if we use DoCommand() but receive the previous result
21:49<Samu>can't get an assert anymore
21:49<+glx>yes no assert because we check before the call
21:50<Samu>what could go wrong now?
21:51<Samu>receive the result
21:51<Samu>what will it do to the result?
21:51<+glx>the old AI called a command, is stopped, the new AI call a command, receive result of old AI call
21:52<Samu>I see
21:52<+glx>if the new call happens after the result, no problem because it has been discarded
21:52<+glx>but if it happens before
21:53<Samu>it'd be put in a que first
21:53<+glx>yes and results are given in order
21:55<Samu>wasn't the command called Sleep?
21:56<+glx>no Sleep() is when the AI decides to sleep
21:56<+glx>no need to wait for the server in that case
21:56<+glx>indeed Continue() just convert the remaining waiting time in sleep time
21:57<+glx>so for multiplayer AI stopping is "wrong"
21:58<Samu>would it mean the old AI could cause the new AI sleep for the time determined by the old ai? that's funny
21:59<+glx>the old AI can't do anything to the new AI
22:00<+glx>except the possible incorrect command result
22:04<+glx>but that won't be easy to prevent
22:04-!-Thedarkb-X40 [] has quit [Ping timeout: 480 seconds]
22:07-!-Speedy` [] has quit [Ping timeout: 480 seconds]
22:08-!-HerzogDeXtEr [] has joined #openttd
22:08-!-HerzogDeXtEr is "purple" on #openttd
22:09<Samu>line 681 of script_instance.cpp ?
22:09<Samu>doesn't look that serious
22:09<Samu>important, i mean
22:10<Samu>hmm, it sets a bunch of variables
22:10<+glx>yeah probably very low probability to happen
22:12<Samu>this one may be the serious one
22:12<Samu>if i understand what it do, it will subtract money from the new company?
22:12<+glx>but that won't be the place to fix the possible issue
22:13<+glx>it's more in AI:Stop() side
22:13<Samu>oh oh, crash
22:13<+glx>where ?
22:14<Samu>> openttd.exe!SQClass::Mark(SQCollectable * * chain) Line 529 C++
22:14<Samu>the only thing in the call stack
22:14<Samu>nothing else
22:14<Samu>1 line
22:15<Samu>void SQClass::Mark(SQCollectable **chain)
22:16<Samu>Unhandled exception at 0x00007FF63B8C42CF in openttd.exe: 0xC0000005: Access violation writing location 0x000000B8988BFFD0. occurred
22:16<Samu>Exception thrown at 0x00007FF63B8C42CF in openttd.exe: 0xC0000005: Access violation writing location 0x000000B8988BFFD0. occurred
22:17<+glx>that's the garbage collector
22:19<Samu>what does it do?
22:20<+glx>memory cleaning
22:28<+glx>and it's initiated in only 2 places AI::GameLoop() and Game::GameLoop()
22:37-!-debdog [~debdog@2a00:79c0:612:9600:7a24:afff:fe8a:d04d] has joined #openttd
22:37-!-debdog is "Wowbagger" on #openttd #bitlbee
22:38-!-Gustavo6046 [~Gustavo60@2804:14d:4cd8:81a4:8dc5:b2ea:7366:705c] has quit [Ping timeout: 480 seconds]
22:40-!-D-HUND [~debdog@2a00:79c0:667:ac00:7a24:afff:fe8a:d04d] has quit [Ping timeout: 480 seconds]
22:51-!-HerzogDeXtEr [] has quit [Read error: Connection reset by peer]
23:01-!-Mahjong1 [~qq@2a00:23c5:6526:4400:3d11:820b:d645:fa17] has joined #openttd
23:01-!-Mahjong1 is "realname" on #ohnx #openttd
23:02<DorpsGek_II>[OpenTTD/OpenTTD] nikolas opened issue #7189: fluidsynth driver plays music too loudly
23:08-!-Mahjong [] has quit [Ping timeout: 480 seconds]
23:24-!-Samu [] has quit [Quit: Page closed]
23:36-!-glx [] has quit []
---Logclosed Thu Feb 07 00:00:54 2019