IRC logs for #openttd on OFTC at 2024-10-21
            
02:45:37 *** TinoDid|znc has joined #openttd
02:46:12 *** TinoDidriksen has quit IRC (Read error: Connection reset by peer)
02:46:31 *** gnu_jj has joined #openttd
02:49:41 *** gnu_jj_ has quit IRC (Ping timeout: 480 seconds)
02:57:49 *** godbed has joined #openttd
02:57:55 *** godbed_ has joined #openttd
03:01:13 *** debdog has quit IRC (Ping timeout: 480 seconds)
03:01:18 *** D-HUND has quit IRC (Ping timeout: 480 seconds)
05:47:55 *** godbed is now known as debdog
05:50:09 *** TinoDid|znc is now known as TinoDidriksen
05:59:29 *** Flygon has quit IRC (Read error: Connection reset by peer)
06:05:15 <DorpsGek> [OpenTTD/OpenTTD] Kuhnovic approved pull request #13012: Fix: Don't invalidate water regions on the other side of the map. https://github.com/OpenTTD/OpenTTD/pull/13012#pullrequestreview-2381001865
06:07:58 *** keikoz has joined #openttd
07:16:38 <DorpsGek> [OpenTTD/survey-web] survey-summary[bot] pushed 1 commits to main https://github.com/OpenTTD/survey-web/commit/9d6a1dc2a399413f7f6ef7e74e34251597a9b0bd
07:16:39 <DorpsGek> - Add: summary for week 42 of 2024 (by OpenTTD Survey)
07:34:07 *** welterde has joined #openttd
07:57:33 <DorpsGek> [OpenTTD/OpenTTD] PeterN approved pull request #12836: Fix #12831: Delay vehicle cache initialisation to after map upgrades in load https://github.com/OpenTTD/OpenTTD/pull/12836#pullrequestreview-2381228682
07:59:40 *** nielsm has joined #openttd
08:13:23 <andythenorth[d]> ok new cargo classes kind of work in FIRS v4
08:13:52 <andythenorth[d]> I tested about 10 train grfs, anything that's really weird or broken was also weird or broken with old cargo classes
08:56:17 <peter1138> reldred: I have Timtams
08:57:19 <reldred> peter1138: ooooh
08:57:25 <reldred> I've ordered dinner
08:57:37 <kuhnovic> peter1138: Do you want to address my comments about some local variable names in #13005, or do you want to leave those for a different PR? If not then I'll hit approve again.
08:57:46 <reldred> some sort of udon noodles tomato soupy thing with beef in it.
08:59:14 <andythenorth[d]> `dumpinfo cargotypes` eh 🙂
08:59:30 <andythenorth[d]> that's probably configured in some .h file or something
08:59:35 <andythenorth[d]> "I am not a programmer"
09:00:06 <peter1138> What?
09:00:24 <peter1138> kuhnovic: I can address it but I'm not currently working on it (well, it's $work-oclock)
09:02:13 <kuhnovic> Then I'll wait a bit 🙂
09:02:47 <peter1138> IIRC when I looked it's a case of working out which one of the variables should be named `node` 🙂
09:06:54 <kuhnovic> They definitely shouldn't be named pNode 😛
09:07:20 <johnfranklin> Will new nml change "cargo classes" texts? like ``CC_OVERSIZED`` etc becomes other categories
09:07:38 <andythenorth[d]> 🤷
09:07:53 <andythenorth[d]> I'm just using bit numbers for now
09:08:03 <johnfranklin> This will make Garry unable to produce any grf...
09:10:31 <andythenorth[d]> part of the reason cargo classes are such a mess is that they needed 'measure twice, cut once' in 2011 😛
09:10:35 <andythenorth[d]> and that didn't happen
09:11:07 <andythenorth[d]> it was more like "argue for weeks, then implement a misunderstanding"
09:11:40 <andythenorth[d]> so I'm just going to try it all on bit numbers, and worry about NML later, and not add to the mess
09:18:17 <andythenorth[d]> "we were all much younger" 😄
09:26:43 <andythenorth[d]> current draft proposal, being tested https://grf.farm/polar_fox/cargo_classes_A.html?91231
09:35:42 <xarick> andythenorth[d]: https://www.youtube.com/watch?v=bw5pi9nUGJ8
09:53:28 <xarick> peter1138: how did you place red squares? I am looking at 13013
09:56:29 <peter1138> https://cdn.discordapp.com/attachments/1008473233844097104/1297861056550666290/water-flooding-debug.diff?ex=671776cc&is=6716254c&hm=377bd747b909a792ba61a473c3bb39e61d477210db8ad01e7f10c3b6515d899f&
09:56:40 <xarick> btw can you rebase it? This fix is important <https://github.com/OpenTTD/OpenTTD/commit/4a359a4aed48df419892a7d6846ac58b5e6f3b3b>
09:58:00 <peter1138> (First time I've shared a .diff for a long time...)
09:59:58 <xarick> ^_^
10:00:02 <xarick> thx
10:01:45 <xarick> hmm only water tile type
10:03:07 <peter1138> I only changed the behaviour of the water tile type.
10:06:44 <xarick> MarkTileDirtyByTile doesn't seem to be doing a good work
10:07:10 <kuhnovic> Oh god, here we go again
10:07:17 <peter1138> 🙂
10:12:27 <xarick> oh, i forgot to copy that last part
10:15:41 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1297865891542994974/image.png?ex=67177b4d&is=671629cd&hm=f02aa1a3dfddca779996d931b84b2ccb00798d4f686f88ed82eaca01ed38e737&
10:15:42 <xarick> yeah i suspected this
10:16:44 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1297866153640595496/image.png?ex=67177b8c&is=67162a0c&hm=cff4b5ef145508a9ab772115b4ef31322fc4dadb8a550905c0f248dfdc59decb&
10:16:44 <xarick> canals
10:18:48 <DorpsGek> [OpenTTD/OpenTTD] telk5093 commented on issue #13000: [Crash]: Unhandled exception in ottd:game thread: [json.exception.type_erro.316] invaild UTF-8 byte at index 41: 0xB4 https://github.com/OpenTTD/OpenTTD/issues/13000
10:18:53 <peter1138> The debugging is very simple and doesn't take account of the fact that canals don't actually ever flood.
10:18:58 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1297866707670536232/image.png?ex=67177c10&is=67162a90&hm=2f8b29741259a45cec0f383a9036c98aac271460cfb16f8ef5468d213b7ec6cc&
10:18:58 <xarick> bridge tunnel
10:21:09 <xarick> okay let's fix the canal/river thing
10:26:31 <peter1138> It's throw-away debugging code.
10:28:38 <xarick> GetFloodingBehaviour tells me what floods
10:28:49 <xarick> need to refresh my memory
10:32:55 <xarick> strange that nothing is mentioned about tunnel bridge
10:33:04 <peter1138> It doesn't matter.
10:37:56 <peter1138> However I think, while porting from JGRPP, I've left it more complicated than it needs to be.
10:40:28 <xarick> why do trees trigger a red square...
10:41:06 <xarick> momentaneosly
10:41:34 <xarick> you know trees can eat performance :p
10:41:35 <peter1138> Because it's a shore tile that got updated.
10:42:29 <xarick> but placing a lock doesn't trigger a red square
10:42:41 <xarick> locks should be reworked
10:47:58 <xarick> dang void tiles flooding constantly, need to isolate them
10:55:26 <xarick> hmm red square is constantly trying to flood the tunnel
10:55:48 <xarick> but tunnel is unfloodable
10:56:20 <xarick> where do I make the change so that it stops retrying it
10:59:43 <xarick> this comment is outdated
11:00:19 <xarick> https://github.com/OpenTTD/OpenTTD/blob/master/src/water_cmd.cpp#L1227
11:00:38 <xarick> i went to tunnelbridge_cmd and i don't see where
11:03:34 <truebrain> w00p, Factorio Space Age is out! \o/
11:09:59 <dwfreed> \o/
11:10:05 <dwfreed> The Factory Must Grow
11:10:17 <ian01223> oh yeah it is
11:10:24 <ian01223> ...well, see you all in two weeks
11:10:38 <ian01223> might as well declare a server wide bank holiday
11:10:38 <dwfreed> s/weeks/decades/
11:12:24 <ian01223> this but for real this time https://xkcd.com/2204/
11:15:33 <dwfreed> I heard KSP 2 was a major disappointment
11:17:05 <ian01223> yeah it wasn't very good
11:17:07 <ian01223> or very done
11:17:44 <ian01223> or very much a "2" at all
11:19:18 <ian01223> actually I think the studio developing the game was closed, so pretty bad
11:20:57 <ian01223> factorio of course was confident enough to do a full playtest with hundreds of reviewers and has shown the whole DLC fairly in depth by now so it's pretty clear to everyone that it's good
11:23:03 <dwfreed> Yeah, and they have a history of actually supporting their game
11:23:19 <dwfreed> like, there was a 1.1 patch 2 months ago
11:24:01 <reldred> There was two patches. I had to keep updating my server 😠
11:24:17 <dwfreed> first world problems
11:32:15 <ian01223> i'll just tell myself that I won't buy it until they put a discount on it, how long could that take
11:33:45 <ian01223> also a british problem right here, looking at the prices at steam db and it costs £30 here and everywhere else in the world except switzerland it costs less (when converted)
11:40:31 <peter1138> Factorio never discounts, so...
11:41:04 <LordAro> just got to wait for the £ to improve
11:41:14 <LordAro> might be a while...
11:41:44 <LordAro> wait, no, wait for it to decrease in value
11:42:09 <LordAro> i think
11:42:43 <peter1138> OpenFactorio.
11:44:06 <peter1138> Factorio must be about as old now as when Transport Tycoon Deluxe was when OpenTTD started...
11:44:15 <peter1138> Time is weird.
11:44:31 <ian01223> that is the joke 😛
11:44:42 <ian01223> older, actually
11:45:04 <ian01223> ...oh, no it was only announced in 2013
11:45:19 <ian01223> with a crowdfunding campaign
11:45:24 <ian01223> and only "complete" in 2020
11:45:28 <ian01223> how modern
11:45:32 <LordAro> https://www.indiegogo.com/projects/factorio#/ neat
11:46:03 <peter1138> In 2004, nobody was selling Transport Tycoon Deluxe at full price in the stores. But modern games seem to live much longer.
11:46:25 <LordAro> in some ways i miss the days when games were "done" when they were shipped
11:46:36 <ian01223> took much longer to get off the ground too
11:46:46 <LordAro> a simpler time
11:48:28 <LordAro> omg the car in that trailer
11:49:36 <ian01223> that trailer is a blast from the past
11:50:59 <ian01223> work in progress graphics, that player character, soothing czech voice, bipedal biters for some reason
11:51:11 <ian01223> why did they ever think that was a good idea?
11:59:07 <DorpsGek> [OpenTTD/OpenTTD] glx22 commented on issue #13000: [Crash]: Unhandled exception in ottd:game thread: [json.exception.type_erro.316] invaild UTF-8 byte at index 41: 0xB4 https://github.com/OpenTTD/OpenTTD/issues/13000
12:58:23 *** ahyangyi has joined #openttd
12:58:24 <ahyangyi> peter1138: Nice
13:00:49 *** argoneus7 has quit IRC (Quit: The Lounge - https://thelounge.chat)
13:01:00 *** argoneus7 has joined #openttd
13:02:35 *** argoneus7 has quit IRC ()
13:04:11 *** argoneus7 has joined #openttd
13:06:24 <kuhnovic> I thought I saw a strange drawing glitch. Turns out it was just dirt on my monitor...
13:12:55 <peter1138> Could be worse... < https://www.reddit.com/r/hardwaregore/comments/1g65znf/_/>
13:17:34 <ian01223> that reddit post somehow managed to remind me of a robert burns poem
13:20:16 <ian01223> to a louse, if you're wondering, it's great but damned hard to read if you're not familiar with scots https://en.wikisource.org/wiki/The_Poetical_Works_of_Robert_Burns/To_a_Louse,_on_seeing_one_on_a_Lady%27s_Bonnet_at_Church
13:22:20 *** Wormnest has joined #openttd
13:27:08 *** argoneus7 has quit IRC (Quit: The Lounge - https://thelounge.chat)
13:27:18 *** argoneus7 has joined #openttd
13:27:21 *** argoneus7 has quit IRC ()
13:27:30 *** argoneus7 has joined #openttd
13:30:06 *** argoneus7 has quit IRC ()
13:30:35 *** argoneus7 has joined #openttd
13:30:36 *** argoneus7 has quit IRC ()
13:30:55 *** argoneus7 has joined #openttd
13:31:04 *** argoneus7 has quit IRC ()
13:32:29 *** argoneus7 has joined #openttd
13:39:19 *** argoneus7 has quit IRC (Quit: The Lounge - https://thelounge.chat)
13:40:23 *** argoneus7 has joined #openttd
14:02:30 <talltyler> kuhnovic: I thought my power supply was failing last week, turned out my landlord turned the heat on for the first time in months and that smells exactly like the magic computer smoke.
14:11:08 <DorpsGek> [OpenTTD/OpenTTD] LordAro approved pull request #12981: Codefix [Win32]: String handling in OTTDStringCompare, Win32StringContains https://github.com/OpenTTD/OpenTTD/pull/12981#pullrequestreview-2382245912
14:30:51 <kuhnovic> talltyler: That is not a good sign 😛
14:31:17 <kuhnovic> Furnace or electric heating?
14:34:48 <kuhnovic> Reminds me of a car that I borrowed from a friend a couple of times. It had a dual fuel system so you could switch between gasoline and LPG. When you switched fuels you had to drive with the windows down for about 5 minutes to let the gasoline fumes out... Fun times 😛
14:35:24 <peter1138> Sounds... broken. Mine just had a slight difference in power between the two.
14:36:50 <kuhnovic> There must have been something wrong with it, but it was a 35 year old banger so it only got the bare maintenaince.
14:37:48 <talltyler> Furnace, I assume. It’s an old rowhouse. But it smells fine now. 🙂
14:39:11 <kuhnovic> Ah good, then that high power draw must have been temporary. Could even have been dust on the ignition element or something like that.
14:40:37 <peter1138> Dust most likely.
14:46:31 <talltyler> The smell was isolated above my computer, so I assumed I had identified the source. But my computer is just in the corner of the room, opposite the heating vent.
14:46:31 <talltyler> I realized my mistake an hour later when I was on my laptop googling where to get a new power supply locally, and smelled it again. But not before wondering if I were cursed and had just fried the laptop too. 🤦
14:52:39 *** belajalilija has quit IRC (Read error: Connection reset by peer)
14:52:39 *** mnhebi has quit IRC (Read error: Connection reset by peer)
14:52:39 *** ahyangyi has quit IRC (Write error: connection closed)
14:52:39 *** leadnaut has quit IRC (Write error: connection closed)
14:52:39 *** xarothbrook has quit IRC (Write error: connection closed)
14:52:39 *** messenils has quit IRC (Write error: connection closed)
14:52:39 *** michi_cc[d] has quit IRC (Write error: connection closed)
14:52:39 *** _glx_ has quit IRC (Write error: connection closed)
14:52:39 *** DorpsGek_vi has quit IRC (Write error: connection closed)
14:52:39 *** woobilicious has quit IRC (Read error: Connection reset by peer)
14:52:39 *** telk5093 has quit IRC (Read error: Connection reset by peer)
14:52:39 *** johnfranklin has quit IRC (Read error: Connection reset by peer)
14:52:39 *** ian01223 has quit IRC (Write error: connection closed)
14:52:39 *** xarick has quit IRC (Write error: connection closed)
14:52:39 *** locosage has quit IRC (Write error: connection closed)
14:52:39 *** andythenorth[d] has quit IRC (Write error: connection closed)
14:52:39 *** squirejames has quit IRC (Read error: Connection reset by peer)
14:52:39 *** emperorjake has quit IRC (Read error: Connection reset by peer)
14:52:39 *** tabytac has quit IRC (Read error: Connection reset by peer)
14:52:39 *** banhmarie has quit IRC (Read error: Connection reset by peer)
14:52:39 *** aviationgamerx has quit IRC (Read error: Connection reset by peer)
14:52:39 *** reldred has quit IRC (Write error: connection closed)
14:52:39 *** flote has quit IRC (Write error: connection closed)
14:52:39 *** bigyihsuan has quit IRC (Write error: connection closed)
14:52:39 *** audigex has quit IRC (Write error: connection closed)
14:52:39 *** abboh_132 has quit IRC (Write error: connection closed)
14:52:39 *** talltyler has quit IRC (Write error: connection closed)
14:52:39 *** kuhnovic has quit IRC (Write error: connection closed)
14:52:39 *** truebrain has quit IRC (Write error: connection closed)
14:52:39 *** _pruple has quit IRC (Write error: connection closed)
14:52:39 *** _jgr_ has quit IRC (Write error: connection closed)
14:52:39 *** peter1138 has quit IRC (Write error: connection closed)
14:52:39 *** wensimehrp has quit IRC (Write error: connection closed)
14:52:39 *** brickblock19280 has quit IRC (Remote host closed the connection)
14:52:39 *** jlx0 has quit IRC (Write error: connection closed)
14:52:57 *** DorpsGek_vi has joined #openttd
15:20:13 *** _glx_ has joined #openttd
15:20:13 <_glx_> the smell is quite usual for convection heaters
15:25:28 *** xarick has joined #openttd
15:25:28 <xarick> my power supply is 4 years old
15:25:48 <xarick> a graphic cards already exploded
15:25:54 <xarick> i still kept the power supply
15:34:08 <DorpsGek> [OpenTTD/OpenTTD] rubidium42 merged pull request #13010: Codefix: [Win32] Truncated stack trace symbols were not null-terminated https://github.com/OpenTTD/OpenTTD/pull/13010
15:34:33 <DorpsGek> [OpenTTD/OpenTTD] rubidium42 merged pull request #12981: Codefix [Win32]: String handling in OTTDStringCompare, Win32StringContains https://github.com/OpenTTD/OpenTTD/pull/12981
15:37:53 <DorpsGek> [OpenTTD/OpenTTD] rubidium42 approved pull request #13013: Change: Disable water flooding when water tiles have no floodable neighbours. https://github.com/OpenTTD/OpenTTD/pull/13013#pullrequestreview-2382503643
15:53:19 <xarick> I wonder something
15:54:08 <xarick> why don't we check GetFloodingBehaviour(dest) == FLOOD_ACTIVE
15:54:17 <xarick> on the dir tiles
15:54:33 <xarick> let me test
15:55:05 <xarick> oh... performance reasons
16:00:06 <xarick> nevermind, i fail at understanding what this is doing
16:02:51 *** kuhnovic has joined #openttd
16:02:51 <kuhnovic> This is how you blow up your graphics card Xarick
16:03:37 *** ian01223 has joined #openttd
16:03:37 <ian01223> surely there's got to be an easier way to blow up a graphics card
16:10:39 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1297955218721603604/image.png?ex=6717ce7e&is=67167cfe&hm=58952d7a5a7327582461679c1b6cf2c4964c7681f4895a6d7a4466f734da2280&
16:10:39 <xarick> I'm trying to reinvent the wheel
16:23:47 <xarick> hmm
16:25:02 *** Wolf01 has joined #openttd
16:25:06 <DorpsGek> [OpenTTD/OpenTTD] PeterN opened pull request #13015: Codechange: Use template parameter of SetBitIterator instead of casting later. https://github.com/OpenTTD/OpenTTD/pull/13015
16:27:03 *** peter1138 has joined #openttd
16:27:03 <peter1138> I have some minor tweaks to make to #13013 though.
16:27:17 *** HerzogDeXtEr has joined #openttd
16:27:31 <xarick> please rebase
16:28:37 <LordAro> you can do that yourself
16:28:39 <LordAro> locally
16:30:47 <DorpsGek> [OpenTTD/OpenTTD] rubidium42 approved pull request #13015: Codechange: Use template parameter of SetBitIterator instead of casting later. https://github.com/OpenTTD/OpenTTD/pull/13015#pullrequestreview-2382633408
16:32:51 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1297960804662116453/Geborough_Transport_2060-07-30.png?ex=6717d3b2&is=67168232&hm=7c1922251019981b23b186803c02f6a3758ef0a3fde39e6179d15675a306dca4&
16:32:51 <xarick> my wheel...
16:33:31 <peter1138> Do you understand what is going on there?
16:33:33 <xarick> there are canals around, they're quite hidden
16:34:01 *** Flygon has joined #openttd
16:34:41 <xarick> I think not, yet
16:37:06 <_glx_> canals don't flood
16:37:46 <LordAro> echo
16:38:58 <_glx_> and a comment in the PR even says "Canal tiles never flood anyway so never get the "not flooding" state"
16:43:43 <xarick> SetNonFloodingWaterTile needs to consider more types than just water
16:44:01 <peter1138> Why?
16:44:53 <LordAro> peter1138: because of the big scary red squares your inadequate debugging function produces
16:44:57 <LordAro> obvs
16:45:19 <xarick> 🙂
16:45:29 <Wolf01> So, it's factorio time?
16:45:46 <xarick> I'm gonna investigate this better 😐
16:45:48 <peter1138> It's about protionality.
16:45:55 <peter1138> AND proportionality.
16:46:16 <peter1138> On 2048x2048 map with 50% water, there are approximately 2,000,000 water tiles.
16:46:32 <peter1138> There are approximately 8000 void tiles.
16:47:42 <peter1138> Proportion wise, the number of tiles that can flood but are not water tiles is tiny.
16:50:42 *** mnhebi has joined #openttd
16:50:43 <mnhebi> Every time I think to myself "I shoulda contributed features I want to OpenTTD" I just remind myself to look in Discord channel #openttd-development these days
16:51:00 <LordAro> :(
16:51:26 <peter1138> What did I do that put you off?
16:52:06 <mnhebi> No no...its just this discussion reminds me how many revisions my code goes through before its actually somewhat semi-working xD
16:54:45 <DorpsGek> [OpenTTD/OpenTTD] PeterN dismissed a review for pull request #13013: Change: Disable water flooding when water tiles have no floodable neighbours. https://github.com/OpenTTD/OpenTTD/pull/13013#pullrequestreview-2382503643
16:54:48 <DorpsGek> [OpenTTD/OpenTTD] PeterN updated pull request #13013: Change: Disable water flooding when water tiles have no floodable neighbours. https://github.com/OpenTTD/OpenTTD/pull/13013
16:54:59 <DorpsGek> [OpenTTD/OpenTTD] PeterN merged pull request #13015: Codechange: Use template parameter of SetBitIterator instead of casting later. https://github.com/OpenTTD/OpenTTD/pull/13015
16:56:48 <DorpsGek> [OpenTTD/OpenTTD] PeterN commented on pull request #13013: Change: Disable water flooding when water tiles have no floodable neighbours. https://github.com/OpenTTD/OpenTTD/pull/13013#issuecomment-2427241300
16:56:57 <mnhebi> <https://github.com/MnHebi/wgmus/blob/main/wgmus.c> like, this took me a shit tonne of time to get working anywhere near properly, and theres still a bug in there I haven't been able to solve :D
16:57:23 <peter1138> It's C, it can't be solved 😉
16:57:42 <xarick> IsFloodingTypeTile you don't seem to call this
16:58:13 <LordAro> he's right you know
16:58:24 <LordAro> but you should ignore him on principle until HE POSTS IT IN THE RIGHT PLACE
16:58:33 <mnhebi> peter1138: better C than C# and not having a compiler old enough to compile NET 4.0...
16:59:01 <LordAro> mnhebi: mm, global variables
16:59:03 <DorpsGek> [OpenTTD/OpenTTD] rubidium42 approved pull request #13013: Change: Disable water flooding when water tiles have no floodable neighbours. https://github.com/OpenTTD/OpenTTD/pull/13013#pullrequestreview-2382712107
16:59:14 <mnhebi> LordAro: yes, my code is JUICY.
17:02:02 <mnhebi> mostly cause I'm lazy and can't bother to make shit that actually passes values between methods.
17:02:12 <LordAro> ;_;
17:03:11 <mnhebi> better to just hope Cthulhu doesn't grab a byte randomly and stick a global variable in there than bother to figure out how do I pass this or that between 5 different things that all need it xD
17:03:40 <LordAro> "took me a shit tonne of time to get working anywhere near properly, and theres still a bug in there I haven't been able to solve"
17:03:43 <LordAro> ;)
17:04:55 <mnhebi> well, you see the game I made that dll for originally
17:05:00 <mnhebi> doesn't really use MCI_SEEK
17:05:03 <_glx_> if-else coding style doesn't help readability 😉
17:05:11 <xarick> why does it require to save the state on the map array? 😮
17:05:15 <mnhebi> but then I repurposed the dll for another game...that does use it(see the SWGB branch)
17:05:33 <_glx_> xarick: speed
17:05:33 <mnhebi> and I opened a can of bugs right there when I started backporting fixes from that branch xD
17:05:37 <xarick> just wondering if it could be on a cache
17:05:49 <_glx_> it's is caching in the map array
17:06:08 <xarick> oh, well fine
17:06:59 <mnhebi> _glx_: I mean, I did use a more elaborate method at one point..
17:07:23 <mnhebi> but if-else is easier to debug
17:07:57 <_glx_> https://cdn.discordapp.com/attachments/1008473233844097104/1297969637715349555/image.png?ex=6717dbec&is=67168a6c&hm=ec25f3f346ef00e19870b8aed612ee3a2c6317aeff4c093540808d8cd2ce0be8&
17:07:57 <_glx_> this is asking for troubles 🙂
17:08:23 <mnhebi> well without that the game just freezes, actually. :)
17:08:39 <_glx_> I mean, at least add some {}
17:08:43 <mnhebi> no.
17:08:47 <mnhebi> NEVER.
17:09:06 <mnhebi> Well I did use to but I just find it easier to read it like that.
17:11:07 <mnhebi> but yeah I did use to use switch statements instead of if else.
17:13:10 <mnhebi> I also had some while loops but sometimes bugs broke them so I just resorted to cruder code :d
17:13:36 <peter1138> At least use indentation.
17:14:12 <mnhebi> if I didn't you'd be clawing your eyes out tho.
17:14:48 <xarick> m6 bit 7 seems to be a good alternative if I want to add more tile types
17:14:56 <xarick> which flood
17:14:57 <mnhebi> I just like whatever happens after an else to be on the same level as the else :p
17:15:28 <mnhebi> unless its {] in which case it gets indented. :P
17:17:25 <peter1138> That is a very strange coding style.
17:17:46 <LordAro> i take back my ':(' from earlier
17:19:34 <mnhebi> but yeah, a reason I can't figure out a fix for a bug is...cause I can't figure out an alternative to sscanf. You see my code catches ``status cdaudio position`` and `` "status cdaudio position track %d"`` as the same command.
17:20:09 <mnhebi> cause sscanf cant differentiate since it just has the right keywords at the start there.
17:20:16 <LordAro> try the longer one first?
17:20:23 <peter1138> Ah, thanks for blocking it.
17:20:31 <mnhebi> then it just goes with the longer one
17:20:33 <peter1138> Yeah, that function seems spurious.
17:20:34 <mnhebi> instead of the shorter one
17:20:35 <peter1138> Even in JGRPP 🙂
17:20:48 <LordAro> mnhebi: how would it do that?
17:20:49 <LordAro> peter1138: :D
17:21:06 <LordAro> if it matches "... track", then it can't be the "...position" command
17:21:26 <mnhebi> don't ask me, I tried switching them around and after that every call was answered with the longer command even when the game sent for the shorter one
17:21:41 <LordAro> probably getting your if/elses wrong ;)
17:21:45 <peter1138> `if (IsFloodingTypeTile(tile) && !IsNonFloodingWaterTile(tile)) {`
17:21:55 <LordAro> 🤔
17:22:13 <mnhebi> well you see shorter one just uses strstr...while longer one uses sccanf.
17:22:16 <peter1138> JGRPP has that, I don't have that code because we don't have a separate auxiliary tile loop.
17:23:00 <peter1138> Something to do with daylength.
17:23:16 <mnhebi> and yes, I did try a switch tree instead of doing a bunch of ifs :p
17:23:29 <mnhebi> results were not..good.
17:24:34 <xarick> if is FloodingTypeTile is probably to help against using IsTileType(tile, type) all the time
17:25:17 <mnhebi> you see both strstr and sscanf just care they hit the first possible result, instead of the complete one.
17:25:23 <peter1138> No, it's a detail that's only relevant to JGRPP.
17:25:29 <mnhebi> and its quite the hurdle to break that down so it actually catches the complete string.
17:26:26 <DorpsGek> [OpenTTD/OpenTTD] PeterN dismissed a review for pull request #13013: Change: Disable water flooding when water tiles have no floodable neighbours. https://github.com/OpenTTD/OpenTTD/pull/13013#pullrequestreview-2382712107
17:26:29 <DorpsGek> [OpenTTD/OpenTTD] PeterN updated pull request #13013: Change: Disable water flooding when water tiles have no floodable neighbours. https://github.com/OpenTTD/OpenTTD/pull/13013
17:26:48 <DorpsGek> [OpenTTD/OpenTTD] PeterN commented on pull request #13013: Change: Disable water flooding when water tiles have no floodable neighbours. https://github.com/OpenTTD/OpenTTD/pull/13013#issuecomment-2427313382
17:32:15 <mnhebi> cause "status cdaudio position" contains the keywords it is looking for sscanf doesn't care its missing "track %d" at the end. And every workaround I read for it made the code a salad. There was even one with strncpy.
17:33:26 <xarick> i think there's a bug, not sure if I caused it, let me retry with your changes only
17:35:37 <LordAro> i really don't understand the issue - `if (sscanf(buffer, "status cdaudio position track %d", &track_no) == 1) { ... } else if (strcmp(buffer, "status cdaudio position") == 0) { ... }` should work fine
17:35:59 <mnhebi> yeah its been tried with an else if :D
17:36:02 <mnhebi> changes nothing lol
17:36:47 <LordAro> then the code is not running what you're writing
17:36:52 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1297976918544748606/image.png?ex=6717e2b4&is=67169134&hm=26dfe83c87ab8090710b67194393b7558024c5a94f98657dd9e1828ab3c4b099&
17:36:52 <xarick> yep, peter1138 I magic bulldozed industries, they weren't flooded
17:37:05 <mnhebi> yeah I figure I should just make my own stuff to read the strings..
17:37:25 <mnhebi> cause none of the standard C ones actually care for the complete string, just that it contains the keywords.
17:37:38 <xarick> that's with your PR unchanged
17:37:45 <mnhebi> and it takes a whole load of chopping the string to make it parse the whole string :D
17:38:05 <LordAro> https://github.com/MnHebi/wgmus/blob/main/wgmus.c#L1432-L1450 yeah, exactly as i thought. swap these (and make it an else if) and it'll work
17:38:23 <LordAro> oh, there's a return, guess it doesn't need to be an else if
17:38:48 <mnhebi> theres a return cause it potentially freezes without it xD
17:39:11 <LordAro> there's a return case because you've clearly got no idea what you're doing, but that's a valid way of shortcutting regardless
17:39:12 <_glx_> yeah always check for long string first
17:39:57 <mnhebi> yeah then it just catches the long string always and you get a program that has unexpected input that goes ??? and promptly freezes :)
17:40:25 <_glx_> no if it's the short string it won't match the longer version
17:41:22 <LordAro> think about it - (in pseudocode) given the string "abc", and do `if (str == "ab") { echo "foo"; return; } if (str == "abc") { echo "bar"; return; }` - how can it ever match the second if ?
17:44:04 <LordAro> on the other hand, strstr is searching within a string, not actually matching an entire string
17:44:08 <LordAro> you want strcmp for that
17:44:40 <mnhebi> yeah...I did try strcmp at one point
17:45:53 <LordAro> trying things without adequately understanding what's going on is a recipe for ...not understanding the results
17:46:16 <mnhebi> well you see, when I use strcmp
17:46:19 <_glx_> I think it would be simpler to spilt the string into an array, then you can check by item
17:46:21 <mnhebi> result is a freeze.
17:46:35 <LordAro> like i say, not adequately understanding what's going on
17:46:55 <LordAro> maybe strcmp isn't appropriate and it's not matching anything
17:47:03 <LordAro> maybe that's why the sscanf isn't working either
17:47:19 <LordAro> not matching anything because the full string contains other data*
17:48:03 <LordAro> https://godbolt.org/z/EajTnsaac but i promise it works - play around with it, swap the if statements round
17:48:25 <LordAro> it doesn't behave different just because it's a plugin to some other program
17:48:44 <LordAro> but i can tell you now that one thing strcmp does not do is "freeze"
17:48:53 <LordAro> under zero circumstances does that happen
17:49:23 <mnhebi> well in this case, it somehow caught the command...out of order
17:49:28 <LordAro> (ok, fine, maybe if the string is completely unbounded)
17:49:32 <mnhebi> which resulted in sending the program data it did not expect
17:49:38 <LordAro> (which is why you should be using strncmp)
17:51:29 <peter1138> xarick: This doesn't show anything useful, I don't know what your layout was before you did it.
17:51:29 <_glx_> hmm if I tweak input string I get Matched track 0 even for just "status"
17:51:40 *** andythenorth has joined #openttd
17:51:40 <andythenorth> naptime?
17:52:06 <LordAro> _glx_: ...have i thoroughly misunderstood sscanf's exit code?
17:52:31 <LordAro> ah, -1
17:52:35 <LordAro> amazing.
17:52:40 <xarick> i started a new game, asked for 10000 moneys, then leveled everything around the industries to sea level, waited for all tiles to be watered, then i enabled magic bulldozer and demolished the industries there
17:52:59 <xarick> and that's what it became...
17:53:19 <LordAro> mnhebi: another thing to think about is that *only* 0 is falsy. -1 is also truthy
17:53:58 <LordAro> sscanf returns -1 "on input failure" (it calls it EOF)
17:55:42 <_glx_> yup with `> 0` it works
17:55:50 <mnhebi> also, that section of code is mostly unchanged from the original, I just added new strings to read
17:56:07 <mnhebi> https://github.com/bangstk/ogg-winmm/blob/master/wav-winmm.c was the original project I based my code on initially.
17:56:54 <LordAro> https://github.com/bangstk/ogg-winmm/blob/master/wav-winmm.c#L565 yeah, look how they're treating their sscanf calls
17:57:03 <LordAro> looking for *exact* return values
17:57:09 <LordAro> not just "nonzero"
17:57:51 <_glx_> as it should be
17:57:57 <LordAro> indeed
17:58:04 <LordAro> even > 0 is kinda dubious :p
17:58:20 <_glx_> was a quick test 🙂
17:59:42 <mnhebi> well you see my understanding of sscanf is based on <https://www.tutorialspoint.com/c_standard_library/c_function_sscanf.htm> where it was used kinda like I used it
18:00:20 <LordAro> there are no if statements there
18:00:39 <LordAro> and they're clearly counting the number of parameter matches
18:01:33 <LordAro> (sorry, i'm being a bit harsh here - some C stdlib functions are extremely unclear about the meaning of their return values)
18:01:51 <LordAro> https://en.cppreference.com/w/c/io/fscanf cppreference 4 lyfe, anyway
18:02:45 <andythenorth> pff GPT failed me
18:03:53 <LordAro> andythenorth: :o
18:03:54 <mnhebi> and I've had much more experienced coders help me with this and none of them noticed my foobar with the sscanf there :P
18:04:22 <mnhebi> man my head hurts looking at that tutorialspoint version. It just goes full cthulhu rllyeh there.
18:05:05 <LordAro> copilot completely fails to find the issue with your code, just for reference :p
18:05:50 <mnhebi> see, this is why I don't write cpp.
18:06:29 <andythenorth> pff, I need 3 tokens (dict keys) for lists of covered hopper classes. (1) food grade covered hoppers (2) non-food-grade covered hoppers (3) "don't care" covered hoppers (food-grade, but can be used for any cargo, assume they're cleaned). No idea what to call these keys
18:06:58 <andythenorth> "covered_hopper_freight" is what old Horse uses, because all the food / non-food is on labels, not classes
18:07:00 <mnhebi> but suppose tomorrow ill replace all that strstr with strcmp...that actually works
18:07:10 <mnhebi> and sscanf with proper usage xD
18:07:12 <LordAro> mnhebi: we all started somewhere :)
18:07:41 <mnhebi> Started? Nah man I just went into it full sprint from standing still and wonder why my knees hurt.
18:07:44 <LordAro> https://i.imgur.com/IzqfJUY.png yeah it's got no idea
18:07:56 <LordAro> mnhebi: we all usually did that too :D
18:08:29 <LordAro> (but the suggested code would also work)
18:08:36 <andythenorth> "covered_hoppers_food_grade_but_can_be_cleaned_so_refit_any_class"
18:09:12 <mnhebi> well, my code also worked...until I started fixing a bug :P
18:09:27 <mnhebi> at which point it promptly went back to not working again ahaha.
18:10:08 <mnhebi> oh well lets hope I remember all this once I come back from work tomorrow x_X
18:11:10 <mnhebi> its always so illuminating tho when someone looks at my code and goes "why you use it that way, its wrong".
18:11:21 <mnhebi> and im like "well, it compiles and works?"
18:12:47 *** Wormnest has quit IRC (Ping timeout: 480 seconds)
18:18:08 <LordAro> that's fine as long as you never need to modify it again
18:18:12 <LordAro> which is rarely the case :)
18:18:38 <LordAro> most code is read far more often than it is written
18:19:03 <LordAro> optimising for readability (and so maintainability) is usually more important than anything else
18:19:24 * LordAro downloads factorio
18:19:40 <peter1138> Hmm
18:19:52 <peter1138> We've lost them
18:20:30 <LordAro> 10 minutes before it finishes downloading
18:24:45 <mnhebi> Did you know there is a combinator mod that allows you to write assembly code instructions for combinators?
18:25:24 <mnhebi> You can actually make self replicating factories with it ;)
18:25:48 <LordAro> this doesn't surprise me in the slightest
18:26:15 <LordAro> i don't generally get on very well with those sort of "toy assembly" type games
18:26:18 <LordAro> too much like work ;)
18:35:57 <peter1138> Okay, I see what I've done wrong.
18:39:42 <DorpsGek> [OpenTTD/OpenTTD] PeterN updated pull request #13013: Change: Disable water flooding when water tiles have no floodable neighbours. https://github.com/OpenTTD/OpenTTD/pull/13013
18:42:18 <DorpsGek> [OpenTTD/OpenTTD] PeterN commented on pull request #13013: Change: Disable water flooding when water tiles have no floodable neighbours. https://github.com/OpenTTD/OpenTTD/pull/13013#issuecomment-2427457386
18:47:02 <xarick> back from dinner
18:50:48 *** Wormnest has joined #openttd
18:54:31 <xarick> oh, red squares
18:54:43 <xarick> they're supposed to be there?
18:58:30 <xarick> nevermind
19:13:23 <peter1138> Yeah, thanks for finding my bugs.
19:45:11 <andythenorth> hmm slow Horse compile is slow
19:48:11 <xarick> that part about trees on the coast... confusing me
19:50:42 <andythenorth> pff, should I drop label support from Horse, where FIRS will provide new classes?
19:50:48 <andythenorth> might be quite aggressive 😛
19:52:07 <xarick> why are trees influencing whether a tile is marked nonflooding
19:53:04 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1298011192177983608/image.png?ex=671802a0&is=6716b120&hm=bbe98b179e684ecf0e1842ec3aaa20ac2d830898e4458a1a475f6ae1b5aa1920&
19:54:18 <xarick> white = nonflooding tile, red = flooding tile, if I understood this
19:54:46 <xarick> blue = dryup
19:55:52 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1298011895877341216/image.png?ex=67180347&is=6716b1c7&hm=b21e6f1249ea3464e2002aff08f5b8e0f3028975b24c105dec95ffae516b775a&
19:56:57 <DorpsGek> [OpenTTD/OpenTTD] PeterN opened pull request #13016: Codechange: Tweaks to water region debug output. https://github.com/OpenTTD/OpenTTD/pull/13016
19:57:32 <peter1138> xarick: Coastal tiles are MP_WATER, unless they have trees on them in which case they are MP_TREE.
19:59:10 <peter1138> Clearing trees on a coast will convert the tile to a clear tile instead of a water tile.
19:59:32 <peter1138> (water tile in coast with trees mode)
20:00:08 <peter1138> And yes, I also thought I was being clever by catching that situation.
20:00:25 <peter1138> But it turns out that it is deliberately left flooding.
20:00:48 <peter1138> It is still a massive improvement over *every* water tile still flooding.
20:06:26 *** nielsm has quit IRC (Ping timeout: 480 seconds)
20:08:44 <xarick> wish I could decipher if (!HasBit(_flood_from_dirs[slope_dest & ~SLOPE_HALFTILE_MASK & ~SLOPE_STEEP], ReverseDir(dir))) continue;
20:12:07 <_glx_> what's hard to read there ?
20:14:56 <xarick> let me try `Slope whatever_slope_this_is = slope_dest & ~SLOPE_HALFTILE_MASK & ~SLOPE_STEEP;`
20:18:21 <xarick> ah, there's a table at the start of the file
20:23:07 <andythenorth> _slightly serious idea_ what if nml could have plugins?
20:42:28 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1298023624522993674/Geborough_Transport_2067-12-14.png?ex=67180e34&is=6716bcb4&hm=47cf48402c6e01c40dd868c33b4559f3909b1b9ea74d45bc0e142bd692ca17e7&
20:42:28 <xarick> some tests
20:46:18 <xarick> I'm not sure what to think anymore, this is slightly overwhelming
20:46:40 <peter1138> You are misinterpreting the intention of the change.
20:46:56 <andythenorth> nml plugins provide, e.g. ready-made groupings of cargo classes
20:47:09 <andythenorth> maybe a few other things
20:47:23 <andythenorth> basically limited to constant expansion
20:48:03 <LordAro> i'd be tempted to say that that's the sort of thing nml should provide
20:48:07 <LordAro> "nice helper things"
20:48:51 <andythenorth> a few of the previous attempts are a bit weird
20:48:56 <andythenorth> like the railtype 'fallback' thing
20:49:40 <andythenorth> someone, maybe me, can't remember, did modfify nml to load extra constants from json
20:49:49 <andythenorth> probably more likely someone who could actually program, not me
20:50:13 <peter1138> Is packed struct notation legal these days?
20:50:22 <LordAro> in python? sure
20:50:44 <peter1138> OpenTTD isn't written in Python.
20:50:51 <andythenorth> "we could change that"
20:51:05 <LordAro> in which case "depends what you mean"
20:51:05 <andythenorth> RustyTTD perhaps though?
20:52:11 <peter1138> Ah, they're call bit-fields.
20:52:20 <LordAro> ah, then yes
20:55:22 <peter1138> Hmm, although a reference or pointer to them does not seem likely 🙂
20:55:45 <LordAro> probably not, no
20:56:38 *** _jgr_ has joined #openttd
20:56:38 <_jgr_> I thought you were talking about attribute packed at first
20:56:51 <kuhnovic> PeterNviaGitHub: I vaguely remember iterating because going the direct route would print the traversability bits backwards
21:04:48 <peter1138> To be honest I was expecting to have to reverse it, but, uh, that showed it the wrong way.
21:05:21 <peter1138> The rotation of the region data is a bit weird. I think.
21:10:15 <peter1138> > line = fmt::format("{:{}}", label_str, max_element_width) + " " + line;
21:10:27 <peter1138> Ah no, just that confused me, by prepending instead of appending.
21:13:01 *** keikoz has quit IRC (Ping timeout: 480 seconds)
21:13:32 <peter1138> If it wasn't preprending like that the string would be the wrong way around indeed.
21:15:31 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1298031942901698641/image.png?ex=671815f3&is=6716c473&hm=7a5a2dea40cd01ede39a3ba6118dbd2b683bc62577aa9dd9b56a6e1f7156cb6e&
21:15:31 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1298031943140642857/Dadinghead_Cross_Transport_2055-11-13.png?ex=671815f3&is=6716c473&hm=5b14973978c79f9bc642e1ded5685f6c4c2041c505173d75b5fc350d9c6de697&
21:15:31 <xarick> it's starting to make sense
21:19:20 <_glx_> andythenorth: you can declare extra constants in your nml file
21:20:58 <xarick> hmm so, industries and rail with one corner raised need to be taken into account
21:21:15 <xarick> buys and docks are already fixed
21:21:28 <xarick> trees need to swap position with the bool
21:22:08 <xarick> and i guess the red is ... normal, unless there's a white adjacent to it
21:32:40 <peter1138> The industry parts of oilrigs do flood, but there generally aren't enough oilrigs around to go to the effort of disabling their flooding.
21:33:38 <_glx_> the idea is just to remove as much as possible flooding tiles, and the biggest amount is plain water
21:35:21 <_glx_> industries and "watered" rails don't cost much compared to water itself
21:35:50 <peter1138> I'm sure he can come up with a contrived savegame where 75% of the map is oilrigs 🙂
21:35:55 <xarick> 🙂
21:36:13 <xarick> I've seen them
21:36:32 <xarick> and I didn't exactly force them to spawn
21:36:33 <_glx_> in "normal" condition you always have more water than oilrigs
21:39:29 <xarick> actually, screw the railway... the tiles still stay red for some reason 😦
21:40:34 <xarick> they flood from a certain direction
21:40:38 <xarick> and im too tired
21:44:02 <xarick> `if (IsTileType(dest, MP_RAILWAY) && GetRailGroundType(dest) == RAIL_GROUND_WATER && !HasBit(_flood_from_dirs[slope_dest], reverse_dir)) continue;` this works, but can_flood = true; must be after
21:44:22 <xarick> cyas good night
21:51:49 *** tokai|noir has joined #openttd
21:51:49 *** ChanServ sets mode: +v tokai|noir
21:53:51 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
21:58:48 *** tokai has quit IRC (Ping timeout: 480 seconds)
22:18:40 *** HerzogDeXtEr has quit IRC (Read error: Connection reset by peer)
23:33:33 <DorpsGek> [OpenTTD/OpenTTD] PeterN merged pull request #13012: Fix: Don't invalidate water regions on the other side of the map. https://github.com/OpenTTD/OpenTTD/pull/13012
23:34:19 <DorpsGek> [OpenTTD/OpenTTD] PeterN merged pull request #12994: Fix #12993: Replace known-bugs text with markdown version. https://github.com/OpenTTD/OpenTTD/pull/12994
23:34:22 <DorpsGek> [OpenTTD/OpenTTD] PeterN closed issue #12993: [Bug]: Known bugs tab https://github.com/OpenTTD/OpenTTD/issues/12993