IRC logs for #openttd on OFTC at 2024-02-27
ā“ go to previous day
00:19:00 <_glx_> oh of course 13.4 didn't have circular reference detection
01:10:35 *** HerzogDeXtEr1 has quit IRC (Read error: Connection reset by peer)
02:14:57 *** Flygon has quit IRC (Quit: A toaster's basically a soldering iron designed to toast bread)
03:00:26 *** herms has quit IRC (Quit: bye)
03:04:09 *** Wormnest has quit IRC (Quit: Leaving)
03:55:19 *** debdog has quit IRC (Ping timeout: 480 seconds)
03:55:28 *** Leopold___ has joined #openttd
03:59:35 *** Leopold has quit IRC (Ping timeout: 480 seconds)
04:00:56 *** gnu_jj_ has quit IRC (Ping timeout: 480 seconds)
04:06:55 *** D-HUND is now known as debdog
05:55:59 <johnfranklin> Is this viable? I have no clue after 2-hour digging into grf-py
05:56:24 <johnfranklin> Restaurant cars are masked with bit 0
06:18:01 *** keikoz has quit IRC (Ping timeout: 480 seconds)
07:04:33 <locosage> johnfranklin: all the logic needs to go inside the switch code
07:05:15 <locosage> johnfranklin: also ranges are normally a dict, not a list and feauture is TRAIN, not Train
07:05:29 <ajmiles> I'm not sure it's remotely in the Top 3 reasons for why the GPU blitter is good, but it looks like taking Screenshots is about 3-4x faster now
07:05:59 <locosage> johnfranklin: iirc there is no hasbit function as well, just use binary operators
07:13:07 <belajalilija> my project already has people forking it
07:14:32 <belajalilija> i hope this doesnt impact things for me
07:14:56 <belajalilija> the changes wont happen to me right?
07:52:38 <andythenorth> stupid question, but a python assignment of an attribute value to a method result won't call the method each time the attribute is read?
07:52:47 <andythenorth> (it's a method with @property decorator)
08:16:24 <peter1138> Which languages did that...
08:16:28 <peter1138> I remember at least one š®
08:42:00 <ahyangyi> andythenorth: if you have provided the setter, I think the setter would be called; otherwise you are simply replacing the method with the value I think
08:43:01 <ahyangyi> you shouldn't be able to set it at all without a setter
09:01:22 <andythenorth> `foo = bar()` won't call bar() every time I want `foo` though?
09:01:56 <andythenorth> it's a one time assignment of `foo` to the result of `bar()` when called?
09:02:07 <andythenorth> I have only been doing python for 20 years š
09:03:23 <_jgr_> If you want to just copy a reference to the function, leave the function call brackets off
09:04:29 <andythenorth> the opposite š the function is very expensive
09:04:39 <andythenorth> I don't want it called every time I read `foo`
09:05:29 <andythenorth> generally I assumed assignments would copy the result to the attribute, rather than placing a reference to the function, but something made me distrust that assumption
09:10:35 <peter1138> Urgh, tummy rumbling
09:11:11 <andythenorth> too early for lunch
09:11:13 <andythenorth> even I know that
09:11:29 <andythenorth> might be time for a orange
09:12:31 <andythenorth> oof I assumed oranges had zero negative health benefits, I should **not** have googled that š
09:12:35 *** Leopold___ has quit IRC (Ping timeout: 480 seconds)
09:12:38 <andythenorth> is there no food with downsides?
09:13:06 <andythenorth> peter1138: get openttd to draw a vector line between them, 1px, black
09:13:10 <andythenorth> llike a tow rope
09:15:17 <_jgr_> andythenorth: The dose makes the poison, as they say
09:20:54 <johnfranklin> I think I have found a bug in grf-py
09:20:54 <johnfranklin> "has_consist_info" only checks the bitmask of wagons BEFORE the current wagon
09:23:19 <johnfranklin> Kiosk/restaurant cars (coded with bitmask(0)) has bonus to passenger cars only by attaching BEFORE them
09:26:55 <locosage> johnfranklin: ehm, what is has_consist_info? i see nothing with this name in grf-py
09:27:40 <ahyangyi> `cargo_classes_in_consist`
09:28:07 <locosage> if you mean bitmask_consist_info that's straight up var42
09:28:44 <ahyangyi> `bitmask_consist_info`
09:28:53 <ahyangyi> since we need the high bits
09:28:57 <andythenorth> is it a tree if each parent has one child?
09:29:03 <andythenorth> and they just recurse upwards?
09:29:06 <ahyangyi> I'm too little-endian to read the docs correctly
09:29:07 <andythenorth> or is that a chain?
09:30:30 <ahyangyi> Well, a chain is a tree, just like an empty graph is a forest
09:30:45 <locosage> can also be a loop though which isn't a tree
09:35:36 <belajalilija> what are you even trying to do?
09:35:45 <belajalilija> it might be something i can do?
09:40:37 <brickblock19280> Lower cargo age period when there is a restaurant/pub/kiosk car
09:41:12 *** Leopold has joined #openttd
09:41:31 <belajalilija> but im not fucking with that unless you *really* want to
09:42:08 <brickblock19280> Nah but I don't mind adding it if he manages to code it
09:42:34 <belajalilija> ill let you manage that
09:42:51 <belajalilija> you did your own merge thing recently
09:42:59 <belajalilija> so i trust you to do that stuff
09:56:15 <kuhnovic> Let's make xarick unhappy
10:00:52 <xarick> `if (!path_found || node == nullptr)` I don't think node == nullptr will ever be true
10:01:10 <xarick> if path is found, then there is a node
10:01:42 <xarick> if path is not found, then node == nullptr is not tested
10:02:10 <kuhnovic> That might be true, but it doesn't hurt to check
10:02:12 <xarick> so the times when it's true, it's not checked
10:03:27 <xarick> I wonder how much it's gonna affect my AI now
10:03:49 <kuhnovic> Dereferencing a nullptr is undefined behavior. It might crash the application š
10:04:03 <kuhnovic> So in this case I figured it's best to check
10:04:28 <kuhnovic> Why do you rely on this behavior? Again, a lost ship is truely lost, you won't reach your destination anyway.
10:20:17 <peter1138> Oh hey, I changed something else from 13ms to... almost nothing.
10:21:27 <peter1138> Caveat, it's only 13ms in one of (all of?) Xarick's crazy saves. In Wentbourne it's only ~1ms.
10:25:57 <peter1138> Also, trying to work out what this spare 12V/1.2A power supply is for.
10:26:08 <peter1138> Mikrotik router maybe?
10:27:02 <peter1138> Well, I better move it away from all the equipment that expects 9VDC centre negative.
10:28:29 <johnfranklin> I don't know why, but when I add the right bracket and compile, GRF-PY would show "list index out of range"
10:29:04 <johnfranklin> Otherwise, I am ready to make a PR.
10:34:08 <brickblock19280> That's really weird
10:49:51 <kuhnovic> peter1138: This brings back traumatic memories of guitar FX pedals going up in smoke by plugging in the wrong adapter.
10:50:38 <locosage> johnfranklin: need a full traceback to see what's going on, but anyway use `bitmask_consist_info & 1` that should be the same thing
10:51:07 <xarick> `m_new_td_bits &= (TrackdirBits)~(int)TrackdirCrossesTrackdirs(m_old_td);`
11:11:54 <xarick> hmm, found another ship problem, I think
11:45:19 <ahyangyi> ^ first error is about a comma
11:46:02 <peter1138> More full-width commas where normal ASCII expected? š
11:46:17 <kuhnovic> xarick: Xarick is keeping me off the streets
11:47:17 <xarick> i'm looking at some random ship lost messages out of nowhere, different than the usual
11:50:30 <merni> meh, it can probably wait for the weekend
11:59:21 <locosage> johnfranklin: "fixed"
11:59:33 <locosage> should now raise NotImplementedError š
11:59:59 <locosage> add and div/mod args are not currently imlplemented so just omit them
12:16:26 <xarick> okay this is a really strange occurence
12:17:25 <xarick> for some reason, the low lvl pf found no path, but the high lvl pf has a path
12:17:51 <xarick> failed on attempt 0 and 1
12:17:58 <xarick> even after restricted path
12:21:17 <xarick> what does trackdir 168 even mean?
12:24:31 <peter1138> Assuming it's TRACKDIR_BIT, not TRACKDIR, 168 = 0b 1010 1000 = TRACKDIR_RVREV_SE | TRACKDIR_RIGHT_S | TRACKDIR_LOWER_E.
12:24:43 <peter1138> So perhaps not, as RVREV_SE is road vehicle only.
12:25:17 <xarick> im testing now with debug build, but loading this save is slow, brb
12:25:20 *** pickpacket3 has joined #openttd
12:25:26 <peter1138> Loading your saves usually is slow, yes.
12:27:12 <xarick> ship is about to get flagged as lost
12:27:44 <xarick> the ship is heading that canal to the southeast, but the destination is at the northwest
12:27:46 *** pickpacket has quit IRC (Ping timeout: 480 seconds)
12:27:46 *** pickpacket3 is now known as pickpacket
12:28:14 <xarick> it has no way to turn around until it follows the entire canal towards southeast
12:28:35 <xarick> why did it go this way in the first place
12:31:40 <xarick> in debug build it tells me the real value
12:34:21 <xarick> ship is in that circle
12:34:47 <xarick> it's heading southeast, can only turn around at that place the arrow points at southeast
12:34:55 <xarick> until then, it's lost?
12:36:33 <kuhnovic> I guess that the ship can't turn around?
12:44:04 <kuhnovic> Can you make an issue for this? Sounds like another fun edge case.
12:44:29 <kuhnovic> Preferably not with a 4K map with 2 million ships if possible š
13:32:21 <xarick> there goes the theory the low lvl pf has a better path
13:33:51 <xarick> high lvl pf doesn't take ship direction into account
13:34:06 <kuhnovic> Indeed. But the LL PF has to.
13:35:12 <kuhnovic> But I wonder why the LL PF doesn't just tell the ship to turn around. But I believe the pre-regions-pathfinder never did that either. Maybe that's something that can be added.
13:35:43 <xarick> ram into the side of a canal?
13:37:26 <xarick> gonna experiment with the "return" fix, maybe it will do just that
13:40:01 <xarick> road vehicles can turn around at the end of a road without signaling they're lost
13:42:04 <xarick> GetRandomFollowUpTrackdir has only 1 track choice, it's in a lock
13:42:11 <xarick> it's only lost while in the lock
13:42:35 <xarick> when it's no longer in a lock, it also coincides with entering a new region... tough luck
13:43:53 <LordAro> kuhnovic: "ever given mode"
13:44:57 <xarick> hmm, i suspect the version is old
13:47:34 <xarick> version doesn't exist... š®
13:48:17 <peter1138> Could be some local branch that you've since rebased.
13:48:52 <peter1138> (Or deleted, of course)_
13:51:03 <LordAro> so i'm reading the wikipedia page on the 2021 Suez blockage
13:51:09 <LordAro> "In England and across Europe, supply chain disruption from the canal incident, coupled with an already increased interest in gardening due to COVID-19 lockdowns, led to a shortage of garden gnomes."
13:52:03 <xarick> so it's an invalid test
13:52:26 <xarick> let's go by savegame version 328
13:52:50 <truebrain> so many questions š
13:58:17 <xarick> it's a savegame between 23 and 26 january
14:01:43 <xarick> 25 jan had the lock issue fixed
14:01:59 <xarick> invalidation missing for locks, so i doubt this savegame was started on 26th jan
14:02:10 <xarick> probably started on 23th
14:02:17 <xarick> it's before the invalidation fix
14:08:28 <xarick> loading a savegame on this version, I have the order pointing to 3, not 4
14:08:39 <xarick> savegame conversion error?
14:08:50 <xarick> when was unbunch added? before or after 23 jan?
14:12:05 <xarick> no unbunch at this version
14:12:14 <xarick> hmm... I'm onto something
14:24:03 <xarick> unbunch added on 3rd february
14:25:12 <xarick> but.. sometimes there are multiple versions installed of the same script
14:28:43 <_glx_> hmm if you select a previous version using ctrl when opening, then reopen without ctrl it "selects" random
14:29:33 <_glx_> I think that works as "expected"
14:30:50 <xarick> there is a weird bug when you have an old version of a script and then download the most recent one from bananas
14:31:12 <xarick> the script config remains with the old version loaded in the slot
14:31:22 <xarick> so it starts the old one
14:31:29 <xarick> after you downloaded a newer
14:31:57 <xarick> you have to restart openttd
14:34:58 <_glx_> oh funny, if you select an older version then close openttd, it will use latest when you restart
14:36:05 <xarick> okay, I am almost 99% sure there was a savegame error when unbunch was added
14:36:18 <xarick> tested the version before unbunch, ship goes to order 3
14:36:27 <xarick> tested version with unbunch, ship goes to order 4
14:36:35 <xarick> order 3 is go to nearest depot
14:39:22 <xarick> the other 1% uncertainty is go to nearest depot was also added before unbunch
14:42:20 <_glx_> savegame conversion looks fine, if you see the same depot action
14:48:44 <_glx_> you mean it goes from order 2 to order 4 ?
14:49:12 <xarick> it was saved on 26th january
14:49:21 <xarick> it was saved as going to order 3
14:49:35 <xarick> service at nearest depot
14:49:49 <xarick> and the depot is already calculated
14:50:36 <xarick> when loading back after unbunch, order 3 seems to be skipped, and ship is now heading to 4
14:52:35 <_glx_> but conversion doesn't touch this at all, so it's something else
14:53:03 <peter1138> No longer needs servicing...
14:53:18 <xarick> I tested at 8a4a99b7 and it still goes to order 3, it's correct
14:53:24 <xarick> so it's the unbunch that causes it
14:56:11 <_glx_> anyway it's not the savegame conversion
14:56:40 <_glx_> as the conversion just moves the flags
14:58:35 <xarick> then... it's something š
14:58:49 <xarick> gonna check what it does
15:00:37 <_glx_> I don't see anything that could change order index in the commit
15:03:00 <xarick> it's a current order isn't it?
15:04:03 <xarick> is current_order listed in Orders? I think not
15:05:18 <_glx_> oh might be something, there's no conversion for current_order
15:05:45 <xarick> peter knows, he worked on that recently
15:07:03 <_glx_> yup I think you spot the issue
15:08:41 <_glx_> tests like ` if (v->current_order.GetDepotActionType() & ODATFB_NEAREST_DEPOT) {` will have a different result
15:08:56 <_glx_> as they are not converted
15:11:31 <_glx_> funny how there was the correct example just above the conversion
15:11:51 <peter1138> Yes, I was just about to say š
15:14:03 <_glx_> I can fix, unless you already doing it
15:15:00 <xarick> I'm testing a fix of my own, but seems to be different
15:19:24 <xarick> now it finally makes sense why the ship was taking this path
15:19:41 <xarick> it was heading to the depot which is indeed towards southeast
15:20:20 *** zero2474 has quit IRC (Quit: User went offline on Discord a while ago)
15:29:55 <xarick> bad choice of depot, though but meh...
15:30:19 <xarick> i was intending on testing water regions
15:30:30 <xarick> so i used nearest depot
15:31:58 <_glx_> in your case it shows "service at nearest", but current_order is actually unbunch&halt
15:32:23 *** alfagamma7 has joined #openttd
15:32:34 <peter1138> We removed them, just like block signals.
15:32:35 *** Wormnest has joined #openttd
15:33:04 <alfagamma7> could have used them as way points
15:33:44 <_glx_> noone prevents you to still use them
15:34:10 <_glx_> they are just not required for ships to find their way
15:34:20 <peter1138> Yes, we removed waypoints too.
15:34:48 <LordAro> we also removed ships
15:34:51 <LordAro> no one was using them
15:37:31 <peter1138> Famous last words... "That won't take long, most of the pieces are still in place"
15:37:41 <peter1138> Still working out what bits to update.
15:48:38 <xarick> you're saying the ship is gonna halt at depot?
15:50:13 <xarick> it proceeded to order 4
16:20:57 <truebrain> (your reply on 12189)
16:36:35 <xarick> those PRs with backport can't be merged atm right?
16:39:37 *** tabytac has quit IRC (Quit: User went offline on Discord a while ago)
16:43:28 <xarick> finally they fixed github desktop, I can see all my branches now
17:13:39 <frosch123> for all the C++20 nerds here
17:15:36 <_glx_> that's the only possibility I can see
17:20:34 <xarick> nice merge, does it mean I can now async buy 1 million vehicles faster?
17:21:10 <peter1138> Not sure, do you list vehicles in a depot a lot?
17:21:36 <xarick> i expected something else
17:22:12 <xarick> remember that GS that buys vehicles in mass
17:22:46 <xarick> oh no rubidium approved!
17:24:07 <xarick> i kinda proved today that low lvl pf does not always bring the best path
17:24:36 <xarick> but it's probably fine
17:26:19 <peter1138> "Whoops, that escalated"
17:27:09 <xarick> still better than leaving ships doing circles
17:29:33 <xarick> just found another "edge case"
17:31:22 <xarick> a combination of ship leaving dock, the region being in the corner, and low lvl pf not finding a path
17:33:44 <kuhnovic> xarick: Does #12176 fix this case?
17:35:23 <LordAro> xarick: well then you know where issues go
17:35:28 <kuhnovic> Eh yeah sorry, 12181 indeed
17:36:00 <xarick> I'm trying to understand how the ship got into this situation
17:36:29 <_glx_> it used the free docking tile
17:36:48 <peter1138> LordAro, keep thinking about buying a turbo trainer... š®
17:37:32 <peter1138> xarick: What is the problem here, then?
17:48:07 <xarick> I'm unsure what's called next after Vehicle::LeaveStation
17:49:04 <xarick> ChooseShipTrack vs CheckShipReverse
17:56:14 <xarick> CheckShipReverse is called first
17:57:43 <xarick> ah I see... the path was immediately restricted
17:57:56 <xarick> there's no 2 attempts here
18:02:09 <xarick> CheckShipReverse returned false... didn't reverse, forcing the ship into a corner
18:02:26 <xarick> it's CheckShipReverse fault this time
18:05:14 <xarick> it return false because path was restricted immediately? hmm I really need to print coordinates into each region
18:14:30 *** HerzogDeXtEr has joined #openttd
18:20:26 <xarick> i'm too noob for strings
18:20:38 <xarick> `std::string text = region_x + "" + region_y;` will this work? I doubt it
18:21:37 <peter1138> std::string text = fmt::format("{}{}", region_x, region_y);
18:27:28 <xarick> hmm no signs, maybe wrong owner
18:28:56 <xarick> nop, it's not pllacing them signs, i fail
18:32:53 <xarick> oh, I see, it places them, then removes them at a later point during initialization š
18:36:11 <DorpsGek> - Update: Translations from eints (by translators)
18:41:31 <andythenorth> I wish nml was nfo
18:41:48 <andythenorth> the ability to recurse varact 2 using the same ID
18:42:29 <andythenorth> I need to manage switch number assignments across 900 vehicles š
18:43:35 <andythenorth> my compile should be able to do it, but there's a gap somewhere and 'next switch' is failing on a missing switch number
18:46:38 <peter1138> NML can do that, surely? You just don't get to control it.
18:48:51 <frosch123> yes, it does that, you can see it in action in the regression tests
18:49:43 <andythenorth> yes I just want a weird BAD FEATURE
18:50:02 <andythenorth> nml enforces unique switch IDs for sensible reasons
18:50:10 <andythenorth> generating them is a pain in the arse š
18:50:31 <andythenorth> in one case which is probably beyond a corner case at this point š
18:54:40 <xarick> lol, not enough signs to place all coordinates
19:03:16 <xarick> dang, dinner, I'll explain later
19:03:26 <xarick> the restricted path is the culprit
19:18:33 <andythenorth> Hmm maybe I should stop trying to save varact2 IDs š
19:18:57 <andythenorth> The cure starts to look worse than the disease š
19:25:40 <xarick> j0anjosep: can you add rename hangar feature?
19:27:41 <kuhnovic> xarick: Please explain, curious!
19:29:49 *** j0anjosep has joined #openttd
19:29:49 <j0anjosep> xarick: For which purpose? I think the name of the airport is the most descriptive and useful name.
19:31:32 <locosage> psst, I have this thing called grf-py... š
19:31:51 <locosage> can nfo recurse switches though? I thought it just refers to the previous use of that ref_id
19:32:12 <locosage> andythenorth: that was supposed to be a reply...
19:32:44 <frosch123> locosage: the wording was off. andy wants to redefine/shadow switch names
19:33:00 <frosch123> instead of having to number them just to make them unique across the whole file
19:33:20 <frosch123> in nfo "shadowing" is the default behavior
19:33:30 <locosage> ah, well, yeah grf-py is perfect in this case, switches have no id š¤£
19:33:52 <andythenorth> frosch123: Yes, that
19:34:27 <frosch123> locosage: who knows, maybe python object ids are 32bit, andy may fill those
19:34:47 <locosage> isn't that just a memory address?
19:44:09 <truebrain> frosch123: who are you kidding, even if they are 64bit, he will fill those!
19:44:59 <frosch123> did peter already extend grfid to 64bit?
19:45:21 <xarick> j0anjosep: the other depots could be renamed, so I thought maybe now hangars could be renamed if they have their own Depot id
19:46:32 <truebrain> presets have been on my mind, and how stupid simple it is to implement .. just the BaNaNaS part is annoyingly difficult š¦
19:47:12 <truebrain> so rewrite BaNaNaS, right?
19:49:02 <frosch123> i thought the biggest problem was upgrading them
19:49:16 <frosch123> or whether they should store version numbers or parameters
19:49:46 <truebrain> upgrading? parameters?
19:49:47 <j0anjosep> xarick: I could add the havility to rename them on those PRs, but I think there is no purpose.
19:50:29 <frosch123> oh sorry, i assumed "presets" means "newgrf presets" š i now realize you are truebrain, and probably mean "settings presets"
19:50:39 <truebrain> which includes newgrfs, yes š
19:50:50 <truebrain> why do something so-so if you can do it full!
19:51:44 <frosch123> the problem with newgrf presets is. do they reference a grf by grfid only (i.e. any version / latest), or do they reference a md5sum (i.e. specific version)
19:52:03 <frosch123> and do newgrf presets only reference the grfs, or also set newgrf parameters
19:52:22 <truebrain> for presets, or "settings presets", that is a tiny bit easier, as the preset should point to the exact NewGRF; and as they are just ini files, parameters are also easier, as they are part of the ini file š
19:52:31 <truebrain> see, so many problems disapear if you just use the superset š
19:52:41 <frosch123> because we have no migration mechanism parameters between different newgrf releases
19:53:20 <xarick> these tiles should ~match
19:54:14 <frosch123> for basegraphics i store the baseset version in openttd.cfg, so i can reset the parameters, if the version changes
19:54:18 <xarick> they don't match because dest_tile is a dock, what it should actually look for is one of the docking tiles
19:54:30 <frosch123> because we implicitly always load the newest baseset
19:55:01 <xarick> "tile" is a docking tile of the dock located at "v->dest_tile"
19:55:15 <frosch123> either way, i assume the ottd client was not yet rewritten to query the content list via https?
19:55:33 <truebrain> which is why BaNaNaS is such a pita
19:55:38 <frosch123> does the legacy protocol allow new content types?
19:55:40 <truebrain> as it means presets need a 4 byte unique ID
19:56:13 <truebrain> but you get this whole "upgrade" blabla again, for what makes a newer preset
19:56:20 <truebrain> and I don't want another heightmap/scenario incident š
19:56:24 <frosch123> so what, we also assign unique ids to scenarios and heightmaps via a sidecar file
19:56:34 <truebrain> I answered before you mentioned! Whoho! š
19:57:41 <frosch123> well, i guess you can store the uniqueid inside the preset
19:57:54 <truebrain> yeah ... but that is just the annoying shitty part .. and so boring š
19:58:01 <frosch123> and normalize the preset by sorting keys/whitespace before computing md5sum
19:58:22 <truebrain> I already sneaked most of the other stuff in there during some changes
19:58:34 <truebrain> so it really is just loading another ini file on top of the current settings š
19:59:00 <truebrain> (they even have a compatibility-version š )
20:00:16 <frosch123> sounds like loading presets is easier than saving them. maybe it's fine if regular users can't do that, and only "experts" can upload content to bananas :p
20:00:49 <frosch123> actually, presets on bananas gives me horrors
20:00:54 <truebrain> it is basically uploading your openttd.cfg š
20:01:24 <frosch123> the entry barrier for scenarios is already too low, so there is a lot of trash
20:01:33 <truebrain> make them do a test? š
20:01:58 <frosch123> do presets only include game settings, or also company or client settings?
20:02:04 <truebrain> guess a question I do have, can you stack presets? š
20:02:18 <truebrain> I would do the first, personally; but that is something to fine tune
20:02:39 <frosch123> stacking only makes sense, if they do not set everything. and that kind of forbids "upload your openttd.cfg"
20:02:45 <andythenorth> frosch123: I'm wondering if this plan is unwise. Walking 993 switches in the graphics chain, comparing vehicle ID with a register value. Might not be good.
20:03:00 <truebrain> I guess .. also makes it a bit easier in managing, to only allow a single preset
20:03:11 <truebrain> maybe I should like the survey results to a "what is popular" to BaNaNaS first š
20:03:52 <frosch123> "play like in 2023-12"
20:05:21 <frosch123> hmm, stacking also asks for presets like "all vehicle grfs active", "all townname grfs active", ...
20:05:51 <frosch123> oh, and ofc the "download everything from bananas" preset
20:06:02 <frosch123> maybe exclude basesets from presets :p
20:06:18 <truebrain> and I will add code to avoid the "download NNN" presets š
20:06:54 <frosch123> make it change the preset into "force toyland"
20:09:00 <xarick> lol, the more I look into this, the more I find this situation extremely rare
20:10:26 <xarick> the ship is at the top corner tile of the region, on trackdir left south
20:10:51 <xarick> it is restricted to find a path at the region at the northeast
20:11:17 <xarick> it it reverts, the region it gets into is at northwest
20:11:29 <xarick> if it doesn't revert, it gets cornered
20:11:36 <peter1138> Did #12188 fix your savegame issue?
20:12:15 <xarick> in other words, the ship is in an impossible situation
20:13:49 <xarick> I suspect lifting the restrictedpath would solve it, let me try
20:27:46 <_glx_> andythenorth: procedures would be an issue, var 7E still wants a byte
20:29:13 <andythenorth> I wonder if there's a better way š
20:30:12 <_jgr_> Giving var 7E a bigger parameter size wouldn't be any more difficult than making the action IDs bigger in the other places
20:30:32 <andythenorth> the primary concurrent consumer of varact2 IDs is randomised vehicles
20:30:49 <_glx_> as long as it's a new GRF version yes
20:31:12 <andythenorth> the implementation of these is that the action 3 from the 'random' vehicle chains to randomly selected varact 2 chain from one of the randomisation 'candidates'
20:31:19 <andythenorth> this consumes IDs rapidly
20:31:19 <_glx_> it's the kind of changes undoable without a new version
20:32:02 <andythenorth> I _could_ copy all of the graphics chains for all the randomisation candidates to the 'randomised' vehicle
20:32:28 <_glx_> but 15bits IDs should be enough
20:32:29 <andythenorth> this would increase switch count and parse time and grf size
20:32:30 <_jgr_> andythenorth: Isn't that just making the bloat problem even worse?
20:32:45 <andythenorth> it would add bloat, but reduce ID exhaustion
20:32:54 <_glx_> keeping the current ID reusage
20:33:43 <_glx_> 255 concurrent is short, 15bits concurrent should be harder to reach
20:34:07 <_jgr_> Any particular reason for 15 instead of 16 bits
20:35:44 <_glx_> it decides if it's a result or a jump to another action2
20:40:38 <xarick> can I make a trust me bro PR?
20:41:11 <andythenorth> peter1138: such PR š
20:44:47 <peter1138> Well, just a commit right now.
20:46:46 <_glx_> v9 could redesign station spec š
20:47:57 <peter1138> I used action 2 layouts for newgrf docks, so...
20:48:14 <_glx_> roadstops also use the new way
20:48:56 <peter1138> It's not that complex to support the new way but you went and put effort into supporting the old way in NML...
20:49:47 <peter1138> Hmm, this level is weird, a solid black wall obscuring things š
20:50:03 <xarick> kuhnovic: I think the restrictcorridor needs a different approach
20:50:52 <andythenorth> peter1138: all code dies though š
20:51:09 <_glx_> well I implemented the old way in NML, but authors seem to have issues with the limitations and the workarounds
20:51:12 <xarick> I was thinking, for the starting region, to also add all the (up to) 8 surrounding regions
20:51:33 <_glx_> especially when they are used to objects/industries
20:52:27 <_glx_> stations look similar but they work differently
20:53:00 <kuhnovic> You need to come up with a slightly better explanation why xarick š
20:53:28 <_glx_> details are important š
20:53:40 <xarick> this edge case is due to the restricted corridor pointing to a region the ship can't get to
20:54:05 <xarick> if more regions were added around it, then it would reverse correctly
20:54:14 <peter1138> I think act2 tile layouts can be supported for rail stations without any version bumps though.
20:54:38 <xarick> the ship is really at the edge of the region, a literal "edge" case
20:55:07 <peter1138> Oh that was right, coding wise it's not that much, but spec wise there isn't a "this is a tile layout action 2" thing.
20:55:27 <kuhnovic> That's only an issue for the checkReverse right? Because we always restrict that one
20:55:40 <_glx_> yeah stations use spritegroups, not layours
20:55:43 <xarick> i just tested without restricting, and it reversed fine
20:55:53 <xarick> even though that wasn't the path suggested by the hpf
20:56:11 <kuhnovic> Although theoretically it could also happen with the non-reverse variant when it restricts
20:56:24 <peter1138> act2 tile layouts are sprite groups š
20:57:05 <peter1138> I probably should've changed the naming of all that when rewriting it years ago.
20:58:45 <kuhnovic> xarick: I think a better solution would be to always add the ability for a ship to turn around. Why should that be a stuck-only or at-station-only thing?
20:59:10 <xarick> when ship leaves station, a CheckReverse is issued
20:59:26 <_glx_> don't focus on edge cases, think about the general case
21:00:08 <xarick> maybe i'll upload this savegame, it's another 4k4k
21:00:09 <_glx_> if it solves edge case without needing to be specific to edge case it's simpler
21:00:40 <_glx_> you skip all the "detection" stuff
21:00:42 <kuhnovic> Can you please reproduce it in a slightly smaller map š
21:01:24 <xarick> gonna try make a reproducible map, I need to get the ship going exactly the direction I want
21:01:33 <_glx_> else you'll end up with another unhandled edge case
21:02:02 <kuhnovic> I'm currently playing around with adding the ability for ships to always turn around. What would also remove the need for separate ChooseShipTrack and CheckShipReverse logic.
21:02:24 <_glx_> would solve many problems
21:02:46 <andythenorth> edge cases, within normal parameters, are just edge cases
21:02:50 <andythenorth> things don't really go wrong
21:02:59 <andythenorth> they just deviate from expected behaviour
21:03:13 <andythenorth> catastrophic failure tends to arise when edge cases combine to corner cases
21:04:34 <andythenorth> corner cases often aren't forseeable, they arise empirically š
21:05:41 <_glx_> kuhnovic: some kind of every exit path from a tile is possible but turning more than 90Ā° gets huge penalty
21:06:49 <kuhnovic> Not the ChooseShipTrack function used by regular calls to the yapf_ship pathfinder. It doesn't consider the reversal option at all. Only the CheckShipReverse considers it.
21:07:54 <kuhnovic> xarick: The problem with this fix is that if you are in a situation where you need to restrict, then you could end up with the same problem
21:08:37 <kuhnovic> I think that would qualify as a corner case, two edge cases meet š
21:09:02 <andythenorth> so...randomised vehicle builder in game?
21:09:10 <andythenorth> or is that just baking in a BAD FEATURE?
21:10:15 <andythenorth> is there any vestigal bit of the grf spec that lets me reroute a varact 2 to an action 3 of another vehicle? š
21:11:39 <locosage> there is probably a bunch of stuff that would be nice to have in grf9
21:13:00 <_glx_> oh better string stuff in v9 š
21:13:31 <_glx_> instead of packing params in the registers
21:13:58 <locosage> reusing an extending stuff from other grfs
21:14:02 <locosage> better compression...
21:14:48 <locosage> reusing sprites with other offset
21:14:48 <_jgr_> A better varaction2 format so that NML doesn't have to output godawful code for ternaries? š
21:14:55 <locosage> conditional alternative sprites...
21:15:03 <_glx_> ternaries were a mistacke
21:15:28 <_glx_> they are abused when a switch is better
21:15:31 <locosage> oh, yeah, va2 code can use a bunch of improvement
21:16:14 <locosage> just do a normal stack ffs š
21:16:52 <_jgr_> Even a simple forward jump instruction is enough to make the problem go away
21:17:10 <_jgr_> That basically what I've done internally for optimising ternaries
21:18:22 <locosage> oh, unify actiond and va2 code
21:19:03 <locosage> remove weird shit like action6 xDD
21:19:23 <locosage> though I guess it's basically WASM at that point š¤
21:20:12 <xarick> ok, got a savegame, made it reproducible
21:20:12 <_jgr_> Action 6 isn't really a problem TBH
21:20:36 <_glx_> action 6 is just to get "dynamic" action 0 values
21:21:36 <locosage> action6 is a pita for code generation
21:21:49 <_glx_> ah yes from generation POV it's a pain
21:22:14 <peter1138> Redesign things so that it isn't necessary.
21:22:59 <peter1138> Reminds me, I need to look at act3/2/1 bridges again.
21:23:08 <peter1138> IIRC that's a bit user of 'GRM'
21:23:31 <_glx_> GRM is worse than act6 š
21:24:02 <_glx_> original CHIPS code is full of GRM
21:24:16 <peter1138> And that's stations. Hmm.
21:25:02 <_glx_> but it also uses old layout stuff
21:25:11 <_glx_> so it was quite limited
21:25:12 <peter1138> Hmm, I need to make a lot of orders, then do a lot of cloning...
21:25:30 <_glx_> with advanced layouts GRM is less needed
21:26:15 <_glx_> as you are not limited to only one action1
21:26:23 *** tokai|noir has quit IRC (Remote host closed the connection)
21:26:47 <_glx_> (the one chosen by action2)
21:28:16 *** ChanServ sets mode: +v tokai
21:32:05 <kuhnovic> xarick: I can't reproduce it. I'm using the latest master
21:32:40 <xarick> uh... let me check on master
21:32:44 <kuhnovic> Hold on, it's subtle, but yes it is there! My bad
21:32:52 <kuhnovic> The ship gets lost for a split second
21:32:55 <peter1138> Hmm, cloning a vehicle 10,000 times takes a while.
21:33:26 <peter1138> And it didn't even do it š¦
21:33:48 <xarick> im using a pseudo-12181
21:34:03 <xarick> maybe master does something different
21:35:14 <peter1138> Oh and it failed because I forgot to turn on infinite money š
21:35:16 <kuhnovic> Is your ship getting stuck or lost?
21:35:33 <kuhnovic> On master it's just lost for a brief moment, but doesn't get stuck.
21:35:39 <peter1138> And I forgot to increase the vehicle limit.
21:35:44 <xarick> it doesn't get exactly stuck, it just didn't reverse when leaving dock
21:35:59 <xarick> it goes into a corner and reverses there instead
21:38:11 <xarick> tested master, it's reproducible there too
21:39:34 <truebrain> little green cars go broem!
21:39:52 <xarick> now back to the other issue i found
21:40:20 <xarick> `/* Handle special case - when next tile is destination tile. */
21:40:20 <xarick> if (tile == v->dest_tile) {`
21:41:17 *** Wormnest has quit IRC (Quit: Leaving)
21:43:53 <peter1138> Maybe FindVehicleWithOrder can use some heuristic comparing number of vehicles with number of orders and guess which method will be faster...
21:44:39 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
21:44:41 <truebrain> `if username == ...`?
21:51:55 <kuhnovic> xarick: I agree, that part is such an eyesore
21:53:25 <kuhnovic> There probably is a good reason to handle that case specifically, but it would be a lot nicer if it can be dealt with in a different way
21:59:02 <xarick> the ship would now enter the docking tile facing the side of the pier
22:01:37 <kuhnovic> That doesn't look a lot better at first glance haha
22:03:21 <kuhnovic> This might fix this particular case, but you have to think about the concept of your change instead. What is it doing, and how is it preventing problems? Otherwise you'll find yourself playing whack-a-mole, fixing one edge case while creating another...
22:04:34 <xarick> I see, the docking area is 2x3
22:04:42 <xarick> but 2 of those tiles aren't even docking tiles
22:06:34 <kuhnovic> So I'm thinking: what's so special about that tile == v->dest_tile case? What makes it different than all the regular cases? That's what you need to find out first
22:07:02 <xarick> v->dest_tile is the slope
22:07:05 <kuhnovic> And you might come to the conclusing that there is no difference, or maybe it was done for a good reason. It's anyone's guess really.
22:08:10 <kuhnovic> Ok it's the slope. But what if you were to remove that special casing code and just let the PF treat it like any other PF run?
22:08:55 <xarick> docking tiles are also a relatively recent change
22:09:06 <xarick> doesn't look like it was handled properly here
22:10:42 <kuhnovic> It might not be an issue. You can set a destination tile that's not a valid water tile, and let the PF use it to calculate the heuristic. The detect-destination-function stops the PF run when a valid docking tile is detected. I did a similar thing with the region centers remember?
22:11:22 <kuhnovic> It does make the concept of a destination tile somewhat confusing, but oh well
22:12:29 *** keikoz has quit IRC (Ping timeout: 480 seconds)
22:12:39 <xarick> hmm this needs to check the closest docking tile to be 100% correct, not the closest area...
22:24:26 <andythenorth> will we do grf v9 before I run out of IDs again? š
22:24:32 <andythenorth> ` nmlc info: Concurrent spritegroups: 220/256 ("generated/iron-horse.nml", line 630063)
22:24:44 <andythenorth> got headroom š
22:29:38 <peter1138> In the ship controller, the ship stops at the first docking tile.
22:30:26 <_zephyris> Woo. Full combining diacritics. Needs a few bugfixes, but mostly suitable for testing.
22:43:30 <_zephyris> Yup pushed. I'll try to nail the last few little bugs tonight
22:43:40 <peter1138> The Hebrew "alphabet" is quite small... š
22:45:51 <_zephyris> Yeah, that's an achievable one.
22:46:53 <_zephyris> There's a stylistic question there (also with Korean), they always seem to be written with even vertical and horizontal stroke width... I wonder if I can break that convention!
22:46:54 <peter1138> I think Cyrillic is nailed now.
22:47:22 <_zephyris> Yeah, I think so too
22:47:51 <_zephyris> Should be all European alphabet languages
22:49:23 <_zephyris> Bah, combining diacritics turn everything into a combinatorial problem!
22:53:19 <xarick> is this prettier, or uglier?
22:54:34 <xarick> just pretend I wrote const bool check_dest
22:55:30 <_zephyris> I guess wait for as many translations to come in as possible before PRing a new font
22:55:46 <_zephyris> At least the leg work on combining diacritics is done
22:57:08 <xarick> it's the most horizontal line in this file, š¦ it's bad then
23:02:20 *** Leopold has quit IRC (Remote host closed the connection)
23:04:12 *** Leopold__ has joined #openttd
23:11:45 *** tony_pixel has joined #openttd
23:11:45 <tony_pixel> Why not check if `tile == dest_tile` first?
23:11:59 <tony_pixel> You don't need a ternary afterwards
23:12:29 <xarick> I have modified it since
23:15:00 <xarick> shall I PR, mister Kuhnovic, expert pf'er
23:17:19 <peter1138> I'm not convinced that special case needs to exist at all.
23:19:49 <peter1138> Given it's been 'broken' since multi-tile docks were introduced, which was a long time ago.
23:22:03 <xarick> it was making ships dock in the wrong track
23:22:22 <xarick> nothing too serious, it still worked
23:24:04 <xarick> it was in the video example, sending the ship towards the tile with the slope
23:24:18 <peter1138> The special case makes ship dock in the wrong track -- sounds like you should rephrase that.
23:24:24 <xarick> the tile with the station sign, so it entered the tile in a weird direction
23:35:37 <peter1138> Yeah that special case doesn't make sense anyway, now that ships can stop on any side of the dock.
23:44:49 *** tokai|noir has joined #openttd
23:44:50 *** ChanServ sets mode: +v tokai|noir
23:45:01 <reldred> I know that change is largely positive for 99% of players but I might have to make a JGRPP option to turn that off š
23:47:41 *** nielsm has quit IRC (Ping timeout: 480 seconds)
23:48:12 <_jgr_> Not sure what there is to turn off TBH?
23:48:37 <reldred> I find the boats using the other sides to be aesthetically displeasing
23:48:48 <reldred> or I need to design my dock complexes better
23:49:10 <reldred> Yeah there's nothing actually wrong with it
23:49:55 *** HerzogDeXtEr has quit IRC (Read error: Connection reset by peer)
23:51:05 <peter1138> So the issue is ships dock the moment they enter the docking tile, whatever direction that is.
23:51:31 *** tokai has quit IRC (Ping timeout: 480 seconds)
23:51:55 <peter1138> Part of that is obscured by ships being quite long.
23:51:58 <reldred> It'd be nice if they shimmied up and lined up against the dock but that's another order of complexity
23:52:26 <_glx_> yeah don't add a state machine to reorient the ship š
23:53:09 <reldred> Bit beyond my capabilities, you don't need to worry about that.
23:53:39 <_glx_> because depending on docking tile the orientation would be different
23:54:26 <reldred> I've already had lots of fun picking apart the other state machines.
23:54:47 <peter1138> Which is the best place to stop in this configuration?
23:55:12 <_glx_> one 90Ā° left, the other one 90Ā° right
23:55:26 <reldred> Oh yeah, it's all wishful thinking
23:55:57 <reldred> And again, I agree it's perfectly fine for 99% of players/use cases.
23:56:07 <peter1138> The only track bits are the ones these ships are already on.
23:56:36 <peter1138> So the ships cannot go alongside or perpendicular to the dock.
23:56:48 <belajalilija> reldred: Iād love this, could do proper venice style water busses
23:56:54 <_glx_> yeah some water tiles are limited
23:56:55 <peter1138> They can't stop on the tile directly south because that's not a docking tile.
23:57:24 <peter1138> And that's not really adjacent either.
23:57:38 <peter1138> (It would kinda work for very long ships though)
23:58:14 <_glx_> and imagine when custom docks become a thing
23:58:32 <peter1138> Custom docks don't change what water track bits are available.
23:59:02 <_glx_> they could say where the docking tile is
continue to next day āµ