IRC logs for #openttd on OFTC at 2024-11-03
β΄ go to previous day
00:01:01 *** Flygon has quit IRC (Quit: A toaster's basically a soldering iron designed to toast bread)
00:08:21 *** gelignite has quit IRC (Quit: Stay safe!)
02:09:06 *** Wormnest_ has joined #openttd
02:09:06 *** Wormnest has quit IRC (Read error: Connection reset by peer)
02:10:17 <talltyler> Oops I made a mess again (by doing NewGRF shenanigans)
02:29:48 *** Wormnest_ has quit IRC (Quit: Leaving)
03:32:29 *** godbed_ has joined #openttd
03:35:53 *** debdog has quit IRC (Ping timeout: 480 seconds)
03:35:58 *** D-HUND has quit IRC (Ping timeout: 480 seconds)
04:45:35 <DorpsGek> - Update: Translations from eints (by translators)
08:10:05 *** godbed is now known as debdog
08:42:48 *** nielsm has quit IRC (Ping timeout: 480 seconds)
08:54:38 <johnfranklin> Newark Castle -> Northgate is the most English thing, so what about the other way round? Is transferring an abelian group such that the other way round is also very much English?
09:15:44 <truebrain> clearly nobody actually pays attention to payment? π
09:20:09 <peter1138> I am now working on it...
09:21:28 <peter1138> I think I've done it, let's see if it links...
09:31:29 <peter1138> Maybe. I've simply written it, not actually run it yet π
09:34:29 <peter1138> "It builds, ship it"
09:37:13 *** gelignite has joined #openttd
09:43:40 <truebrain> Haha, might be essiential to also test it π
09:45:02 <peter1138> I'm not good enough to set up a profitable transfer route...
09:45:19 <truebrain> ask user that reported it for a savegame!
09:57:21 <peter1138> > Your script made an error: There is no passenger cargo.
09:57:42 <peter1138> Uh, there is, although it's renamed to Workers, the label is still PASS.
10:46:39 <xarick> what keywords are available
10:58:13 <xarick> according to the guide:
10:58:13 <xarick> * Doc: Update to (player-facing) documentation, like in the `docs/` folder etc.
10:58:27 <xarick> it's not in the docs folder
10:59:49 <xarick> Codefix, Cleanup, Codechange. I'm fixing landscape_grid.html
11:00:45 <peter1138> Now, it's not over a same time period but even so that seems a bit odd.
11:01:08 <xarick> what was it like in previous versions where it worked
11:01:33 <peter1138> This code was introduced 12 years ago.
11:01:40 <peter1138> I'm not going back that far.
11:04:16 <peter1138> Final cargo delivery payment shouldn't have changed.
11:13:41 <peter1138> Hmm, doesn't add up at all.
11:18:42 <xarick> bit is introduced by a patch is not used anywhere
11:22:32 <peter1138> So is group profit just wildly wrong with transfers...
11:30:28 <peter1138> xarick: `man openttd`
11:35:52 <xarick> some html <span> don't have an </span> counterpart
11:44:06 *** gelignite is now known as Guest8305
11:44:06 *** Guest8305 has quit IRC (Read error: Connection reset by peer)
11:44:10 *** gelignite has joined #openttd
11:46:46 <peter1138> Okay, so Workers in IOTC actually cost money to transport.
11:47:09 <peter1138> With master, this coffee is transferred as workers instead of coffee, so the transfer is negative.
11:47:16 <peter1138> With my PR it's tranferred as coffee.
11:47:25 <peter1138> But it doesn't add up :S
11:48:10 <peter1138> IOTC doesn't care about how long it takes either.
11:49:21 <andythenorth> peter1138: βTransfers are weirdβ π
11:49:51 <peter1138> Broken currently, considering they always calculate at passenger rates.
11:50:19 <peter1138> Maybe that depends on how many transfers/payments there are.
11:50:27 <_jgr_> The `this->visual_profit == 0 && this->visual_transfer == 0` test in `CargoPayment` looks questionable, as that doesn't guarantee that `route_profit` is also 0.
11:51:13 <andythenorth> Why do vehicles need to all be profitable anyway?
11:51:55 <_jgr_> andythenorth: The rating system penalises having unprofitable vehicles, not that the rating system matters much either
11:54:27 <peter1138> Doesn't really matter but we should at least use the correct cargo type.
11:55:00 <reldred> It would be lovely if it all worked a bit better
11:55:04 <peter1138> But if group profit doesn't match finance revenue even vaguely then that is... weird.
11:55:49 <peter1138> Hmm, is my group period difference from my finance period?
11:59:01 <peter1138> Adding `&& this->route_profit == 0` to that test reduces the ship's group profit per period f
11:59:15 <peter1138> From around 8500 to 3000. Not enough to make anything add up.
11:59:26 <peter1138> Not sure if that test is right either mind you π
12:06:13 <peter1138> talltyler: What have you done!? I was going to get the bike out but started looking at this and now it's 3 hours later...
12:06:50 <peter1138> (Caveat, summer bike does not have mudguards attached, winter/commuter bike does not have pedals attached (and it's heavy))
12:09:03 <peter1138> Okay, I think it's because my cargo isn't ALL being transfered.
12:11:02 <peter1138> Added more ships and... well.
12:11:10 <peter1138> Β£59732 road vehicle group profit
12:11:14 <peter1138> Β£12104 ship group profit
12:11:33 <peter1138> Β£87357 ship revenue in finances
12:12:32 <peter1138> So: Assigning profit to road vehicles even though it hasn't been transferred all the way seems to be "an issue"?
12:13:18 <peter1138> Maybe that doesn't happen, I dunno.
12:14:06 <peter1138> Splitting the profit between vehicles at the final point of delivery would seem to me to be most reliable.
12:14:31 *** emperorjake has joined #openttd
12:14:31 <emperorjake> I just noticed this inconsistency in the setting names
12:15:30 <peter1138> peter1138: Of course, storing this information would somewhat bloat things.
12:16:45 <peter1138> Every cargo packet would need to store a list of vehicles and share to attribute. And those vehicles might not even exist, or have been changed around...
12:18:02 *** Smedles has joined #openttd
12:20:05 <peter1138> If vehicles/groups maintained real profit as well as virtual profit this would be easier to see at least. Hmm.
12:20:30 <peter1138> I added 3 ships and my revenue is now 4x.
12:20:39 <peter1138> But the road vehicle "profit" is the same.
12:22:50 <peter1138> Now does that route_profit == 0 make any difference or was that just a coincidence.
12:25:25 <andythenorth> Imagine the pitchforks if we removed profit per vehicle
12:25:43 <andythenorth> βLiterally ruined the gameβ
12:26:05 <andythenorth> All those big complicated saves weβd destroy
12:27:42 <xarick> does this convey information in a non confusing way?
12:28:20 <peter1138> No, just a coincidence.
12:28:49 <peter1138> Talking about my profit.
12:32:30 <andythenorth> βProfit has been wrong for years, so we deleted itβ
12:51:09 *** ialokin has quit IRC (Ping timeout: 480 seconds)
12:56:02 *** tokai|noir has joined #openttd
12:56:02 *** ChanServ sets mode: +v tokai|noir
12:58:25 <peter1138> The extra long vehicle parts are chopped up though, so that bit works.
13:01:33 *** tokai has quit IRC (Ping timeout: 480 seconds)
13:11:57 <xarick> I don't like the word "always"
13:12:07 *** gelignite has quit IRC (Quit: Stay safe!)
13:12:53 <xarick> Water tile type: (upper bits always 0)
13:13:17 <xarick> who's the expert documentator?
13:14:38 <xarick> I wanna indicate that these bits are part of water tile type, but that the current upper bits are 0, so the word "always" is subjective
13:14:57 <xarick> it's "always", but only currently :p
13:25:36 *** alfagamma0007 has joined #openttd
13:25:36 <alfagamma0007> peter1138: extrazoom yikes
13:26:39 <peter1138> alfagamma0007: You can't stop 'em.
13:27:04 <alfagamma0007> Well I can express my thoughts
13:40:27 <peter1138> Hmm, how to add libraries... π
13:46:32 <xarick> I feel like giving WaterClass for MP_RAILWAY for the sole reason of checking if they have a flooding behaviour more quick...
13:47:15 <xarick> and maybe void tiles too, maybe
13:48:24 <xarick> or just write the long line
13:48:40 <xarick> `(HasTileWaterClass(tile) && GetWaterClass(tile) == WATER_CLASS_SEA) || (IsTileType(tile, MP_RAILWAY) && GetRailGroundType(tile) == RAIL_GROUND_WATER) || IsTileType(tile, MP_VOID)`
13:54:31 <xarick> question, isn't there a quicker way to check if a slope has one corner raised? I can very much bet that's the main slowdown in GetFloodingBehaviour
13:56:30 <xarick> or a novel idea... store slope in map array
14:03:25 <_glx_> xarick: and of course you have numbers to prove it's slow
14:04:31 <xarick> not sure what exactly is slowing down
14:04:45 <xarick> but i suspect slope...
14:06:01 <xarick> or could be switch/case
14:06:56 <xarick> or could be bad optimizations in compile?
14:12:30 <xarick> HasFloodingBehaviour is faster than GetFloodingBehaviour(tile) != FLOOD_NONE
14:12:48 <xarick> and yields the same results
14:16:24 <xarick> now i need a FLOOD_ACTIVE only fast query function
14:16:39 <xarick> but involves checking slopes π¦
14:42:36 <_glx_> xarick: with a release build ?
14:49:37 <peter1138> No point doing performance tests with debug builds.
14:55:18 <truebrain> You don't pay my subscription!
14:55:48 <xarick> but not with master code
14:59:39 <truebrain> So in #13055 CMake detects opus just fine, but linking refuses π Sad days π
15:13:50 <peter1138> Well, the detecting could be wrong.
15:14:00 <peter1138> But something is there because the includes also work.
15:14:16 <peter1138> I am a bit stumped on what to look for.
15:22:38 *** XYZ has quit IRC (Ping timeout: 480 seconds)
15:28:32 *** tokai|noir has quit IRC (Quit: c('~' )o)
15:34:28 *** Wormnest has joined #openttd
15:35:36 <_glx_> vcpkg output seems to imply no need for extra cmake files
15:39:06 <_glx_> let's try the PR locally
15:40:54 <_glx_> can confirm it fails to link locally too π
15:46:20 <peter1138> So just remove support for Windows and Mac OS? π
15:53:50 <_glx_> looks like a "broken" vcpkg port indeed, which means linux releases may fail to build too
15:55:42 <_glx_> triggering a PR release to test
15:57:56 <peter1138> Doubt it's broken, just my CMake detection is probably wrong.
15:58:28 <_glx_> I should test without these 2 files maybe
16:01:22 <xarick> RAIL_GROUND_WATER misleading me
16:02:05 <xarick> this qualifies as RAIL_GROUND_WATER
16:03:44 <_glx_> peter1138: yup if I remove your detection it builds fine (and the libs are detected)
16:05:13 <peter1138> So `find_package(Opus)` works for you without `cmake/FindOpus.cmake` being there?
16:05:20 <_glx_> hmm but the files are not compiled
16:06:57 <peter1138> We have Find* scripts for everything else, I find it unlikely that they are not needed here.
16:10:01 <peter1138> It's not just vcpkg though.
16:12:42 <_glx_> ok there's at least an error in CONDITION
16:18:12 <_glx_> from linux (clang) CI run
16:18:34 <peter1138> It's not included alphabetically, it'll be near the top.
16:21:28 <peter1138> So that condition seems to be case-insensitive for me.
16:22:25 <asasnat> base sounds can now be changed on the fly?
16:22:57 <asasnat> base sound sets I mean
16:23:05 <_glx_> in the PR yes, but in my local test without the Find* scripts it is case sensitive
16:23:58 <_glx_> add tree on coast, the tile becomes trees
16:24:03 <wensimehrp> What about base music set? Could it also use ogg after this PR?
16:24:39 <xarick> where in the newgrf code does that error message in the issue happen?
16:24:52 <peter1138> CMake Warning at CMakeLists.txt:158 (find_package):
16:24:52 <peter1138> By not providing "FindOpus.cmake" in CMAKE_MODULE_PATH this project has
16:24:52 <peter1138> asked CMake to find a package configuration file provided by "Opus", but
16:24:52 <peter1138> CMake did not find one.
16:25:20 <peter1138> Not having them does not work when building without vcpkg.
16:27:23 <peter1138> Linux-world did have pkg-config stuff but that does not magically work with find_package
16:30:31 <_glx_> so linux (generic) also failed with undefined references
16:33:26 <peter1138> btw I didn't expect this to work first time, we don't add libs very often π
16:36:27 <johnfranklin> Newark Northgate -> Castle 15 minutes.
16:37:07 <_glx_> my guess is it's missing a link to ogg
16:56:47 <peter1138> So we have pkg-config which tells everything, but because of cross-platform, we can't use it, afaict.
16:57:05 <peter1138> So we need Find* files for things that are missing.
16:57:17 <peter1138> For me, FindOgg/Opus/Opusfile do not exist.
16:58:16 <peter1138> Is it normal for Linux users to be using vcpkg to get OpenTTD dependencies? Because I've never done that.
17:11:25 <xarick> i can't put a breakpoint in it
17:11:33 <_glx_> your impression is wrong
17:12:07 <_glx_> if slope test is wrong it will fall through
17:14:37 <xarick> okay, just tested, it's flooding it
17:19:02 <_jgr_> peter1138: No, vcpkg is a Microsoft thing
17:23:50 <xarick> Gonna look at DoFloodTile
17:25:22 <_glx_> peter1138: we do it for generic build because we embed them
17:34:37 <_glx_> as I understand it, with FindPackage() cmake first tries Find* and falls back to config mode, ie search for .pc
17:35:56 <_glx_> hmm or vcpkg automatically uses pkgconfig
17:40:17 <peter1138> The package configuration file is either `OpusConfigu.cmake` or `opus-config.cmake`, not the `pkgconfig/opus.pc` files provided by libopus.
17:41:09 <peter1138> So I don't think fallback means fallback to pkg-config here.
17:41:59 <andythenorth> Could we track unit tiles of cargo transportesd per vehicle per annum?
17:42:23 <andythenorth> We have a utilisation figure already
17:43:14 <andythenorth> Per-vehicle profit is reslly weird
17:47:12 *** turretnodefect has joined #openttd
17:51:31 <_glx_> yeah I can see OpusFileConfig.cmake
17:52:44 *** turretnodefect has quit IRC (Quit: Page closed)
17:53:42 <peter1138> CMake doesn't make this very flexible. I'd rather it used OpusFileConfig.cmake if present, and only use FindOpusFile.cmake if not.
17:54:00 <_glx_> which creates Ogg:ogg and Opus::opus targets if needed, before creating OpusFile::opusfile which links to both
17:54:11 <_glx_> set_target_properties(OpusFile::opusfile PROPERTIES
17:54:11 <_glx_> INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include/opus;${_IMPORT_PREFIX}/include/opus"
17:54:11 <_glx_> INTERFACE_LINK_LIBRARIES "Ogg::ogg;Opus::opus;\$<\$<BOOL:>:m>"
18:02:22 <truebrain> _jgr_: It might be a Microsoft thing, just not a Windows thing π So yes, it is used by Linux users too. Just not as commonly used as distro versions. But I see it used more than for example Conan, which is suppose to be -the- C++ package manager tool π
18:03:22 <truebrain> peter1138: Just in case you don't know, we only have Find scripts for those libraries of which CMake itself doesn't ship the Find scripts
18:03:27 <truebrain> which is a bit hit&miss, tbh
18:04:06 <peter1138> That does appear to be "most of them", notably not SDL2.
18:04:49 <truebrain> zlib, png, etc are all from CMake π But it depends on the CMake version too, which are available. It is a hot mess π
18:04:54 <truebrain> but you say Opus has pkg-config support?
18:05:08 <peter1138> FindLZO.cmake has explicit stuff for VCPKG in it, heh.
18:05:19 <truebrain> LZO is a nice example of a package that has pkg-config support
18:05:34 <_glx_> vcpkg provides many xxxConfig.cmake
18:08:44 <truebrain> main issue with most Find cmakes we have, most are Linux-only π
18:09:25 <peter1138> And I assume that's the problem with my FindOpusFile.cmake too.
18:09:59 <peter1138> I'm not sure if there's a canonical one.
18:10:30 <peter1138> opusfile itself has a FindOpus.cmake, which looks like it only works with pkg-config.
18:11:53 <_glx_> yes your FindOpusFile doesn't check for ogg, nor adds the libs
18:15:23 <peter1138> I doubt this is going to work.
18:16:18 <peter1138> FindLZO maybe something to use as a reference, I dunno.
18:19:13 <asasnat> peter1138: I was always taught that you're supposed to use your system's native package manager for installing dependencies
18:20:23 <xarick> `auto [slope_dest, z_dest] = GetFoundationSlope(dest);` this thing alone costs 7 ms
18:23:10 <truebrain> owh, the nightmares of that `CONFIG` statement π
18:23:56 <_glx_> yeah I tried using $<> stuff but it seems it's not allowed there (or I failed with the syntax)
18:24:44 <_glx_> anyway we only need OpusFile, which is supposed to check for Opus and Ogg by itself
18:25:57 <_glx_> at least that's how vcpkg does it in OpusFileConfig.cmake
18:37:43 *** gelignite has joined #openttd
18:39:12 <peter1138> Sure. But OpusFileConfig.cmake isn't directly usable as FindOpasFile.cmake, afaik.
18:39:28 <peter1138> Also that built that time, because it didn't include opus π
18:42:09 <peter1138> Oh, actually it did. Copy & paste from the CI logs only copies the visible part. Sigh.
19:28:15 <peter1138> Doubt that is going tow ork.
19:36:08 <xarick> /** Wav file (RIFF/WAVE) sound louder. */
19:41:30 *** ChanServ sets mode: +v tokai
19:53:28 <xarick> I just made an #ifdef _DEBUG / #endif /* _DEBUG */
19:54:56 <peter1138> Apparently I can't spell "loader" and can't read it either becase yeah.
19:56:07 <peter1138> But I was correct, that didn't work.
20:09:56 <xarick> DoFloodTile can be made static
20:12:07 <peter1138> I noticed that but forgot about it π
20:12:38 <peter1138> Unlikely to have a performance benefit but it's worth doing anyway.
20:15:25 <xarick> GetFloodingBehaviour can be made static if...
20:15:39 <_glx_> peter1138: what I meant was having the 3 Find*.cmake, but OpusFile one doing the find_package() calls
20:17:43 <_glx_> with Ogg::ogg and Opus::opus in OpusFile::opusfile INTERFACE_LINK_LIBRARIES
20:20:42 <_glx_> from OpusFileConfig.cmake (search part) and OpusFileTarget.cmake (auto linked deps)
20:21:34 <_glx_> ok course providing our own search modules allows simplification for detection
20:22:10 <_glx_> like the extra search using pkgconfig
20:33:31 <peter1138> Hmm, wonder if the bits in `INTERFACE_LINK_LIBRARIES` need to be in `INTERFACE_LINK_FLAGS` too
21:00:42 *** tokai|noir has joined #openttd
21:00:42 *** ChanServ sets mode: +v tokai|noir
21:07:17 <xarick> 0% improvement on a 100% water scenario
21:07:41 *** tokai has quit IRC (Ping timeout: 480 seconds)
21:09:06 <xarick> 0% improvement on a 100% land scenario
21:10:31 <xarick> or it could be seen as a success, as I made some functions static
21:10:38 <xarick> not sure if that accounts for a PR
21:12:26 <xarick> file size is the same on both openttd.exes
21:17:40 <Rubidium> xarick: that darn compiler and linker are way too smart, eh?
21:20:56 *** nielsm has quit IRC (Ping timeout: 480 seconds)
21:47:38 *** gelignite has quit IRC (Quit: Stay safe!)
21:52:36 <xarick> I have thought of storing Slope in map array
21:55:05 <xarick> there's also Foundation
21:57:47 <xarick> nop, there's a setting
22:00:47 <xarick> going to need 12 bits from my calculations
22:13:13 *** keikoz has quit IRC (Ping timeout: 480 seconds)
22:13:41 <xarick> you could make a 3rd function static too with a bit of effort
22:14:44 <xarick> btw, is inline any good doing or....
22:15:20 <peter1138> Usually not, let the compiler sort that.
22:18:43 <xarick> oh, GetFloodingBehaviour contains a switch π¦
22:47:02 *** HerzogDeXtEr has quit IRC (Read error: Connection reset by peer)
22:53:17 *** toktik is now known as Guest8351
22:56:14 *** Guest8351 has quit IRC (Remote host closed the connection)
23:00:14 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
continue to next day β΅