IRC logs for #openttd on OFTC at 2026-01-30
⏴ go to previous day
00:09:46 <mmtunligit> ```if (read_pos + sizeof(T) > this->buffer.size()) {
00:10:20 <mmtunligit> also im confused by what you meant about the constructing a new vector or at least clearing first
00:11:26 <michi_cc[d]> this->read_pos += sizeof(T), read_pos is in bytes
00:14:08 <michi_cc[d]> mmtunligit: Look at the operator >> for e.g. std::string, EncodedString or bool. You'll see the all assign (=) the value they read to data. In your PR you are just emplacing onto the passed vector, even if it already has elements in it.
00:15:55 <michi_cc[d]> Oh, and if you want to be a hero, EndianBufferReader/EndianBufferWriter is something that could probably really benefit from unit tests, exactly to verify edge cases like this 😛
00:20:07 <mmtunligit> michi_cc[d]: is that what the push_back thing you suggested does? or are you suggesting that every time i want to add to the vector i clopy the data from the existing one, clear it and then fill it with that dat and the new value?
00:24:49 <mmtunligit> michi_cc[d]: im happy to be a hero but im gonna need to know what exactly a unit test entails, looking it up just seems to give me a lot of people going "use catch2" which isnt very helpful. pointing me in the direction of existing ones in the codebase would be the biggest result for the least effort. i see the folder src/tests but beyond that im not sure what id be looking for
00:25:53 <_glx_> we have some unit test already, so the hard part is done 🙂
00:28:48 <_glx_> basically you add a cpp file in src/tests and in its CMakeLists.txt
00:30:09 <mmtunligit> and then you give it a bunch of stuff to try passing to the methods youre testing, and a way to pass them?
00:30:34 *** toktik has quit IRC (Remote host closed the connection)
00:32:16 <_glx_> you can look at string_builder.cpp for a simple example
00:34:25 <mmtunligit> ok i think i get it
00:34:58 <_glx_> it's mainly use of the functions, then assertions
00:35:51 <mmtunligit> yeah ill take a look at doing that
00:36:49 <_glx_> hardest tests to write are corner case detection 🙂
00:37:56 <mmtunligit> i will write all the tests i can think of and then anything else that gets pointed out to me
01:59:55 *** soylent_cow[m] has joined #openttd
02:37:24 *** Wormnest has quit IRC (Quit: Leaving)
02:44:54 *** MinchinWeb[m] has quit IRC (Read error: Connection reset by peer)
02:45:11 *** MinchinWeb[m] has joined #openttd
04:00:06 *** gnu_jj_ has quit IRC (Ping timeout: 480 seconds)
04:38:07 *** Zathras_1 has joined #openttd
04:41:44 *** Zathras_4 has quit IRC (Ping timeout: 480 seconds)
05:00:43 <DorpsGek> - Update: Translations from eints (by translators)
05:43:13 *** Binette[m] has joined #openttd
05:47:12 *** WormnestAndroid has quit IRC (Remote host closed the connection)
05:47:28 *** WormnestAndroid has joined #openttd
07:24:02 *** Flygon has quit IRC (Read error: Connection reset by peer)
07:39:33 *** MinchinWeb[m] has quit IRC (Remote host closed the connection)
07:39:47 *** MinchinWeb[m] has joined #openttd
08:51:11 *** marktheshark3209 has joined #openttd
08:51:11 <marktheshark3209> I realize this is not going to be helpful, but there is something related to vehicles crashing that causes desyncs in multiplayer... several people have noticed desyncs happen shortly after a train or plane crashing, though not always
08:51:19 <marktheshark3209> Have not been able to reproduce
08:53:27 <marktheshark3209> I have a feeling it might happen when it coincides with either autosave or quarterly profit update or something...
09:07:10 <tabytac> Yeah someone yesterday opened a bug report saying the same thing, that a vehicle crashing around an auto save caused a desync
09:28:11 <Rubidium> the main problem with desyncs is that you need to be able to reliably reproduce it to have a chance of finding and fixing the issue. It coinciding with autosave seems unlikely as autosave does not change the state.
09:31:26 <Rubidium> marktheshark3209: are you hosting the server? If so, please run the server with '-d desync=3'. That will store some extra stuff in the autosave folder; commands-out.log (a log of all the commands, joins, etc) and a lot of savefiles. Then just play/host until you hit a desync. Once that has happened, please open an issue with the commands-out.log, initial savegame and if the dmp_cmds* savegames aren't
09:31:32 <Rubidium> too big those as well. Otherwise we might be asking for specific savegames once we start analysing the log.
10:10:20 <peter1138> And hope it's not a 4kx4k map :o
10:28:13 <marktheshark3209> Rubidium: I do not, but I can ask the host to enable it
10:38:56 <xarick> let's see if anyone joins
10:46:15 <xarick> heh my GS is spamming commands
10:47:53 <xarick> 12k lines in less than 5 minutes
10:55:25 <LordAro> US still asleep, Europe at work, probably not a huge market at the moment
11:07:20 <__abigail> LordAro: I'm also here
11:09:16 <LordAro> lies, Australia doesn't exist
11:38:48 *** reldred has joined #openttd
11:38:48 <reldred> awful lot of people here from a place that doesnt existy
11:41:02 <__abigail> reldred: The Netherlands
11:41:21 <reldred> thats Discord channel #off-topic-1 and Discord channel #off-topic-2
11:42:22 <talltyler> I am awake, but wish I wasn’t
11:42:29 <peter1138> Discord doesn't exist :D
11:42:37 <reldred> it's nearly time for me to be awaken't
11:42:45 <reldred> i have errands to run tomorrow
11:43:00 <reldred> then go play 2nd ed 40k with a bunch of forty year olds
12:35:04 <xarick> master hellish is famous
13:03:08 *** lactomeda has joined #openttd
13:03:08 <lactomeda> Hey everyone. I'm new to the server and OpenTTD. I was wondering if you guys were open to adding new music to the soundtrack. I'm a music producer and would love to contribute to the project.
13:03:33 <peter1138> Discord doesn't exi
13:14:41 <lactomeda> Okay, ty for the links with all the information
13:27:39 *** Wormnest has joined #openttd
13:30:33 <ahyangyi> If your music is in a different style from the existing default, you might want to consider making your music pack an add-on instead, though that goes to Discord channel #add-on-development.
13:32:35 <lactomeda> ahyangyi: Oh I was hoping to expand the default music if that's possible. I'd try my best to compose in the same style
13:33:33 <lactomeda> should I post my questions in the OpenTTD forums? This is my first time contributing to a project like this
13:42:24 <emperorjake> lactomeda: You'll get faster help here, but it couldn't hurt to post to both. Though maybe Discord channel #add-on-development is the better place 🙂
13:43:55 <lactomeda> emperorjake: Ok, tysm 🙏
13:55:03 <talltyler> Another proposed subsidy and town rating improvement: Fulfilling a subsidy improves your town rating at both source and destination towns.
13:55:03 <talltyler> Only trouble is, my code doesn't seem to work. I had to remove some `const`s to get it working. Anybody see something obvious I've missed?
13:55:38 <talltyler> It compiles and runs, but the town rating doesn't seem to change 🙂
13:59:06 <Rubidium> that subsidy code runs likely under OWNER_NONE or something similar, so it's going to change the rating of that non-existing company
14:00:12 <talltyler> Ah, `_current_company` isn't set?
14:01:58 <Rubidium> yup though bear in mind to restore it (look for current_company and backup I'd guess). And why don't you add this to AwardTo instead of duplicating it 4 times?
14:04:25 <Rubidium> and I would add a GetTown (I have doubts about the exact naming) to Source (where you just return nullptr when it's a HQ)
14:05:10 <talltyler> Thanks, there's definitely some code cleanup to be done 🙂
14:13:25 <peter1138> I've got a patch for that :)
14:26:00 <peter1138> Hmm, annoying, the fix didn't get backported properly.
14:26:50 <peter1138> I think this might happen if the PR contains multiple commits, and one of them is the same title as the PR title.
14:28:00 <_glx_> ah yes it's missing 2/3 of the fix
14:28:42 <LordAro> oh, rebase vs squash screw up?
14:28:48 <LordAro> i thought the script was supposed to handle that
14:29:05 <peter1138> It does if the names are different.
14:31:48 <peter1138> Commit vs PR, I think.
14:31:57 <peter1138> Well. I don't fancy experimenting on tbh.
14:32:02 <LordAro> that's a weird way of doing it
14:32:05 <peter1138> I noticed something weird before.
14:32:29 <peter1138> # In case of multiple commits, check if it was squashed or rebased.
14:32:29 <peter1138> # We do this by comparing commit titles. As if you rebased, they have
14:32:44 <_glx_> I know there's a special label for squashed PR (but it should not be needed anymore)
14:33:09 <LordAro> sounds like we need the reverse
14:33:22 <LordAro> though i'm not sure why it can't be detected via GH API or whatever
14:33:23 <peter1138> I don't know for sure if that's the problem, but it seems related for sure.
14:33:32 <peter1138> For sure for sure :o
14:34:00 <_glx_> bug in the script is highly possible
14:37:08 <_glx_> but issue might be in the original handling of multiple commits
14:46:50 <definitelynotcheese_> Ahh is that discord light mode
14:48:07 <_glx_> xarick: it's just handling of `#`
14:54:42 <xarick> somebody join my server, I wanna see someone desync
14:56:08 <_glx_> and of course you enabled desync logging
14:56:50 <xarick> yes, is that a bad idea
14:57:54 <xarick> 230 savegames created so far
15:00:08 <xarick> 145 MB commands-out.log
15:01:59 <xarick> seems the AIs are a bit op limited in multiplayer
15:02:17 <xarick> they're slowed down somehow
15:06:15 <peter1138> Should be the same, can only issue one command per tick.
16:09:06 *** gelignite has joined #openttd
16:39:03 <xarick> peter1138, do you have a patch for lifetime profit for vehicles
16:50:11 <andythenorth[d]> pickpacket is TTD expected to work with FIRS? 👀
16:51:27 <andythenorth[d]> Tea Tea Deluxe
16:51:39 <andythenorth[d]> or are you ? Xarick?
16:51:45 <andythenorth[d]> or just generally at no-one?
16:51:56 <peter1138> Oh, of course, the funny naming :)
16:52:32 <pickpacket> andythenorth[d]: I haven't tried. I was under the impression that FIRS disables all other industry sets
16:52:46 <andythenorth[d]> it doesn't disable with TTD, but it will as of now
16:52:47 <pickpacket> Also I don't know how cargo id works
16:53:29 <pickpacket> andythenorth[d]: didnit have some exception for TTD? 🤔
16:56:05 <pickpacket> Can I make ot work with FIRS somehow?
16:58:18 *** brickblock19280 has joined #openttd
17:18:03 <peter1138> Why do you have to disable things instead of just saying "don't ever mix industry sets"?
17:23:53 <andythenorth[d]> peter1138: I might have not had enough lunch, but how would that work?
17:55:36 <peter1138> Let the player pick up the pieces when they do something silly.
18:10:47 <andythenorth[d]> what's the upside? 🙂
18:17:57 <peter1138> You don't have to keep updating FIRS to disable other random NewGRFs.
18:26:23 <andythenorth[d]> hmm can I detect cargos that FIRS didn't define?
18:26:52 <andythenorth[d]> it's almost always the cargos
18:55:38 <xarick> the few ppl that joined haven't desynced
18:56:11 <peter1138> If you deliberately crashed vehicles?
18:56:45 <peter1138> Well considering the desync is allegedly due to vehicle crashes...
19:01:47 <xarick> Deleting a company requires holding left click
19:02:04 <xarick> not consistent with the click two times
19:08:44 <peter1138> Feel free to create an issue.
19:29:39 <andythenorth[d]> hmm could industry grfs just have a flag for "if any other grf defines cargo, disable me"?
19:44:13 <xarick> gah, ChooChoo has an annoying error
19:53:27 <xarick> yeah, im not the only one with the problem
19:54:34 *** MinchinWeb[m] has quit IRC (Ping timeout: 480 seconds)
19:56:47 <xarick> location is a this.location
19:57:33 *** MinchinWeb[m] has joined #openttd
20:09:40 <pickpacket> What are your thoughts on how the new invite system has been received? For joining a company. I very much agree with a lot of the critique, especially because of how difficult asynchronous play becomes
20:15:23 <xarick> I'm not sure what to say
20:26:11 <xarick> difficult to debug choochoo. all the variables are hidden as class members :(
20:30:26 <peter1138> pickpacket, players can scream into their voids as much as they like, that isn't where construct feedback goes.
20:33:19 <pickpacket> peter1138: Apart from the tone of discussions, what do you think of the actual arguments?
20:41:08 <xarick> I don't like the way this AI is set up with try/catch stuff
20:51:50 <peter1138> pickpacket, do you know what screaming into the void means?
20:57:06 <pickpacket> peter1138: yes, but I thought at least some of y'all read the forums 😂
20:59:08 <LordAro> pickpacket: you're quite welcome to try to distill something into an issue (or discussion) if you like
21:03:08 <peter1138> Doesn't seem very heated to me ;)
21:05:32 <xarick> oh, choochoo uses .slice stuff
21:05:41 <xarick> text = text.slice(0, space);
21:34:34 <xarick> this looks so confusing
21:36:19 <_zephyris> @peter1138 Still interested in newgrf terrain tile ideas?
21:36:36 <xarick> constructor constructor calling constructor...
21:38:08 <xarick> var names with the same name as class members
21:38:16 <xarick> surely nothing goes wrong
21:41:18 <xarick> something went wrong though, one of the "location" remained null
21:44:55 <xarick> there is a GetTile in WorldObject and another GetTile in RelativeCoordinates
21:44:55 <xarick> function TileStrip in WorldObject calls one of these GetTile... tiles.append(GetTile([x, y]));
21:51:59 <xarick> ExtendCrossing constructor is never called. Okay, I'm finally getting somewhere
21:53:54 <rito12_51026> andythenorth[d]: Hurray
22:12:25 <xarick> okay, I think i may have found an issue
22:15:20 *** lobstarooo has quit IRC (Ping timeout: 480 seconds)
22:21:08 <xarick> added a few logs. It has a tile, but then the task is interrupted because it needs money. upon returning to the same task, tile isn't recalculated and breaks everything
22:22:21 <xarick> it's kind of weird though. BuildCrossing has the tile
22:22:32 <xarick> but it's not passed around
22:22:38 <xarick> to the other functions
22:28:49 <mmtunligit> peter1138: will do, i just want to make sure ive adressed all of michi_cc[d]'s concerns before i do and it gets buried in a bigger PR that is much more of a hassle to review
22:31:09 <xarick> bug fixed! probably not the right way to fix it but it's not crashing
22:46:54 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
23:18:30 *** lobster has joined #openttd
23:19:50 *** Flygon has quit IRC (Remote host closed the connection)
continue to next day ⏵