IRC logs for #openttd on OFTC at 2024-03-03
β΄ go to previous day
00:00:30 <_glx_> and now I have just read it too, and tried to follow how it works
00:01:43 <truebrain> It does need keep stack, so be careful with these local variables! Better make them all static π
00:02:53 <xarick> it's an alternative to 10544 and to 11768
00:03:29 <truebrain> Did not know you could store a label in a variable π
00:03:57 <xarick> oh well, have a good night
00:04:18 <_glx_> it's not the label but the address of the label
00:04:21 <truebrain> (Or that you can have the same label more than once in a function)
00:04:38 <truebrain> _glx_: Tomato tomato π
00:07:08 <truebrain> Haha, local labels .. the crazy shit people come up with π
00:09:26 <_glx_> and it seems people decided to abuse it to do crazier stuff
01:28:50 *** tokai|noir has joined #openttd
01:28:50 *** ChanServ sets mode: +v tokai|noir
01:35:37 *** tokai has quit IRC (Ping timeout: 480 seconds)
01:44:57 <coil> someone might get a kick out of this but I put OpenTTD on LG WebOS since someone already did the hard work of porting SDL2
01:58:32 *** D-HUND is now known as debdog
02:01:36 <debdog> OR in a fresh game the first vehicle being build is a truck, what would be its ID?
02:02:14 <debdog> the first train engine in a fresh game is "1" but that does not work for a road vehicle
02:04:23 <debdog> hmm, somehow the script is not active, investigating...
02:10:47 <debdog> ok, now I have fresh game, game script is active but I still cannot find said tool.
02:19:43 <_glx_> I guess it's in story book
02:19:56 <debdog> wow, never would have guessed a "Story Book" would contain that
02:20:17 <_glx_> it's the only way to interact with GS
02:20:21 <debdog> but then I am not that familiar with games scripts and never dealt with one before
02:22:40 <debdog> I don't suppose it's possible to get that script included into an already existing scenario?
02:26:16 <_glx_> I think you can change GS in scenario editor
02:38:14 *** HerzogDeXtEr has quit IRC (Read error: Connection reset by peer)
02:56:41 <debdog> phew, I now have got a self made opntitle, not yet populated but just a vehicle the cam follows
02:59:23 *** Wormnest has quit IRC (Quit: Leaving)
03:49:44 *** debdog has quit IRC (Ping timeout: 480 seconds)
03:51:56 *** gnu_jj_ has joined #openttd
03:55:06 *** gnu_jj has quit IRC (Ping timeout: 480 seconds)
04:14:43 *** D-HUND is now known as debdog
05:53:18 <locosage> Citymania client shows id in the vehicle window
05:53:36 <locosage> Probably more convenient than using story book
05:53:51 <locosage> Need to enable dev mode though
06:04:30 <debdog> anywho, I was able to find the vehicles ID by now
07:05:15 *** Flygon has quit IRC (Quit: A toaster's basically a soldering iron designed to toast bread)
07:44:22 *** marchnex has joined #openttd
09:11:39 *** Leopold has quit IRC (Remote host closed the connection)
09:17:31 *** Leopold_ has joined #openttd
09:21:15 *** Smedles has joined #openttd
09:30:50 <peter1138> Might yolo #12192. Can always be reverted if it's wrong.
09:30:57 <peter1138> Doesn't need backporting.
09:31:08 <truebrain> so will take months before someone notices it is wrong π
09:31:54 <peter1138> Now, should I get the bike out?
09:32:30 <peter1138> But then I can't work on PRs π¦
09:33:22 <peter1138> I "could" go out later when the ice has thawed a bit.
09:33:39 <truebrain> how is there ice .. lol. Here it hasn't been below zero in a few days / weeks π
09:33:41 <peter1138> But we all know that means I won't.
09:33:51 <peter1138> It was -2Β°C last night.
09:37:32 <peter1138> Hmm, the title game uses NPF.
09:37:43 <peter1138> A good reason to get rid of NPF.
09:38:10 <peter1138> ==446507== Use of uninitialised value of size 8
09:38:10 <peter1138> ==446507== at 0x98DAAC: Ship::GetVehicleTrackdir() const (src/ship_cmd.cpp:0)
09:38:47 <jfs> will it keep working if NPF is removed?
09:39:17 <jfs> v14 has been branched and NPF could just be removed in master
09:39:34 <peter1138> The PR is there, we're just going to wait for more survey results.
09:39:38 <peter1138> Just to be sure π
09:40:39 <peter1138> Starting a game with valgrind is much quicker when you don't forget you've got 14 AIs configured to start.
09:43:45 <peter1138> `still reachable: 546,139,111 bytes in 34,956 blocks`
09:44:25 <truebrain> yes; we don't free most of our memory. It is fine π
09:44:46 <peter1138> Yeah, I'm sure after I fixed the ICU leak it was much closer to zero.
09:45:01 <truebrain> the whole spritecache is in there π
09:45:28 <peter1138> It was the `definitely lost` line that is closer to zero.
09:45:45 <peter1138> Still not actually zero though π
09:46:15 <peter1138> Yeah, spritecache and blitter buffer at 540MB of the 546MB.
09:46:54 <peter1138> I saw it existed, I haven't looked at it yet.
09:48:00 <peter1138> But now that my PR is merged you could raise against OpenTTD master.
09:52:43 *** HerzogDeXtEr has joined #openttd
10:05:10 <xarick> I already have so many commits
10:14:55 <truebrain> Codefix without a mention what it fixes; nice
10:15:40 *** marchnex has quit IRC (Quit: marchnex)
10:29:06 <peter1138> That's because it's not a codefix.
10:32:47 <truebrain> I always imagine people getting a hammer, and now going: NAIL NAIL NAIL, dunno π
11:00:32 <andythenorth> weird I've got one shell window that runs dog slow, typing is several seconds behind
11:00:38 <andythenorth> all other shell windows work normally
11:01:29 <andythenorth> closing and re-opening the window does not fix it π
11:02:07 <andythenorth> wonder if it's because there's a HUGE git repo in this directory
11:02:32 <andythenorth> and I've got a shell prompt util that shows current git branch etc in prompt
11:04:53 <truebrain> size of repo is rarely relevant. Amount of files does have an impact
11:05:23 <truebrain> either way, those hooks to show branch etc only run when rendering the shell prompt; not while typing
11:06:49 <andythenorth> wonder if I can compress the repo anyway
11:06:53 <truebrain> if you work with a lot of files in a git-repo, there are ways to make that a lot faster, by running a background task and inotify hooks. But not sure that is worth it π
11:07:18 <andythenorth> I don't actually need the history, it's just an archive of all my grf docs
11:07:37 <truebrain> `git clone --depth=1` removes the history when cloning π
11:07:51 <truebrain> but again, a history rarely makes git slow
11:07:58 <truebrain> the amount of files in the current working directory does
11:08:11 <truebrain> so make sure you are looking at the wrong issue before trying to solve it π
11:08:56 <truebrain> (most shell prompts execute a `git status`-like function, which crawls all your files to check if they have been changed; this is the most common reason for slow shell prompts)
11:09:29 <andythenorth> hmm only 277k files here though
11:10:26 <truebrain> so every shell prompt that is rendered, it checks 277k files whether they have been changed .. yeah ... your history is not your issue π
11:13:09 <andythenorth> can I be arsed to write a different zshrc π
11:13:22 <truebrain> so deal with the slowness it is! π
11:14:03 <truebrain> In case it really bothers you enough that you want to make some git-related changes
11:16:14 <andythenorth> so much faster, thanks
11:22:39 <peter1138> truebrain: Unless you're using WSL and it's being rsynced every time π
11:26:13 <_zephyris> FWIW I think the github gui runs the change monitor daemon
11:29:20 <truebrain> On Windows it is wise to run the monitor, as .. Windows π
11:41:46 <merni> jfs: It seemed to, anyway
11:42:27 <merni> if you want to see for yourself, you could add that nice "preview" tag to the PR :p
11:50:26 <peter1138> `this->line_height = FONT_HEIGHT_NORMAL + WD_MATRIX_TOP + WD_MATRIX_BOTTOM;`
11:50:30 <peter1138> This might be too old...
11:51:38 <merni> is RC2 going to happen? there are a whole bunch of backport-requested PRs
11:56:42 <xarick> I'm tempted to click the green button
11:57:49 <merni> opening a PR doesn't hurt anyone
11:58:11 <xarick> it's an alternative to an alternative to something already merged
11:58:41 <merni> well if it has no purpose now then yeah you shouldn't :p
12:01:02 *** Leopold___ has joined #openttd
12:02:36 <xarick> but my other alternative was also better
12:02:58 <xarick> so now they're both better π
12:08:05 *** Leopold_ has quit IRC (Ping timeout: 480 seconds)
12:09:03 <xarick> judging by the number of line changes, the better A has +360 -81 lines, the better B has +329 -83 lines
12:10:10 <xarick> oh, and 12 lines are about TicToc
12:30:42 <peter1138> Hmm, I guess returning `std::optional<std::string>` will make a copy of the string.
12:31:32 <truebrain> `string_view` ftw? π
12:32:20 <peter1138> I've got a std::string that may or may not exist, currently a `const char *` is returned, which can be null or point to string.
12:32:32 <peter1138> std::optional<std::string &> is not a thing.
12:33:00 <peter1138> Wouldn't `std::move` mean the original string is no longer valid?
12:33:28 <truebrain> depends a bit; but I am shooting in the dark here π
12:33:57 <truebrain> if you do a `std::optional<std::string> a() { return "abc"; }`, a `std::move` might work; dunno if `optional` understands that π
12:34:14 <peter1138> It's a list containing std::strings, the list of strings has to stay as it is.
12:34:30 <peter1138> I want to return the string, if it exists.
12:34:59 <peter1138> I guess `const std::string *` would work but...
12:35:31 <truebrain> that would make the `optional` a bit pointless again π
12:35:32 <_jgr_> If you only want to return the string data, and not the string itself, std::optional<std::string_view> would be the thing to use?
12:36:20 <peter1138> truebrain: Instead of optional, of course.
12:45:46 <peter1138> Using `std::string_view` is kinda like a virus, once you start using it in places it gets deeper and deeper.
13:07:49 <xarick> just thought of something... aqueducts
13:08:03 <xarick> where the ship comes from when inside an aqueduct
13:08:32 <xarick> didn't think of that, need to test
13:09:32 <kuhnovic> It will come from the start tile of the aqueduct. Bridges and tunnels are essentially teleport from one end to the other, it's just the animation that gives the right visual effect.
13:09:35 <kuhnovic> But it;s good to test
13:13:47 <klote> Hi, does anyone know why trying to load a map via openttd.cfg on a dedicated server doesnt seem to work... it just keeps generating a small map even though i have the save game in the same folder as the executable
13:14:27 <klote> trying to load a scenario
13:14:29 <peter1138> I don't think you can load a map just by the config file?
13:15:05 <klote> map_name = buildeurope.scn is not a thing?
13:16:21 <klote> cause it says you can do it via run command or via cfg
13:17:41 <peter1138> Your search - "map_name" url:wiki.openttd.org - did not match any documents.
13:17:47 <peter1138> Which wiki... what page?
13:19:04 <xarick> xarick: just checked. it traverses the entire aqueduct including exit ramp before calling the pf. By the time it does, `tile` is the tile after the exit ramp, and v-tile is the exit ramp. It's fine.
13:21:12 <klote> peter1138: i made a msitake
13:24:06 <peter1138> _zephyris: I wonder why the missing glyph `?` is narrower than the regular `?`
13:26:44 <peter1138> It's nearly 13:30 and I've not touched a bike.
13:27:15 <andythenorth> it's nearly 13:30 and I haven't touched lunch
13:28:27 <peter1138> Okay, everyone else I ride with has been on Zwift instead.
13:36:05 <xarick> Visual Studio has a new feature, #include cleanup
13:36:35 <_zephyris> peter1138: I don't know... Not sure how openttd selects the missing character glyph.
13:36:57 <_zephyris> I thought it should use unicode 0x0? That's coded as a question mark with a black border.
13:42:32 <peter1138> Hmm, it's not falling back to the `?` character, at least.
13:45:40 <_zephyris> That's what I'd expect to see... Maybe it's putting the question mark character on a space character? That'd match the spacing
13:50:42 <_zephyris> The sprite font is probably the clue. There's no 0x0/missing character glyph, so probably is drawing a question mark on a space.
14:03:02 <peter1138> [2024-03-03 14:01:26] dbg: [misc:0] 240 253 54
14:03:02 <peter1138> [2024-03-03 14:01:26] dbg: [misc:0] 254 265 70
14:03:02 <peter1138> [2024-03-03 14:01:26] dbg: [misc:0] 266 277 75
14:03:02 <peter1138> [2024-03-03 14:01:26] dbg: [misc:0] 278 284 0
14:03:02 <peter1138> [2024-03-03 14:01:26] dbg: [misc:0] 285 291 0
14:03:04 <peter1138> [2024-03-03 14:01:26] dbg: [misc:0] 292 305 20
14:03:04 <peter1138> [2024-03-03 14:01:26] dbg: [misc:0] 306 309 3
14:04:28 <peter1138> So the space is glyph 3, and is 4 pixels, whilst the ? is glyph 0 and is wider.
14:06:18 <peter1138> But it's not drawing your actual glyph for unicode 0.
14:06:18 <_glx_> xarick: don't, it's not the best thing
14:07:02 <peter1138> I wonder if it behaves differently on Windows or macOS.
14:07:33 <_glx_> this is library_loader_win.cpp and it's already wrong about fmt/format.h (mainly because precompiled headers)
14:16:39 <LordAro> peter1138: i had sausage and bacon sandwich
14:16:51 <LordAro> i meant to say sausage and mushroom, but bacon came out instead
14:26:24 <_zephyris> peter1138: Is that George's newgrf, with superscripts?
14:29:52 <peter1138> One of the xUSSR sets, yeah.
14:57:16 <_glx_> is it defining sprite glyphs ?
14:59:45 <peter1138> No. I just found the drawing of missing glyphs a bit weird. I think it's us but I'm not sure π
15:12:00 <_glx_> [2024-03-03 16:10:30] dbg: [fontcache:4] Set glyph for unicode character 0x026E, size 0
15:12:00 <_glx_> [2024-03-03 16:10:30] dbg: [fontcache:4] Set glyph for unicode character 0x024C, size 0
15:12:25 <_glx_> but these characters don't seem to exist
15:25:21 <_glx_> ah no these exist, I was searching wrongly
15:28:54 <_glx_> using Arial it's fine for me
15:53:17 <Rubidium> apparently that exists in the ipad version
16:34:26 *** Wormnest has joined #openttd
16:34:35 <xarick> got a crash in one of them
16:45:26 *** Wormnest has quit IRC (Ping timeout: 480 seconds)
16:53:16 <xarick> yeah, the one on the right crashed...
16:53:23 *** blathijs has joined #openttd
16:53:23 *** ChanServ sets mode: +o blathijs
16:56:29 *** gretel[m] has quit IRC (Quit: Client limit exceeded: 20000)
17:06:55 <Rubidium> lets quickly get rid of all std::shared_mutex instances in OpenTTD before the 14 release!
17:09:48 *** Wormnest has joined #openttd
17:17:11 <peter1138> Well I was reading that too.
17:33:58 <rau117> Is there a way to return the display to a more... normal appearance?
17:33:58 <rau117> Instead of β123 456 kβ, can I change it to a β123.4 mβ or β123 456 789β?
17:39:39 <LordAro> i think all changes in that area got reverted
17:39:48 <LordAro> so it's not a "return to" as such
17:40:41 <rau117> Hmm... looks like I've got the memory bug again, yeah, looks like I'm getting too old (=
17:40:49 <peter1138> Not quite, we previously on had thousands and millions, now we have billions and trillions.
17:41:09 <truebrain> but for his case, nothing has changed in that regards in ... years π
17:41:29 <peter1138> But it's always switches to the next 'level' at 6 digits, not 3.
17:41:36 <peter1138> (Or is that 7 digits, not 4)
17:41:49 <rau117> *eh, a local mandella effect occurred (=*
17:59:13 *** kstar892[m] has quit IRC (Quit: Client limit exceeded: 20000)
18:03:48 *** gelignite has joined #openttd
18:13:09 <Rubidium> those changes got reverted after 14.0-RC1 though, so the reverting might not be that visible yet
18:19:14 <rau117> yeah, the only difference is localized 123 456 **ΡΡΡ**, instead of the usual 123 456 **k** β it caught my attention βsomething is wrong hereβ
18:34:27 <peter1138> In master it is still localised.
18:35:04 <DorpsGek> - Update: Translations from eints (by translators)
18:46:26 <peter1138> > 9 files changed, 142 insertions(+), 164 deletions(-)
18:46:30 <peter1138> Terrible deduplication :S
18:54:42 <peter1138> `* @return Indicates whether the StationSpec was deallocated.`
18:54:49 <peter1138> `void Deallocate...`
18:54:53 <peter1138> Yeah, no, it doesn't π
19:07:01 <ajmiles> Maybe someone typedef'ed 'void' to 'bool'
19:11:27 <LordAro> Pretty sure you can't do that
19:11:30 <LordAro> #define on the other hand...
20:16:36 <xarick> found the cause of the crash, applied a fix, let's see if it works
20:25:14 <kuhnovic> Does anyone know which code is used to spawn a red/green cost "label" that's drawn whenever you buy / sell something? I want to see if I can abuse it for some pathfinding debugging
20:41:09 <truebrain> jfs: one thing you need to know about Steam: there are hunderds of places something could be located. I looked around. I cannot find it. I think absolutely nobody is marked as OpenTTD dev .. at least mister o and myself are not π
20:42:45 <rutoks> But I can't find an address of a public instance of this API that I can query. Is there one?
20:59:57 <peter1138> Heh, two things on there with `openttd: "peter1138"`
21:02:18 <frosch123> do you want it migrated?
21:12:21 *** nielsm has quit IRC (Ping timeout: 480 seconds)
21:16:00 *** gelignite has quit IRC (Quit: Stay safe!)
22:13:12 *** keikoz has quit IRC (Ping timeout: 480 seconds)
22:44:31 <kuhnovic> Bugfix in the very heart of YAPF. What could possibly go wrong π ?
22:46:21 <xarick> how to destroy a game!
22:46:31 <peter1138> Hmm, well #12192 would have hidden that, if it wasn't intentional even...
22:48:47 <xarick> I'm a bit scared of that fix
22:49:05 <LordAro> seems like something you would be perfectly placed to test
22:49:28 <xarick> road vehs, trams, trains, ships... with all their quirks
22:50:49 <kuhnovic> Yes, I know. The risk is high. But what YAPF is doing is definitely wrong.
22:57:44 <kuhnovic> I don't think we have to put it in 14.0, YAPF works fine without it. Although "fine" is always a bit of a grey area with pathfinders.
22:58:35 <xarick> "I'm a terrible programmer"
23:00:38 <xarick> I have a vector, it's empty, I want to fill it via another function with a param [out]. Once returned from that function, I wanna forward the now filled vector to another function
23:01:35 <xarick> this function then takes its content and assigns to another variable... I wanted to do this in the most optimal way, without having copies
23:05:36 <LordAro> imo the fact that you're even asking that question makes you not a terrible programmer
23:05:37 <xarick> need a bit of guidance
23:06:21 <LordAro> (emphasis on the "not")
23:08:28 <LordAro> std::vector<my_type> my_vec; for (...) { my_type a; func_1(&a); my_vec.push_back(a); } ; func_2(my_vec);
23:08:50 <LordAro> where func_2 is something along the lines of `func_2(const std::vector<my_type> &vec);`
23:08:58 <LordAro> does that match what you want?
23:09:14 <xarick> just a min, writing up what i'm trying to do
23:13:20 <xarick> these dudes have declarations
23:19:16 *** Wormnest has quit IRC (Ping timeout: 480 seconds)
23:22:13 <xarick> does it have to be const?
23:24:03 <LordAro> it doesn't have to be
23:24:12 <LordAro> but it should be if it's not being modified within the function
23:24:34 <LordAro> const is a declaration to the compiler that the variable will not be modire
23:24:53 <LordAro> so it can shout at you if you try to (and apply certain optimisations to it)
23:39:20 <LordAro> you can't push_back on a const vector
23:39:28 <LordAro> as that's modifying it, funnily enough
23:39:58 <LordAro> in fact, i think you have const and non-const entirely inverted
23:40:50 <xarick> also the declaration needs an overload
23:41:42 <xarick> the CheckShipReverse and ChooseShipTrack complain about YapfShipFindWaterRegionPath': function does not take 3 arguments
23:42:48 *** Wormnest has joined #openttd
23:52:54 <xarick> hole crap, i think i did it, let's see
23:53:01 <xarick> it built without errors
continue to next day β΅