IRC logs for #openttd on OFTC at 2023-03-08
⏴ go to previous day
00:42:17 *** WormnestAndroid has quit IRC (Read error: Connection reset by peer)
00:42:20 *** WormnestAndroid has joined #openttd
00:54:22 *** Wormnest has quit IRC (Ping timeout: 480 seconds)
01:42:05 *** Wormnest has joined #openttd
02:02:50 *** herms has quit IRC (Quit: bye)
02:19:39 *** Wormnest has quit IRC (Quit: Leaving)
03:28:26 *** debdog has quit IRC (Ping timeout: 480 seconds)
04:55:49 *** WormnestAndroid has quit IRC (Read error: Connection reset by peer)
04:58:00 *** WormnestAndroid has joined #openttd
05:05:07 *** Smedles has joined #openttd
06:08:47 *** keikoz has quit IRC (Ping timeout: 480 seconds)
06:53:40 *** D-HUND is now known as debdog
07:21:18 *** sla_ro|master has joined #openttd
10:22:56 <Xarick> i knew i was missing something 😮
10:28:12 <Xarick> how do I get the depot index
11:05:13 <Xarick> there should be a group->child
11:21:25 <petern> There can be multiple children, but only one parent.
11:34:03 <petern> Another win for accidental release asserts.
11:37:02 *** WormnestAndroid has quit IRC (Remote host closed the connection)
12:04:43 <Xarick> I'm having trouble dealing with empty lists
12:07:53 <Xarick> `ScriptList::~ScriptList()
12:28:26 *** WormnestAndroid has joined #openttd
12:31:59 <petern> Why add ScriptVehicleList1() to list1, instead of just using ScriptVehicleList1()?
12:33:32 <petern> And as list1 is added to this list anyway, why even have that temporary list too?
12:34:57 <glx[d]> Anyway AddList wants a pointer, and you pass the address of the pointer, that's wrong
12:40:43 <glx[d]> You really need to learn the basics about pointers
13:10:35 <Xarick> weird, there's no error in release mode
13:16:51 <Xarick> didn't work that way petern
13:20:18 <petern> Release builds don't have asserts enabled.
13:29:07 <Xarick> im back to the same problem i had yesterday, memory usage doesn't go down
13:29:59 <glx[d]> `ScriptList *list1 = new ScriptVehicleList1();` should work
13:31:41 <glx[d]> ah no can't work, it's not a constructor
13:31:59 <LordAro> petern: pretty sure they do unless you're building a release branch (which has changed the default) or you've explicitly disabled them
13:33:27 <glx[d]> only openttd asserts are still present I think
13:34:01 <glx[d]> this one was probably an msvcrt assert
13:35:21 <glx[d]> anyway ScriptVehicleList1() and ScriptVehicleList2() are probably wrong, returning local stack object is never a good idea
13:53:15 *** Smedles has quit IRC (Remote host closed the connection)
13:54:01 <Xarick> unsure about asserts, let me try debug mode
13:54:15 *** Smedles has joined #openttd
13:55:36 <Xarick> i swear i tried that before and i had issues, now it works
13:55:44 <Xarick> i must have missed something
14:14:03 <Xarick> fantastic! I can finally test AIs
14:14:25 <Xarick> both list methods are produced and asserted if they're equal
14:19:46 <Xarick> the expected assert on free wagons
14:20:05 <Xarick> wondering if any AI really needs to list free wagons
14:21:30 <petern> Using a separate list for list1 is still redundant and makes a copy of the list contents.
14:22:09 <glx[d]> not really important, it's just a debug test for the functions
14:23:04 <glx[d]> in the end one of the two will be the actual constructor code
14:25:39 <kamnet> I'm surprised that nobody has taken ownership of the OpenGFX+ projects and moved them to Github
14:29:04 *** HerzogDeXtEr has joined #openttd
14:51:05 <petern> kamnet: Are you offering? 😄
14:56:01 *** WormnestAndroid has quit IRC (Read error: Connection reset by peer)
14:56:15 *** WormnestAndroid has joined #openttd
14:59:12 *** Smedles has joined #openttd
15:15:50 <kamnet> petern: Only if you want to watch me screw it all up for giggles
15:25:19 <Xarick> wide rivers broke HellyFerry
15:39:48 *** WormnestAndroid has quit IRC (Ping timeout: 480 seconds)
15:47:13 *** WormnestAndroid has joined #openttd
16:00:27 <Xarick> I am probably dropping the cache checks
16:00:44 <Xarick> can't find any issue as of yet
16:04:26 <Xarick> just had a random idea
16:04:44 <Xarick> limit the number of statues per town
16:16:10 <Xarick> the one that gives a perma boost to station ratings
16:21:51 <Xarick> i got some infrastructure cache mismatch: multiple companies in commands-out.log
16:22:06 <Xarick> but i don't know when that happened
16:22:36 <Xarick> yesterday or the day before, or so
16:24:03 <Xarick> is commands-out.log created from fresh everytime i debuglevel desync=2 ?
16:25:39 *** gelignite has joined #openttd
16:31:55 <Xarick> i dont know what to do with these savegames
16:32:12 <Xarick> dmp_cmds_c34224fc_000ade1f.sav and the like
16:33:29 <LordAro> Xarick: there's a file in doc that describes debug desync
16:38:27 <Xarick> what did i run with debuglevel desync=2 that caused it to save
16:49:07 <GeorgeVB> Would these variables be available for purchase sprite as well?
16:49:07 <GeorgeVB> If we can adjust a name in the purchase tree, it would be nice to adjust graphics just the same way.
16:53:09 <GeorgeVB> As you can see, the serie's name is not replaced with a sub name, but is saved and only followed by a sub name.
16:54:50 <GeorgeVB> The same can be applied to menu sprite as well. Instead of having a sub sprite it would be possible to use some special sprite with a serie's part and subs part.
17:10:59 <Xarick> hmm the infrastructure cache mismatch was on the game I was currently running
17:11:33 <Xarick> too bad i closed the game, i guess i can reproduce it
17:23:20 *** tokai|noir has joined #openttd
17:23:20 *** ChanServ sets mode: +v tokai|noir
17:23:59 <GeorgeVB> J0anJosepviaGitHub: It would be nice to have the possibility to limit the available trains' types as well. It is rather annoying to have steamers in the modern depot for electric trains
17:30:12 *** tokai has quit IRC (Ping timeout: 480 seconds)
17:31:24 <petern> 1) Best place to respond to a PR is in the PR 2) Seems offtopic for that PR.
17:35:23 <petern> andythenorth: see the pinned messages 😉
17:37:08 <LordAro> andythenorth: only 89?
17:37:13 <LordAro> we're clearly not trying hard enough
17:37:42 <andythenorth> petern: it's a meme now
17:38:38 <andythenorth> so full yolo, change the purchase sprite according to context?
17:38:49 <pickpacket> I'm getting a pretty hefty return on my taxes this year. I'd like to put some of that toward supporting the project. Now I'm putting the responsibility for reminding me (probably around Easter) of that promise ;)
17:39:00 <petern> Purchase sprite vs not purchase sprite is the context
17:40:20 <Xarick> the infrastructure desync points out to road piece counting
17:40:47 <andythenorth> petern: but categories!
17:41:21 <petern> "Why does the vehicle I purchased look different from the purchase list?"
17:42:41 <andythenorth> because it's a category folder divider marker
17:43:12 <Xarick> any road changes recently?
17:44:21 *** Flygon has quit IRC (Quit: A toaster's basically a soldering iron designed to toast bread)
17:45:12 <pickpacket> uhh... are there any known bugs with the music or effects in 13.0?
17:45:13 <petern> How many road pieces are there?
17:46:44 <petern> I noticed that with the original DOS music the initial set up delay isn't there/enough.
17:47:51 <Xarick> okay, build a lorry station, then demolish it, you remain with 2 road pieces
17:48:38 <petern> 2? Drive through road stop?
17:48:58 <Xarick> but i used demolish, dynamite
17:50:20 <Xarick> bug is not present in 13.0
17:56:53 <Xarick> trying to hunt which commit caused the bug 😮
18:08:36 <Xarick> 4c1406a4b5421632df2b5faadd56d5d965c108a8
18:09:01 <Xarick> Add: NewGRF road stops
18:09:05 *** gelignite has quit IRC (Quit: Stay safe!)
18:17:19 <andythenorth> you know we need to increase roadtype limit to 65k?
18:17:29 <andythenorth> well that would be great, then we could have categories
18:17:34 <andythenorth> how about roadtype variants?
18:21:33 *** Wormnest has joined #openttd
18:21:37 <andythenorth> timberwolf I played Stunt Car Racer recently
18:21:45 <andythenorth> WASM or dosbox web or something
18:21:48 <andythenorth> still super hard
18:26:29 <kamnet> andythenorth: Yes, please and thank you. Gosh I knew I was missing something!
18:26:44 <andythenorth> it was intended as a troll suggestion
18:26:54 <andythenorth> it might actually solve a lot of the fuckery
18:28:04 <kamnet> Road -> Road with white stripes / Road with yellow stripes / road with or without electricity.
18:28:45 <kamnet> It would actually make the UI easier
18:30:08 <kamnet> Something like that, yes.
18:30:28 <andythenorth> that's just how it is now 😛
18:30:37 <andythenorth> that's how roadtypes are used 😛
18:32:04 <kamnet> Oh I thought the [ - ] was supposed to represent a submenu you could open
18:33:23 <TallTyler> Variants would probably need the road menu to change from a dropdown to a new GUI, like the Object menu. Which probably wouldn't be a bad thing, new players get confused by the dropdown, in my experience. Rails would need the same treatment too, I think.
18:34:28 <petern> andythenorth: Such interoperability.
18:34:30 <kamnet> TallTyler: Would be better for mobile platforms too
18:35:16 <petern> Why did someone include green backgrounds...
18:35:16 <andythenorth> I mean...ideas are easy 🙂
18:35:24 <andythenorth> I've had as many as 10 ideas before breakfast
18:35:37 <andythenorth> 6 of them impossible
18:48:42 <DorpsGek> - Update: Translations from eints (by translators)
19:52:16 <Timberwolf> andythenorth: I was fine until I got to Division 2, and then it got difficult :)
19:52:33 <Timberwolf> I still haven't seen the Super Division off the back of my own work.
20:02:19 <andythenorth> I can't even finish track 1
20:02:56 <Xarick> I'm not sure where to put the EnforceCompanyModeValid
20:04:17 <andythenorth> timberwolf ever played Stunt Racer 2000 on RiscOS?
20:04:51 <Xarick> do I put it before the retry part, or after?
20:05:20 <Timberwolf> No, I didn't even realise it existed!
20:05:49 <andythenorth> definite 'inspired by'
20:06:04 <andythenorth> physics handling was more complete, but also even twitchier
20:06:23 <Xarick> or do I put it at line 623?
20:06:28 <Rubidium> Xarick: maybe be inspired by #10529?
20:09:30 <Xarick> oh, pff, you're doing there what I was going to do
20:10:34 <Rubidium> did that previous month, but split it up into multiple smaller simpler PRs... and now that one's waiting for a review
20:13:12 <Xarick> I was wondering if i could put the condition earlier
20:13:40 <Xarick> you have them placed in the same position as I do in script_order.cpp
20:14:59 <Xarick> there's no need to, for example, resolve order position if the company isn't valid
20:15:33 <Rubidium> I've just took the easy route and added them just before the others
20:15:57 <TrueBrain> oooeeehhhh, did Rubidium write Python code? 😄
20:17:32 <andythenorth> I saw a rubidium PR with python in it
20:17:32 <Xarick> SetOrderFlags is difficult to understand what it does
20:20:52 <glx[d]> callback is just to try multiple times
20:23:13 <Rubidium> TrueBrain: I might have, I wouldn't necessarily say it's good or efficient code
20:23:31 <TrueBrain> I am writing you the most nitpicking review OpenTTD has seen in a while
20:23:38 <TrueBrain> and you can 100% ignore all comments if you so like 😄
20:23:47 <TrueBrain> but thought you might appreciate some Pythonic hints and tricks 😄
20:24:45 <Rubidium> the last I wrote Python was probably still in the 2.x era
20:25:08 *** gelignite has joined #openttd
20:25:14 <TrueBrain> function wise you did well; nothing really to improve there
20:26:49 <TrueBrain> does `@game` and `@pre` stack? Cool 🙂
20:27:43 <Rubidium> I saw it being used in many other places, so I guess it does
20:28:56 <TrueBrain> none of these comments matter; so do with them what-ever you like 🙂
20:31:23 <LordAro> oh wow, i didn't even notice the tabs
20:31:35 <TrueBrain> your OCD sucks balls
20:31:47 <LordAro> github hid it from me
20:32:04 <TrueBrain> for me it renders as 8 spaces, so it triggered me 😛
20:33:39 <TrueBrain> I like you wrote a script to prevent this problem from existing again 🙂 That is nice 🙂
20:35:01 *** nielsm has quit IRC (Ping timeout: 480 seconds)
20:37:25 <TrueBrain> `0 & 0x1F` is zero, `0x20 & 0x1f` is zero, `0x40 & 0x1f` is zero
20:38:49 <TallTyler> Is there a reason to use this instead of a modulo?
20:39:42 <glx[d]> playing with bits is often faster
20:39:48 <TrueBrain> TallTyler: premature optimization basically. In the old days, not all compilers changed a modulo into an and. And this way you know you are using a power-of-two, instead of a slower modulo
20:40:06 <dwfreed> modern compilers generally produce the same results when doing mod a power of 2
20:40:39 <TallTyler> Ah, that gist is very helpful at showing why it's more efficient 🙂
20:41:14 <JGR> Mod behaves unintuitively with negative numbers, & is generally easier to understand
20:42:06 <TrueBrain> it gets wild when people start to do `_date & ((1 << 6) - 1)` 😛
20:45:31 <Rubidium> dwfreed: only true when using *unsigned* integers, with *signed* integers you get a different result (due to modulo behaving differently with negative numbers)
20:46:32 <dwfreed> sure, but generally if you're dealing with negative numbers, you know you are :P
20:48:58 <Rubidium> true, but the compiler might not know that the int you did the modulo on doesn't (shouldn't) become negative, or won't be negative in your specific part of the code
20:50:00 <Rubidium> though if you do your types correctly, i.e. mark them unsigned when they shouldn't become negative then there's no problem
20:51:02 <dwfreed> heh, gcc identifies that I'm performing the same operation and doesn't even calculate the second var
20:51:19 <TrueBrain> I just love when your modulo is negative, not all languages return the same value 😛 It confuses me every time ...
20:51:40 <dwfreed> indeed, python does not do negative modulo
20:51:51 <TrueBrain> it kinda does, just different 😛
20:52:07 <dwfreed> -37 % 32 is -5 in C, 27 in python
20:53:04 <TrueBrain> it just cracks me up, languages can behave differently like that .. it is so confusing
20:53:13 <TrueBrain> like .. MAKE UP YOUR MIND I AM TRYING TO BUILD GOLD HERE
20:53:19 <glx[d]> it's the same plus/minus 32 🙂
20:53:30 <TrueBrain> and neither is wrong
20:53:33 <TrueBrain> they are just different 😛
20:56:00 <andythenorth> ok time to write my GS debugger some more
20:56:09 <andythenorth> can I have text entry and eval?
20:56:18 <andythenorth> then I can run an arbitrary named function
20:56:31 <andythenorth> or inspect the values of arbitrary table slots and class instances
20:56:40 <andythenorth> "what could go wrong"
20:57:00 <TrueBrain> can I have "insert something widely out of scope of the thing at hand" here? Answer: no
20:57:02 <TrueBrain> there, I solved it 😄
20:57:16 <andythenorth> I have an idea though
20:57:27 <andythenorth> there's probably a case for a search widget in storybook
20:57:33 <andythenorth> then I can take the search query and abuse it 😛
20:58:22 <andythenorth> "Search the storybook" would be really useful....right?
20:58:45 <dP> I haven't seen any case for a buttons in storybook yet
20:59:27 <andythenorth> it was originally tutorial I think?
20:59:51 <TallTyler> The tutorial doesn't use the storybook, it hadn't been added yet
20:59:54 <dP> no someone just added them for no particular reason iirc
21:00:00 <TallTyler> Just the blue notification messages
21:01:06 <andythenorth> anyway, as I am trying to teach everyone I know...
21:01:06 <andythenorth> - food & shelter
21:01:06 <andythenorth> - access to medical care
21:01:06 <andythenorth> - basic level of human relations (friends / family / etc)
21:01:07 <andythenorth> Then the only remaining use case for anything is 'lolz'
21:01:22 <andythenorth> Obvs. not everyone has those things, so they are unable to make progress on the 'for the lolz' agenda
21:01:28 <andythenorth> sad state of the world
21:01:32 <Xarick> question: `* @game @pre ScriptCompanyMode::IsValid() when group_id != GROUP_ALL && group_id != GROUP_DEFAULT.`is this good english?
21:01:46 <TallTyler> I didn't expect a philosophy lesson in Discord channel #openttd-development today 😛
21:01:59 <TrueBrain> it is andythenorth , you never actually know what you can expect
21:04:43 <dP> in theory buttons in the story book sound like a good idea
21:04:56 <dP> on practice they're kinda awkward like the rest of the story book
21:05:20 <dP> I have a feeling most players don't even know what story book is
21:06:21 <dP> and then there is a whole thing with individual story books for each company...
21:08:36 <andythenorth> the buttons are awesome
21:08:51 <andythenorth> they have quite a few nice features about styling
21:08:56 <andythenorth> a little bit of layout control
21:09:06 <andythenorth> and a totally horrific way of bubbling events to handle UI clicks
21:09:56 <andythenorth> they can do colours and stuff
21:10:02 <andythenorth> and position left / middle / right
21:10:43 <andythenorth> It would be really helpful to have toggles / latches, but I can fake them by removing the button on click and replacing it with a different one
21:10:52 <andythenorth> I am planning to make the settings for my GS in the story book
21:11:00 <andythenorth> so they can be changed during gameplay
21:11:55 <andythenorth> oh maybe settings can be changed in GS during gameplay anyway now?
21:12:11 <andythenorth> seems to be available to me
21:12:58 <dP> may be affected by debug mode
21:14:17 <andythenorth> what does 'reload_ai' do and why doesn't GS have it? 🙂
21:14:58 <glx[d]> reload_ai kills the company and restart it
21:15:51 <andythenorth> ok so not applicable to GS
21:33:32 *** gelignite has quit IRC (Quit: Stay safe!)
21:34:27 <Xarick> wow, conflicts incoming, and i just rebased
21:35:43 <Rubidium> you could've expected that given the approval ;)
21:42:55 <glx[d]> there's still many places not using EnforceXXX macros
21:45:48 <Rubidium> is that in company/deity mode context, or just in general?
21:46:47 <glx[d]> noticed them when doing SQInteger stuff
21:47:41 <Rubidium> yeah, I noticed them too and then thought... something for later ;)
21:47:57 <glx[d]> yeah was out of scope for my PR
21:48:04 <andythenorth> is it intended that pages in the global story book also show in the company story book?
22:03:29 <Xarick> we have a disagreement
22:04:27 <frosch> TrueBrain: for the record: the python 3.x modulo is the correct one
22:04:30 <glx[d]> but it's using GetCompany()
22:04:46 <andythenorth> hmm writing table slot values to story book
22:04:57 <Xarick> one sets an error message, the other doesn't
22:05:00 <TrueBrain> frosch: Glad you made that decision :p
22:05:05 <glx[d]> anything using GetCompany() needs to be enforced
22:05:23 <andythenorth> should I write a recursive function, for when slots contain tables? 😛
22:06:18 <glx[d]> setting the error is ok here
22:06:44 <glx[d]> as it is actually an error
22:07:13 <Xarick> but it's not running a DoCommand 😦
22:07:41 <andythenorth> oof can't sort squirrel tables it seems
22:07:59 <glx[d]> preconditions are not only for commands, they can be for any API functions
22:08:53 <Xarick> got a dilema to solve now 😦
22:15:21 *** keikoz has quit IRC (Ping timeout: 480 seconds)
22:21:19 <Xarick> let's see what's gonna happen
22:24:39 <Xarick> I put the precondition in ScriptOrder::SetOrderFlags() instead
22:25:42 <Xarick> oops GetNumVehicles doesn't need the precondition
22:26:58 <glx[d]> use EnforceDeityOrCompanyModeValid then
22:27:12 <andythenorth> can I lambda sort in squirrel 2 sort()
22:27:21 <andythenorth> or do I have to write a custom comparator?
22:27:40 <andythenorth> squirrel 3 seems to have `result.sort(@(a,b) a<=>b);`
22:27:43 <andythenorth> but that errors in GS
22:28:51 <Xarick> how is this detection method working?
22:29:16 <Rubidium> Xarick: it does need one of the preconditions checks, specifically the one glx mentioned, because a company mode becomes invalid when the company goes away, but you aren't deity either.
22:29:57 <Rubidium> in other words, CompanyMode::IsValid() || CompanyMode::IsDeity() does not always result in true
22:30:18 <glx[d]> the script mainly checks if ScriptObject::GetCompany() is protected
22:32:22 <Xarick> EnforceDeityOrCompanyModeValid(false); for those 3 functions seems weird
22:32:32 <Xarick> they have special rules
22:33:22 <Xarick> depending on the group, it may or may not require being in Company Mode
22:35:03 <glx[d]> you can put the Enforce call only where needed
22:36:07 <Rubidium> please don't add EnforceDeityMode and EnforceCompanyModeValid in two different branches
22:36:24 <Rubidium> just use EnforceDeityOrCompanyModeValid before branching
22:36:54 <Rubidium> any further rules you can implement after it, just like is done for building roads
22:37:57 <glx[d]> anyway for ScriptGroup::GetNumVehicles() the Or version is fine
22:38:00 <Rubidium> or... just not make the functions complicated by only allowing company mode
22:38:11 <glx[d]> as you explicitely want one or another
22:38:42 <Rubidium> because... why would you want to iterate over *some* groups of vehicles?
22:39:09 <Rubidium> but not have access to the default/all group. That's only going to make the API harder to understand and use
22:39:58 <andythenorth> I think next I need to abuse side channels so GS can control industry
22:40:04 <andythenorth> how many bits do I get?
22:40:51 <andythenorth> 3 bits via IndustryControlFlags
22:40:56 <andythenorth> that's 8 values?
22:41:37 <glx[d]> and I agree with rubidium, groups are for company scope, if GS wants to do more it can change scope multiple times
22:44:15 *** esselfe has quit IRC (Remote host closed the connection)
22:45:08 <Xarick> _SetOrderFlags is false positive imo
22:45:22 <Xarick> I moved it up further to SetOrderFlags instead
22:47:45 <glx[d]> it must be in _SetOrderFlags
22:48:27 <Xarick> ah, i see, there's 2 functions
22:48:35 <Xarick> calling _SetOrderFlags
22:48:37 <andythenorth> hmm can we add more arbitrary industry control flags?
22:48:58 <Xarick> think im gonna revert my movements
22:49:34 <andythenorth> if I can find 1 more bit that can be given a reason to exist
22:50:09 <andythenorth> then I have 16 values
22:51:03 *** esselfe has joined #openttd
22:51:41 <andythenorth> INDCTL_CLOSE_SOON?
22:52:12 <andythenorth> or I could just not abuse side channels, and we could have actual comms?
22:52:22 <andythenorth> but I don't know how 😛
22:52:56 <andythenorth> GS reading / writing grf registers was already ruled out
23:01:26 <glx[d]> using registers could work, but only if 2 are reserved for that, one for newgrf->GS, one for GS->newgrf
23:05:21 <JGR> Directly writing to NewGRF registers is probably not the best design
23:06:12 <glx[d]> a specific newgrf callback would be better I guess
23:06:37 <Xarick> It didn't detect ScriptCompany::IsMine btw
23:06:50 <Xarick> I'm not using enforce precondition
23:07:17 <glx[d]> the detection is done for Command or GetCompany
23:07:54 <glx[d]> if the function doesn't call these it won't enforce
23:08:20 <Xarick> it requires being in a valid company
23:08:20 <JGR> Given that GSs can be arbitrarily suspended, you'd have all sorts of horrid race issues if you wanted to write more than one register at once
23:09:50 <JGR> A callback is atomic and the command layer already handles proper queuing
23:10:27 <glx[d]> so yeah command and newgrf callback
23:20:54 <Xarick> yes, it didn't complain now
continue to next day ⏵