IRC logs for #openttd on OFTC at 2023-10-14
            
00:05:45 *** Wormnest has joined #openttd
01:54:59 *** HerzogDeXtEr has quit IRC (Read error: Connection reset by peer)
01:59:14 *** Wormnest has quit IRC (Quit: Leaving)
02:00:27 *** MIlGrau has joined #openttd
02:00:37 <MIlGrau> Hi guys
02:01:02 *** MIlGrau has quit IRC ()
02:08:03 *** pickpacket has quit IRC (Ping timeout: 480 seconds)
02:08:41 *** pickpacket has joined #openttd
02:15:09 *** debdog has joined #openttd
02:18:31 *** godbed has quit IRC (Ping timeout: 480 seconds)
03:05:06 <talltyler> Bye
03:08:27 *** pm has joined #openttd
03:09:05 *** pm is now known as Guest3301
03:14:48 *** Guest3196 has quit IRC (Ping timeout: 480 seconds)
03:32:04 *** keikoz has joined #openttd
04:04:13 <pickpacket> Blip blop
04:11:54 <DorpsGek> [OpenTTD/OpenTTD] Lamrr commented on issue #11353: [Bug]: incorrect resolution set with multiple monitors https://github.com/OpenTTD/OpenTTD/issues/11353
04:43:52 *** keikoz has quit IRC ()
04:54:10 *** keikoz has joined #openttd
05:40:32 <DorpsGek> [OpenTTD/OpenTTD] PikkaBird opened issue #11367: [Bug]: custom town count does not display correctly on play heightmap https://github.com/OpenTTD/OpenTTD/issues/11367
05:43:38 *** Flygon has joined #openttd
05:51:08 <DorpsGek> [OpenTTD/OpenTTD] merni-ns commented on issue #11367: [Bug]: custom town count does not display correctly on play heightmap https://github.com/OpenTTD/OpenTTD/issues/11367
06:49:09 *** merni has joined #openttd
06:49:09 <merni> https://cdn.discordapp.com/attachments/1008473233844097104/1162643233516556318/image.png?ex=653caee3&is=652a39e3&hm=9580bc0f4aad5d8a7a6cce40829a6c58745d8ae17bc8f975f84b05d051f375ee&
06:49:09 <merni> Pages and pages of this...
07:14:04 <LordAro> it'd nice if the debug message actually said which string was missing..
07:14:44 <merni> I am reasonably sure in this case though
07:23:32 *** HerzogDeXtEr has joined #openttd
07:26:55 *** Wolf01 has joined #openttd
07:45:35 <Rubidium> LordAro: that's going to incur quite a bit of overhead, and in this case it likely wouldn't have helped you
07:46:18 <LordAro> well in its current state the message is pretty useless
07:48:30 *** nielsm has joined #openttd
07:52:14 <DorpsGek> [OpenTTD/OpenTTD] rubidium42 opened pull request #11368: Fix #11367, 7c37dcb: use STRING1 when the passed string can have a parameter https://github.com/OpenTTD/OpenTTD/pull/11368
07:54:23 <Rubidium> in any case, the heightmap window has technically been broken for years... only because {STRING} incorrectly passed all remaining parameters it previously worked before the checks became more stringent
07:54:32 <truebrain> We could change it into DANGER SIR ROBINSON DANGER πŸ™‚
08:00:54 <Rubidium> we could dump the remainder of the string that is being resolved, but the string that is to be resolved isn't necessarily valid UTF8. Especially with the plural/gender choice lists, which are `\0` terminated strings, thus cutting the string short. Or just dump the whole (sub) string that is being drawn, but again that might not be very readable because of the UTF8 formatting characters we inject.
08:02:30 <Rubidium> that would leave getting the string names (and storing them in the binary), which could be useful for debugging... but that's not going to work for NewGRFs. Also with sub strings you might want to know the outer strings as well, the location in the string parameters, all the string parameters, etc.
08:04:00 <Rubidium> so yes, I agree the debug message does not tell much *but* when used in correlation to bug reports or windows being shown, it at least gives a hint to primarily look at the validity of the string parameters
08:07:03 <pickpacket> does loading speed scale linearly?
08:53:48 *** thelounge34 has quit IRC (Quit: The Lounge - https://thelounge.chat)
08:57:14 *** thelounge34 has joined #openttd
09:34:08 *** gelignite has joined #openttd
09:54:57 <DorpsGek> [OpenTTD/OpenTTD] michicc approved pull request #11368: Fix #11367, 7c37dcb: use STRING1 when the passed string can have a parameter https://github.com/OpenTTD/OpenTTD/pull/11368#pullrequestreview-1677978001
10:15:30 <DorpsGek> [OpenTTD/OpenTTD] rubidium42 merged pull request #11368: Fix #11367, 7c37dcb: use STRING1 when the passed string can have a parameter https://github.com/OpenTTD/OpenTTD/pull/11368
10:15:33 <DorpsGek> [OpenTTD/OpenTTD] rubidium42 closed issue #11367: [Bug]: custom town count does not display correctly on play heightmap https://github.com/OpenTTD/OpenTTD/issues/11367
10:17:49 <_pruple> πŸ‘
10:19:22 <Eddi|zuHause> pickpacket: loading speed scaling, based on what variable? changing the property of the vehicle itself? or the number of wagons in a train?
10:19:39 <Eddi|zuHause> (the answer should in both cases be "yes" anyway)
10:20:49 <Eddi|zuHause> loading speed is the number of cargo pieces being loaded in one loading step
10:22:21 <Eddi|zuHause> in practice, however, you'd want to look at how many steps it takes to fill the vehicle.
10:22:55 <Eddi|zuHause> which obviously also depends on the capacity
10:23:44 <Eddi|zuHause> and there is a completely separate scaling of the length of a loading step, based on platform length.
10:25:18 <Eddi|zuHause> which i never really bothered looking up the formula for
10:40:48 <Wolf01> Hmmm flu step 2... on summer... wait, not summer?
11:04:04 *** tokai has quit IRC (Quit: c('~' )o)
11:06:42 *** georgevb has joined #openttd
11:06:42 <georgevb> Is it a known issue, that vehicle_life displayed is less by 1 than grf specifies?
11:09:26 <merni> https://github.com/OpenTTD/OpenTTD/issues/11270
11:09:29 <merni> yes
11:17:51 <georgevb> Thank you, searching by "vehicle_life" didn't help, so I decided to ask first
11:23:49 <andythenorth> well
11:33:48 <kamnet> We need to get that cursed OpenTTD install off of the apple store
11:35:37 <andythenorth> report it to apple
11:37:41 <merni> I think people have tried already
11:38:17 <merni> "perhaps the answer is to properly port openttd to ios"
11:39:51 <FLHerne> I think that's impossible thanks to GPL
11:40:33 <FLHerne> (without consent from all significant copyright holders, which isn't feasible)
11:41:47 <FLHerne> https://www.fsf.org/blogs/licensing/more-about-the-app-store-gpl-enforcement
11:42:13 <merni> yeah
11:45:01 <FLHerne> now there's a formal 'OpenTTD Ltd' it's probably time to send some cease-and-desist letter?
11:50:44 <FLHerne> https://www.apple.com/legal/internet-services/itunes/appstorenotices/ this seems to be the form
11:56:09 <andythenorth> merni: I am not aware of anyone reporting it so far
12:32:36 <peter1138> LordAro, flooded rosds tofay, majes the avg speed fsll... ;(
12:33:23 <LordAro> peter1138: muddy tracks do that too
12:34:05 <peter1138> oof, mobile keyboard makes typing ability fall...
12:34:24 <LordAro> lol
12:34:41 <peter1138> Lots of punctures, fortunately not mine.
12:46:05 <peter1138> Hmm, maybe I'll gonout on the tomorrow.
12:46:19 <peter1138> -n+' '
12:47:16 <andythenorth> ypyinat
12:49:58 <LordAro> catinahat
12:59:56 <Eddi|zuHause> what did we learn?
13:04:45 *** gelignite has quit IRC (Quit: Stay safe!)
14:12:06 <andythenorth> I have a video for that
14:18:56 <peter1138> I have a pa... oh.
14:19:35 <peter1138> One of my VS Code extensions has a virtual memory size of 263GB...
14:24:50 <truebrain> As long as it stays virtual πŸ˜›
14:26:22 <peter1138> IniFile::RemoveGroup seems to remove by partial name match. Presumably that is deliberate, but the function documentation doesn't say so.
14:28:02 <peter1138> I'm not sure if it's also case-insensitive of whatever.
14:28:42 <peter1138> It's also possible that's a left-over from an old incorrect strncmp...
14:28:55 <peter1138> (Have not checked the history though :))
14:29:08 <alfagamma7> peter1138: Woah
14:30:08 <truebrain> peter1138: Incorrect strncmp seems more likely πŸ˜›
14:30:35 <peter1138> - if (strncmp(group->name, name, len) == 0) {
14:30:36 <peter1138> + if (group->name.compare(0, len, name) == 0) {
14:30:39 <peter1138> Well...!
14:34:31 <peter1138> GetGroup also use to...
14:34:56 <peter1138> - if (!strncmp(group->name, name, len) && group->name[len] == 0) {
14:34:56 <peter1138> + if (group->name == name) return group;
14:35:35 <peter1138> Fortunately it's late enough to be a PR. Maybe that explains.
14:35:51 <peter1138> > This PR converts a more or less random selection of stuff to use std::string
14:35:53 <peter1138> Unlikely :)
14:37:33 <peter1138> Okay, given it's in the same PR where other instances are simplified, I'll assume it's deliberate.
14:38:51 <peter1138> Although I think the correct check would be == name or startswith(name + '.')
15:38:27 *** virtualrandomnumber has joined #openttd
15:38:36 *** virtualrandomnumber has quit IRC ()
15:41:19 <andythenorth> hmm
15:41:27 <andythenorth> I don't understand why FIRS spritelayouts aren't invalid
15:41:38 <andythenorth> there are cases where they omit 'ground'
15:41:51 <andythenorth> and then supply 'childsprite'
15:42:11 <andythenorth> the childsprite is apparently rendered just fine
15:42:20 <andythenorth> but it's not a child of anything, so this should not be valid
15:43:21 <andythenorth> also, in nfo, childsprite isn't an explicit entity
15:44:41 <andythenorth> normally my stupidity amuses me, but today....not so much 😦
15:45:46 <andythenorth> https://gist.githubusercontent.com/andythenorth/06b7d2890a6bb55594292281d80cfd02/raw/b148d54f5637c3d930c392c40520e25912149cea/gistfile1.txt
15:45:56 <andythenorth> water industry
15:45:58 <andythenorth> no ground sprite
15:46:09 <andythenorth> but using a ground sprite constant in a childsprite
15:46:37 <andythenorth> this works fine, has for years, but it makes no sense when I read the spec
15:54:02 <peter1138> Does not specifying a ground sprite mean it just uses some default or placeholder?
15:55:23 <andythenorth> if there's no ground sprite, and nothing else, garbage is drawn
15:55:52 <andythenorth> hmm `When placing them before the first building sprite, they will have no bounding box, as if they would use the 'bounding box' of the ground tile`
15:55:58 <andythenorth> ok we'll just go with that
15:56:04 <andythenorth> spec says "yeah don't worry about it"
16:14:28 <andythenorth> https://cdn.discordapp.com/attachments/1008473233844097104/1162785505579114526/image.png?ex=653d3364&is=652abe64&hm=8dd5573805fb3b0af2949a1d143f9e18127ca93eeb52fc2e92ab37e0d0c01179&
16:14:28 <andythenorth> so to position on coasts, I want to adjust zoffset?
16:16:07 <_glx_> you can test with sprite aligner
16:16:40 <andythenorth> that can't do zoffset I think
16:16:42 <andythenorth> only x and y
16:16:47 <_glx_> but z seems the right axis to touch
16:17:46 <peter1138> In-game bounding box adjuster?
16:18:26 <peter1138> z should be +8.
16:18:50 <andythenorth> yeah that works
16:18:59 *** Wormnest has joined #openttd
16:19:42 <andythenorth> https://cdn.discordapp.com/attachments/1008473233844097104/1162786821583941752/image.png?ex=653d349d&is=652abf9d&hm=08797bfac39b43cc33441bfccc9df237b6720ea8dffc429d6ab85176b63dfea3&
16:19:42 <andythenorth> ok
16:19:48 <andythenorth> need to set some foundations now πŸ™‚
16:21:15 <_glx_> doesn't CB30 handles all that ?
16:23:10 <andythenorth> objects don't have access to it
16:23:23 <andythenorth> they just have an action 0 prop to disable foundations
16:23:27 <andythenorth> afaict
16:29:11 <_glx_> 5 32 Supported by OpenTTD 1.1 (r20670)1.1 Supported by TTDPatch 2.6 (r2340)2.6 Do not display foundations if on a slope
16:29:19 <_glx_> only a flag indeed
16:30:16 <andythenorth> it would be more convenient if the API was the same as other tiles
16:30:18 <andythenorth> but eh
16:30:32 <andythenorth> I can make it work anyway, just duplicate code
16:49:20 <_pruple> objects will just draw the default foundations like anything else built-on-slope, unless you disable them to do something fancy, right?
16:49:57 <_pruple> probably needs a ground tile though πŸ™‚
16:58:14 <andythenorth> yeah I want fancy foundations
16:59:31 <andythenorth> wonder how to do them πŸ˜›
16:59:37 <andythenorth> building sprite or childsprite?
17:01:04 <_glx_> hideable childsprite
17:06:52 <andythenorth> couldn't figure out what they'd be childsprites of
17:06:56 <andythenorth> did them as buildings πŸ˜›
17:09:08 <andythenorth> now I just need to figure out the slopes
17:09:27 <_pruple> always a good time
17:10:12 <andythenorth> probably just OR a bunch of things here
17:10:13 <andythenorth> https://newgrf-specs.tt-wiki.net/wiki/NML:List_of_tile_slopes
17:10:17 <andythenorth> or read how FIRS does it πŸ˜›
17:16:07 <peter1138> So
17:16:23 <peter1138> Cheese.
17:20:22 <andythenorth> very
17:34:32 <andythenorth> https://cdn.discordapp.com/attachments/1008473233844097104/1162805653736280135/image.png?ex=653d4627&is=652ad127&hm=b9031bf623c5fdc53413aa955f1d90232194343e950e5e7d07a00f263d964183&
17:34:32 <andythenorth> such
17:35:05 <andythenorth> https://cdn.discordapp.com/attachments/1008473233844097104/1162805793255587890/image.png?ex=653d4648&is=652ad148&hm=265cae5edec10217015e0aa392ad7b0009ee5816cae38aa93466f4340d0c847a&
17:35:05 <andythenorth> no longer matches non-coast industry foundations though πŸ˜›
17:35:40 <andythenorth> would be easier to check coast tile if this was a callback, not action 0 flag
17:47:29 <andythenorth> hmm I could just duplicate all the objects
17:47:33 <andythenorth> coast / non-coast
17:48:13 <_glx_> They can probably share spritelayout
17:48:40 <andythenorth> I can just reference base set sprites probably
17:48:44 <andythenorth> just a lot more registers to set πŸ™‚
17:49:11 <andythenorth> we're not short though, the graphics chain here only uses 22 so far
17:49:48 <_glx_> You have 128 available
17:49:59 <andythenorth> 'plenty'
17:52:05 <andythenorth> splitting foundation sprites is only another 6
17:58:13 <peter1138> Suddenly, a Cyberdemon.
17:58:25 <andythenorth> was it wanted?
17:59:14 <peter1138> It was not a team-player for sure.
18:05:01 <andythenorth> ach, for an object built on water, does `nearby_tile_is_water(0, 0)` return false?
18:05:05 <andythenorth> because it's now an object?
18:05:59 <andythenorth> ok we'll check tile water class instead
18:11:25 <brickblock19280> no it is true
18:22:13 <andythenorth> ach do base set foundation sprites vary by climate?
18:22:51 <talltyler> I believe so, like Forest industry trees 😦
18:24:16 <andythenorth> ach the base set foundations aren't split
18:24:22 <andythenorth> https://cdn.discordapp.com/attachments/1008473233844097104/1162818194453577778/image.png?ex=653d51d5&is=652adcd5&hm=01aef66402811bc7afd1043b6987bbf776bde5286893fe8b681ac8b02225206d&
18:24:42 <andythenorth> meh, this is a bad idea
18:25:50 <andythenorth> https://cdn.discordapp.com/attachments/1008473233844097104/1162818565007740948/image.png?ex=653d522e&is=652add2e&hm=5b87f8675caeb38ad2ee928f4d4951b6d6c0b8cf2c0128d1ab3a2eb32bf3b079&
18:25:50 <andythenorth> I could give industries dock-style foundations also
18:25:54 <andythenorth> but then what about stations?
18:27:05 <talltyler> You could replace the base set foundations entirely, so everything matches
18:28:48 <peter1138> NewFoundations!
18:29:14 <truebrain> NewOpenTTD!
18:29:50 <peter1138> NewDevelopers!
18:31:34 <andythenorth> yes, controversial idea, I just draw 6 more foundations πŸ˜›
18:31:42 <andythenorth> roughly matching the base set
18:32:23 <andythenorth> or is it 12? subarctic are the ones that are different?
18:37:30 *** Wormnest has quit IRC (Ping timeout: 480 seconds)
18:37:31 <DorpsGek> [OpenTTD/OpenTTD] eints-sync[bot] pushed 1 commits to master https://github.com/OpenTTD/OpenTTD/commit/a73ef95a2bc21066023d7ea25ebcaedd35540888
18:37:32 <DorpsGek> - Update: Translations from eints (by translators)
18:39:23 <andythenorth> hmm do stations have CB 30?
18:39:26 * andythenorth looks
18:40:32 <andythenorth> seems not
18:41:27 <peter1138> CB IDs are never shared across features, so if it has one it'll be a different number.
18:41:33 <peter1138> (Unless someone started sharing them)
18:42:04 <andythenorth> stations have their own foundations magic
18:42:24 <andythenorth> var 10
18:43:03 <brickblock19280> 9890
18:43:09 <brickblock19280> whoops
18:45:03 <andythenorth> lol I think it's really just easier to split objects again by foundation type
18:45:20 <andythenorth> so now the combinations are: ground type, building colour, foundation type πŸ˜›
19:00:30 <kamnet> FLHerne: Other than the flap up well over a decade ago where it was suggested by FSF that Apple was not compatible with open source licenses, nobody has actually verified if this is still the case and hasn't actually tried to submit open source software.
19:03:28 <FLHerne> kamnet: the result of the flap was VLC being removed by Apple, so more than 'suggested'
19:03:32 <kamnet> merni: Like Andy said, I don't think anybody's reported it. A decade or so ago when somebody posted "ZodTTD" I believe Planetmaler filed the complaint to remove it.
19:04:00 <FLHerne> they returned it by relicensing to MPL which isn't a plausible option for OTTD
19:04:48 <FLHerne> neither the GPL nor Apple's terms have changed significantly since, so I don't see why it would be different now
19:06:03 <FLHerne> GNU Go was removed by Apple about the same time also due to GPL incompatibility
19:08:58 <kamnet> But has anybody actually tried recently?
19:09:53 <FLHerne> Not that I'm aware of
19:10:22 <FLHerne> but "try it and hope no-one brings it to Apple's attention" doesn't seem a reasonable strategy
19:11:12 <FLHerne> the license incompatibility is pretty clear, it's not some hidden Apple internal policy
19:11:48 <FLHerne> distributing under the App Store licensing terms is inherently a GPL violation
19:14:15 <peter1138> Moo
19:18:05 <FLHerne> *shrug*
19:19:45 <andythenorth> the reason I haven't done submitted a report is that the form is boring πŸ˜›
19:19:46 <andythenorth> sorry
19:20:08 <andythenorth> then I'd have to check email for progress, and I hate email
19:20:09 *** Wormnest has joined #openttd
19:23:11 <andythenorth> https://cdn.discordapp.com/attachments/1008473233844097104/1162832998610247793/image.png?ex=653d5f9f&is=652aea9f&hm=0f4dc6a9fa02dfc567572917abe00b2cb23b5feea23d20fe8a8ce9623a78897b&
19:23:11 <andythenorth> hmm
19:23:16 <andythenorth> tropic foundations eh
19:23:57 <andythenorth> https://cdn.discordapp.com/attachments/1008473233844097104/1162833190642262157/image.png?ex=653d5fcd&is=652aeacd&hm=9169bb515ec079efabcd80494f336bc73fbce15d9ac8e39ab8b86216f6f4b504&
19:24:11 <andythenorth> goes it I override base set sprites? πŸ˜›
19:24:27 <andythenorth> what would _pruple do?
19:26:58 <_pruple> to what end? πŸ™‚
19:27:20 <andythenorth> do we like base set foundations?
19:27:31 <_pruple> 🀷
19:28:04 <_pruple> you could replace the base foundations, but they'd obviously apply everywhere. and other grfs might override them too. πŸ™‚
19:28:38 <andythenorth> I am curious if the split ones are in the base set
19:28:39 <brickblock19280> I usually don't but having two types is more interesting
19:28:50 <brickblock19280> some are
19:29:59 <andythenorth> the base set has so many pre-composed combinations πŸ˜›
19:30:16 <andythenorth> think I can make it work on sprite numbers probably
19:30:25 <andythenorth> or just check more slopes
19:33:28 <_pruple> hmm... most of the base set ones are for autoslopes
19:33:52 <_pruple> there are only 16 original flat-top-only foundations
19:34:17 <_pruple> https://cdn.discordapp.com/attachments/1008473233844097104/1162835789508517978/foundations1_tropic.png?ex=653d6238&is=652aed38&hm=3618e9292d1773fad5560420d92fd512ab0609061c88cc8af92909477738de68&
19:34:59 <andythenorth> there's a bunch with the rear part removed
19:35:47 <_pruple> for autoslope, roads and rails that connect up on that edge afaict
19:36:48 <_pruple> and some for combining to create foundations on steep slopes?
19:37:52 <_pruple> there was no infrastructure or industries on foundations in the original game afair, they were used by town buildings only. πŸ™‚
19:38:13 <andythenorth> ah yes
19:39:19 <andythenorth> ok I play tanks while my brain sorts this out for me
19:54:06 <andythenorth> so do spritelayouts have any performance implications?
19:57:50 *** Tirili has joined #openttd
19:59:13 <peter1138> Code-style: `bool operator()(...` or `bool operator() (...`
19:59:27 <andythenorth> I need 24 sprites for foundations, most of which will be 'hide sprite'
20:00:55 <_glx_> use spriteset_name(LOAD_TEMP(...))
20:01:17 <peter1138> And following on from that, should a comparator class be snake case or camel case, and should it be named a sorter or a comparator...
20:01:24 <peter1138> (We have a mix of everything)
20:02:32 <andythenorth> _glx_: it's base set sprite numbers, but yes, good idea
20:03:07 <_glx_> oh then LOAD_TEMP() should work too
20:03:18 <peter1138> base_timer_sorter, PriorityComparator...
20:03:58 <_glx_> I don't think we included that in code style
20:04:36 <_glx_> I guess if it's a class it should follow other classes
20:05:17 <_glx_> and comparator makes more sense as it's used to compare values
20:05:47 <_glx_> (which results in sorted container)
20:06:25 <peter1138> base_timer_sorter seems to be an outlier.
20:06:34 <_glx_> but in c++ doc it's called comparator IIRC
20:09:11 <peter1138> And annoyingly, std::sort can't use a comparator class, IIRC.
20:10:35 <peter1138> (Probably because it's invoked differently.)
20:11:20 <_glx_> I think it can
20:11:59 <_glx_> https://en.cppreference.com/w/cpp/algorithm/sort <-- the example uses a struc
20:12:01 <_glx_> +t
20:12:21 *** nielsm has quit IRC (Ping timeout: 480 seconds)
20:13:01 <peter1138> Oh. Hmm,
20:14:04 <peter1138> Ah, that's an instance of an unnamed struct. Okay.
20:14:20 *** nielsm has joined #openttd
20:15:56 *** Wormnest has quit IRC (Ping timeout: 480 seconds)
20:39:43 <peter1138> Oof, my build is linked against libSDL-1.2.so AND libSDL2-2.0.so.0
20:40:13 *** Wormnest has joined #openttd
20:41:42 <_glx_> weird
20:43:37 <_glx_> it does ```
20:43:37 <_glx_> link_package(SDL)
20:43:37 <_glx_> link_package(SDL2 TARGET SDL2::SDL2)
20:43:37 <_glx_> ```but only one of them should be found```
20:43:37 <_glx_> find_package(SDL2)
20:43:39 <_glx_> if(NOT SDL2_FOUND)
20:43:39 <_glx_> find_package(SDL)
20:43:41 <_glx_> endif()
20:44:32 <peter1138> Probably it's linked via another dependency.
20:45:49 <peter1138> lddtree shows it, it's included via libfluidsynth.
21:08:01 *** nielsm has quit IRC (Ping timeout: 480 seconds)
21:14:13 *** keikoz has quit IRC (Ping timeout: 480 seconds)
21:16:16 <peter1138> Hmm, my 2GB Dropbox account has 5.2GB available.
21:20:13 <peter1138> And now it doesn't exist.
21:28:00 <andythenorth> what's the water class of coast?
21:28:05 <andythenorth> I thought it was sea?
21:29:00 <andythenorth> industry tile var 60 bit 1 works that way
21:29:03 <andythenorth> wtf do objects do
21:30:08 <andythenorth> spec says the same
21:31:26 <andythenorth> I guess not
21:32:23 <_glx_> object var62 is industry var60
21:32:30 <andythenorth> yup
21:32:52 <andythenorth> maybe I should try doing this in JGRPP where there are debugging tools
21:34:00 <andythenorth> https://cdn.discordapp.com/attachments/1008473233844097104/1162865918725070979/image.png?ex=653d7e48&is=652b0948&hm=f0c5952fb10e571779578c55ad6f589a25882f2c9ca38f1d4bd6982e0e9873fc&
21:34:00 <andythenorth> water tile is returned as water
21:34:01 <andythenorth> coast tile is not
21:34:09 <andythenorth> I am checking water class
21:34:51 <andythenorth> that's not bit 1 though, it's bits 5..6
21:36:29 <_glx_> <https://github.com/OpenTTD/OpenTTD/blob/master/src/newgrf_industrytiles.cpp#L34> and <https://github.com/OpenTTD/OpenTTD/blob/master/src/newgrf_object.cpp#L194> are very similar
21:36:56 *** Wormnest has quit IRC (Ping timeout: 480 seconds)
21:38:35 <andythenorth> https://github.com/andythenorth/chips/blob/nml-port/src/templates/foundations.pynml#L10
21:38:39 <andythenorth> must be PEBKAC
21:38:56 <_glx_> <https://github.com/OpenTTD/OpenTTD/blob/master/src/newgrf_commons.cpp#L439> and both return the same bitset
21:38:58 <andythenorth> intent is to return 0 for coast / sea, otherwise return 1 (hide foundation)
21:39:14 <andythenorth> I have rewritten the switch chains 5 different ways to try and make this work
21:41:43 <andythenorth> maybe I have to do a circular tile walk to find a nearby water tile
21:41:51 <andythenorth> spec implies not
21:43:10 <peter1138> Oh yeah, Cyberdemon. Damn.
21:43:33 <brickblock19280> Why can't you just look at the tile ahead of the foundation?
21:45:01 <andythenorth> HasTileWaterClass() appears to return true for objects
21:45:54 <_glx_> "Be aware that due to the way that TTD generates a random map, the class number of a neighbour tile could be different from what you expect. E.g., when placing a water-based industry adjacent to a coast in a random game, these tiles arenΒ΄t adjacent to water anymore after the industry has been generated and therefore you can't reliably check for coast tiles in the industryΒ΄s placement callback"
21:46:14 <andythenorth> I probably even wrote that
21:46:15 <andythenorth> sounds like me
21:46:46 <brickblock19280> are you coding industries stations or objects?
21:46:51 <andythenorth> yes
21:47:05 <brickblock19280> in this specific case
21:47:15 <_glx_> doesn't really matter here, they all use the same vars πŸ™‚
21:47:20 <andythenorth> stations objects and roadstops
21:47:24 <andythenorth> and industries in future
21:47:45 <andythenorth> it's all calls to GetNearbyTileInformation()
21:47:54 <brickblock19280> and you are trying to do what?
21:48:01 <andythenorth> detect coast
21:48:33 <brickblock19280> what would you do after that?
21:48:47 <andythenorth> show custom foundations for water, or base set foundations
21:48:50 <andythenorth> I suspect this isn't possible
21:49:10 <brickblock19280> it should be
21:49:21 <andythenorth> I have encountered issues before with coast
21:49:25 <_glx_> you can check slope and tile next to the slope
21:49:29 <andythenorth> we had a bug with trees on coast making them not coast
21:49:40 <andythenorth> there's a thing where bulldozing a coast tile makes it not coast
21:50:29 <brickblock19280> nearby_tile_is_water(0, 1) and if true you provide your own sprite and if it isn't you use the ingame sprites
21:50:33 <andythenorth> I think basically this is a stupid idea
21:50:43 <brickblock19280> I don't think it is
21:51:12 <brickblock19280> my object grf does that to chose whether to have water animation or not
21:51:14 <_glx_> anyway it's possible, just not by checking only current tile
21:51:41 <andythenorth> reliably detecting all possible combinations of coast ... brr
21:51:52 <brickblock19280> it's not to bad
21:52:21 <brickblock19280> if there is a water tile next to it than it isn't coast and if there is then you just look at slope
21:52:34 <_glx_> you can use a procedure to convert slope into offset
21:52:41 <andythenorth> https://cdn.discordapp.com/attachments/1008473233844097104/1162870620468559952/image.png?ex=653d82a9&is=652b0da9&hm=f2231386308a1425c35cca647ef339cc675f5981124a01eaa4ebc41d403cc811&
21:52:41 <andythenorth> also what is supposed to happen in the river case?
21:53:24 <brickblock19280> up to you I did animated but that is probably not the best it depends if they can be placed on the river or not imo
21:53:35 <brickblock19280> if not then you shouldn't have it
21:54:00 <brickblock19280> if it is possible then you should have it possibly detect if it is built on water
21:54:06 <andythenorth> https://cdn.discordapp.com/attachments/1008473233844097104/1162870976715968523/image.png?ex=653d82fd&is=652b0dfd&hm=1fcef5c729c6ef738266bedb78b268e761f3f4b8dc4f73634301b9d14637d52a&
21:54:42 <brickblock19280> probably base set foundation
21:54:45 <andythenorth> I am stuck at 'but it needs a circular tile search'
21:54:46 <andythenorth> hmm
21:54:53 <andythenorth> no, we know the slope number
21:54:59 <brickblock19280> why would it need that
21:55:08 <brickblock19280> exactly
21:55:57 <andythenorth> ok so it needs a limted tile walk, not a circular search
21:56:05 <andythenorth> but every slope number needs a specific tile walk
21:56:45 <brickblock19280> this is how I did it
21:56:46 <brickblock19280> https://github.com/Brickblock1/Chips-Style-Dock-Objects/blob/main/src/basic_tile.pnml
21:57:06 <_glx_> private ?
21:57:17 <brickblock19280> is it?
21:57:27 <brickblock19280> whoops
21:58:20 <brickblock19280> fixed
21:58:24 <_glx_> ah it works now
21:59:19 <brickblock19280> the custom foundations could simply be replaced with the baseset ones when there isn't any water
21:59:26 <andythenorth> similar to FIRS ports that code
21:59:28 <brickblock19280> would need more slope checks
21:59:35 <_glx_> in your case it's simpler because your sprite has an orientation
21:59:36 <brickblock19280> yeah I mostly stole it
21:59:47 <andythenorth> whatever I do also needs to work for stations
22:00:02 <andythenorth> where I think I'm restricted to a a specific foundations implementation
22:00:09 <andythenorth> via var 10
22:00:09 <brickblock19280> I don't see why this wouldn't
22:00:36 <_glx_> for stations you know which slope it can't be
22:01:01 <brickblock19280> stations can use the object foundation trick
22:01:22 <_glx_> as depending on station orientation your are limited in allowed slope
22:02:10 <_glx_> you just need to check the tile in the "next track"
22:02:53 <brickblock19280> https://www.tt-forums.net/viewtopic.php?p=1253411 this does it the object way but I can't find the discussion where we talked about it
22:03:54 <brickblock19280> here it ishttps://www.tt-forums.net/viewtopic.php?t=90844
22:04:40 <brickblock19280> might not have been exactly like objects but similar
22:04:42 <_glx_> so (0, 1) or (0, -1)
22:06:03 <_glx_> nearby_tile_is_water(0,1)+nearby_tile_is_water(0,-1) should return something useable
22:06:33 <brickblock19280> for stations going like this /?
22:06:35 <_glx_> (for stations)
22:06:38 <brickblock19280> or both?
22:06:52 <_glx_> "The first parameter is the distance to move along the platform, the second parameter is the distance to move sideways (between platforms). Both parameters are signed numbers with range -8..7, negative numbers go northwards."
22:06:57 <_glx_> it's magic πŸ™‚
22:07:19 <andythenorth> ha
22:07:32 <brickblock19280> so it has to be different for station anyway?
22:07:48 <andythenorth> right, all of this makes sense, but none of it makes sense because I need to sleep πŸ˜›
22:08:01 <brickblock19280> same, gn
22:08:17 <andythenorth> what I need is to rewrite this procedure https://github.com/andythenorth/chips/blob/nml-port/src/templates/foundations.pynml#L10
22:08:17 <_glx_> stations use some automatic orientation stuff
22:08:43 <andythenorth> (currently a switch, but can be called as procedure)
22:09:27 <andythenorth> hmm maybe I need a procedure for each slope number
22:09:40 <andythenorth> every slope needs a different set of nearby tile checks?
22:10:41 *** Wormnest has joined #openttd
22:10:43 <brickblock19280> More or less
22:10:55 <brickblock19280> But at most four per slope
22:11:17 <_glx_> you can reduce it to 2 orientations
22:11:42 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
22:11:57 <_glx_> NW-SE or SE-SW
22:12:38 <andythenorth> oh because they're the only faces to show foundations on
22:13:44 <andythenorth> hmm I'm still counting more
22:15:02 <_glx_> I think the simplest solution is to add the four nearby_tile_is_water()
22:16:16 <_glx_> or 8 if you also want to check the little corners
22:16:55 <andythenorth> let's see
22:17:15 <_glx_> not 0 meaning at least one of the tiles around is water
22:18:30 <andythenorth> some slopes need to check 2 directions
22:19:14 <_glx_> that's why I suggest adding (0,-1)(0,1)(1,0)(-1,0)
22:19:23 <_glx_> ignoring the slope
22:21:12 <andythenorth> seems like there should be a shortcut to do this with boolean AND
22:21:33 <andythenorth> I tried earlier, water class & slope
22:22:21 <andythenorth> hmm no, it still needs to branch through slope
22:22:30 <andythenorth> meh, this is not hard, I just can't see the logic flow
22:22:36 <andythenorth> it seems to need a LOT of switches
22:23:26 <_glx_> ignore the slope (or just test it's not flat) then check all surroundings
22:23:39 <andythenorth> I need the slope to know which foundation to show though?
22:23:40 <andythenorth> there are 6
22:23:46 <andythenorth> I have to hide the others
22:24:30 <andythenorth> I think I need a table in python, and just generate this, it will be more reliable
22:25:30 <andythenorth> slope: ([water positions], [foundation sprites to show])
22:26:22 <andythenorth> then I just give all the switches numbers, auto-generated
22:26:30 *** Flygon has quit IRC (Read error: Connection reset by peer)
22:27:06 <_glx_> slopes are equivalent to bitmask(CORNER_N, CORNER_W) (SLOPE_NW)
22:27:34 <andythenorth> the docs for them are pretty good https://newgrf-specs.tt-wiki.net/wiki/NML:List_of_tile_slopes
22:27:54 <_glx_> you hide some sprites depending on the rised corners
22:28:12 <andythenorth> I wonder if we could write an nml built-in for 'coast tile' πŸ˜›
22:29:25 <andythenorth> wouldn't work for slopes by rivers eh πŸ™‚
22:31:49 <_glx_> each "hide" would be a combination of HasBit(slope, ...)
22:32:59 <andythenorth> did we decide nml ternary was bad?
22:33:23 <andythenorth> I want to fold this into an expression if possible, not generating chained switches
22:33:52 <_glx_> ternary can generate mutlipe switches if needed
22:35:34 <andythenorth> ok tomorrow I try something afresh
22:35:36 <andythenorth> thanks all
22:37:01 <_glx_> but it might be easier to read if you write a chain
22:37:38 <andythenorth> ideally I reduce it to a set of booleans for each slope, and just & them
22:38:27 <_glx_> using HasBit can help I think
22:40:29 <_glx_> ie checking which corner is raised instead of the slope value
22:42:11 <andythenorth> which is simpler to map the actual foundation sprites against
22:43:24 <andythenorth> ok zzzzzzz πŸ™‚
23:05:51 *** Wormnest has quit IRC (Ping timeout: 480 seconds)
23:40:51 *** Wormnest has joined #openttd