Back to Home / #openttd / 2019 / 03 / Prev Day | Next Day
#openttd IRC Logs for 2019-03-23

---Logopened Sat Mar 23 00:00:24 2019
00:00-!-tokai|noir [] has quit [Ping timeout: 480 seconds]
00:27-!-glx [] has quit []
00:38<Samu>wow, they're making it a big deal...!/UC-lHJZR3Gqxm24_Vd_AJ5Yw$$UCq-Fj5jknLsUf-MWSy4_brA
00:39-!-Samu [] has quit [Quit: Leaving]
01:09-!-Thedarkb-X40 [] has quit [Ping timeout: 480 seconds]
02:10-!-sla_ro|master [] has joined #openttd
02:10-!-sla_ro|master is "slamaster" on #sla #openttd
02:36-!-andythenorth [] has joined #openttd
02:36-!-andythenorth is "andythenorth" on #openttd
03:00-!-sla_ro|master [] has quit []
03:12-!-Alberth [] has joined #openttd
03:12-!-mode/#openttd [+o Alberth] by ChanServ
03:12-!-Alberth is "purple" on @#openttd
03:12-!-Progman [] has joined #openttd
03:12-!-Progman is "Peter Henschel" on #openttd
03:38<andythenorth>hi Alberth
03:39<andythenorth>_probably_ not java Alberth
03:46<DorpsGek_II>[OpenTTD/OpenTTD] PeterN commented on pull request #7165: [core] Implement SmallVector using std::vector
03:50<andythenorth>I have no information on the 'Python is slow' problem
03:51<andythenorth>might be easiest to just go to C++?
03:52<@Alberth>safest, at least, and generally accepted
03:53<andythenorth>then we could distribute a cross-platform binary?
03:53<andythenorth>avoid all the python packaging problems
03:53<@Alberth>computers without default installed python aren't useful anyway :p
03:54<@Alberth>but yeah, just compile it at all relevant platforms
03:56-!-nielsm [] has joined #openttd
03:56-!-nielsm is "Niels Martin Hansen" on #openttd
03:57<andythenorth>not sure how maintainability is affected by python vs C++
03:57<@LordAro>needs some profiling, before making assumptions
03:58<andythenorth>I think maintainability is +/-0
03:59<andythenorth>lots of contributors here dislike python
03:59<andythenorth>nml has fallen into a poor maintenance state
03:59<andythenorth>python helps me maintain trivial things like constants, but I can't work with the parser / lexer :P
04:00<@Alberth>LordAro: expression optimizing is done too often, but it's pretty much impossible to say which ones are actually needed
04:00<@Alberth>it can't get much worse than current nml :)
04:00<andythenorth>a spike rewrite to C++? o_O
04:01<andythenorth>pick a subset of features, and make a minimally functional compile?
04:01<@Alberth>could be an option
04:02<@Alberth>just grfid, I bet :p
04:02<@Alberth>maybe town names?
04:12<DorpsGek_II>[OpenTTD/OpenTTD] PeterN commented on pull request #7165: [core] Implement SmallVector using std::vector
04:13<@peter1138>LordAro, "this line looks potentially wrong" ... which line? :p
04:14<@peter1138>I think github is being silly to me :/
04:14<@peter1138>Oh yes, I didn't mention the line number either, oops.
04:15<@peter1138>But yes, that's the offending one.
04:17<nielsm>wth you never required that before during the point updates?
04:22-!-nielsm [] has quit [Quit: wroom]
04:25-!-nielsm [] has joined #openttd
04:25-!-nielsm is "Niels Martin Hansen" on #openttd
04:46-!-Wolf01 [] has joined #openttd
04:46-!-Wolf01 is "Wolf01" on #openttd
04:54<@LordAro>peter1138: :)
05:24*Pikka dindins
05:35<DorpsGek_II>[OpenTTD/OpenTTD] TrueBrain commented on pull request #7376: Fix 011257d: Enforce the max_no_competitors and network.max_companies tests before creating an AI company in multiplayer.
05:35<TrueBrain>who made Samu write a PhD on the issue? :P
05:35<andythenorth>it was me!
05:36<andythenorth>or not
05:36<andythenorth>'s a TrueBrain
05:43<TrueBrain>hmm .. how to backport language changes ..
05:43<TrueBrain>I know people had clever scripts for that ..
05:47<DorpsGek_II>[OpenTTD/OpenTTD] TrueBrain opened pull request #7397: Backport marked PRs to 1.9
05:49<TrueBrain>should, once merged, this also be backported: ?
05:49<TrueBrain>(given it is linked to a ticket that I just backported)
05:49<TrueBrain>LordAro, happen to know?
05:52<andythenorth>FIRSes then?
05:54<TrueBrain>can't find scripts people created/used to backport languages
05:59<DorpsGek_II>[OpenTTD/OpenTTD] TrueBrain updated pull request #7397: Backport marked PRs to 1.9
06:01-!-HerzogDeXtEr [] has joined #openttd
06:01-!-HerzogDeXtEr is "purple" on #openttd
06:02<DorpsGek_II>[OpenTTD/OpenTTD] M3Henry commented on pull request #7165: [core] Implement SmallVector using std::vector
06:04<DorpsGek_II>[OpenTTD/OpenTTD] nielsmh commented on issue #7371: Kdtree is built too early in savegame loading process
06:05-!-Alberth [] has left #openttd []
06:09<nielsm>hmm something missing? :(
06:10<TrueBrain>what did you dooooooo :D
06:11<nielsm>just loaded it :|
06:11<nielsm>all newgrfs are in place
06:14<TrueBrain>hmm .. I forgot that modifying a patch in place is difficult, because it also tracks 'adds' and 'removes'
06:24<DorpsGek_II>[OpenTTD/OpenTTD] nielsmh opened pull request #7398: Fix #7371: Avoid dependency on foundations of town tile during saveload
06:37<TrueBrain>patch files are picky :D
06:37<TrueBrain>if a chunk has no changes, it errors
06:37<TrueBrain>so how can I, in a streaming way, remove additions .. hmm
06:38<TrueBrain>I don't want to complicate my script by tracking chunks :(
06:43<nielsm>gah I wish assert breaks in the VS debugger would take me to the assert call, instead of inside the assert library code
06:48-!-m3henry [] has joined #openttd
06:48-!-m3henry is "realname" on #openttd
06:49<TrueBrain>ghehe, yes, yes indeed
06:56-!-circ-user-3HYVs [] has quit [Ping timeout: 480 seconds]
06:59<nielsm>hmm did we do the changes from /*virtual*/ to c++11 "override" qualifier?
07:07<DorpsGek_II>[OpenTTD/OpenTTD] TrueBrain updated pull request #7397: Backport marked PRs to 1.9
07:07<TrueBrain>lets see if I did this correctly :D
07:10<TrueBrain>no language errors; so I guess I did :)
07:12<TrueBrain>115 lines of Python
07:12<TrueBrain>I should store this somewhere ..
07:12<nielsm>I guess it's not a catastrophe if the 1.9 lang files end up containing a new string only necessary for 1.10
07:13<TrueBrain>the main issue for me were strings that were modified in 1.10
07:13<TrueBrain>you don't want those in 1.9 :)
07:13<TrueBrain>so I wrote a simple script that ignores any id that is changed in master (from release branch), and ignores those lines in the translations
07:14<TrueBrain>both removal, additions or modification
07:14<TrueBrain>"best effort" :D
07:15-!-Samu [] has joined #openttd
07:15-!-Samu is "realname" on #openttd
07:15<TrueBrain>hmm .. how can we poke translators to fix those '35' outdated strings and stuff ..
07:16-!-Thedarkb-T60 [] has joined #openttd
07:16-!-Thedarkb-T60 is "realname" on #openttd #oolite
07:16<TrueBrain>do we normally email them or something?
07:17<TrueBrain>many have not been updated for 1.9, it seems
07:17<TrueBrain>German even is outdated :P
07:19<nielsm>maybe? no idea
07:20<Samu>TrueBrain, I made a small mistake. On the last tick, both DC_TEST and DC_EXEC are run, they both fail on my patch
07:21<Samu>I edited it
07:22<nielsm>I'm amazed the latin translation is among the almost complete ones...
07:22<Samu>as for trying to start multiple AIs in just one command... I don't know how to do that
07:23<Samu>I mean, I know, but I don't think it will work
07:23<Samu>OnTick_Companies never stops being called
07:23<nielsm>Samu: My suggestion for fixing AIs starting correctly "simultaneously" would be to send the next "start AI" command within the execution of the previous
07:40<Samu>I'm always worried about OnTick_Companies
07:41<TrueBrain>nielsm: that would work too; I would just add the 'amount of AIs to start' to that command, and loop in there :)
07:41<TrueBrain>just moving of code, basically
07:42<Samu>but OnTick_Companies...
07:42<TrueBrain>nielsm: funny, tail recursion or loop recursion :D
07:42<Samu>uhm, so it starts 10 AIs as 1 command, then next tick it could do the same
07:42<Samu>start 10 more
07:43<DorpsGek_II>[OpenTTD/OpenTTD] nielsmh opened pull request #7399: Fix #7374: Ensure k-d trees are always updated when station sign moves
07:44<Samu>explain, I'm failing to understand
07:45<nielsm>buried in kdtrees atm, want to finish these up before thinking too much about other things
07:59-!-Alberth [] has joined #openttd
07:59-!-mode/#openttd [+o Alberth] by ChanServ
07:59-!-Alberth is "purple" on @#openttd
08:04<DorpsGek_II>[OpenTTD/OpenTTD] nielsmh commented on pull request #7376: Fix 011257d: Enforce the max_no_competitors and network.max_companies tests before creating an AI company in multiplayer.
08:05<Samu>ah bitmask magic
08:06<Samu>i think you mean 15 bits
08:06<Samu>but i see it can work
08:07<nielsm>may as well reserve a full 16 (initially) instead of making some weird odd positions
08:08<Samu>OnTick_Companies will still be queued a second time
08:08<Samu>but fail against the bitmask
08:09<Samu>instead of dozens of commands failing, it's just 1 or so
08:12-!-synchris [~synchris@] has joined #openttd
08:12-!-synchris is "Synesios Christou" on #openttd
08:13<Samu>actually, I'm not sure
08:21-!-DrSegfault [] has left #openttd [ - Chat comfortably. Anywhere.]
08:25<Samu>will have to make changes in AI::GetStartNextTime()
08:25<Samu>for some reason, this doesn't look like it's not another hack
08:28<m3henry>nielsm: #7324 has merge conflicts, but I can resolve them tomorrow
08:31-!-gelignite [] has joined #openttd
08:31-!-gelignite is "gelignite" on #openttd
08:45-!-gelignite [] has quit [Quit: Good fight, good night!]
08:50<DorpsGek_II>[OpenTTD/OpenTTD] M3Henry updated pull request #7324: Codechange: [C++11] Use override specifer for overriding member declarations
08:50<m3henry>Actually it didn't take long xD
09:08-!-Thedarkb-T60 [] has quit [Ping timeout: 480 seconds]
09:11-!-m3henry [] has quit [Quit: Leaving]
09:14-!-Flygon [] has quit [Quit: A toaster's basically a soldering iron designed to toast bread]
09:14<Samu>DoCommandP(0, CCA_NEW_AI | INVALID_COMPANY << 16, 1 | << 1 | num_to_start << 5, CMD_COMPANY_CTRL);
09:15<Samu>i dont know about the bitsmask
09:16<Samu>must work on a bitmask thing
09:17<@Alberth>not working mostly
09:18<@Alberth>CCA_NEW_AI | INVALID_COMPANY << 16 is interpreted as (CCA_NEW_AI | INVALID_COMPANY) << 16 rather than the most often intended CCA_NEW_AI | (INVALID_COMPANY << 16)
09:19<nielsm>also you probably should not store data in the command number?
09:19<nielsm>I'm misreading
09:19<Samu>INVALID_COMPANY is meant to start AI as spectator
09:19<@peter1138>AI specatator? What?
09:20<Samu>the command is issued by 255
09:20<Samu>it's fine
09:20<@Alberth>AIs like to watch too :p
09:20<Samu>I didn't change that, it's how the command is issued
09:21<Samu>the owner of the command
09:21<@Alberth>that doesn't mean it makes sense :)
09:22<Samu>i fail at explaining
09:22-!-andythenorth [] has quit [Quit: andythenorth]
09:23<Samu>it's a DoCommand thing that stuff are executed as Spectators
09:34<@peter1138>nielsm, so did you forget to compile?
09:34-!-Thedarkb-T60 [] has joined #openttd
09:34-!-Thedarkb-T60 is "realname" on #openttd #oolite
09:41<Samu>sorry nielsm I don't think I can do what you asked
09:41<Samu>it's becoming hackier
09:41<Samu>as TrueBrain would say
09:43<TrueBrain>please don't put words in my mouth; that is not a nice thing
09:45<DorpsGek_II>[OpenTTD/OpenTTD] nielsmh updated pull request #7399: Fix #7374: Ensure k-d trees are always updated when station sign moves
09:51<DorpsGek_II>[OpenTTD/OpenTTD] PeterN commented on pull request #7398: Fix #7371: Avoid dependency on foundations of town tile during saveload
09:51<@Alberth>strcmp result swaps sign if you swap arguments :p
09:58<Samu>this is starting to look like a terrible mess
10:09-!-Thedarkb1-T60 [] has joined #openttd
10:09-!-Thedarkb1-T60 is "realname" on #openttd #oolite
10:15-!-Thedarkb-T60 [] has quit [Ping timeout: 480 seconds]
10:18<Samu>sorry I didn't do the bitmask thing as requested
10:18<DorpsGek_II>[OpenTTD/OpenTTD] SamuXarick updated pull request #7376: Fix 011257d: Enforce the max_no_competitors and network.max_companies tests before creating an AI company in multiplayer.
10:18<Samu>how does it look now?
10:19-!-sla_ro|master [] has joined #openttd
10:19-!-sla_ro|master is "slamaster" on #sla #openttd
10:23-!-Wormnest [~Wormnest@] has joined #openttd
10:23-!-Wormnest is "Wormnest" on #openttd
10:25<TrueBrain>you are still fixing symptoms .. not the issue
10:26<Samu>:( ok i give up
10:26<Samu>somebody else take over
10:30<@peter1138>> out
10:30<TrueBrain>you seem to be so focused on the symptoms, that you forget to look at the problem itself. And I think the problem already started with the initial patch that introduced this behaviour
10:30<TrueBrain>the system is not designed to start more than one company in a single tick
10:30<TrueBrain>so there the problem already starts
10:31<TrueBrain>fixing it at the other end of the spectrum only results in lines and lines of code validating if things have changed in the meantime
10:31<TrueBrain>but you have to ask yourself .. why can it queue more AIs than intended?
10:31<TrueBrain>and does that part of the system make sense?
10:32<TrueBrain>as when I look at the code, I wonder if the original patch didn't introduce another issue too: to me it looks like that every tick the system checks if it should start an AI
10:32<TrueBrain>sounds a bit wasteful on the CPU
10:32<TrueBrain>Normally this was only done AT MOST once a game-day
10:33<TrueBrain>which is still iffy, but at least less wrong
10:33<TrueBrain>seems the initial review didn't spotted this
10:33<TrueBrain>specifically, here:
10:34<TrueBrain>if GetStartNextTime is zero, _next_competitor_start is always one, so every tick it runs MaybeStartNewCompany .. every tick
10:34<TrueBrain>I think there it already went wrong
10:34<TrueBrain>and the rest just is an escalation of that issue
10:35-!-andythenorth [] has joined #openttd
10:35-!-andythenorth is "andythenorth" on #openttd
10:53-!-keoz [~keikoz@2a01:e35:2fd5:51e0:d790:795d:2cc7:b53d] has quit []
10:54<TrueBrain>bah; glx broke cmake :P
10:58<andythenorth>and tanks
11:14<Samu>checking every tick was so it could start AIs immediately
11:14<Samu>it was the whole point of the patch
11:14<TrueBrain>so for the whole of the rest of the game, you checking something every tick, just so you could start them at the beginning
11:14<TrueBrain>can you see there is some logic error in there?
11:15<TrueBrain>and as such, my suspicion is that if you fix the root cause (checking every tick till the end of time if there might be a reason to start an AI), the symptom you are currently fixing goes away too
11:15<Samu>maybe I can now change that part back to checking daily, since it can now start multiple AIs in 1 command
11:17<DorpsGek_II>[OpenTTD/OpenTTD] gbomfim opened issue #7400: Funding a new primary industry
11:18<Samu>the double check is probably not gonna be needed
11:18<Samu>ok, brb gonna try
11:18<DorpsGek_II>[OpenTTD/OpenTTD] TrueBrain commented on issue #7400: Funding a new primary industry
11:39-!-Thedarkb2-T60 [] has joined #openttd
11:39-!-Thedarkb2-T60 is "realname" on #openttd #oolite
11:43<Samu>how to detect the first tick of a game?
11:44-!-Thedarkb1-T60 [] has quit [Ping timeout: 480 seconds]
11:54-!-supermop_Home [] has joined #openttd
11:54-!-supermop_Home is "Guest" on #openttd
11:55-!-Thedarkb2-T60 [] has quit [Ping timeout: 480 seconds]
12:01<Samu>AIs now start before the HU company
12:05<Samu>this all feels so different
12:25<TrueBrain>"/usr/bin/rpmbuild can't handle paths with spaces, use a build directory without spaces for building RPMs."
12:29<@peter1138>Oh dear.
12:29<Eddi|zuHause>... at least they check and don't silently fail? :p
12:30<@peter1138>Well the thing about checking if you need to start a tick is that traditionally it was with a delay of a year or so. But it still checked every tick.
12:31<andythenorth>let's delete something
12:31<TrueBrain>okay, changing build directory with cmake is really easy .. which makes me happy :)
12:33<Samu>i'm reworking MaybeStartNewCompany
12:35<Samu>the delay was 74 ticks
12:36<@LordAro>why did instant starting AIs get included in the game?
12:36<@LordAro>wouldn't it be more appropriate for an admin console thing?
12:37<Samu>beucase it's a new feature
12:37<Samu>and I like it :p
12:39<@peter1138>LordAro, well, revert it all, and then the problem is solved :p
12:39<@LordAro>peter1138: well indeed
12:40<@peter1138>Hmm, why are news items not saved?
12:42<_dp_>peter1138, who needs that spam :p
12:43<@peter1138>Dunno, just seems like missing game-state.
12:44-!-Wormnest [~Wormnest@] has quit [Ping timeout: 480 seconds]
12:44<TrueBrain>hmm ... what version to give non-tagged, in terms of bundling ..
12:44<TrueBrain>take a 'deb' package .. what version should a random master commit have ..
12:45<@LordAro>1.9.0.revisioncount ?
12:45<@LordAro>well, trunk would be 1.10.0.revisioncount
12:45<TrueBrain>so 1.10.0 is older? :D
12:46<TrueBrain>also, I only have major/minor/patch
12:46<TrueBrain>1.10.0-dev<revisioncount> ? Not sure that works tbh
12:46<TrueBrain>Python-style :D
12:46<@LordAro>yeah, not great
12:46<TrueBrain>okay, can't be bothred with this today .. something to table for now
12:47-!-glx [] has joined #openttd
12:47-!-mode/#openttd [+v glx] by ChanServ
12:47-!-glx is "Loïc GUILLOUX" on @#openttd.noai #openttd.notice +#openttd
12:47<DorpsGek_II>[OpenTTD/OpenTTD] TrueBrain updated pull request #7270: Introduce CMake (and removing all other project-related code)
12:48<DorpsGek_II>[OpenTTD/OpenTTD] SamuXarick updated pull request #7376: Fix 011257d: Enforce the max_no_competitors and network.max_companies tests before creating an AI company in multiplayer.
12:48<Samu>I hope this is it
12:49<Samu>the enforce title is now wrong though
12:49<Samu>there's no enforce any more
12:49<@peter1138>Or does that need a new vision?
12:49<DorpsGek_II>[OpenTTD/OpenTTD] stormcone opened pull request #7401: Change: Do not display a newspaper about old vehicles for which repla…
12:50<TrueBrain>Samu: a lot better, in my opinion. But to me it reads you are slipping in additional changes :)
12:50<TrueBrain>the src/openttd.cpp changes seems unrelated to the fix
12:50<Samu>it is, otherwise it would have to wait 1 day
12:51<Samu>or actually... wait
12:51<Samu>that is wrong :(|
12:51<Samu>damn... i fail
12:52<TrueBrain>and GetStartNextTime() for sure needs some love. 'skip_counter' is not very verbose, and comments in that function are now wrong :)
12:52<@peter1138>Why did I buy more snacks? I have tons of snacks :/
12:52<TrueBrain>seems more you mean 'index' or something, instead of 'skip_counter'
12:52<TrueBrain>peter1138: yes
12:53<Samu>_next_competitor_start = max(DAY_TICKS, AI::GetStartNextTime() * DAY_TICKS); this is wrong, halp
12:53<TrueBrain>also, because you are inviting us to a party are your house
12:53<Samu>or is it right?
12:53<+glx>hmm TrueBrain, seems you drop my timestamp commit
12:53<@peter1138>TrueBrain, go for it.
12:53<TrueBrain>glx: yes, I did
12:53<TrueBrain>glx: it failed horribly here
12:53<TrueBrain>on a clean build, it refused to work
12:53<TrueBrain>so I wanted to ask you if you knew what was going on
12:54<TrueBrain>well, I did not mean to drop your patch as such
12:54<Samu>max(74, 0 *74) = 74
12:54<TrueBrain>but ... my push did :P
12:54<TrueBrain>glx: I tried another approach to fix your itch; does that also work?
12:54<Samu>getstartnexttime will still be 74 ticks
12:54<TrueBrain> <- glx
12:54<TrueBrain>(and sorry, I wanted to push to another branch of mine, but I forgot :( )
12:55<+glx>for baseset your approach is ok as they are not used later in build
12:55<Samu>but then --_next_competitor_start means MaybeStartNewCompany() will never run
12:55<TrueBrain>glx: I couldn't find a way to break the other 2 you changed
12:56<TrueBrain>I now got what you meant with the configure_file() btw
12:56<TrueBrain>are there other places that break?
12:56<+glx>easy, build, touch window_type.h and it will regenerate script_window.hpp everytime
12:57<TrueBrain>owh, in your other branch?
12:57<+glx>in cmake branch
12:57<TrueBrain>hmm .. let me try; as I don't get what your commit fixed for that?
12:58<TrueBrain>anyway, what broke with your commit, was that it kept telling me it couldn't find table/strings.h or something, in the dependency
12:58<+glx>oh forget it that's in my api branch :)
12:58<TrueBrain>it only worked if I manually touched that file in existence
12:58<Samu>nevermind, it's correct apparently, I'm stupid
12:58<TrueBrain>glx: pfew, was afraid I was going mad :P :D
12:58<+glx>in cmake branch touch any .ini for settings
12:58<+glx>or english.txt
12:59<TrueBrain>testing ...
12:59<@peter1138>How do you run your Manley-Morel DMUs? As is, or with extra carriages?
12:59<nielsm>occasionally adding up to two extra cars
13:00<+glx>it will the "regenerate" strings.h and settings.h everytime
13:00<DorpsGek_II>[OpenTTD/OpenTTD] TrueBrain updated pull request #7270: Introduce CMake (and removing all other project-related code)
13:00<TrueBrain>glx: as I came to the realization when I was debugging your commit, that it feels a bit off; keeping another file to avoid Makefile doing the wrong thing
13:00<TrueBrain>what do you think about the commit above; can we also live with that? (touching the files)
13:01<+glx>will then rebuild a lot for a non real change
13:01<TrueBrain>but only once
13:01<+glx>will be a pain for api ;)
13:02<TrueBrain>it is the same as when you touch CMakeLists.txt, it also triggers a recompile for some files, which might not have been needed
13:02<TrueBrain>what is the usecase for those files to change glx?
13:02<supermop_Home>apparently I had left the window in the room open slightly all winter and just noticed it now
13:03<+glx>you can change english.txt just to fix a typo without needing to rebuild all files using strings.h
13:03<TrueBrain>glx: I expected settingsgen to always touch the output file .. I guess it does not :)
13:03<TrueBrain>glx: good usecase
13:04<TrueBrain>the issue is, I guess, that we are fighting against how 'make' expects things to work
13:04<TrueBrain>owh, there was btw a real bug in your macros glx, at least I think: if the dependency in add_target didn't have byproduct set, it was never added again
13:05<TrueBrain>so it could miss dependencies, from what I could tell
13:05<+glx>not needed
13:05<+glx>byproducts is mainly a ninja thing
13:05<TrueBrain>yes, dependencies is not :)
13:05<Samu> /* Find the first company which doesn't exist yet, but skip some */
13:05<TrueBrain> <- that IF is missing an ELSE, from what I can tell :)
13:06<Samu>good comment? :p
13:06<TrueBrain>Samu: no
13:07<+glx>the original depends file is added before the if
13:07<@peter1138>Comments should really explain why. The what is covered by the code.
13:07<TrueBrain>glx: gatcha!
13:07<TrueBrain>glx: it is really hard to read, as you notice :D
13:08<+glx>yes cmake language doesn't always help
13:08<TrueBrain>glx: I also could not figure out what all the ;:::, :::, and :::; was about
13:08<andythenorth>AIs are too hard to code
13:08<andythenorth>and need to be improved
13:08<@peter1138>Yes ;)
13:08<andythenorth>they're unintuitive
13:08<@peter1138>I hope in the future...
13:08<andythenorth>and hard to figure out
13:08<+glx>I replace the keyword with ::: so each command stay separated
13:08<andythenorth>are AIs hard to code?
13:09<@peter1138>Yes, but that's the AI part, not the API part.
13:09<TrueBrain>glx: blaming CMake is easy; but what I notice that newlines, some comments, etc, really help :)
13:09<@peter1138>We delegated them to scripts for a reason :)
13:09<+glx>because cmake_parse_arguments merges all matching keywords into a single list
13:10<TrueBrain>glx: now THAT is a useful comment to add ;) As it explains the "why" more than the "what" :)
13:10<+glx>so 3 commands end up in only one
13:11<TrueBrain>we really have to work in the CMake files to not add comments telling what we can read in the code below, but WHY we added those lines :D
13:11<TrueBrain>(I noticed that with some of my own code too)
13:11<TrueBrain>anyway, please check if you can fix your patch breaking on an clean build directory, would be nice :D
13:13<Samu>maybe reserved_counter?
13:13<+glx>I'm fighting again with VS and cmake after a branch switching
13:13<+glx>this stuff is really unstable
13:13-!-rubenwardy [] has joined #openttd
13:13-!-rubenwardy is "" on #openttd
13:13<+glx>stuck in cancel
13:14<TrueBrain>2017 or 2019?
13:14<TrueBrain>2019 seems to integrate CMake a bit nicer
13:15<+glx>I'll switch to 2019 when it's official ;)
13:15<Samu>it's not really an 'index'
13:15<+glx>in 10 days or so
13:16<Samu>it's a skip, it's a count of companies that are yet not valid to be skipped because they were already accounted for last while
13:17-!-andythenorth [] has quit [Quit: andythenorth]
13:17<Samu>a company index skipping?
13:18<@peter1138>Should I update to 2019?
13:18<@peter1138>I don't really use it.
13:19<Samu>company_index_skipping_counter ... good name?
13:19<@peter1138>Debian VM + vim + vnc is... a better developing experience o_O
13:20<TrueBrain>glx: I think what breaks in your patch is exactly the else() what I was talking about. I think it should not depend on the file itself when there is a '.timestamp' alternative
13:20<TrueBrain>I somewhat start to understand how this is wokring and what is going on :P
13:24<TrueBrain>glx: yup, that fixes it :)
13:24<TrueBrain>glx: I will make this into a patch, if you don't mind
13:24<TrueBrain>add some comments and things, see if together we can create macros people can understand :D
13:24<+glx>np :)
13:25<+glx>but indeed working around cmake requires good comments
13:25<TrueBrain>neck deep in Macro shit :P
13:25<TrueBrain>first some food
13:26<@peter1138>Wasn't cmake supposed to be great? :p
13:27<+glx>cmake is nice
13:27<Samu>* @param ids_to_skip Number of company indexes to skip during evaluation.
13:39<DorpsGek_II>[OpenTTD/OpenTTD] SamuXarick updated pull request #7376: Fix 011257d: Enforce the max_no_competitors and network.max_companies tests before creating an AI company in multiplayer.
13:40<Samu>just renamed title, looks a bit big now :)
13:41-!-Thedarkb-T60 [] has joined #openttd
13:41-!-Thedarkb-T60 is "realname" on #openttd #oolite
13:44<Samu>crap, num_ais still wrong
13:44<Samu>let me quick fix
13:44<DorpsGek_II>[OpenTTD/OpenTTD] PeterN opened pull request #7402: Fix: Filtered file list did not scroll properly.
13:46<Samu>what is a better fix? uint num_to_start = max((uint)1, GB(p2, 0, 4)); ? or go change everywhere in the code the value of p2?
13:46<Samu>this is the line with problem
13:47<@peter1138>(uint)1 -> 1U
13:47<Samu>1U ok
13:47<Samu>but p2 or 1U?
13:49<Samu>i'm inclined towards uint num_to_start = max(1U, GB(p2, 0, 4));
13:49<@peter1138>Are you saying that I can't start up multiple AIs instantly during a game, now?
13:49<@peter1138>(By increasing max competitors)
13:50<Samu>no, p2 in some places is still 0
13:50<Samu>start 0 AIs makes not much sense
13:50<@peter1138>I'm refering to _next_competitor_start and the removal of the loop.
13:50<@peter1138>I guess it doesn't matter to much. DAY_TICKS is quite short.
13:51<Samu>p2 is meant to be the number of ais to start
13:51<Samu>not the delay
13:52<@peter1138>I'm not talking about p2.
13:52<@peter1138>FFS, learn to read :/
13:52-!-utack [~utack@2a02:810d:1380:36fc:3951:9c73:d100:c7f] has joined #openttd
13:52-!-utack is "utack" on #openttd
13:52<utack>hi. does anyone know a good grf with school buildings?
13:53<Samu>it should
13:53<Samu>hmm let me test
13:54<Samu>it will be slightly delayed though, it's not exactly next tick right away
13:55<Samu>yep, it works
13:55<@peter1138>Yeah, just 1 day instead of instantly. No biggie mid-game.
13:56-!-Thedarkb1-T60 [] has joined #openttd
13:56-!-Thedarkb1-T60 is "realname" on #openttd #oolite
13:56<DorpsGek_II>[OpenTTD/OpenTTD] nielsmh approved pull request #7402: Fix: Filtered file list did not scroll properly.
13:57<DorpsGek_II>[OpenTTD/OpenTTD] SamuXarick updated pull request #7376: Fix 011257d: Allow multiple AI companies to be started with just 1 command, but revert the starting of companies back to once per day. At the start of a new game, check whether to start AI companies immediately, to avoid having to wait one day for that to happen.
13:57<@peter1138>TrueBrain, does using "rebase and merge" or "squash and merge" affect backporting?
13:58<TrueBrain>peter1138: no; it is just a bit more work that we have both options
13:58<TrueBrain>but that is fine :)
13:58<@peter1138>I like squash-and-merge cos it adds the PR number. But sometimes you don't want to squash, so... heh.
13:59<TrueBrain>I agree :)
13:59<DorpsGek_II>[OpenTTD/OpenTTD] PeterN merged pull request #7402: Fix: Filtered file list did not scroll properly.
14:00<@peter1138>"I'm unsure if this is really really correct," that's a scary start, nielsm :-)
14:01<nielsm>well, the original kdtree PR was the same situation, "I hope I've caught all places that need to maintain this"
14:02-!-Thedarkb-T60 [] has quit [Ping timeout: 480 seconds]
14:03<DorpsGek_II>[OpenTTD/OpenTTD] TrueBrain requested changes for pull request #7376: Fix 011257d: Allow multiple AI companies to be started with just 1 command, but revert the starting of companies back to once per day. At the start of a new game, check whether to start AI companies immediately, to avoid having to wait one day for that to happen.
14:03-!-Thedarkb-T60 [] has joined #openttd
14:03-!-Thedarkb-T60 is "realname" on #openttd #oolite
14:04-!-Supercheese [] has joined #openttd
14:04-!-Supercheese is "Caseum" on #openttd
14:05<DorpsGek_II>[OpenTTD/OpenTTD] TrueBrain commented on pull request #7376: More than max_no_competitors could be created in network games
14:05<TrueBrain>Samu: the art of programming is more with less. Not the other way around.
14:06<DorpsGek_II>[OpenTTD/OpenTTD] PeterN updated pull request #7301: Feature: When filtering purchase list by cargo type, make buy button perform a refit if required.
14:08-!-Thedarkb1-T60 [] has quit [Ping timeout: 480 seconds]
14:08<DorpsGek_II>[OpenTTD/OpenTTD] SamuXarick commented on pull request #7376: More than max_no_competitors could be created in network games
14:09<DorpsGek_II>[OpenTTD/OpenTTD] TrueBrain commented on pull request #7376: More than max_no_competitors could be created in network games
14:16<Samu>the value can never be over 15
14:16<Samu>@calc 0x1111
14:16<@DorpsGek>Samu: 4369
14:17<Samu>@calc 2^^4
14:17<@DorpsGek>Samu: Error: invalid syntax (<string>, line 1)
14:17<Samu>@calc 2**4
14:17<@DorpsGek>Samu: 16
14:17<Samu>or ?
14:17<Samu>isn't binary 1111 15?
14:18<@Alberth>1+2+4+8, so yes
14:18-!-circ-user-3HYVs [] has joined #openttd
14:18-!-circ-user-3HYVs is "A CIRC user" on #openttd
14:18<nielsm>but 0x is hexadecimal
14:19<Samu>no need to check num_to_start > MAX_COMPANIES then
14:23-!-supermop_Home [] has quit [Ping timeout: 480 seconds]
14:26<Samu>that 'possibly' word was peter1138's suggestion
14:27-!-Pikka [] has quit [Read error: Connection reset by peer]
14:27<TrueBrain>I doubt he meant this
14:28<TrueBrain>"Allow multiple AIs to possibly start in the same tick" <- this is now just bad english. Without 'possibly' it means what you want
14:28<TrueBrain>allowing something to possibly happen is as vague as fog
14:28<TrueBrain>I am allowing you to possibly merge this .. doesn't mean anything
14:29<TrueBrain>comments should not be vague or unspecfic .. it is rarely helping the reader along .. "is it? Owh .. I dont know .. I have to figure this out myself"
14:29<TrueBrain>next step is a comment like: /* Doing stuff */ :D
14:29<Samu> /** Start new competitor companies if possible. */ this one was already there, even before the initial comment
14:29<TrueBrain>yes; and that is perfectly fine
14:29<Samu>oh? ... ok
14:30<TrueBrain>'Allow a new competitor to possibly start' is now
14:31<TrueBrain>the problem is with 'allow' vs 'possibly'
14:31<Samu>'some' :(
14:31<Samu>this one is tricky to explain
14:32<Samu>they've already been accounted for, but they're currently not created
14:32<Samu>i have to pretend they were
14:32<Samu>so I skip some indexes
14:33<TrueBrain>you are not skipping SOME indexes
14:33<TrueBrain>you skipping a VERY SPECIFIC amount
14:35<@peter1138>I've got a can of IPA. Woo.
14:36*LordAro has a curry
14:36<@peter1138>Lidl brand, so it may not be any good :p
14:36<@peter1138>Ooh curry.
14:36<@peter1138>Ah, phew, I found a stash :D
14:37<Samu>I don't know how to comment
14:38<@LordAro>i feel the last few hours has made that abundantly clear
14:39<@LordAro>it's quite hard to get right, but the important part is that comments should explain why the code is the way it is, not what the code does. if code requires comments to explain what it is doing, *in general* the code is not clear and should be changed
14:42-!-Thedarkb-T60 [] has quit [Ping timeout: 480 seconds]
14:44<DorpsGek_II>[OpenTTD/OpenTTD] TrueBrain updated pull request #7270: Introduce CMake (and removing all other project-related code)
14:44<Samu>ids_to_skip--; // number of company indexes to skip, that are pretended to have been started, but actually aren't
14:44<Samu>looks ok now?
14:44<TrueBrain>there glx :) Let me know if I misunderstood any :)
14:45<TrueBrain>fixed 3 minor bugs while going through it; nothing fancy :) (as we were not using it that way)
14:49-!-Thedarkb-T60 [] has joined #openttd
14:49-!-Thedarkb-T60 is "realname" on #openttd #oolite
14:51<TrueBrain>time to rebase the branch I guess ..
14:54<+glx>I considered adding ALL in options, but I think its location matters
14:54<+glx>so I left it in unparsed, with the target and first command
14:54<TrueBrain>glx: that should have been in a comment :D
14:54<+glx>true :)
14:55<+glx>feeding time for me
14:56<TrueBrain>fixed ALL, and rebased
14:56<DorpsGek_II>[OpenTTD/OpenTTD] TrueBrain updated pull request #7270: Introduce CMake (and removing all other project-related code)
14:57<Samu>Comparing, incrementing, and substracting in a single statement.
14:57<Samu>i thought that was code efficiency :(
14:57<TrueBrain>efficient for who?
14:57<TrueBrain>that statement you made there is VERY error prune
14:57<TrueBrain>a - ++b > 0
14:57<TrueBrain>I mean ...
14:58<rubenwardy>readability is way more important
14:59<rubenwardy>"premature optimisation is the root of all evils"
14:59<rubenwardy>also, the compile does a lot of optimisations like that anyway
14:59-!-D-HUND is now known as debdog
14:59<rubenwardy>and it will result in the same machine code
14:59<Samu>4 - ++0 > 0 becomes 4 - 1 > 0, becomes 3 > 0
14:59<@LordAro>Samu: no, stop trying to explain it to us, we already understand it
15:00<@LordAro>we're telling you that it's confusing and error prone, so stop trying to do it
15:00<Samu>ok let me try another way
15:00<rubenwardy>yeah, bad code
15:00<@peter1138>b++; if (a - b > 0)
15:00<@peter1138>^ obvious
15:01<TrueBrain>I believe it is even in a while statement :p
15:01<TrueBrain>reinventing for(), basically :)
15:01<rubenwardy>oh fun
15:02<DorpsGek_II>[OpenTTD/OpenTTD] stormcone opened issue #7403: Game crashes
15:03<@peter1138>TrueBrain, ah...
15:03<@peter1138>"In the main menu donwload and activate LuDiAI AfterFix (v9)"
15:03<rubenwardy>b++; for(; a -b > 0; b++)
15:03<@peter1138>^ blame the bug on Samu :D
15:04<@peter1138>Refit Cost: -£25,122
15:04<@peter1138>I may have got that sum the wrong way around :-)
15:05-!-circ-user-3HYVs [] has quit [Ping timeout: 480 seconds]
15:06<TrueBrain>okay, first steps of making a bundle are there ... w00p :D
15:06<TrueBrain>CPack is pretty cool
15:07<TrueBrain>FHS is annoying, but that is Linux only, so meh :)
15:07<Samu>converting a do while into a for is complicated
15:08<DorpsGek_II>[OpenTTD/OpenTTD] gbomfim commented on issue #7400: Funding a new primary industry
15:09<Samu>i can't do this, it was fine the way I had it :(
15:11<Samu>oh a bug with my AI?
15:12<Samu>no wai
15:12<TrueBrain>changing a do/while into a for, especially if that do/while has a line: int a = 0, before it, is the most trivial thing to do
15:12<TrueBrain>converting a while{} to a for, that can be tricky
15:12<TrueBrain>you basically wrote a for(), just as a do/while
15:13<DorpsGek_II>[OpenTTD/OpenTTD] gbomfim opened issue #7404: Diagonal bridges and tunnels
15:14<@peter1138>If 7404 was a PR...
15:14<DorpsGek_II>[OpenTTD/OpenTTD] TrueBrain commented on pull request #7376: More than max_no_competitors could be created in network games
15:16<DorpsGek_II>[OpenTTD/OpenTTD] TrueBrain commented on issue #7404: Suggestion: Diagonal bridges and tunnels
15:16<DorpsGek_II>[OpenTTD/OpenTTD] TrueBrain closed issue #7404: Suggestion: Diagonal bridges and tunnels
15:17<TrueBrain>I want templates to reply with
15:17<TrueBrain>owh, that exists!
15:17<TrueBrain>well, for next time :)
15:17<@peter1138>I think you can have multiple templates somehow, as well.
15:17<TrueBrain>many many even :D
15:18<TrueBrain>and put them even on shortcuts
15:18<TrueBrain>it is the top right button in the reply box
15:18<TrueBrain>never noticed :D
15:20<@Alberth>look for it, and you'll find it :)
15:20-!-supermop_Home_ [] has joined #openttd
15:20-!-supermop_Home_ is "Guest" on #openttd
15:20<supermop_Home_>there should be a many rivers tool in SE
15:21<Samu>good idea
15:21<supermop_Home_>as it is you get whatever rivers the SE generates at the beginning, but can't make more later except manually
15:22<supermop_Home_>in case you had to terraform a valley that has an odd slope stopping a river making it to the shore
15:23<supermop_Home_>regardless if the river generator is good or bad, it should be usable like the 'many random towns' or 'many random industries' tools
15:23<Samu>perhaps the same for GetNumItems
15:25<@LordAro>peter1138: TrueBrain: you can only have multiple issue templates displayed through the interface. you can have multiple PR templates, but you need to use a specific link to get to them.. which rather defeats the purpose
15:26<TrueBrain>I meant reply templates :)
15:26<TrueBrain>of which you can have many
15:26<@peter1138>supermop_Home_, PR? ;)
15:29<@LordAro>TrueBrain: oh, didn't know about thos
15:29<TrueBrain>me neither; that was the whole point :D
15:30<supermop_Home_>peter1138 idk how to do that
15:33<DorpsGek_II>[OpenTTD/OpenTTD] SamuXarick updated pull request #7376: More than max_no_competitors could be created in network games
15:33<Samu>what about now?
15:36-!-andythenorth [] has joined #openttd
15:36-!-andythenorth is "andythenorth" on #openttd
15:38<Samu>hmm about the 'some' comment... meh... i dunno what to say there
15:38<Samu>it is commented in the declaration thing
15:38<Samu>hope it's enough
15:39<Samu>i still need to change commit message, and do the fix up's rebases thingies
15:39<Samu>before I do, I wanted to know if it needs further changes
15:40<TrueBrain>for sure it is improving every iteration :)
15:41<TrueBrain>GetStartNextTime is a bit annoying to have this skip-thingy .. it misses context what it is for
15:41<TrueBrain>you need to read the code now, and assume that start_date is different for every AI, for this to make sense
15:44<DorpsGek_II>[OpenTTD/OpenTTD] TrueBrain requested changes for pull request #7376: More than max_no_competitors could be created in network games
15:44<TrueBrain>Samu: and you never answered why the changes in src/openttd.cpp are important :)
15:45<Samu>because they were set up to start immediately, I did comment there
15:46<Samu>it won't start on the OnTick_Companies because there is a 74 ticks delay now
15:46<TrueBrain>a) you did not; b) answering the the question is not an answer ;)
15:46<TrueBrain>I can read WHAT it does. I am asking WHY it needs to do that
15:46<TrueBrain>you keep falling for this :)
15:51<Samu>regression test failed? :(
15:59-!-gnu_jj_ [] has joined #openttd
15:59-!-gnu_jj_ is "jj" on #ceph #ceph-devel #openttd
16:00<Samu>I forgot how to check the result of regression
16:00<Samu>have to edit regression.bat but can't remember what
16:02<@peter1138>If regression is changed, you have probably broken something.,
16:03<Samu>i want to see what
16:05-!-Thedarkb-T60 [] has quit [Ping timeout: 480 seconds]
16:06-!-gnu_jj [~quassel@] has quit [Ping timeout: 480 seconds]
16:07<Samu>glx, how to log regression into a .txt? I forgot
16:08-!-circ-user-3HYVs [] has joined #openttd
16:08-!-circ-user-3HYVs is "A CIRC user" on #openttd
16:08<+glx>add -k in regression.bat IIRC
16:10<Samu>created an empty file :(
16:11<Samu>so... the AI didn't start, I assume?
16:12<Samu>ah, found the problem
16:13<+glx>TrueBrain: something like -k option may be useful in cmake branch
16:13<Samu>the test is being done before the HU company is created
16:14<_dp_>can we just ban non-bananas grfs?
16:14<_dp_>wanted to check that funding bug but couldn't find all that grf crap :(
16:15<Samu>actually, 2 errors, that and then some more
16:16<Samu>turns out that bool isn't necessary
16:17<Samu>it's my for cycle
16:17<Samu>i failed
16:18<Samu>the do while cycle was working fine
16:18<Samu>the for cycle is now what's failing regression
16:18<Samu>can I go back to do while?
16:19<TrueBrain>only if you agree that makes you a stackoverflow kiddy
16:20<DorpsGek_II>[OpenTTD/OpenTTD] nielsmh commented on issue #7400: Funding a new primary industry
16:21-!-Thedarkb-X40 [] has joined #openttd
16:21-!-Thedarkb-X40 is "realname" on #openttd #/r/openttd #oolite
16:24<_dp_>ehm, why is it called eGRVTS on nielsm screenshot but for me it says GRVTS (without e)? o_O
16:25<_dp_>also what is "This is a replacement for an existing NewGRF" supposed to mean on that screen?
16:26<_dp_>why is it calling all unknown grfs a replacement for smth?
16:27<Samu>Running ai/regression/tst_regression... passed!
16:27<nielsm>and is it missing two or three files?
16:27<Samu>great, so I'm back to do, while :( failed to convert it into a for
16:28<_dp_>nielsm, ha, indeed xD
16:29<Samu>who's a do while to for convertion expert? :p
16:29<@peter1138>Damn, showing correct capacity and cost of refits in purchase menu is such a rabbit-hole
16:29<Samu>and all those shennanigans about readability too?
16:30<Samu>cus I'm afraid if I touch it, I will break it again
16:30<Samu>it currently works
16:30<nielsm>and eGRVTS 1.0 shows as "matching not found, loaded compatible"
16:30<nielsm>for me
16:30<nielsm>so just missing one file now
16:31<Samu>meanwhile, dinner, afk
16:34-!-synchris [~synchris@] has quit [Quit: yeeha!]
16:40<_dp_>weird, I can fund stuff but not on trees %)
16:40<DorpsGek_II>[OpenTTD/OpenTTD] nielsmh commented on issue #7400: Funding a new primary industry
16:41<nielsm>yeah, same here
16:41<nielsm>trees make the site unsuitable
16:41<andythenorth>oh wait
16:42<andythenorth>I asked for that to be 'fixed'
16:42<andythenorth>for water tiles
16:42<andythenorth>has it broken something related?
16:42<andythenorth>trees on coasts were preventing industry funding
16:42-!-Alberth [] has left #openttd []
16:44<nielsm>yeah, converted savegames can't place industries on trees
16:44<@peter1138>New games can?
16:46<@peter1138>But yeah, that's a glaring ommission now that you pointed it out :/
16:46<DorpsGek_II>[OpenTTD/OpenTTD] nielsmh commented on issue #7400: Funding a new primary industry
16:46<nielsm>hmm aren't trees supposed to convert cleared terrain back to grassland immediately?
16:47<planetmaker>you clear trees like all other tiles
16:47-!-Thedarkb-T60 [] has joined #openttd
16:47-!-Thedarkb-T60 is "realname" on #openttd #oolite
16:47<planetmaker>with the same dirt to grass procedure
16:47<nielsm>I mean, when you plan trees on tiles
16:48<nielsm>okay guess not
16:50-!-Thedarkb-X40 [] has quit [Ping timeout: 480 seconds]
16:51<planetmaker>plant? No, when planting trees, it doesn't get dirty
16:51<planetmaker>When removing trees... that is normal to convert it to dirt
16:52<nielsm>when planting trees on clear dirt, I remebered that the land would instantly convert to grass
16:53<@peter1138>nielsm, nope.
16:54<@peter1138>Just tested in 1.8.0
16:54<nielsm>anyway, it looks like m1 is 0x70 on new trees planted, which can be built over
16:54<nielsm>and is 0x10 on converted saves where you can't build industries over them
16:54<DorpsGek_II>[OpenTTD/OpenTTD] michicc commented on pull request #7324: Codechange: [C++11] Use override specifer for overriding member declarations
16:57-!-circ-user-3HYVs [] has quit [Ping timeout: 480 seconds]
16:57<@peter1138>nielsm, yeah.
16:58<@peter1138>Looks like a fucked up :(
16:58<@peter1138>No savegame conversion.
16:58<nielsm>actually, if I plant a tree on a clear grass tile, its m1 remains 0x10
16:59<@peter1138>And imho, waterclass should only be tested for the coast tiles, but... waterclass is how that is determined. Hmm.
16:59<nielsm>but if I plant a tree on a dirt tile m1 is also 0x10, but then wait until the dirt has grown fully back to grass then m1 becomes 0x70
17:00<nielsm>as soon as grass begins to grow back underneath the new tree m1 changes to 0x70
17:00<+michi_cc>Who wants to buy PR#7379 from me for review? Barely used, $0.
17:01<Samu> transform this into a for, plz
17:04<DorpsGek_II>[OpenTTD/OpenTTD] gbomfim commented on issue #7400: Funding a new primary industry
17:05<@peter1138>nielsm, it's duplicated information anyway :/
17:05-!-Thedarkb-T60 [] has quit [Ping timeout: 480 seconds]
17:06<@peter1138>So I think we should revert and do the fix differently.
17:08<@peter1138>IsCoastTile can just check for TREE_GROUND_SHORE
17:09<DorpsGek_II>[OpenTTD/OpenTTD] nielsmh commented on issue #7400: Tree tiles converted wrong in savegames, block new industry creation
17:10<nielsm>so, can't do a savegame version upgrade in 1.9 branch
17:10<@peter1138>It's unnecessary.
17:11<@peter1138>I'm working on it :-)
17:14<DorpsGek_II>[OpenTTD/OpenTTD] SamuXarick updated pull request #7376: More than max_no_competitors could be created in network games
17:15<@peter1138>nielsm, probably shouldn't change the subject of bug reports like that :/
17:15<nielsm>hmm :/¨
17:16<nielsm>changing it back + adding the "on trees" detail
17:16<@peter1138>Which industry type is it? Any or a specific one?
17:16<@peter1138>Stock or newgrf?
17:16<nielsm>tried both stock and a game with SPI
17:16<nielsm>so either
17:16<nielsm>any industry that requires flat, dry land
17:17<@peter1138>Ok, so most of them :-)
17:18<DorpsGek_II>[OpenTTD/OpenTTD] SamuXarick commented on pull request #7376: More than max_no_competitors could be created in network games
17:19<@peter1138>And for the water test, I need FIRS I guess.
17:21<DorpsGek_II>[OpenTTD/OpenTTD] gbomfim commented on issue #7404: Suggestion: Diagonal bridges and tunnels
17:25<DorpsGek_II>[OpenTTD/OpenTTD] SamuXarick commented on issue #7403: Game crashes
17:28<+glx>Samu: I tried to reproduce but couldn't, thanks for the hint but without a full trace it won't be easy
17:29-!-gelignite [] has joined #openttd
17:29-!-gelignite is "gelignite" on #openttd
17:29<Samu>oh, my bad
17:31<Samu>something about kdtree, definitely not my AI causing it
17:32<DorpsGek_II>[OpenTTD/OpenTTD] SamuXarick commented on issue #7403: Game crashes
17:33-!-supermop_Home_ [] has quit [Ping timeout: 480 seconds]
17:35<Samu>zoom in and zoom out
17:35<Samu>should crash
17:37<Samu>uhm, nop, not crashing now
17:41<Samu>now I managed to crash the way he reported
17:41<Samu>clicked ignore, and game still runs lol
17:42<+glx>I followed the steps, no crash for me
17:44<DorpsGek_II>[OpenTTD/OpenTTD] SamuXarick commented on issue #7403: Game crashes
17:54-!-Supercheese [] has quit [Read error: Connection reset by peer]
17:54-!-Supercheese [] has joined #openttd
17:54-!-Supercheese is "Caseum" on #openttd
18:06-!-nielsm [] has quit [Ping timeout: 480 seconds]
18:08-!-sla_ro|master [] has quit []
18:21<Samu>it's funny, I wrote this code, and now I can't follow it
18:22<Samu>i just know that it works
18:23<Samu>Need to make this into a for
18:31<Samu>assert(num_to_start_do_while == num_to_start_for);
18:31<Samu>let's test!
18:32-!-Thedarkb-T60 [] has joined #openttd
18:32-!-Thedarkb-T60 is "realname" on #openttd #oolite
18:35<Samu> 3rd time
18:37<Samu>i think do while looks simpler
18:37<Samu>or i just suck at turning this into a for
18:37<_dp_>Samu, don't use ++ in expressions, I'm not even sure if that's a defined behavior there
18:38<Samu>the do while part is tested as correct
18:38<Samu>can u help me create a for version of it?
18:38<milek7>why it would be undefined?
18:38<milek7>it is just ugly
18:39<_dp_>milek7, is evaluation order of operands in binary operator defined?
18:40<_dp_>milek7, it may be for && but I'm not 100% sure
18:40<@peter1138>For && and ||, yes.
18:40<_dp_>milek7, it definitely is ub for function arguments
18:41-!-andythenorth [] has quit [Quit: andythenorth]
18:42<Samu>i think im missing a check, now that i closely look at it
18:43<Eddi|zuHause>i'm fairly sure && is a sequence point
18:43<Eddi|zuHause>but it is definitely a dangerous field to step in
18:47<_dp_>yeah, while(--x) is borderline acceptable imo but not that
18:48<Eddi|zuHause>there's no reeal reason why it couldn't be a separate statement
18:50<Eddi|zuHause>also "(uint)_settings_game.difficulty.max_no_competitors - num_to_start_for > 0" is probably better expressed as "num_to_start_for < (uint)_settings_game.difficulty.max_no_competitors"
18:57<Eddi|zuHause>on a separate note, why is it checking for i would have taken that as max human companies...
18:57<Eddi|zuHause>so people can set those things separately
18:57<DorpsGek_II>[OpenTTD/OpenTTD] stale[bot] commented on issue #7037: Smarter random town names
18:58<Samu>it was already there
18:58<Samu>I kept the same functionality
18:59<Samu>my while is missing a check, speaking of which, that one
19:00<Samu> } while ((!_networking || num_to_start < &&
19:00<Samu> num_to_start < (uint)_settings_game.difficulty.max_no_competitors && AI::GetStartNextTime(num_to_start) == 0);
19:01<Samu>beter copy paste into there
19:02<milek7>don't try to force everything into while condition
19:05<Samu>do you think AI::GetStartNextTime(num_to_start) is sufficient?
19:05-!-drac_boy [] has joined #openttd
19:05-!-drac_boy is "OFTC WebIRC Client" on #openttd
19:05<drac_boy>hi there
19:06*drac_boy wonders how much longer it will still be winter for in east canada -_-
19:06<drac_boy>I mean come on its already mid-march :-|
19:06<Samu> gonna test this
19:06<drac_boy>anything even interesting on your side samu? :P
19:07<drac_boy>hmm can't help with that coding sorry
19:09-!-gelignite [] has quit [Quit: Good fight, good night!]
19:09<Samu>I'm starting to think that simple check is sufficient
19:10<Samu>no need for "redundancy" or so
19:14<drac_boy>I thought the same thing too peter ;)
19:17<Samu>do while versus for
19:17<Samu>i think it's gonna assert, i fail at fors
19:18<Samu>boom, asserted
19:18<Eddi|zuHause>why are you checking the same condition twice, once in the while and again in the if break?
19:20<Samu>assert(1 == 0); yep... the for one is wrong
19:20<Eddi|zuHause>because the GetStartNextTime check is once before the ++ and once after the ++
19:23<Eddi|zuHause>you effectively moved the while-check to the beginning of the loop, not the end
19:26<Samu>lol at me, I thought for loops were supposed to be easier than do while loops
19:26<Samu>I'm failing miserably
19:29<Samu>uhm nop
19:30<Samu>loops like now the error is in do while
19:30<Samu>damn me
19:37<Samu>no, it's correct
19:37<Eddi|zuHause>for loops are easy. "for (a; b; c) { d }" is equivalent to "a; while (b) { d; c }"
19:38<Eddi|zuHause>(there are minor semantic differences in various languages)
19:39<_dp_>Eddi|zuHause, try that with do...while :p
19:39<Eddi|zuHause>i don't know why it's a do..while in the first place
19:40<Samu>for loop is still wrong
19:40<Eddi|zuHause>or what the aim of the exercise is
19:40<Samu>just retested the do while loop
19:40<Samu>and it's correct
19:40<Samu>damn me
19:41<Samu> i have this atm
19:41<Samu>do while is working correctly. for is not matching :(
19:44<Samu>while loop could even be simplified again
19:44<Samu> } while (AI::GetStartNextTime(++num_to_start) == 0);
19:44<Samu>and remove num_to_start++; line
19:44-!-circ-user-3HYVs [] has joined #openttd
19:44-!-circ-user-3HYVs is "A CIRC user" on #openttd
19:46<Samu>TrueBrain, may I keep the do while loop? I can't get my head how to make a for loop
19:48-!-tokai [] has quit [Ping timeout: 480 seconds]
19:57<DorpsGek_II>[OpenTTD/OpenTTD] stale[bot] commented on issue #6173: Add support for SDL2
19:59-!-Thedarkb1-T60 [] has joined #openttd
19:59-!-Thedarkb1-T60 is "realname" on #openttd #oolite
20:00-!-Wolf01 [] has quit [Quit: Once again the world is quick to bury me.]
20:01-!-Thedarkb-T60 [] has quit [Ping timeout: 480 seconds]
20:13-!-Thedarkb1-T60 [] has quit [Ping timeout: 480 seconds]
20:14-!-Flygon [] has joined #openttd
20:14-!-Flygon is "Flygon" on #openttd
20:19<TrueBrain>Samu: no. and you are again stuck on the problem right in front of you. take a step back and see what the whole statement is doing. as is, it is incredibly hard to understand. I am sure you can make something more readable from it. but don't focus on the do/while on it's own.. think what you want it to do, and do it in the most clean way you can!
20:23<@peter1138>Hmm, maybe it is cleaner to keep the waterclass-for-tree-tiles change.
20:23<@peter1138>Regardless of how illogical it seems :/
20:42-!-Wormnest [~Wormnest@] has joined #openttd
20:42-!-Wormnest is "Wormnest" on #openttd
20:42-!-Thedarkb-T60 [] has joined #openttd
20:42-!-Thedarkb-T60 is "realname" on #openttd #oolite
20:44<Samu> * @param count Current count of number of AI company indexes that are going to be started.
20:44<Samu> * @see MaybeStartNewCompany
20:46<Samu>terrible terrible english
20:59-!-drac_boy [] has left #openttd []
21:04-!-Wormnest [~Wormnest@] has quit [Quit: Leaving]
21:51-!-tokai [] has joined #openttd
21:51-!-tokai is "Christian Rosentreter" on #openttd
21:51-!-mode/#openttd [+v tokai] by ChanServ
21:59<DorpsGek_II>[OpenTTD/OpenTTD] PeterN opened pull request #7405: Fix #7400: WaterClass for tree tiles was not converted for old saves preventing industry creation.
22:05-!-Progman [] has quit [Remote host closed the connection]
22:06<@peter1138>Turns out that doing the savegame conversion and keeping the data duplication is cleaner than reverting and explicitly checking for trees on coasts.
22:14<Samu>why can't I do something that is so simple...
22:23<Eddi|zuHause>or we scrap the pseudo-water-classes and recalculate it for more tiles?
22:23<Eddi|zuHause>like for industries and stuff?
22:24<@peter1138>Eddi|zuHause, possible but makes everything more complex.
22:24<@peter1138>For the sake of 3 bits which are already allocate.d
22:25<@peter1138>For tree tiles it's very easily calculated, I'm not sure about the others.
22:25<Eddi|zuHause>this is more a "maybe we should have designed it differently in the first place, but for now it works" kind of thing
22:25-!-Supercheese [] has quit [Read error: Connection reset by peer]
22:25<@peter1138>Eddi|zuHause, well, we didn't have a vision.
22:25-!-Supercheese [] has joined #openttd
22:25-!-Supercheese is "Caseum" on #openttd
22:26<@peter1138>Eddi|zuHause, it is odd that shore tiles are considered water at all.
22:26<Eddi|zuHause>hysterical raisins
22:27<@peter1138>But it is what it is, and NewGRF landscape checks rely on this implementation detail.
22:39<DorpsGek_II>[OpenTTD/OpenTTD] PeterN updated pull request #7301: Feature: When filtering purchase list by cargo type, make buy button perform a refit if required.
22:39<DorpsGek_II>[OpenTTD/OpenTTD] PeterN commented on pull request #7301: Feature: When filtering purchase list by cargo type, make buy button perform a refit if required.
22:40<DorpsGek_II>[OpenTTD/OpenTTD] PeterN commented on pull request #7301: Feature: When filtering purchase list by cargo type, make buy button perform a refit if required.
22:46<DorpsGek_II>[OpenTTD/OpenTTD] Eddi-z commented on pull request #7405: Fix #7400: WaterClass for tree tiles was not converted for old saves preventing industry creation.
22:49<@peter1138>Hmm, this may call for... minor version :p
22:50<@peter1138>Really it calls for _sl_version <= major, but we don't have that function.
22:53<Eddi|zuHause>iirc there was some trickery done in some minor releases to have savegame conversion stuff without breaking the forward compatibility
22:53<Eddi|zuHause>i have no clue what that was, though
22:54<@peter1138>If we check against sub version 1, then it basically becomes a <= test.
22:54<@peter1138>But it's not entirely clear :/
22:55<@peter1138>Probably best to add a new function.
22:56<Eddi|zuHause>i don't know why we have a minor version when we're not allowed to use it
22:57<@peter1138>It's only there because it's needed for old savegame conversion.
22:58<@peter1138>It's read-only, not written to the save.
23:05-!-D-HUND [~debdog@2a00:79c0:60d:cb00:7a24:afff:fe8a:d04d] has joined #openttd
23:05-!-D-HUND is "Wowbagger" on #bitlbee #openttd
23:09-!-debdog [~debdog@2a00:79c0:65e:7f00:7a24:afff:fe8a:d04d] has quit [Ping timeout: 480 seconds]
23:14<DorpsGek_II>[OpenTTD/OpenTTD] SamuXarick updated pull request #7376: More than max_no_competitors could be created in network games
23:14-!-Supercheese [] has quit [Read error: Connection reset by peer]
23:14<Samu>who wants to read my code
23:15-!-Supercheese [] has joined #openttd
23:15-!-Supercheese is "Caseum" on #openttd
23:15<Samu>if it's still confusing, then...
23:16<Samu>.... I'm stuck
23:36-!-Pikka [] has joined #openttd
23:36-!-Pikka is "realname" on #openttd
23:55<DorpsGek_II>[OpenTTD/OpenTTD] SamuXarick updated pull request #7376: More than max_no_competitors could be created in network games
23:56<Samu>just fixup'ed everything, and changed commit message, nothing else
---Logclosed Sun Mar 24 00:00:26 2019