Times are UTC Toggle Colours
01:39:06 *** Eddi|zuHause has quit IRC 02:01:25 *** Eddi|zuHause has joined #openttd 02:25:40 *** D-HUND has joined #openttd 02:27:22 *** Wormnest has quit IRC 02:29:03 *** debdog has quit IRC 02:29:49 *** HerzogDeXtEr has quit IRC 02:51:29 *** Compu has joined #openttd 03:13:35 *** glx has quit IRC 03:19:44 *** D-HUND is now known as debdog 03:49:06 *** Smedles has quit IRC 03:49:38 *** Smedles has joined #openttd 04:25:10 *** Extrems` has joined #openttd 04:26:01 *** Extrems has quit IRC 04:26:01 *** Extrems` is now known as Extrems 06:14:06 *** WormnestAndroid has quit IRC 06:19:45 *** debdog has quit IRC 06:30:15 *** Flygon has joined #openttd 06:45:12 *** Westie has quit IRC 06:45:51 *** Westie has joined #openttd 07:03:32 *** nielsm has joined #openttd 07:34:13 *** Wolf01 has joined #openttd 07:50:45 *** sla_ro|master has joined #openttd 08:39:49 *** Samu has joined #openttd 08:57:02 *** wallabra has quit IRC 08:58:56 *** wallabra has joined #openttd 09:51:10 <Samu> i turned #9915 as a draft, my proposed fix isn't good enough, it doesn't fit all purposes, sorry 10:39:44 *** WormnestAndroid has joined #openttd 10:46:00 <TrueBrain> if a townname GRF fails to load, you don't get the usual popup that a NewGRF failed to load :P 10:46:06 <TrueBrain> it is only visible in the console that it failed 10:46:13 <TrueBrain> not even in the NewGRF window it shows it failed to load .. 10:46:15 <TrueBrain> our UI could use some love :D 10:46:25 <TrueBrain> (old news, I know :P) 10:50:07 *** gelignite has joined #openttd 10:51:48 *** HerzogDeXtEr has joined #openttd 11:04:32 *** WormnestAndroid has quit IRC 11:33:15 *** WormnestAndroid has joined #openttd 12:26:25 *** glx has joined #openttd 12:26:25 *** ChanServ sets mode: +v glx 12:38:15 *** frosch123 has joined #openttd 12:39:01 <frosch123> yay, TRU1 arrived on bananas :) 12:43:00 <glx> oh no 13:02:42 <Samu> hi glx, i am tackling 9914 in a different manner 13:03:18 <Samu> i will use a variable that tracks whether the pathfinder was run 13:04:16 <Samu> !v->path.empty() isn't sufficient 13:07:06 <Samu> unconditionally doing it is also the wrong approach, :| 13:08:51 <DorpsGek> [OpenTTD/OpenTTD] SamuXarick updated pull request #9915: Fix #9914, 86818e5: prevent useless pathfinder run for blocked vehicles https://github.com/OpenTTD/OpenTTD/pull/9915 13:16:03 <DorpsGek> [OpenTTD/OpenTTD] SamuXarick updated pull request #9915: Fix #9914, 86818e5: prevent useless pathfinder run for blocked vehicles https://github.com/OpenTTD/OpenTTD/pull/9915 13:16:11 <Samu> a cleaner diff 13:28:59 <frosch123> i wonder, should truegrf auto-generate the grfid from the github userid? 13:29:35 <frosch123> compute some 16bit hash from the userid and use as first 2 bytes, pick a random number for bytes 3 and 4? 13:29:43 *** sla_ro|master has quit IRC 13:30:31 <frosch123> grfid = (userid % 0xFFFF) | (random & 0xFFFF) << 16 13:31:01 <frosch123> would avoid reservedgrfids FFFFxxxx 13:31:32 <peter1138> Finally found a use for my Leap Motion controller... MIDI expression. But it turns out that waving your arm in the air gets heavy. 13:34:06 *** Wormnest has joined #openttd 13:45:45 *** debdog has joined #openttd 13:58:53 *** D-HUND has joined #openttd 14:02:18 *** debdog has quit IRC 14:08:04 *** D-HUND is now known as debdog 14:34:57 <Samu> why is TileIndex values so much harder to see in visual studio? 14:36:33 <Samu> - StrongIntegralTypedef<unsigned int,TileIndex> {...} StrongIntegralTypedef<unsigned int,TileIndex> 14:36:41 <Samu> what is this 14:42:02 <glx> it's for the new command stuff, that way TileIndex is really TileIndex and can't be any int 14:54:12 <frosch123> https://github.com/TrueGRF/TrueGRF/issues/71 <- transferred idea from above to GH 14:58:52 <Samu> hmm, yapf path caching doesn't add reverse trackdirs to the cache, but it still queues the tracks that come after reverse 14:59:06 <Samu> and openttd doesn't handle it properly 14:59:19 <Samu> it clears the cache 14:59:25 <Samu> and it shouldn't 15:00:04 <Samu> openttd expected a reverse trackdir in the path cache 15:01:01 <Samu> instead, it invalidates the rest of the path queue, clears it, forcing it to do an expensive pathfinding call 15:01:10 <Samu> next time it gets to it 16:09:45 <TrueBrain> Lol ... frosch123, that was a lot quicker than I expected 16:09:51 <TrueBrain> Wanted to blacklist is :D 16:10:04 <TrueBrain> Owh well .... 16:10:07 <TrueBrain> Your idea sounds good :) 16:10:10 <Samu> hey peter1138, shouldn't this line be "if (!v->path.empty() && v->path.tile.front() == tile) v->path.clear();" over here -> https://github.com/OpenTTD/OpenTTD/commit/6c6971fb43514c4e4923c2ec3b1fdd9fe852617d#diff-c7b20601878b09b3bc5dd2b78cd8620999aa7e969c1468011b4d1f2fcc4f04afR927-R928 16:11:21 <Samu> in the same manner you made it for line 959 16:11:41 <frosch123> now it is blacklisted :) 16:11:56 <frosch123> i wonder who will get TRU2 to 9 :p 16:15:22 <Samu> I've been hunting for false calls to v->path.clear() when the cache is legitimaly valid, and they all seem to point to that being the problem, because it doesn't check tile.front == tile 16:16:09 <glx> still the main issue is the AI making impossible orders 16:17:23 <glx> increased pathfinding is just a side effect 16:19:37 <glx> cache can't be valid if it doesn't lead to the expected destination 16:20:05 <Samu> that's where it does a reverse, reverse trackdirs aren't added to the cache, but the rest of the cache is valid 16:20:24 <Samu> so, it shouldn't clear the cache 16:21:43 <Samu> im bad at explaining this, perhaps 16:21:51 <glx> if you have to reverse while following the cached path then it's invalid 16:22:20 <glx> because cached path should lead you to the destination 16:24:17 <glx> might be removed road tile or whatever but the path no longer exists 16:24:37 <Samu> I see I fail at explaining :( the pathfinder did take reverse into account, it just doesn't add the reverse trackdir code into the path cache 16:24:42 <Samu> something like this 16:25:12 <glx> it reverses and restart pathfinding from there on next run 16:25:19 <Samu> queue looks like this: east - east - east - west - west - west 16:25:28 <Samu> the reverse isn't there 16:25:47 <Samu> it would be east - east - east - reverse - west - west - west 16:25:52 <glx> it doesn't have to, the vehicle shoul have turn around 16:26:48 <glx> the reversing here is really the result of cache following 16:27:17 <glx> no valid path will have reversing in it 16:28:40 <Samu> the reverse is handled outside the cache. what it should do, once it gets to a dead end, is giving it the reverse trackdir, put it in-between the cache, without clearing it 16:28:45 <nielsm> hmm... the game isn't aware at all that it's starting a new game from a scenario, apparently... I wonder if it'd make sense to set a flag for that 16:29:11 <glx> that's not the idea of caching 16:29:29 <glx> if you reversed you have to restart from scratch 16:29:30 <Samu> so it reads the values east - east - east, then fabricates the reverse trackdir, and then continue with the cache, west - west - west 16:30:08 <LordAro> caching is only used for complete paths 16:30:09 <nielsm> the point of the path cache is to store the found path, not some paths that were decided to not be taken 16:30:16 <LordAro> if a path involves a reverse, that's not a complete path 16:30:29 <glx> usually lost vehicles will try to find a valid path on each crossing 16:30:46 <glx> the main issue here is the AI generating lost vehicles 16:30:53 <glx> not the pathfinding 16:31:24 <LordAro> Samu: what issue are you trying to solve? 16:31:45 <LordAro> glx: lost vehicles, AI-generated or otherwise, shouldn't tank the game's performance 16:32:00 <LordAro> most of the traffic AIs intentionally generate lost vehicles, iirc? 16:32:28 <glx> in this case it's an unreachable depot in vehicle order 16:33:15 <LordAro> so we need a way of flagging an order destination as unreachable, so the pathfinder doesn't keep trying? 16:33:16 <glx> so pathfinder has to check every tiles before giving up 16:33:26 <LordAro> (which then gets cleared "at some point") 16:35:19 *** Smedles has quit IRC 16:35:28 *** Smedles has joined #openttd 16:36:51 <frosch123> i think there is already VF_PATHFINDER_LOST 16:36:58 <frosch123> i think it's used for the news message 16:37:01 <glx> I think in this exact case it's a combination of lost and blocked 16:39:01 <Samu> i believe i solved the issues on #9914 with #9915, and now I was onto hunting false path cache clearings 16:40:07 <Samu> I put breakpoints in all "v->path.clear()" to hunt them, and examine their cache 16:42:43 <Samu> most of the time the cache is cleared correctly, because some other AI has built a new crossroad in the meanwhile, so it's fine to invalidate the cache 16:43:39 <Samu> but this one I'm talking about, the reversing, is where I find the oddity of clearing it, when no one has changed the roads 16:44:14 <glx> why is it reversing then ? 16:46:20 <glx> a valid path is the direct path to the destination, if you need to reverse it's not direct, thus invalid 16:46:58 <Samu> but that's how yapf do 16:47:43 <Samu> it takes reversing into account, but does not put reverse trackdirs into the cache 16:48:14 <Samu> it has to be handled externaly 16:49:17 <LordAro> yapf should not be taking reversing into account 16:49:22 <glx> a path with reversing can't be the best path 16:49:37 <LordAro> oh, trams maybe? 16:50:06 <LordAro> and actually, drive through road stops too 16:53:17 <frosch123> https://bananas.openttd.org/package/newgrf/4b415253 <- TrueBrain: i like the version "2022.06.01(v2)" :p 16:53:37 *** tokai|noir has joined #openttd 16:53:37 *** ChanServ sets mode: +v tokai|noir 16:53:42 <LordAro> :D 16:54:17 <glx> but reversing should be quite rare, won't happen on each pf run 16:54:22 <TrueBrain> For when you have more than one release a day ;) 16:54:35 <LordAro> glx: not necessarily, if you have a drive-through on a dead end 17:00:03 *** tokai has quit IRC 17:01:48 <glx> then https://github.com/OpenTTD/OpenTTD/blob/master/src/roadveh_cmd.cpp#L929 needs to be improved to check next node is (tile, reversed_trackdir) 17:05:13 <DorpsGek> [OpenTTD/OpenTTD] SamuXarick updated pull request #9915: Fix #9914, 86818e5: prevent useless pathfinder run for blocked vehicles https://github.com/OpenTTD/OpenTTD/pull/9915 17:37:57 *** Etua has joined #openttd 18:05:12 *** WormnestAndroid has quit IRC 18:05:29 *** WormnestAndroid has joined #openttd 18:06:47 *** WormnestAndroid has quit IRC 18:07:52 *** sla_ro|master has joined #openttd 18:10:24 <TrueBrain> hmm .. so I guess the easiest thing to do for GRFIDs is to have a small server-side components that tracks what GRFIDs are assigned or something .. 18:11:07 <frosch123> you already scan for existing projects when starting a new project 18:11:20 <TrueBrain> yeah, but I don't look in the actual projects 18:11:28 <TrueBrain> I just list the repositories and check for a certain topic 18:11:46 <frosch123> oh, i assumed you checked for truegrf.yaml 18:11:50 <TrueBrain> nah 18:12:18 <TrueBrain> it uses this "truegrf" topic 18:12:26 <TrueBrain> which also serves as an excellent way to find other projects :) 18:12:43 <TrueBrain> funny, some people did use 0000002 18:12:52 <TrueBrain> but nobody used anything after 54540401 18:13:06 <TrueBrain> ah, no, GitHub is just being annoying 18:13:15 <TrueBrain> 161 missing entries from listing, and no way to get them, nice 18:14:19 <TrueBrain> I like your idea of having a fixed character for "TrueGRF Industry GRF" 18:14:28 <TrueBrain> can do the same for the others .. each their unique thingy 18:14:36 <TrueBrain> d0 -> industry, d1 -> townnames, etc 18:14:54 <TrueBrain> that leaves 24 bits for everything else .. hmm 18:15:01 <frosch123> i was wondering about the FFxxxxxx for basesets 18:15:07 <frosch123> maybe F1xxxxxx could be for industries 18:15:17 <TrueBrain> already some F1 exist 18:15:19 <frosch123> there is no reason to check for other types 18:15:45 <TrueBrain> no, but I don't care about the types :P I just want a space I can safely use :D 18:15:52 <frosch123> all F1 are firs :p 18:15:55 <TrueBrain> s/types/checks/ 18:16:08 <TrueBrain> okay, so f1 for industries, f2 for townnames, etc 18:16:16 <TrueBrain> and I have to blacklist xx25xxxx 18:16:17 <_dp_> just check bananas for free grfid :p 18:16:18 <TrueBrain> :D 18:16:26 <frosch123> ah, so you do not want to use ids per owner, but a space for truegrf 18:16:45 <_dp_> actually, that would be a nice service to have regardless of truegrf 18:16:52 <TrueBrain> f2xxxxxx is not used atm by anyone, so an excellent candidate to claim for all townname grfs :) 18:17:25 <TrueBrain> I can make something simple that gives an unique number in that space back 18:17:30 <TrueBrain> so the first repository is f2000001 18:17:35 <TrueBrain> who-ever the author is 18:17:41 <TrueBrain> but I can also assign an id to an author 18:17:53 <TrueBrain> and use, say, the last 2 for the nth GRF of theirs it is 18:18:02 <TrueBrain> so f2XXXXYY, where XXXX is an unique number for the author 18:18:07 <TrueBrain> and YY is what GRF it is 18:18:17 <TrueBrain> just means if someone makes more than 256 townname GRFs, things don't work out 18:18:26 <TrueBrain> (and I can only have 65536 unique authors :P) 18:18:55 <frosch123> imagine having 64k grfs on bananas :p 18:19:14 <TrueBrain> please don't :) 18:20:16 <TrueBrain> the reason I am thinking in this way, is that a) we will not have hash collision (and the space is small enough that based on names can cause hash collisions), b) using f2xxxxxx means I don't have to check any external service for collisions, c) it is big enough that I do not expect any real issues any time soon 18:20:49 *** WormnestAndroid has joined #openttd 18:20:53 <TrueBrain> mainly my worry is that we might collide with some popular GRF that is not on BaNaNaS 18:23:00 <frosch123> F1, FB, FE, FF seem to be the only things in the Fx range 18:23:19 <TrueBrain> yeah, that is why I like that prefix .. it seems "safe" 18:23:35 <TrueBrain> Dxxxxxxx is completely empty it seems 18:23:42 <TrueBrain> but .. f1, f2, etc looks a bit nicer 18:23:53 <frosch123> just don't use 97, that's the drama range or something 18:24:08 <TrueBrain> drama everywhere you look, aint it? :D 18:24:14 <TrueBrain> btw, they had a vote, seems stations is next on the list :P 18:24:42 <frosch123> haha, did we merge stations for nml yet, or still PR without review? 18:24:52 <TrueBrain> I am guessing the latter 18:25:00 <frosch123> still, stations are probably easier than trains 18:25:21 <TrueBrain> okay, alternatively, what I can do, is use the GitHub Username and Repository name, make a hash like you suggest, and check on BaNaNaS for a collision .. easy enough to build that 18:25:23 <frosch123> more objective opinions :p 18:25:26 <TrueBrain> just what to do when there is a collision .. 18:25:57 <frosch123> i like prefixing with the grftype, esp because of the existing FF 18:26:04 <frosch123> though there is only a usecase for industries 18:26:27 <frosch123> author-prefix is not really important 18:26:40 <TrueBrain> so I can just use a single range for everyone you think? 18:26:59 <TrueBrain> there won't be a "I want to block this user's grfs from my grf" situation? 18:28:07 <frosch123> i am not aware of any precedent for that 18:28:14 <TrueBrain> how ever you slice it, it wouldn't really matter that much 18:28:21 <frosch123> but maybe people want a "block truegrf spam from my online content list" option :p 18:28:33 <TrueBrain> nobody is going to make 256 GRFs of a single type, and TrueGRF is not going to have 64k authors :P 18:29:00 <TrueBrain> okay, so I have two technical solutions .. either I can make a service that upon request gives the next number in the batch 18:29:08 <frosch123> remember the guy making 64 cargo grfs? :p 18:29:09 <TrueBrain> of course I will secure it up a bit that it only works for legit repositories etc 18:29:20 <TrueBrain> or I can make a GitHub repository, where a commit is made when someone creates a new TrueGRF project 18:29:36 <frosch123> but yeah, it's a good spam measure. prevent people creating more than 256 townname sets 18:29:44 <TrueBrain> I remember he is still fully convinced "that is just fine" :P 18:30:27 <frosch123> a github repo with pubilc access? sounds troublesome 18:30:36 <TrueBrain> no, it will run through some server-side component 18:30:40 <TrueBrain> much like BaNaNaS database 18:31:11 <TrueBrain> basically, am I going to use Cloudflare KV as backend storage, or GitHub :P 18:31:23 <TrueBrain> guess GitHub is more in line with what we have been doing 18:31:29 <frosch123> how about just using 24 random bits? 18:31:44 <frosch123> type prefix + 24 random bits 18:31:46 <TrueBrain> how to detect collisions? 18:31:52 <TrueBrain> (as that will happen :P) 18:32:06 <frosch123> i will donate cookies for every non-bot collision 18:32:34 <frosch123> bananas can detect them on upload 18:33:27 <TrueBrain> hmm .. I guess I could make a button: "Change GRFID", which first checks if the current GRFID indeed gives a collision on BaNaNaS, and next changes it if that is the case 18:33:32 <TrueBrain> as ultimate "shit hit the fan" procedure 18:33:34 <frosch123> you can also use "unixtimestamp & 0xFFFFFF" to provide a challenge :p 18:33:38 <TrueBrain> which of course I will only build after the first complain :) 18:33:59 <TrueBrain> @calc 2**24 / 3600 / 24 / 365 18:33:59 <DorpsGek> TrueBrain: 0.532002029426687 18:34:09 <TrueBrain> sadly, within 6 months that is an issue :P 18:34:21 <TrueBrain> we could do it by the minute 18:34:30 <TrueBrain> chances of people making a project on the same minute is rather slim 18:34:34 <frosch123> yeah, people will make an event to press a button in the right second 18:34:57 <frosch123> minute or second makes no difference wrt. collissions 18:35:20 <frosch123> it's not like 2**24 seconds align with daytime 18:35:36 <frosch123> so it's equailly distributed 18:36:45 <TrueBrain> I think just a full random works fine 18:37:00 <TrueBrain> there will be someone some day that notices: I cannot upload to BaNaNaS!!! :P 18:37:04 <TrueBrain> but .. we deal with that when that happens 18:37:11 <TrueBrain> I like simple solutions 18:38:48 <TrueBrain> what storage does the GRF version have? 18:38:49 <TrueBrain> 32bit? 18:39:00 <frosch123> yes 18:39:20 <TrueBrain> right .. so yeah, days is a bad idea for TrueGRF 18:39:21 <frosch123> i think coop limited it to 16bit to imitate the ottd version 18:39:35 <TrueBrain> but I like the concept 18:39:45 <TrueBrain> I could just do the seconds since 2020-01-01 18:39:52 <frosch123> but noone ever put branches in the upper bits 18:40:09 <frosch123> which would be useless inside ottd anyway, since it would still only show the highest version 18:40:26 <TrueBrain> or indeed I could just increase the number on commit to the dev-branch 18:40:27 *** Tirili has joined #openttd 18:40:33 <TrueBrain> but that is an extra API call every change .. 18:40:50 <TrueBrain> @calc 2**32 / 3600 / 24 / 365 18:40:50 <DorpsGek> TrueBrain: 136.19251953323186 18:41:00 <TrueBrain> yeah ... 2000-01-01 works fine too :P 18:41:13 <frosch123> well, if you add publish-to-bananas, i guess you would like to put the same version into the bananas version 18:41:28 <frosch123> so, really it's a decision whether you want version 1,2,3 on bananas, or 2022.05.01 18:41:56 <TrueBrain> there is also a string-based version, right? 18:42:00 <TrueBrain> but that you enter in BaNaNaS, I guess 18:42:15 <frosch123> yes, bananas has a string, no idea how many chars 18:42:22 <frosch123> but ottd wants an integer inside the grf 18:42:26 <TrueBrain> unlimited, most likely :) 18:42:35 <TrueBrain> (and with unlimited, I mean 32 :P) 18:42:49 <frosch123> pretty sure *not* unlimited. the ottd-protocol is still the one from 2009 18:43:02 <TrueBrain> what I like about the coop approach, you don't have to worry about it at all .. it "just" works 18:43:19 <TrueBrain> and does anyone really care about the version inside the GRF 18:43:23 <TrueBrain> can you even see it somewhere? 18:43:47 <frosch123> it's shown in-game, but maybe only with some setting 18:44:19 <frosch123> if ((_settings_client.gui.newgrf_" target="_blank">client.gui.newgrf_developer_tools || _settings_client.gui.newgrf_" target="_blank">client.gui.newgrf_show_old_versions) && c->version != 0) { 18:44:38 <TrueBrain> and, and non-zero 18:44:59 <frosch123> yeah, zero is the same as "no action14" 18:45:06 <TrueBrain> ideally, it is only added when you commit to main 18:45:12 <TrueBrain> as those are "these are now for real" commits 18:45:24 <TrueBrain> but I could also do it upon release 18:46:01 <frosch123> i think that TRU1 guy just used the "download grf" button, and then uploaded to bananas 18:46:07 <TrueBrain> yeah 18:46:12 <TrueBrain> there is no release flow yet 18:46:20 <TrueBrain> and I noticed most people also don't understand the "Project" part yet 18:46:47 <TrueBrain> but I plan to add releases there, so you can make real releases 18:47:19 <TrueBrain> so till I get to that, let's skip the GRF version for now; and lets do that properly when I get there 18:47:23 <TrueBrain> but lets now first fix the GRFID :D 18:47:26 <TrueBrain> as that is just broken now :P 18:51:37 <TrueBrain> right ... now to think ... did I have to byteswap this or not ... 18:51:45 <TrueBrain> did TRU1 become TRU1, or did it become 1URT .. 18:51:55 <TrueBrain> (in terms of BaNaNaS folder listing :P) 18:52:18 <TrueBrain> TRU1, good 18:54:28 <TrueBrain> grfid: "ñþ\x01\x92" 18:54:29 <TrueBrain> lovely :P 18:55:33 <TrueBrain> okay .... now the title screen doesn't want to load 18:55:50 <TrueBrain> amazing 18:55:51 <TrueBrain> how did I manage to do that by reloading a NewGRF?! 18:56:16 <TrueBrain> pretty sure I broke something in OpenTTD .. and I think that is because my GRFID is not 4 characters or something 18:56:57 <frosch123> nah, i also had that effect yesterday 18:57:09 <frosch123> didn't figure it out either 18:57:38 <TrueBrain> openttd.html:132 dbg: [sl] Game Load Failed 18:57:43 <TrueBrain> weird 19:00:00 <TrueBrain> yeah, when I make a GRF where the GRFID is not 4 characters long, weird shit happens :D 19:00:06 <TrueBrain> it does not handle that all to well :P 19:00:20 <TrueBrain> okay ... so ... I guess ... this is utf-8 encoding being a bit too trigger happy? :) 19:00:57 <TrueBrain> 0x92 becomes 0xc2 0x92 19:02:24 *** virtualrandomnumber has joined #openttd 19:02:31 <TrueBrain> lets make this in hex :) 19:04:26 *** virtualrandomnumber has quit IRC 19:08:04 <TrueBrain> grfid: '-e6ce408' 19:08:10 <TrueBrain> tnx javascript ... exactly what I meant ?! 19:10:40 <TrueBrain> for some reason, it sometimes makes bit-operations signed 19:10:41 <TrueBrain> but not always 19:10:42 <TrueBrain> lol? 19:15:42 *** Etua has quit IRC 19:23:53 *** Smedles has quit IRC 19:24:01 *** Smedles has joined #openttd 19:30:58 *** Flygon has quit IRC 19:38:24 <_dp_> number type in javascript is super weird, it's a freakish mix of float and int32 19:47:09 <TrueBrain> https://cdn.discordapp.com/attachments/273533192601075712/983094627911479296/unknown.png 19:47:09 <TrueBrain> lol? 19:47:56 <TrueBrain> ah ... I hard-coded that it injects TRU1 via the reload buttons 19:48:01 <TrueBrain> and as the name is different .. things break :D 19:48:02 <TrueBrain> lol 20:03:09 <TrueBrain> grrrr ... even with BSWAP32 it doesn't work :P Why is this so hard .. 20:04:41 <frosch123> can you make it a hex string of length 8? 20:04:52 <TrueBrain> I did, yes 20:05:12 <frosch123> and js still turns it into a int32? :p 20:05:20 <TrueBrain> owh, no, the int32 I solved 20:05:40 <TrueBrain> magic ">>> 0" 20:05:47 <TrueBrain> but I am trying to tell OpenTTD to reload the GRF 20:05:51 <TrueBrain> but it keeps saying: I DONT KNOW YOU 20:07:56 <TrueBrain> right, the dude that uploaded under TRU1 will also get a new GRFID on next load of TrueGRF .. 20:08:02 <TrueBrain> guess .. we are going to hope he is not going to make a next version? 20:08:54 <TrueBrain> when we see him upload a new one, we just link the old to the new 20:08:57 <TrueBrain> we did that before :) 20:09:21 <frosch123> someone had to block TRU1 :) 20:09:43 <TrueBrain> hmm ... I send 0000000 20:09:50 <TrueBrain> how did I do that ... 20:11:19 <TrueBrain> by being a peanut! 20:12:02 <TrueBrain> I love how small my TrueGRF patch for OpenTTD is 20:12:07 <TrueBrain> I am sad there is no way I can ever get it upstream :P 20:12:41 <TrueBrain> and tnx frosch123 for the info on #70 .. I knew that, but completely forgot :P 20:13:58 <frosch123> i wondered, it felt like truegrf enforced the first 32 cargos at some point 20:14:09 <frosch123> not sure whether i imagined that, or whether it got lost in some gui conversion 20:14:29 <TrueBrain> I once started the IDs from 32 20:14:40 <TrueBrain> but later I changed that to just skipping those "these are required" 20:14:53 <TrueBrain> and now I removed all that completely :P 20:14:56 <TrueBrain> so that will be fun fixing :D 20:15:43 <TrueBrain> not looking forward to writing that migration script :) But .. I knew, and I didn't add it before releasing .. I can only blame myself ! 20:16:54 <TrueBrain> but can't believe that someone released a real townname grf a day after releasing the functionality .. and 2 days after starting to build it .. guess you were right there frosch123 , that there is demand for townnames :D 20:17:52 <frosch123> haha, yeah, it's a list of ~50 real town names from some island on the other side of the globe :) 20:19:14 <frosch123> silversurfer had like 20 newgrf with cars and townnames from various tv series and franchises 20:20:46 <TrueBrain> I can understand people making these .. it is easy to do, and it is pretty funny 20:20:52 <TrueBrain> at least, I had fun creating fictive dutch citynames :D 20:22:42 <TrueBrain> also surprised that so far they only discovered 1 compiler crash .. I expected more issues :P 20:23:57 <Samu> that moment you head to bed and remember one of your PRs might actually be wrong... happened last night 20:24:30 <Samu> so for today, I'ma leaving PR as draft 20:24:49 <Samu> maybe I'll think of more things while in bed again 20:24:53 <Samu> lol 20:25:43 <TrueBrain> so, while a new release is baking .... what do I need to know about NewGRF Stations? :P 20:26:54 <frosch123> similar as for industries: do not expose the spritelayouts :) 20:28:24 <frosch123> authors may choose tiletypes between: building without track, platform with track, platform with track but without electrification pylons 20:29:07 <frosch123> technically there can be 8 combinations of (track/no track, wires/no wires, pylons/no pylons), but a newgrf can only choose 4 20:29:30 <frosch123> i think giving that choice to authors is way too difficult to explain, so truegrf should pick the 4 :p 20:29:46 <frosch123> otherwise: you always have to draw two orientations of every tile, X and Y 20:30:15 <TrueBrain> you name 3, and say 4, what is the 4th? 20:30:42 <frosch123> i am not sure whether anyone needs platform without pylons and wires 20:31:05 <frosch123> pylons look weird inside closed stations, but missing wires are weird 20:31:43 <TrueBrain> is there a station GRF that is somewhat decent and under a permissive license, so I can use that as example project? 20:31:54 <frosch123> anyway, picking one of those 3/4 types defines the spritelayout and the tilelayout 20:32:10 <TrueBrain> okay, so really similar to industries 20:32:32 <frosch123> i think the existing station grfs are notoriously complicated :) 20:33:57 <frosch123> stations do not have a separate tile-feature like industries do. also they do not define the spritelayout in action2, but in action0 20:34:13 <TrueBrain> because, why not :D 20:34:17 <frosch123> but since truegrf should have opinions about spritelayouts, you can just fix the spritelayouts, and always use the same 20:35:09 <frosch123> the tile layout defines the 8 options from above, is stored in the map array, so fixed after construction 20:35:54 <frosch123> the spritelayout can be picked via callback, but following the opinionated part, truegrf doe snot need that 20:36:11 <frosch123> displayed sprites are picked via action123 20:36:21 <TrueBrain> (in the meantime, deployed TrueGRF v3.1.0, with the GRFID changes :D) 20:36:54 <frosch123> for platforms you need a magic value for the groundsprite, which ottd replaces with climate/railtype specific sprites 20:37:52 <frosch123> traditionally the action2 can pick different spritesets depending on the amount of waiting cargo. but afaik noone likes that, since waiting cargo is always zero with "full load"-waiting trains 20:38:02 <frosch123> so, maybe just skip that :p 20:38:59 <TrueBrain> ghehe 20:39:06 <TrueBrain> oof, company colours are a thing too ofc 20:39:19 <frosch123> already was for industries 20:39:28 <TrueBrain> true 20:39:34 <TrueBrain> I just enabled it by default :D 20:39:39 <TrueBrain> for all sprites :P 20:39:58 <frosch123> make the same choice for stations :) 20:40:25 <TrueBrain> okay, I do not follow the spritelayout stuff exactly .. but I need to read a bit more anyway 20:40:32 <TrueBrain> I see you can also disallow certain platform lengths etc 20:41:01 <frosch123> when building stations, you can restrict the size options to 2x1 or 2x2 or whatever size your building has. but since you can always remove single tiles, i think that should be skipped as well? 20:41:16 <TrueBrain> lol 20:41:26 <TrueBrain> so you can only build it, say, 2x2, but then you can remove tiles and make it 1x2 20:41:28 <TrueBrain> right :P 20:41:31 <TrueBrain> that is rather pointless :D 20:41:44 <frosch123> well, you will have halfed building sometimes 20:42:19 <frosch123> the good sets check neighbouring tiles and use different sprites depending on whether the same building continues, or ends 20:43:24 <TrueBrain> and I have no clue how to make an UI for that :D 20:44:25 <frosch123> a lot of 2D games also check adjacen tiles, you maybe you could just offer to define 5 sprites 20:45:20 <frosch123> (continuation in X: NE, SW, NE+SW, none) * same for Y 20:45:26 <frosch123> so 16, not 5 :p 20:45:43 <frosch123> maybe not that great of an idea then 20:45:51 <TrueBrain> in Unity you have this rule-based concept, which handles exactly this 20:46:00 <TrueBrain> but it is complex to understand at first :) 20:47:33 <frosch123> i hardly play with stations (too much work to build), so no idea how often animations are actually used 20:47:48 <frosch123> i recall some moving cargo cranes, but they were rather choppy 20:48:05 <frosch123> some stations have doors which open/close using the PBS reservation state 20:48:54 <TrueBrain> okay .. so just to recap for me, see if I am understanding this a bit correct 20:49:06 <TrueBrain> the spritelayout defines certain states a tile can be in, which is stored in the map array 20:49:13 <TrueBrain> so tracks yes/no 20:49:16 <frosch123> nope :p 20:49:18 <TrueBrain> roof 20:49:22 <frosch123> s/spritelayout/tilelayout/ :) 20:49:38 <TrueBrain> a tilelayout resolves to a spritelayout, not? 20:49:48 <frosch123> no, different things 20:50:08 <frosch123> i think even orthogonal 20:53:35 <TrueBrain> yeah, I have no clue what you meant with spritelayout and tilelayout in that case :) 20:56:28 <frosch123> when building a station property 0E / callback 24 is used to decide 3 flags (train can enter tile, draw pylons, draw wires) by indexing properties 11, 14, 15 (which effectivtely pick 4 of 8 possible cases) 20:57:11 <TrueBrain> the specs don't mention any of that, so I am a bit at a loss how that works 20:57:25 <frosch123> when drawing a station callback 14 decides which spritelayout to use from property 1A, and a regular sprite resolve fills the layout with sprites 20:57:55 <frosch123> yeah, the specs are incremental, and i skipped all the deprecated parts :p 20:59:10 <TrueBrain> prop 1A scares me 21:00:54 <TrueBrain> but I don't see how what you say and I said is different :D 21:01:01 <TrueBrain> so yeah .. we have a problem :P (and it is ME!) 21:01:11 <frosch123> prop 1A is the one, which is most similar to industies :p 21:01:25 <TrueBrain> how I read you and the specs, when building a station, prop 0e is used to figure out what tile goes where 21:01:38 <TrueBrain> so, does it have rails or not, etc 21:01:49 <TrueBrain> this is stored on the map 21:02:05 <TrueBrain> when drawing, prop 09 (or 1A I guess) is used to figure out how to make that a reality? 21:02:57 <frosch123> there is an extra level of indirection 21:03:05 <frosch123> the result of callback 24 is stored in the map array 21:03:21 <frosch123> that value is used to index property 15, which decides whether there is rail 21:04:29 <TrueBrain> so those 8 (well, 4, but in each direction) tiles can be redefined how they behave completely, in terms of rail, pylons and wires 21:06:55 <TrueBrain> any real reason industries are over 2 features and stations over 1? 21:08:04 <TrueBrain> can I force bounding boxes here in the same way as with industries? 21:09:10 <TrueBrain> should I care about prop1B (bridges)? 21:09:56 <frosch123> https://dpaste.org/XZFiU 21:10:24 <frosch123> using prop1B will disable the grf in vanilla ottd 21:10:35 <frosch123> you will need special jgrpp-detection stuff to support that 21:10:54 <frosch123> so, definitely not for first version :) 21:11:33 <TrueBrain> tnx for the paste 21:11:47 <TrueBrain> what is this "magic value" you talk about? :P 21:12:09 <TrueBrain> and I read that here I do have to deal with bounding boxes .. will be fun :D 21:12:17 <frosch123> it's the plain track sprite from the baseset 21:12:41 <frosch123> i am sure the number is in the source somewhere :p 21:13:00 <frosch123> you can copy the spritelayout of the default stations from the source as well 21:13:27 <TrueBrain> so this talk about 0/1/2 for ground-sprites 21:13:34 <TrueBrain> if I use the magic values, nothing to worry about? :P 21:13:43 <frosch123> https://github.com/OpenTTD/OpenTTD/blob/master/src/table/station_land.h#L61 21:14:10 <TrueBrain> do you have any idea how tricky it is to find the actual sprite number based on those references? :P 21:14:13 <TrueBrain> I got hurt before :D 21:14:39 <TrueBrain> let's hope 1070 will work .. we will find out :P 21:15:15 <frosch123> https://github.com/OpenTTD/OpenTTD/blob/master/src/table/sprites.h#L376 21:15:21 <TrueBrain> anyway, the 8 (4x2) tile values map directly on the sprite layout, right? 21:16:52 <TrueBrain> and do I get it right there is no actual limit on the amount of sprites you can draw on a single tile? 21:17:00 <frosch123> yes, you can use cb14 to change that, but i see no reason to do so 21:17:31 <TrueBrain> don't I need to use cb14 if I want to be context-aware? As in, to know the tile left of me is tile blabla? 21:17:53 <frosch123> same as for industries, the spitelayout has a sentinel, no length value :) 21:18:37 <frosch123> depends whether your context actually changes the bounding boxes, which it probably doesn't 21:18:58 <frosch123> the actualy sprites to use in the layout are defined by callback0/no-callback 21:18:58 <TrueBrain> owh, the sprite itself can also read the context ofc 21:19:25 <TrueBrain> so okay, main thing I will need help with is this "before" and "after" train bounding box value :) 21:19:41 <TrueBrain> can we just define 2 bounding boxes which will "just work"? 21:19:51 <frosch123> see station_land.h#L61 from above 21:20:12 <frosch123> i recommend to use the same bounding boxes as the default stations :) 21:20:21 <TrueBrain> okay, so not making it configurable 21:20:24 <TrueBrain> that is all I wanted to hear :P 21:20:54 <frosch123> players can choose "building" or "platform", which picks between two sets of bounding boxes 21:21:02 <frosch123> s/players/users/ 21:21:28 <TrueBrain> so we just need to think of 4 types that will be "enough for everyone" :P 21:21:37 <frosch123> exactly :) 21:21:51 <TrueBrain> well, honestly, making it dynamic doesn't sound like a lot of trouble from a TrueGRF point of view 21:21:55 <TrueBrain> but let's start simple 21:22:02 <TrueBrain> so platform and building 21:22:34 <frosch123> i am not aware of any station mixing platform and building tiles in the same station part 21:22:47 <frosch123> so that can be a pretty top-level decision 21:23:11 <TrueBrain> for industries I now kinda forces 2 layers on a tile 21:23:12 <TrueBrain> ground + building 21:23:18 <TrueBrain> so for stations I want to start off with something similar 21:23:22 <TrueBrain> ground, okay, easy 21:23:27 <TrueBrain> building for building tiles, sure 21:23:33 <TrueBrain> but for platform tiles, it might be a bit more tricky 21:23:49 <frosch123> platforms have two building essentially :) 21:23:49 <TrueBrain> if I look at vanilla alone 21:23:51 <TrueBrain> so I guess I do have to add layers here the user can add 21:24:09 <frosch123> 2 fixed layers, not any number of layers 21:24:30 <TrueBrain> ground (read: rail) + building on platform + building above platform? 21:24:59 <frosch123> ground (read: rail) + stuff behind train + stuff in-front of train 21:25:10 <TrueBrain> you just want them to put everything on a single sprite 21:25:11 <TrueBrain> hmm 21:25:35 <frosch123> "stuff behind train" can also be called "far platform", and "stuff in-front of train" can be called "near platform + roof" 21:25:37 <TrueBrain> same with industries, works for now :P 21:27:21 <TrueBrain> now to find out where you define the names of stations .. 21:27:33 <frosch123> action 4 21:27:45 <frosch123> you set a name for every station 21:27:57 <frosch123> and then you group stations using property 08, and assign a name to that group 21:28:37 *** gelignite has quit IRC 21:28:52 <TrueBrain> only 16 classes can exist in total? 21:28:53 <frosch123> oh, right, there are also WAYPOINTS 21:29:03 <frosch123> TrueBrain: in ttdp, yes :p 21:29:13 <TrueBrain> it does not mention that detail 21:29:24 <TrueBrain> are classes global? 21:29:30 <TrueBrain> as in, do I need to worry about that? 21:29:32 <frosch123> 256 per grf 21:29:48 <TrueBrain> or can I just use AAAA, AAAB, etc, and name them? 21:30:01 <frosch123> newgrf can put stations into the same class to share the same group 21:30:19 <frosch123> but it turns out grf authors always want to name the groups "awesome stuff by me" 21:30:21 <TrueBrain> okay, so the user needs to be able to fill it in :) 21:30:26 <frosch123> so they end up grf-pure 21:30:31 <TrueBrain> haha 21:30:35 <TrueBrain> right, no surprise there 21:30:51 <TrueBrain> okay, tnx a lot frosch123 , I think I understand how to get started :) 21:31:14 <glx> unless default and waypoint classes 21:31:35 <frosch123> the names of the groups are set by action4 and using the stringids C4xx 21:31:56 <frosch123> (i am sure noone would find that part on their own :p) 21:32:06 <TrueBrain> btw frosch123 , if you are ever bored, let me know if you spot me doing something stupid in GRFs for industries: 21:32:07 <TrueBrain> https://github.com/TrueGRF/TrueGRF-rs/blob/main/src/grf/industry.rs#L78 21:32:26 <TrueBrain> instead of properties I used names, but I am sure you understand that part :D 21:32:43 <TrueBrain> up till line 250, after that is not really readable and important :P 21:33:36 <frosch123> i am sure authors will find a ways to make something stupid anyway 21:33:47 <TrueBrain> they always do! 21:34:00 <glx> and station tile layouts can have some dynamic values, but it's a pain to do ;) 21:34:17 <frosch123> psst :p 21:34:17 <TrueBrain> funny, townnames GRF have a lot less readable code to generate the actions 21:34:21 <TrueBrain> but actionF is just a bit weird 21:34:26 <frosch123> i just convinced tb to not use those 21:35:04 <TrueBrain> most code for townnames is creating a DAG and figuring out in what order to generate sets :P 21:35:22 <glx> yeah it's possible to do without them, I think CHIPS magic tiles don't use this feature in NFO 21:35:41 <TrueBrain> I am still thinking how to do context-aware things 21:35:47 <TrueBrain> but that is not for the first version :) 21:35:55 <TrueBrain> industries have similar issues, ofc 21:36:26 <TrueBrain> so many things to configure on a single tile :) 21:37:16 <TrueBrain> owh well, things to think about ... now zzz 21:37:19 <TrueBrain> tnx again frosch123 :) 21:37:34 <glx> https://github.com/andythenorth/chips <-- but it's hard to read 21:37:40 <glx> templated nfo 21:37:41 *** Wolf01 has quit IRC 21:38:46 <TrueBrain> station tiles for the type of cargo stored on it? 21:38:49 <TrueBrain> or am I reading that wrong? 21:39:34 <frosch123> chips as some mineral-piles tiles 21:39:37 <frosch123> *has 21:39:47 <TrueBrain> funny 21:39:50 <frosch123> you can put piles of coal or ore next to your station 21:39:56 <frosch123> or containers 21:40:06 <frosch123> you can do the same with objects 21:40:10 <TrueBrain> is that part of the station, or an object? 21:40:17 <frosch123> but objects do not add to the station catchment 21:40:38 <TrueBrain> owh, it is not depending on what is in the station, but just a station-part you can place? 21:40:43 <frosch123> non-track stations and objects cover the same use-case, but one counts to the station catchment, the other doesn't 21:40:59 <TrueBrain> I was hoping it would pick the right sprite depending on the available cargo 21:41:16 <frosch123> TrueBrain: it can depend on what cargo is waiting, but when you use "full load cargo" and always have a train waiting, that is rather boring 21:41:33 <TrueBrain> true .. so don't do that! :D 21:41:35 <frosch123> i don't remember what chips did 21:41:40 <glx> magic tiles pick the cargo 21:41:40 <TrueBrain> pax stations will be crowded! :P 21:41:52 <frosch123> i think at some point andy advertised to never use full-load, so stations are prettier 21:41:59 <glx> https://github.com/andythenorth/chips/blob/master/src/templates/simple_action_3.tnfo 21:42:32 <TrueBrain> not for the first version, but I like the idea :P 21:43:14 <frosch123> TrueBrain: there is variable 69 to get a general idea about which cargos are handled at the station 21:43:32 <frosch123> so, if you don't care about amounts, that can be used 21:44:09 <glx> I have the generate 30K lines CHIPS NFO if you want 21:44:14 <glx> *generated 21:44:20 <TrueBrain> no tnx, I am good :P 21:44:33 <TrueBrain> cargo accepted ... 21:44:41 <TrueBrain> is that cargo that was delivered to the station 21:44:45 <frosch123> yeah, not "cargo delivered" 21:44:50 <TrueBrain> or cargo that the station accepted and made available for trains 21:44:57 <TrueBrain> it is such a weird word to use there :) 21:45:00 <frosch123> i think it's "cargo unloaded from train to station" 21:45:01 <TrueBrain> lacks context :) 21:45:19 <TrueBrain> and nobody ever requested the inverse? :D 21:45:23 <TrueBrain> as that is much more interesting :) 21:45:39 <TrueBrain> deliveries to stations are, at least in vanilla, instant 21:45:40 <frosch123> the inverse only has "cargo waiting" 21:45:54 <TrueBrain> yeah, but you want to know if that cargo has been waiting in the last 3 months or so 21:45:58 <TrueBrain> to not get a blinking sprite 21:46:03 <frosch123> and there is a 15 year debate on whether to change that to "amount of cargo handled last month" 21:46:06 <TrueBrain> THERE IS CARGO, no there is not, THERE IS CARGO, no ... :P 21:46:17 <TrueBrain> why change? ADD! :D 21:46:18 <frosch123> to get rid of the full-load issue 21:46:31 <TrueBrain> yeah, I kinda expected that to already exist :) 21:46:33 <glx> little/lot 21:46:40 <glx> you set the range 21:46:52 <frosch123> TrueBrain: now you can implement it :) 21:47:01 <TrueBrain> I don't even dare (yet) :P 21:47:06 <TrueBrain> what I do dare, is zzz 21:47:08 <TrueBrain> night guys :) 21:47:18 <frosch123> currently everyone is argueing about liveries, so maybe you can sneak in the waiting-cargo thing :p 21:48:08 <glx> and you can't really determine the cargo type in action 3, openttd decides 21:48:33 <frosch123> glx: you can use 60+x vars, and ignore action3 21:49:47 <glx> so layout select callback is used in this case 21:51:05 <glx> CHIPS uses the callback to analyse surrounding tiles and put buffers or things like that 21:52:16 <frosch123> it's similar to ogfx+industriies/landscape to put fences around industries and objects 21:52:42 <glx> multiple layouts and determine the right one for the nfo version, for the nml version I used advanced mode, 1 layout and magic 21:53:21 <glx> but it's the hardest option, and not recommended 21:53:26 <frosch123> so many ways :) truegrf can just pick one 21:53:42 <glx> I just wanted to test my implementation :) 21:54:15 *** sla_ro|master has quit IRC 21:54:28 <glx> btw CHIPS just relies on action 3 for cargo type 21:55:08 <glx> but the result can be random if many cargos are sent to the station 21:56:53 *** Samu has quit IRC 22:08:40 *** frosch123 has quit IRC