IRC logs for #openttd on OFTC at 2025-02-28
⏴ go to previous day
00:48:43 *** k-man has left #openttd (WeeChat 4.4.4)
01:16:32 <_glx_> hard to spot in the original commit
02:17:21 *** Wormnest has joined #openttd
02:45:50 *** Wormnest has quit IRC (Quit: Leaving)
03:26:59 *** debdog has quit IRC (Ping timeout: 480 seconds)
03:27:34 *** D-HUND is now known as debdog
04:11:34 *** Smedles has joined #openttd
04:44:19 <DorpsGek> - Update: Translations from eints (by translators)
06:19:06 *** Speedy` has quit IRC (Read error: Connection reset by peer)
06:20:53 *** Speedy` has joined #openttd
08:58:42 <xarick> infrastructure maintenance costs and roads...
08:58:58 <xarick> difficult problem to solve for an AI
09:43:18 <xarick> "parameter-ised GetString for my beloved AIs"
09:48:40 *** SigHunter has quit IRC (Remote host closed the connection)
09:49:48 *** SigHunter has joined #openttd
09:59:46 *** mindlesstux has joined #openttd
10:17:35 <pickpacket> is it hard to make a newgrf that adds an entirely new type of tracks?
10:19:37 <brickblock19280> Not really but it's not always obvious how to deal with compatibility
10:27:24 <pickpacket> I'm tempted to add a new type
10:29:17 <xarick> `if (const GameInfo *info = GameConfig::GetConfig()->GetInfo(); info != nullptr) ` what is this code style...
10:29:41 <xarick> I thought we were against going back to C-style
10:32:08 <xarick> why not have it in 2 lines?
10:34:15 <Rubidium_> because the equivalent would be 4 lines
10:48:49 *** woobilicious has joined #openttd
10:48:49 <woobilicious> my distro's Openttd doesn't have any music, but it definitely includes the files, any tips on figuring out why it's not finding them?
10:54:11 <brickblock19280> I don't remember if it's the music or sound packs that need to be extracted but I believe one of them had to be
10:54:45 <peter1138> Nothing needs to be manually extracted.
10:55:12 <brickblock19280> Sound and music also doesn't come with the game itself usually but it expected to be downloaded from bananas in game content
10:55:23 <woobilicious> peter1138, yeah I use NixOS, everything is built for reproduciability.
10:55:36 <peter1138> Is it linked with fluidsynth?
10:56:11 <woobilicious> music plays if I download it, it's just not finding those files in openmsx folder.
10:56:12 <peter1138> `openttd -v` should list fluidsynth under the List of music drivers: section.
10:56:55 <peter1138> What do you mean by download it here?
10:57:43 <peter1138> Are you saying it works if you download it in game, but not if openmsx is included in your... whatever the NixOS term is for a bundle?
10:58:06 <peter1138> Okay, then apologies, brickblock19280 is correct.
10:58:16 <peter1138> When you download it in game, the game automatically unpacks it for you.
10:58:55 <peter1138> So for your reproducible build, you will need to manually unpack the openmsx tar.
10:59:25 <peter1138> (Sound does not, only music)
11:00:08 <woobilicious> ahh okay, just noticed that the sound files are in openttd/data but they still work lol
11:08:58 <xarick> the new param string stuff...
11:09:59 <peter1138> GetString(STR__, a, b, c)
11:11:46 <xarick> <if (const AIConfig *config = AIConfig::GetConfig(cid); config != nullptr) return config->GetForceExactMatch() ? config->GetInfo()->GetName() : GetString(STR_AI_CONFIG_NAME_VERSION, config->GetInfo()->GetName());>
11:12:11 <xarick> not GetName, GetVersion
11:12:43 <xarick> horizontal coding style
11:13:17 <peter1138> Firstly, make a variable of config->GetInfo() so you don't have to keep calling it.
11:13:38 <peter1138> Secondly, STR_AI_CONFIG_NAME_VERSION needs two parameters, name and version.
11:13:50 <peter1138> Thirdly, you can split the ternary up on to multiple lines like I've been doing.
11:14:07 <xarick> config->GetForceExactMatch() isn't part of GetInfo
11:14:34 <peter1138> So what? config is still there.
11:15:06 <peter1138> script_config.cpp:212 is an example of splitting ternaries onto different lines.
11:16:06 <peter1138> As yours is already long, youu should use an `if (...) { ... }` block on multiple lines too.
11:24:53 <xarick> which one is less ugly?
11:28:39 <woobilicious> lmao okay got it working and quickly remembered that volume doesn't seem to work...
11:29:24 <peter1138> xarick, too many nested if conditions, and they're already returns.
11:32:57 <peter1138> Something like that maybe.
11:33:25 <peter1138> Avoids calling GetConfig() more often (that seems like it does a lot)
11:33:30 <peter1138> Avoids nesting conditions.
11:38:16 <xarick> i think config is null if info is also null, not sure
11:40:25 <woobilicious> Lmao okay so if I switch to fluidsynth it throws an error and crashes the game about not being able to find a sound font, I guess that is why they didn't default to using fluidsynth by default, and why I don't get volume control.
11:45:00 <xarick> if I'm not mistaken, GetConfig only works if GetInfo returned different than null
11:45:31 <peter1138> GetConfig() must always "work" because GetInfo() uses the result of GetConfig()...
11:47:27 <woobilicious> ahh okay so OpenTTD has hardcoded paths for sound founds, easy enough to fix.
11:48:02 <peter1138> Yeah, fluidsynth is a bit pants.
11:50:23 <woobilicious> hard coded absolute paths not great either lol lets see if I can remember how to reference the install prefix lol
11:52:47 <peter1138> There's a driver parameter to override it.
11:53:02 <xarick> nice, it works, thanks again
11:53:10 <peter1138> fluid_settings_dupstr(_midi.settings, "synth.default-soundfont", &default_soundfont);
11:53:48 <peter1138> Turns out there isn't a driver parameter, sorry.
11:53:53 <peter1138> There probably should be :)
11:57:52 <woobilicious> hmm, so on portable installs you probably don't want relative paths...I also noticed fludsynth does attempt to open a soundfont local to it's install path as well, not sure if fluidsynth works like ladspa or other global plugin systems with envars to change search locations, not sure what the most robust patch would be.
12:13:54 <xarick> AAAHogEx is classes upon classes upon classes...
12:14:06 <xarick> difficult to pinpoint the fault
12:16:57 <woobilicious> easy, lets just create patch that takes the current hard coded path, and replaces it with a hard coded path compatitble with my distro lol it'll be better that the current hack they already have.
12:18:25 <woobilicious> this is the hack it current has *headdesk*
12:18:25 <woobilicious> { playmidi = writeScriptBin "playmidi" ''
12:18:25 <woobilicious> #!${runtimeShell}
12:18:25 <woobilicious> trap "${procps}/bin/pkill fluidsynth" EXIT
12:18:25 <woobilicious> ${fluidsynth}/bin/fluidsynth -a ${audioDriver} -i ${soundfont-fluid}/share/soundfonts/FluidR3_GM2-2.sf2 $*
12:21:52 <xarick> okay, problem is srcLocations pushed a null, switching line 3184 with 3185 should solve
12:26:06 <woobilicious> wait hold up is opensfx on steam out of date? who maintains the stream release? that patch game out what, 3 years ago? lol
12:32:29 <LordAro> opensfx hasn't changed in quite some time
12:32:35 <LordAro> why do you think it's out of date?
12:33:04 <woobilicious> my steam version shows 1.0.1, and my distro version is 1.0.3
12:34:38 <LordAro> maybe that does need uploading manually
12:34:49 <LordAro> still, just looks like build system changes and translations
12:35:23 <woobilicious> idk if it's only the linux release, no huge deal I guess.
12:35:51 <LordAro> truebrain: i think you're the one that needs to update the steam opensfx release
12:37:15 <truebrain> Steam needs manual updating indeed; will see if I remember tomorrow 🙂
12:47:31 <woobilicious> fixed and PR open 🙂
13:02:25 <LordAro> i thought fluidsynth had an env var for soundfonts
13:04:57 <LordAro> though i'd have expected Nix to set synth.default-soundfont correctly
13:06:07 *** akimoto has joined #openttd
13:17:09 <peter1138> Yes, fixing that is the correct fix, not patching our source code.
13:22:33 *** akimoto has quit IRC (Remote host closed the connection)
13:34:13 <xarick> AMD presentation felt so robotic
13:43:38 <peter1138> It's a big corporation doing a presentation, who cares...
13:43:43 <woobilicious> LordAro, every package in Nix has it's own prefix generated by a unique hash based on it's inputs, it might be possible to build fluidsynth against the sound font, hard coding a default location without that is hard.
13:45:02 <peter1138> Probably better to hard code that in fluidsynth's config rather than every program that wasn't to use fluidsynth.
13:45:27 <woobilicious> Yeah I'm not sure what the thinking behind it was
13:51:16 <woobilicious> might try fix that tomorrow and see if anyone complains, there's about 20 packages hard coding a soundfont
13:52:53 <woobilicious> anyway gonna go to bed, thanks for the help.
14:31:19 <xarick> is this spacing correct?
14:43:55 <peter1138> Shorter engine parts is a NewGRF-only feature, default engines can't use it.
15:23:19 <xarick> peter's conflicts becoming so difficult to solve
15:29:59 <xarick> and the intitializing of everything
15:34:10 <xarick> `DrawString(tr, this->show_all ? GetString(STR_AI_CONFIG_NAME_VERSION, item.second->GetName(), item.second->GetVersion()) : item.second->GetName(), (this->selected == i - 1) ? TC_WHITE : TC_ORANGE);` - this is not my code 🙂
15:34:50 <xarick> it's the new horizontal coding guidelines
15:35:07 *** Wormnest has joined #openttd
15:36:25 *** kuka_lie has joined #openttd
15:56:59 *** HerzogDeXtEr has joined #openttd
17:03:16 <xarick> `GetString(STR_JUST_INT, cid + 1)` is this a valid request?
17:06:42 <xarick> ```SetDParamMaxValue(0, MAX_COMPANIES);
17:06:42 <xarick> uint widest_cid = GetStringBoundingBox(STR_JUST_COMMA).width;```
17:07:00 <xarick> what's the difference between STR_JUST_COMMA and STR_JUST_INT
17:07:12 <peter1138[d]> `1,000` vs `1000`
17:07:25 <_glx_> one uses {COMMA], the other uses {NUM}
17:07:40 <peter1138[d]> Nah, that's no comma.
17:08:22 <xarick> is company number a comma or a int? for displaying purposes
17:08:26 <_glx_> peter1138[d]: it is in my locale 🙂
17:08:38 <LordAro> xarick: take a wild guess.
17:09:05 <_glx_> is a company number able to go over 1000 ?
17:09:19 <xarick> no, but languages and such...
17:10:06 <_glx_> here it would be better to use just int
17:11:02 <_glx_> it's expected for company number to not follow locale formatting
17:17:55 <xarick> I made it larger, to comply with the new guidelines:
17:17:55 <xarick> `DrawString(text_rect.left, text_rect.right, tr.top, this->show_all ? GetString(STR_AI_CONFIG_NAME_VERSION, item.second->GetName(), item.second->GetVersion()) : item.second->GetName(), (this->selected == i - 1) ? TC_WHITE : TC_ORANGE);`
17:19:48 <_glx_> oh you can split the lines too
17:20:53 <xarick> i'm just kiding, plz dont hurt me
17:45:17 <xarick> `new DropDownStringListItem` is now `MakeDropDownListStringItem`?
17:45:44 <xarick> `list.emplace_back` -> `list.push_back` ?
17:47:07 <xarick> it compiled... so it's fine
17:48:58 <peter1138[d]> That change was... years ago.
17:49:36 <xarick> it worked until very recently
17:50:21 <xarick> some changes go unnoticed
17:50:27 <xarick> until it no longer compiles
17:50:34 *** Wormnest has quit IRC (Ping timeout: 480 seconds)
18:00:09 *** kuka_lie_ has joined #openttd
18:00:48 <xarick> you don't like this kind of stuff
18:04:15 <xarick> settings_gui.cpp half of the file disappeared?
18:04:47 <Rubidium_> yes, less is more :D
18:06:51 <xarick> ah settingentry_gui.cpp
18:07:14 *** kuka_lie has quit IRC (Ping timeout: 480 seconds)
18:07:39 <xarick> i added one line, got a 1000 block conflict
18:08:07 <xarick> now i wonder where my line is supposed to go on the new file
18:09:11 <xarick> hmm my diff viewer not good enough
18:20:13 *** gelignite has joined #openttd
18:31:58 <xarick> who worked on the PoolID changes?
18:37:45 <_glx_> the limits are now in PoolID<>, it's not hard to move them from Pool<> to PoolID<>
18:39:55 <_glx_> and it's actually simpler because changing base type and limits is in a single place
18:41:09 <_glx_> like your old stuff needed to modify DepotPool and DepotID, and now it only needs to touch DepotID
18:44:19 <xarick> once I get motivation I'll give it a try
19:16:32 <Rubidium_> four more PRs to go
19:18:19 <Rubidium_> though in theory CallocT could now be removed
19:18:24 *** gelignite has quit IRC (Read error: Connection reset by peer)
19:20:46 *** gelignite has joined #openttd
19:35:45 *** ChanServ sets mode: +v tokai
19:42:57 *** tokai|noir has quit IRC (Ping timeout: 480 seconds)
19:50:49 *** Flygon has quit IRC (Quit: A toaster's basically a soldering iron designed to toast bread)
20:44:26 <xarick> oh yah... config flags :!
20:57:19 <xarick> these touch a very sensitive part where I go against the narrative
21:02:35 <xarick> should I port VisibilitySettings part from my branch to master?
21:03:01 <xarick> it's a kind of refactor: deduplicates stuff
21:21:17 *** Wormnest has joined #openttd
21:31:17 *** nielsm has quit IRC (Ping timeout: 480 seconds)
22:12:57 *** gelignite has quit IRC (Quit: Stay safe!)
22:33:04 *** keikoz has quit IRC (Ping timeout: 480 seconds)
22:35:54 <xarick> making TransAI to actually crash with a log
22:40:40 <xarick> oh wow, pretty list of settings:
22:40:58 <xarick> which one are no longer in openttd?
22:42:15 <xarick> hmm what happened to adjacent_stations, can't locate in openttd
22:46:44 <xarick> hmm, fanioz do you still post?
23:02:00 <xarick> i should make an infinite money AI competition
23:03:33 <xarick> CivilAI with infinite money... hmm
23:03:42 <xarick> wanna see the true potential of this
23:19:20 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
23:24:45 <xarick> wish I could make script opcodes a bit more fair
23:24:59 *** kuka_lie_ has quit IRC (Quit: Lost terminal)
continue to next day ⏵