IRC logs for #openttd on OFTC at 2019-03-23
⏴ go to previous day
00:00:05 <Samu> and the fact that AI companies are started every tick
00:00:21 <Samu> and the fact that the network can delay execution of commands by one tick
00:01:24 <Samu> line 598 has a Company::GetNumItems()
00:01:42 <Samu> this test is done before starting the command
00:03:12 <Samu> Company::GetNumItems() is not correct at that point
00:04:59 <DorpsGek_II> [OpenTTD/OpenTTD] glx22 approved pull request #7376: Fix 011257d: Enforce the max_no_competitors and network.max_companies tests before creating an AI company in multiplayer. https://git.io/fjJcm
00:05:31 <DorpsGek_II> [OpenTTD/OpenTTD] glx22 dismissed a review for pull request #7376: Fix 011257d: Enforce the max_no_competitors and network.max_companies tests before creating an AI company in multiplayer. https://git.io/fjJcm
00:07:48 <Samu> gonna try write everything there instead
00:15:00 *** Supercheese has joined #openttd
00:23:49 *** Supercheese has joined #openttd
02:20:37 *** circ-user-3HYVs has quit IRC
02:31:49 <DorpsGek_II> [OpenTTD/OpenTTD] SamuXarick commented on pull request #7376: Fix 011257d: Enforce the max_no_competitors and network.max_companies tests before creating an AI company in multiplayer. https://git.io/fjJC6
02:32:03 <Samu> oh boy, that was too long
03:20:56 *** circ-user-3HYVs has joined #openttd
03:25:24 *** Thedarkb-T60 has joined #openttd
04:10:04 *** Thedarkb-X40 has joined #openttd
04:54:03 *** ChanServ sets mode: +v tokai
07:10:41 *** sla_ro|master has joined #openttd
07:36:31 *** andythenorth has joined #openttd
08:12:51 *** Alberth has joined #openttd
08:12:51 *** ChanServ sets mode: +o Alberth
08:12:52 *** Progman has joined #openttd
08:39:04 <andythenorth> _probably_ not java Alberth
08:46:59 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN commented on pull request #7165: [core] Implement SmallVector using std::vector https://git.io/fjJ83
08:50:54 <andythenorth> I have no information on the 'Python is slow' problem
08:51:34 <andythenorth> might be easiest to just go to C++?
08:52:37 <Alberth> safest, at least, and generally accepted
08:53:11 <andythenorth> then we could distribute a cross-platform binary?
08:53:18 <andythenorth> avoid all the python packaging problems
08:53:54 <Alberth> computers without default installed python aren't useful anyway :p
08:54:12 <Alberth> but yeah, just compile it at all relevant platforms
08:57:13 <andythenorth> not sure how maintainability is affected by python vs C++
08:57:33 <LordAro> needs some profiling, before making assumptions
08:58:36 <andythenorth> I think maintainability is +/-0
08:59:01 <andythenorth> lots of contributors here dislike python
08:59:13 <andythenorth> nml has fallen into a poor maintenance state
08:59:34 <andythenorth> python helps me maintain trivial things like constants, but I can't work with the parser / lexer :P
09:00:03 <Alberth> LordAro: expression optimizing is done too often, but it's pretty much impossible to say which ones are actually needed
09:00:39 <Alberth> it can't get much worse than current nml :)
09:00:53 <andythenorth> a spike rewrite to C++? o_O
09:01:16 <andythenorth> pick a subset of features, and make a minimally functional compile?
09:12:48 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN commented on pull request #7165: [core] Implement SmallVector using std::vector https://git.io/fjJ8B
09:13:31 <peter1138> LordAro, "this line looks potentially wrong" ... which line? :p
09:14:01 <peter1138> I think github is being silly to me :/
09:14:59 <peter1138> Oh yes, I didn't mention the line number either, oops.
09:15:05 <peter1138> But yes, that's the offending one.
10:35:15 <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. https://git.io/fjJ4Z
10:35:33 <TrueBrain> who made Samu write a PhD on the issue? :P
10:36:12 <andythenorth> also....it's a TrueBrain
10:43:35 <TrueBrain> hmm .. how to backport language changes ..
10:43:41 <TrueBrain> I know people had clever scripts for that ..
10:49:13 <TrueBrain> (given it is linked to a ticket that I just backported)
10:49:18 <TrueBrain> LordAro, happen to know?
10:54:45 <TrueBrain> can't find scripts people created/used to backport languages
11:01:46 *** HerzogDeXtEr has joined #openttd
11:02:48 <DorpsGek_II> [OpenTTD/OpenTTD] M3Henry commented on pull request #7165: [core] Implement SmallVector using std::vector https://git.io/fjJ4a
11:04:13 <DorpsGek_II> [OpenTTD/OpenTTD] nielsmh commented on issue #7371: Kdtree is built too early in savegame loading process https://git.io/fjJ4w
11:10:40 <TrueBrain> what did you dooooooo :D
11:11:20 <nielsm> all newgrfs are in place
11:14:28 <TrueBrain> hmm .. I forgot that modifying a patch in place is difficult, because it also tracks 'adds' and 'removes'
11:24:10 <DorpsGek_II> [OpenTTD/OpenTTD] nielsmh opened pull request #7398: Fix #7371: Avoid dependency on foundations of town tile during saveload https://git.io/fjJ49
11:37:08 <TrueBrain> patch files are picky :D
11:37:19 <TrueBrain> if a chunk has no changes, it errors
11:37:34 <TrueBrain> so how can I, in a streaming way, remove additions .. hmm
11:38:25 <TrueBrain> I don't want to complicate my script by tracking chunks :(
11:43:17 <nielsm> gah I wish assert breaks in the VS debugger would take me to the assert call, instead of inside the assert library code
11:48:50 *** m3henry has joined #openttd
11:49:57 <TrueBrain> ghehe, yes, yes indeed
11:56:26 *** circ-user-3HYVs has quit IRC
11:59:06 <nielsm> hmm did we do the changes from /*virtual*/ to c++11 "override" qualifier?
12:07:14 <TrueBrain> lets see if I did this correctly :D
12:10:45 <TrueBrain> no language errors; so I guess I did :)
12:12:30 <TrueBrain> 115 lines of Python
12:12:34 <TrueBrain> I should store this somewhere ..
12:12:43 <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
12:13:09 <TrueBrain> the main issue for me were strings that were modified in 1.10
12:13:13 <TrueBrain> you don't want those in 1.9 :)
12:13:58 <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
12:14:32 <TrueBrain> both removal, additions or modification
12:15:44 <TrueBrain> hmm .. how can we poke translators to fix those '35' outdated strings and stuff ..
12:16:09 *** Thedarkb-T60 has joined #openttd
12:16:42 <TrueBrain> do we normally email them or something?
12:17:18 <TrueBrain> many have not been updated for 1.9, it seems
12:17:35 <TrueBrain> German even is outdated :P
12:20:19 <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
12:22:26 <nielsm> I'm amazed the latin translation is among the almost complete ones...
12:22:48 <Samu> as for trying to start multiple AIs in just one command... I don't know how to do that
12:23:01 <Samu> I mean, I know, but I don't think it will work
12:23:19 <Samu> OnTick_Companies never stops being called
12:23:51 <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
12:40:06 <Samu> I'm always worried about OnTick_Companies
12:41:46 <TrueBrain> nielsm: that would work too; I would just add the 'amount of AIs to start' to that command, and loop in there :)
12:41:57 <TrueBrain> just moving of code, basically
12:42:45 <TrueBrain> nielsm: funny, tail recursion or loop recursion :D
12:42:47 <Samu> uhm, so it starts 10 AIs as 1 command, then next tick it could do the same
12:43:37 <DorpsGek_II> [OpenTTD/OpenTTD] nielsmh opened pull request #7399: Fix #7374: Ensure k-d trees are always updated when station sign moves https://git.io/fjJBj
12:44:50 <Samu> explain, I'm failing to understand
12:45:16 <nielsm> buried in kdtrees atm, want to finish these up before thinking too much about other things
12:59:10 *** Alberth has joined #openttd
12:59:10 *** ChanServ sets mode: +o Alberth
13:04:26 <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. https://git.io/fjJRn
13:06:41 <Samu> i think you mean 15 bits
13:07:49 <nielsm> may as well reserve a full 16 (initially) instead of making some weird odd positions
13:08:21 <Samu> OnTick_Companies will still be queued a second time
13:08:32 <Samu> but fail against the bitmask
13:09:00 <Samu> instead of dozens of commands failing, it's just 1 or so
13:12:05 *** synchris has joined #openttd
13:21:34 *** DrSegfault has left #openttd
13:25:04 <Samu> will have to make changes in AI::GetStartNextTime()
13:25:29 <Samu> for some reason, this doesn't look like it's not another hack
13:28:28 <m3henry> nielsm: #7324 has merge conflicts, but I can resolve them tomorrow
13:31:10 *** gelignite has joined #openttd
13:50:45 <DorpsGek_II> [OpenTTD/OpenTTD] M3Henry updated pull request #7324: Codechange: [C++11] Use override specifer for overriding member declarations https://git.io/fhxq0
13:50:54 <m3henry> Actually it didn't take long xD
14:14:59 <Samu> DoCommandP(0, CCA_NEW_AI | INVALID_COMPANY << 16, 1 | _settings_client.network.max_companies << 1 | num_to_start << 5, CMD_COMPANY_CTRL);
14:15:31 <Samu> i dont know about the bitsmask
14:16:48 <Samu> must work on a bitmask thing
14:18:34 <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)
14:19:20 <nielsm> also you probably should not store data in the command number?
14:19:44 <Samu> INVALID_COMPANY is meant to start AI as spectator
14:19:59 <peter1138> AI specatator? What?
14:20:11 <Samu> the command is issued by 255
14:20:33 <Alberth> AIs like to watch too :p
14:20:56 <Samu> I didn't change that, it's how the command is issued
14:21:02 <Samu> the owner of the command
14:21:27 <Alberth> that doesn't mean it makes sense :)
14:23:19 <Samu> it's a DoCommand thing that stuff are executed as Spectators
14:34:02 <peter1138> nielsm, so did you forget to compile?
14:34:25 *** Thedarkb-T60 has joined #openttd
14:41:12 <Samu> sorry nielsm I don't think I can do what you asked
14:43:55 <TrueBrain> please don't put words in my mouth; that is not a nice thing
14:45:45 <DorpsGek_II> [OpenTTD/OpenTTD] nielsmh updated pull request #7399: Fix #7374: Ensure k-d trees are always updated when station sign moves https://git.io/fjJBj
14:51:02 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN commented on pull request #7398: Fix #7371: Avoid dependency on foundations of town tile during saveload https://git.io/fjJEt
14:51:34 <Alberth> strcmp result swaps sign if you swap arguments :p
14:58:50 <Samu> this is starting to look like a terrible mess
15:09:30 *** Thedarkb1-T60 has joined #openttd
15:18:15 <Samu> sorry I didn't do the bitmask thing as requested
15:18:25 <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. https://git.io/fjvY8
15:19:47 *** sla_ro|master has joined #openttd
15:23:00 *** Wormnest has joined #openttd
15:25:30 <TrueBrain> you are still fixing symptoms .. not the issue
15:30: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
15:30:39 <TrueBrain> the system is not designed to start more than one company in a single tick
15:30:46 <TrueBrain> so there the problem already starts
15:31:07 <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
15:31:21 <TrueBrain> but you have to ask yourself .. why can it queue more AIs than intended?
15:31:32 <TrueBrain> and does that part of the system make sense?
15:32:26 <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
15:32:38 <TrueBrain> sounds a bit wasteful on the CPU
15:32:54 <TrueBrain> Normally this was only done AT MOST once a game-day
15:33:00 <TrueBrain> which is still iffy, but at least less wrong
15:33:13 <TrueBrain> seems the initial review didn't spotted this
15:34:34 <TrueBrain> if GetStartNextTime is zero, _next_competitor_start is always one, so every tick it runs MaybeStartNewCompany .. every tick
15:34:39 <TrueBrain> I think there it already went wrong
15:34:47 <TrueBrain> and the rest just is an escalation of that issue
15:35:23 *** andythenorth has joined #openttd
15:54:08 <TrueBrain> bah; glx broke cmake :P
16:14:08 <Samu> checking every tick was so it could start AIs immediately
16:14:29 <Samu> it was the whole point of the patch
16:14:32 <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
16:14:38 <TrueBrain> can you see there is some logic error in there?
16:15:36 <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
16:15:39 <Samu> maybe I can now change that part back to checking daily, since it can now start multiple AIs in 1 command
16:18:03 <Samu> the double check is probably not gonna be needed
16:39:09 *** Thedarkb2-T60 has joined #openttd
16:43:20 <Samu> how to detect the first tick of a game?
16:54:27 *** supermop_Home has joined #openttd
17:01:29 <Samu> AIs now start before the HU company
17:05:41 <Samu> this all feels so different
17:25:47 <TrueBrain> "/usr/bin/rpmbuild can't handle paths with spaces, use a build directory without spaces for building RPMs."
17:29:42 <Eddi|zuHause> ... at least they check and don't silently fail? :p
17:30:06 <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.
17:31:33 <andythenorth> let's delete something
17:31:38 <TrueBrain> okay, changing build directory with cmake is really easy .. which makes me happy :)
17:33:49 <Samu> i'm reworking MaybeStartNewCompany
17:36:38 <LordAro> why did instant starting AIs get included in the game?
17:36:50 <LordAro> wouldn't it be more appropriate for an admin console thing?
17:37:32 <Samu> beucase it's a new feature
17:39:33 <peter1138> LordAro, well, revert it all, and then the problem is solved :p
17:39:48 <LordAro> peter1138: well indeed
17:40:30 <peter1138> Hmm, why are news items not saved?
17:42:39 <_dp_> peter1138, who needs that spam :p
17:42:59 <peter1138> Dunno, just seems like missing game-state.
17:44:28 <TrueBrain> hmm ... what version to give non-tagged, in terms of bundling ..
17:44:39 <TrueBrain> take a 'deb' package .. what version should a random master commit have ..
17:45:25 <LordAro> 1.9.0.revisioncount ?
17:45:42 <LordAro> well, trunk would be 1.10.0.revisioncount
17:45:53 <TrueBrain> so 1.10.0 is older? :D
17:46:00 <TrueBrain> also, I only have major/minor/patch
17:46:18 <TrueBrain> 1.10.0-dev<revisioncount> ? Not sure that works tbh
17:46:52 <TrueBrain> okay, can't be bothred with this today .. something to table for now
17:47:47 <DorpsGek_II> [OpenTTD/OpenTTD] TrueBrain updated pull request #7270: Introduce CMake (and removing all other project-related code) https://git.io/fhbqc
17:48:17 <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. https://git.io/fjvY8
17:49:17 <Samu> the enforce title is now wrong though
17:49:29 <Samu> there's no enforce any more
17:49:48 <peter1138> Or does that need a new vision?
17:49:54 <DorpsGek_II> [OpenTTD/OpenTTD] stormcone opened pull request #7401: Change: Do not display a newspaper about old vehicles for which repla… https://git.io/fjJg0
17:50:08 <TrueBrain> Samu: a lot better, in my opinion. But to me it reads you are slipping in additional changes :)
17:50:21 <TrueBrain> the src/openttd.cpp changes seems unrelated to the fix
17:50:41 <Samu> it is, otherwise it would have to wait 1 day
17:52:17 <TrueBrain> and GetStartNextTime() for sure needs some love. 'skip_counter' is not very verbose, and comments in that function are now wrong :)
17:52:30 <peter1138> Why did I buy more snacks? I have tons of snacks :/
17:52:45 <peter1138> Brexit-snack-stockpiling?
17:52:47 <TrueBrain> seems more you mean 'index' or something, instead of 'skip_counter'
17:53:01 <Samu> _next_competitor_start = max(DAY_TICKS, AI::GetStartNextTime() * DAY_TICKS); this is wrong, halp
17:53:01 <TrueBrain> also, because you are inviting us to a party are your house
17:53:21 <glx> hmm TrueBrain, seems you drop my timestamp commit
17:53:27 <peter1138> TrueBrain, go for it.
17:53:34 <TrueBrain> glx: it failed horribly here
17:53:44 <TrueBrain> on a clean build, it refused to work
17:53:54 <TrueBrain> so I wanted to ask you if you knew what was going on
17:54:05 <TrueBrain> well, I did not mean to drop your patch as such
17:54:11 <TrueBrain> but ... my push did :P
17:54:25 <TrueBrain> glx: I tried another approach to fix your itch; does that also work?
17:54:27 <Samu> getstartnexttime will still be 74 ticks
17:54:47 <TrueBrain> (and sorry, I wanted to push to another branch of mine, but I forgot :( )
17:55:30 <glx> for baseset your approach is ok as they are not used later in build
17:55:35 <Samu> but then --_next_competitor_start means MaybeStartNewCompany() will never run
17:55:44 <TrueBrain> glx: I couldn't find a way to break the other 2 you changed
17:56:50 <TrueBrain> I now got what you meant with the configure_file() btw
17:56:54 <TrueBrain> are there other places that break?
17:56:57 <glx> easy, build, touch window_type.h and it will regenerate script_window.hpp everytime
17:57:11 <TrueBrain> owh, in your other branch?
17:57:41 <TrueBrain> hmm .. let me try; as I don't get what your commit fixed for that?
17:58:01 <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
17:58:13 <glx> oh forget it that's in my api branch :)
17:58:17 <TrueBrain> it only worked if I manually touched that file in existence
17:58:19 <Samu> nevermind, it's correct apparently, I'm stupid
17:58:38 <TrueBrain> glx: pfew, was afraid I was going mad :P :D
17:58:41 <glx> in cmake branch touch any .ini for settings
17:59:02 <peter1138> How do you run your Manley-Morel DMUs? As is, or with extra carriages?
17:59:34 <nielsm> occasionally adding up to two extra cars
18:00:09 <glx> it will the "regenerate" strings.h and settings.h everytime
18:00:15 <DorpsGek_II> [OpenTTD/OpenTTD] TrueBrain updated pull request #7270: Introduce CMake (and removing all other project-related code) https://git.io/fhbqc
18:00:37 <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
18:00:47 <TrueBrain> what do you think about the commit above; can we also live with that? (touching the files)
18:01:10 <glx> will then rebuild a lot for a non real change
18:01:47 <glx> will be a pain for api ;)
18:02:13 <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
18:02:24 <TrueBrain> what is the usecase for those files to change glx?
18:02:39 <supermop_Home> apparently I had left the window in the room open slightly all winter and just noticed it now
18:03:20 <glx> you can change english.txt just to fix a typo without needing to rebuild all files using strings.h
18:03:20 <TrueBrain> glx: I expected settingsgen to always touch the output file .. I guess it does not :)
18:04:02 <TrueBrain> the issue is, I guess, that we are fighting against how 'make' expects things to work
18:04:51 <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
18:05:00 <TrueBrain> so it could miss dependencies, from what I could tell
18:05:21 <glx> byproducts is mainly a ninja thing
18:05:30 <TrueBrain> yes, dependencies is not :)
18:05:53 <Samu> /* Find the first company which doesn't exist yet, but skip some */
18:07:06 <glx> the original depends file is added before the if
18:07:07 <peter1138> Comments should really explain why. The what is covered by the code.
18:07:30 <TrueBrain> glx: it is really hard to read, as you notice :D
18:08:04 <glx> yes cmake language doesn't always help
18:08:09 <TrueBrain> glx: I also could not figure out what all the ;:::, :::, and :::; was about
18:08:26 <andythenorth> AIs are too hard to code
18:08:30 <andythenorth> and need to be improved
18:08:40 <andythenorth> they're unintuitive
18:08:46 <andythenorth> and hard to figure out
18:08:46 <peter1138> I hope in the future...
18:08:46 <glx> I replace the keyword with ::: so each command stay separated
18:08:57 <andythenorth> are AIs hard to code?
18:09:20 <peter1138> Yes, but that's the AI part, not the API part.
18:09:31 <TrueBrain> glx: blaming CMake is easy; but what I notice that newlines, some comments, etc, really help :)
18:09:34 <peter1138> We delegated them to scripts for a reason :)
18:09:47 <glx> because cmake_parse_arguments merges all matching keywords into a single list
18:10:12 <TrueBrain> glx: now THAT is a useful comment to add ;) As it explains the "why" more than the "what" :)
18:10:15 <glx> so 3 commands end up in only one
18:11:23 <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
18:11:29 <TrueBrain> (I noticed that with some of my own code too)
18:11:55 <TrueBrain> anyway, please check if you can fix your patch breaking on an clean build directory, would be nice :D
18:13:28 <glx> I'm fighting again with VS and cmake after a branch switching
18:13:35 <glx> this stuff is really unstable
18:13:48 *** rubenwardy has joined #openttd
18:14:22 <TrueBrain> 2019 seems to integrate CMake a bit nicer
18:15:20 <glx> I'll switch to 2019 when it's official ;)
18:15:42 <Samu> it's not really an 'index'
18:16:52 <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
18:17:59 <Samu> a company index skipping?
18:18:38 <peter1138> Should I update to 2019?
18:18:42 <peter1138> I don't really use it.
18:19:01 <Samu> company_index_skipping_counter ... good name?
18:19:11 <peter1138> Debian VM + vim + vnc is... a better developing experience o_O
18:20:32 <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
18:20:51 <TrueBrain> I somewhat start to understand how this is wokring and what is going on :P
18:24:07 <TrueBrain> glx: yup, that fixes it :)
18:24:14 <TrueBrain> glx: I will make this into a patch, if you don't mind
18:24:32 <TrueBrain> add some comments and things, see if together we can create macros people can understand :D
18:25:01 <glx> but indeed working around cmake requires good comments
18:25:05 <TrueBrain> neck deep in Macro shit :P
18:26:34 <peter1138> Wasn't cmake supposed to be great? :p
18:27:53 <Samu> * @param ids_to_skip Number of company indexes to skip during evaluation.
18:39:00 <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. https://git.io/fjvY8
18:40:28 <Samu> just renamed title, looks a bit big now :)
18:41:39 *** Thedarkb-T60 has joined #openttd
18:44:10 <Samu> crap, num_ais still wrong
18:44:49 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN opened pull request #7402: Fix: Filtered file list did not scroll properly. https://git.io/fjJ2m
18:46:15 <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?
18:46:50 <Samu> this is the line with problem
18:49:22 <Samu> i'm inclined towards uint num_to_start = max(1U, GB(p2, 0, 4));
18:49:44 <peter1138> Are you saying that I can't start up multiple AIs instantly during a game, now?
18:49:55 <peter1138> (By increasing max competitors)
18:50:03 <Samu> no, p2 in some places is still 0
18:50:23 <Samu> start 0 AIs makes not much sense
18:50:44 <peter1138> I'm refering to _next_competitor_start and the removal of the loop.
18:50:54 <peter1138> I guess it doesn't matter to much. DAY_TICKS is quite short.
18:51:28 <Samu> p2 is meant to be the number of ais to start
18:52:22 <peter1138> I'm not talking about p2.
18:52:27 <peter1138> FFS, learn to read :/
18:52:57 <utack> hi. does anyone know a good grf with school buildings?
18:54:40 <Samu> it will be slightly delayed though, it's not exactly next tick right away
18:55:54 <peter1138> Yeah, just 1 day instead of instantly. No biggie mid-game.
18:56:01 *** Thedarkb1-T60 has joined #openttd
18:56:24 <DorpsGek_II> [OpenTTD/OpenTTD] nielsmh approved pull request #7402: Fix: Filtered file list did not scroll properly. https://git.io/fjJ24
18:57:26 <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. https://git.io/fjvY8
18:57:29 <peter1138> TrueBrain, does using "rebase and merge" or "squash and merge" affect backporting?
18:58:26 <TrueBrain> peter1138: no; it is just a bit more work that we have both options
18:58:30 <TrueBrain> but that is fine :)
18:58:57 <peter1138> I like squash-and-merge cos it adds the PR number. But sometimes you don't want to squash, so... heh.
18:59:22 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN merged pull request #7402: Fix: Filtered file list did not scroll properly. https://git.io/fjJ2m
19:00:24 <peter1138> "I'm unsure if this is really really correct," that's a scary start, nielsm :-)
19:01:54 <nielsm> well, the original kdtree PR was the same situation, "I hope I've caught all places that need to maintain this"
19:03:54 <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. https://git.io/fjJ2u
19:03:54 *** Thedarkb-T60 has joined #openttd
19:04:36 *** Supercheese has joined #openttd
19:05:05 <DorpsGek_II> [OpenTTD/OpenTTD] TrueBrain commented on pull request #7376: More than max_no_competitors could be created in network games https://git.io/fjJ2g
19:05:55 <TrueBrain> Samu: the art of programming is more with less. Not the other way around.
19:06:19 <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. https://git.io/fhAIp
19:08:47 <DorpsGek_II> [OpenTTD/OpenTTD] SamuXarick commented on pull request #7376: More than max_no_competitors could be created in network games https://git.io/fjJ2w
19:09:34 <DorpsGek_II> [OpenTTD/OpenTTD] TrueBrain commented on pull request #7376: More than max_no_competitors could be created in network games https://git.io/fjJ2o
19:16:39 <Samu> the value can never be over 15
19:17:18 <DorpsGek> Samu: Error: invalid syntax (<string>, line 1)
19:18:36 *** circ-user-3HYVs has joined #openttd
19:19:09 <Samu> no need to check num_to_start > MAX_COMPANIES then
19:26:35 <Samu> that 'possibly' word was peter1138's suggestion
19:27:45 <TrueBrain> I doubt he meant this
19:28:11 <TrueBrain> "Allow multiple AIs to possibly start in the same tick" <- this is now just bad english. Without 'possibly' it means what you want
19:28:21 <TrueBrain> allowing something to possibly happen is as vague as fog
19:28:36 <TrueBrain> I am allowing you to possibly merge this .. doesn't mean anything
19:29:15 <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"
19:29:38 <TrueBrain> next step is a comment like: /* Doing stuff */ :D
19:29:40 <Samu> /** Start new competitor companies if possible. */ this one was already there, even before the initial comment
19:29:51 <TrueBrain> yes; and that is perfectly fine
19:30:03 <TrueBrain> 'Allow a new competitor to possibly start' is now
19:31:01 <TrueBrain> the problem is with 'allow' vs 'possibly'
19:31:55 <Samu> this one is tricky to explain
19:32:23 <Samu> they've already been accounted for, but they're currently not created
19:32:38 <Samu> i have to pretend they were
19:33:05 <TrueBrain> you are not skipping SOME indexes
19:33:09 <TrueBrain> you skipping a VERY SPECIFIC amount
19:35:50 <peter1138> I've got a can of IPA. Woo.
19:36:23 <peter1138> Lidl brand, so it may not be any good :p
19:36:49 <peter1138> Ah, phew, I found a stash :D
19:37:58 <Samu> I don't know how to comment
19:38:38 <LordAro> i feel the last few hours has made that abundantly clear
19:39:18 <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
19:44:05 <DorpsGek_II> [OpenTTD/OpenTTD] TrueBrain updated pull request #7270: Introduce CMake (and removing all other project-related code) https://git.io/fhbqc
19:44:44 <Samu> ids_to_skip--; // number of company indexes to skip, that are pretended to have been started, but actually aren't
19:44:55 <TrueBrain> there glx :) Let me know if I misunderstood any :)
19:45:48 <TrueBrain> fixed 3 minor bugs while going through it; nothing fancy :) (as we were not using it that way)
19:49:16 *** Thedarkb-T60 has joined #openttd
19:51:12 <TrueBrain> time to rebase the branch I guess ..
19:54:08 <glx> I considered adding ALL in options, but I think its location matters
19:54:29 <glx> so I left it in unparsed, with the target and first command
19:54:44 <TrueBrain> glx: that should have been in a comment :D
19:56:18 <TrueBrain> fixed ALL, and rebased
19:56:20 <DorpsGek_II> [OpenTTD/OpenTTD] TrueBrain updated pull request #7270: Introduce CMake (and removing all other project-related code) https://git.io/fhbqc
19:57:08 <Samu> Comparing, incrementing, and substracting in a single statement.
19:57:15 <Samu> i thought that was code efficiency :(
19:57:41 <TrueBrain> that statement you made there is VERY error prune
19:58:48 <rubenwardy> readability is way more important
19:59:06 <rubenwardy> "premature optimisation is the root of all evils"
19:59:20 <rubenwardy> also, the compile does a lot of optimisations like that anyway
19:59:26 *** D-HUND is now known as debdog
19:59:30 <rubenwardy> and it will result in the same machine code
19:59:42 <Samu> 4 - ++0 > 0 becomes 4 - 1 > 0, becomes 3 > 0
19:59:59 <LordAro> Samu: no, stop trying to explain it to us, we already understand it
20:00:12 <LordAro> we're telling you that it's confusing and error prone, so stop trying to do it
20:00:30 <Samu> ok let me try another way
20:00:41 <peter1138> b++; if (a - b > 0)
20:01:00 <TrueBrain> I believe it is even in a while statement :p
20:01:11 <TrueBrain> reinventing for(), basically :)
20:03:42 <peter1138> "In the main menu donwload and activate LuDiAI AfterFix (v9)"
20:03:46 <rubenwardy> b++; for(; a -b > 0; b++)
20:03:48 <peter1138> ^ blame the bug on Samu :D
20:04:53 <peter1138> Refit Cost: -£25,122
20:04:59 <peter1138> I may have got that sum the wrong way around :-)
20:05:20 *** circ-user-3HYVs has quit IRC
20:06:51 <TrueBrain> okay, first steps of making a bundle are there ... w00p :D
20:06:55 <TrueBrain> CPack is pretty cool
20:07:24 <TrueBrain> FHS is annoying, but that is Linux only, so meh :)
20:07:47 <Samu> converting a do while into a for is complicated
20:09:14 <Samu> i can't do this, it was fine the way I had it :(
20:12:28 <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
20:12:38 <TrueBrain> converting a while{} to a for, that can be tricky
20:12:59 <TrueBrain> you basically wrote a for(), just as a do/while
20:14:37 <peter1138> If 7404 was a PR...
20:14:41 <DorpsGek_II> [OpenTTD/OpenTTD] TrueBrain commented on pull request #7376: More than max_no_competitors could be created in network games https://git.io/fjJaR
20:17:11 <TrueBrain> I want templates to reply with
20:17:34 <TrueBrain> well, for next time :)
20:17:44 <peter1138> I think you can have multiple templates somehow, as well.
20:18:00 <TrueBrain> and put them even on shortcuts
20:18:05 <TrueBrain> it is the top right button in the reply box
20:20:23 <Alberth> look for it, and you'll find it :)
20:20:48 *** supermop_Home_ has joined #openttd
20:20:57 <supermop_Home_> there should be a many rivers tool in SE
20:21:52 <supermop_Home_> as it is you get whatever rivers the SE generates at the beginning, but can't make more later except manually
20:22:20 <supermop_Home_> in case you had to terraform a valley that has an odd slope stopping a river making it to the shore
20:23:02 <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
20:23:36 <Samu> perhaps the same for GetNumItems
20:25:13 <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
20:26:18 <TrueBrain> I meant reply templates :)
20:26:25 <TrueBrain> of which you can have many
20:26:49 <peter1138> supermop_Home_, PR? ;)
20:29:14 <LordAro> TrueBrain: oh, didn't know about thos
20:29:41 <TrueBrain> me neither; that was the whole point :D
20:30:34 <supermop_Home_> peter1138 idk how to do that
20:33:02 <DorpsGek_II> [OpenTTD/OpenTTD] SamuXarick updated pull request #7376: More than max_no_competitors could be created in network games https://git.io/fjvY8
20:36:56 *** andythenorth has joined #openttd
20:38:03 <Samu> hmm about the 'some' comment... meh... i dunno what to say there
20:38:21 <Samu> it is commented in the declaration thing
20:39:18 <Samu> i still need to change commit message, and do the fix up's rebases thingies
20:39:34 <Samu> before I do, I wanted to know if it needs further changes
20:40:51 <TrueBrain> for sure it is improving every iteration :)
20:41:08 <TrueBrain> GetStartNextTime is a bit annoying to have this skip-thingy .. it misses context what it is for
20:41:23 <TrueBrain> you need to read the code now, and assume that start_date is different for every AI, for this to make sense
20:44:33 <DorpsGek_II> [OpenTTD/OpenTTD] TrueBrain requested changes for pull request #7376: More than max_no_competitors could be created in network games https://git.io/fjJaS
20:44:46 <TrueBrain> Samu: and you never answered why the changes in src/openttd.cpp are important :)
20:45:39 <Samu> because they were set up to start immediately, I did comment there
20:46:05 <Samu> it won't start on the OnTick_Companies because there is a 74 ticks delay now
20:46:12 <TrueBrain> a) you did not; b) answering the the question is not an answer ;)
20:46:21 <TrueBrain> I can read WHAT it does. I am asking WHY it needs to do that
20:46:33 <TrueBrain> you keep falling for this :)
20:51:38 <Samu> regression test failed? :(
20:59:19 *** gnu_jj_ has joined #openttd
21:00:15 <Samu> I forgot how to check the result of regression
21:00:31 <Samu> have to edit regression.bat but can't remember what
21:02:34 <peter1138> If regression is changed, you have probably broken something.,
21:07:09 <Samu> glx, how to log regression into a .txt? I forgot
21:08:09 *** circ-user-3HYVs has joined #openttd
21:08:23 <glx> add -k in regression.bat IIRC
21:10:45 <Samu> created an empty file :(
21:11:19 <Samu> so... the AI didn't start, I assume?
21:13:03 <glx> TrueBrain: something like -k option may be useful in cmake branch
21:13:19 <Samu> the test is being done before the HU company is created
21:14:39 <_dp_> can we just ban non-bananas grfs?
21:14:57 <_dp_> wanted to check that funding bug but couldn't find all that grf crap :(
21:15:30 <Samu> actually, 2 errors, that and then some more
21:16:08 <Samu> turns out that bool isn't necessary
21:18:26 <Samu> the do while cycle was working fine
21:18:37 <Samu> the for cycle is now what's failing regression
21:18:56 <Samu> can I go back to do while?
21:19:22 <TrueBrain> only if you agree that makes you a stackoverflow kiddy
21:21:29 *** Thedarkb-X40 has joined #openttd
21:24:12 <_dp_> ehm, why is it called eGRVTS on nielsm screenshot but for me it says GRVTS (without e)? o_O
21:25:34 <_dp_> also what is "This is a replacement for an existing NewGRF" supposed to mean on that screen?
21:26:30 <_dp_> why is it calling all unknown grfs a replacement for smth?
21:27:26 <Samu> Running ai/regression/tst_regression... passed!
21:27:44 <Samu> great, so I'm back to do, while :( failed to convert it into a for
21:29:04 <Samu> who's a do while to for convertion expert? :p
21:29:18 <peter1138> Damn, showing correct capacity and cost of refits in purchase menu is such a rabbit-hole
21:29:46 <Samu> and all those shennanigans about readability too?
21:30:00 <Samu> cus I'm afraid if I touch it, I will break it again
21:30:19 <nielsm> and eGRVTS 1.0 shows as "matching not found, loaded compatible"
21:30:25 <nielsm> so just missing one file now
21:40:09 <_dp_> weird, I can fund stuff but not on trees %)
21:41:42 <nielsm> trees make the site unsuitable
21:42:01 <andythenorth> I asked for that to be 'fixed'
21:42:14 <andythenorth> has it broken something related?
21:42:22 <andythenorth> trees on coasts were preventing industry funding
21:44:08 <nielsm> yeah, converted savegames can't place industries on trees
21:46:07 <peter1138> But yeah, that's a glaring ommission now that you pointed it out :/
21:46:56 <nielsm> hmm aren't trees supposed to convert cleared terrain back to grassland immediately?
21:47:16 <planetmaker> you clear trees like all other tiles
21:47:25 *** Thedarkb-T60 has joined #openttd
21:47:29 <planetmaker> with the same dirt to grass procedure
21:47:33 <nielsm> I mean, when you plan trees on tiles
21:51:04 <planetmaker> plant? No, when planting trees, it doesn't get dirty
21:51:32 <planetmaker> When removing trees... that is normal to convert it to dirt
21:52:24 <nielsm> when planting trees on clear dirt, I remebered that the land would instantly convert to grass
21:54:02 <peter1138> Just tested in 1.8.0
21:54:22 <nielsm> anyway, it looks like m1 is 0x70 on new trees planted, which can be built over
21:54:33 <nielsm> and is 0x10 on converted saves where you can't build industries over them
21:54:33 <DorpsGek_II> [OpenTTD/OpenTTD] michicc commented on pull request #7324: Codechange: [C++11] Use override specifer for overriding member declarations https://git.io/fjJVi
21:57:52 *** circ-user-3HYVs has quit IRC
21:58:02 <peter1138> Looks like a fucked up :(
21:58:13 <peter1138> No savegame conversion.
21:58:35 <nielsm> actually, if I plant a tree on a clear grass tile, its m1 remains 0x10
21:59:14 <peter1138> And imho, waterclass should only be tested for the coast tiles, but... waterclass is how that is determined. Hmm.
21:59:16 <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
22:00:17 <nielsm> as soon as grass begins to grow back underneath the new tree m1 changes to 0x70
22:00:35 <michi_cc> Who wants to buy PR#7379 from me for review? Barely used, $0.
22:05:22 <peter1138> nielsm, it's duplicated information anyway :/
22:06:06 <peter1138> So I think we should revert and do the fix differently.
22:08:32 <peter1138> IsCoastTile can just check for TREE_GROUND_SHORE
22:09:17 <DorpsGek_II> [OpenTTD/OpenTTD] nielsmh commented on issue #7400: Tree tiles converted wrong in savegames, block new industry creation https://git.io/fjJVQ
22:10:20 <nielsm> so, can't do a savegame version upgrade in 1.9 branch
22:11:36 <peter1138> I'm working on it :-)
22:14:02 <DorpsGek_II> [OpenTTD/OpenTTD] SamuXarick updated pull request #7376: More than max_no_competitors could be created in network games https://git.io/fjvY8
22:15:05 <peter1138> nielsm, probably shouldn't change the subject of bug reports like that :/
22:16:10 <nielsm> changing it back + adding the "on trees" detail
22:16:12 <peter1138> Which industry type is it? Any or a specific one?
22:16:37 <nielsm> tried both stock and a game with SPI
22:16:56 <nielsm> any industry that requires flat, dry land
22:17:08 <peter1138> Ok, so most of them :-)
22:18:41 <DorpsGek_II> [OpenTTD/OpenTTD] SamuXarick commented on pull request #7376: More than max_no_competitors could be created in network games https://git.io/fjJVx
22:19:13 <peter1138> And for the water test, I need FIRS I guess.
22:28:55 <glx> Samu: I tried to reproduce but couldn't, thanks for the hint but without a full trace it won't be easy
22:29:05 *** gelignite has joined #openttd
22:31:24 <Samu> something about kdtree, definitely not my AI causing it
22:33:16 *** supermop_Home_ has quit IRC
22:37:16 <Samu> uhm, nop, not crashing now
22:41:23 <Samu> now I managed to crash the way he reported
22:41:48 <Samu> clicked ignore, and game still runs lol
22:42:57 <glx> I followed the steps, no crash for me
22:54:36 *** Supercheese has joined #openttd
23:21:50 <Samu> it's funny, I wrote this code, and now I can't follow it
23:22:04 <Samu> i just know that it works
23:31:49 <Samu> assert(num_to_start_do_while == num_to_start_for);
23:32:40 *** Thedarkb-T60 has joined #openttd
23:37:30 <Samu> i think do while looks simpler
23:37:42 <Samu> or i just suck at turning this into a for
23:37:54 <_dp_> Samu, don't use ++ in expressions, I'm not even sure if that's a defined behavior there
23:38:25 <Samu> the do while part is tested as correct
23:38:34 <Samu> can u help me create a for version of it?
23:38:38 <milek7> why it would be undefined?
23:39:44 <_dp_> milek7, is evaluation order of operands in binary operator defined?
23:40:01 <_dp_> milek7, it may be for && but I'm not 100% sure
23:40:19 <peter1138> For && and ||, yes.
23:40:40 <_dp_> milek7, it definitely is ub for function arguments
23:42:58 <Samu> i think im missing a check, now that i closely look at it
23:43:00 <Eddi|zuHause> i'm fairly sure && is a sequence point
23:43:27 <Eddi|zuHause> but it is definitely a dangerous field to step in
23:47:08 <_dp_> yeah, while(--x) is borderline acceptable imo but not that
23:48:14 <Eddi|zuHause> there's no reeal reason why it couldn't be a separate statement
23:50:22 <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"
23:57:00 <Eddi|zuHause> on a separate note, why is it checking for _settings_client.network.max_companies? i would have taken that as max human companies...
23:57:20 <Eddi|zuHause> so people can set those things separately
23:58:53 <Samu> I kept the same functionality
23:59:32 <Samu> my while is missing a check, speaking of which, that one
continue to next day ⏵