IRC logs for #openttd on OFTC at 2025-01-12
⏴ go to previous day
00:02:27 <peter1138> The logic for generic strings was broken as all action 4 string id is always a word now.
02:02:34 *** gelignite is now known as Guest5664
02:02:37 *** gelignite has joined #openttd
02:02:43 *** wallabra has quit IRC (Write error: connection closed)
02:09:56 *** Guest5664 has quit IRC (Ping timeout: 480 seconds)
02:16:35 *** gelignite has quit IRC (Quit: Stay safe!)
03:07:24 *** Wormnest has quit IRC (Quit: Leaving)
03:39:04 *** D-HUND has quit IRC (Ping timeout: 480 seconds)
03:47:36 *** wallabra has joined #openttd
04:03:06 *** gnu_jj_ has quit IRC (Ping timeout: 480 seconds)
04:20:59 *** wallabra has quit IRC (Quit: Bowserinator is wrong don't blame iczero)
04:30:36 *** wallabra has joined #openttd
05:33:19 *** gnu_jj_ has joined #openttd
05:36:29 *** gnu_jj has quit IRC (Ping timeout: 480 seconds)
06:01:38 *** goddess_ishtar has joined #openttd
06:01:38 <goddess_ishtar> `openttd -q` still returns code 0 even if it was unable to read the file provided and this annoys me
06:07:47 <goddess_ishtar> which means no elegant way to tell if it failed unless you want to check for the presence or absence of "Failed to open file" on std_err
06:55:13 *** akimoto has joined #openttd
07:00:28 <merni> you could always submit a PR or an issue :p
07:08:58 <goddess_ishtar> merni: pretty sure I will
07:09:27 <goddess_ishtar> was just checking if it was already fixed in the nightlies or something
07:11:52 <goddess_ishtar> and there it is :p
07:16:38 <pickpacket> there we go. Regression fixed and rebased on master
07:23:59 <goddess_ishtar> > For your questions, there are a few possible answer. We have been willing to add in-game the ability to automatically download all missing content from BaNaNaS, if you load a game that is missing any. So you can just do ./openttd -g <savegame> -DOWNLOADSTUFF, and that it makes it happen. Via the UI it is already possible, but not in-game yet.
07:23:59 <goddess_ishtar> > But, as that goes, nobody actually implemented that yet, so we don't have that yet.
07:23:59 <goddess_ishtar> sounds like a new project (once I actually learn C++ lmao)
07:24:46 <goddess_ishtar> seeing as the entire reason I even care about this bug is that I was trying to write a python wrapper script to do just that
07:47:18 <pickpacket> goddess_ishtar: you don't need to learn C++. God knows I haven't 😂 If you have general knowledge of programming you can figure most things out in the codebase. Most of whatever you want to do has existing examples elsewhere.
08:06:43 <goddess_ishtar> does anyone know where the worldgen code is?
08:10:40 <goddess_ishtar> I've never really looked around the repo before and there's no good developer documentation :p
08:11:19 <merni> idk what you mean by developer documentation
08:11:37 <merni> most of the code is pretty well documented internally with comments etc
08:11:57 <merni> (of course some bits are a bit of a gnarly mess)
08:13:08 <kuhnovic> Just don't expect a high level "this is how things mesh together"-doc, there's hardly any of that
08:13:56 <goddess_ishtar> kuhnovic: yeah that's the part which I would really like to have
08:14:17 <Rubidium> well... it meshing together is kinda a clue... almost everything is connected to almost everything ;(
08:14:43 <pickpacket> goddess_ishtar: if I were to do that one I would start with "grep -ril house src/" 😄
08:17:22 <merni> but I agree with pickpacket in that I find the best way to find where to start is often searches and then just following code paths until I find what I need 😆
08:17:51 <merni> also worth noting that github.com's code search is not comprehensive
08:18:44 <goddess_ishtar> tbh most of it is the fact that I've never really worked on anyone else's code before, much less a huge project like this
08:19:53 <merni> even if you do something silly, people here aren't rude :p
08:27:10 <kuhnovic> You will have many wtf-is-this-moments, but things will start to make sense when you work with them. There's really only one way and that is the hard way 😉
08:28:30 <kuhnovic> merni: And this is very true. At least as long as you don't create PRs full of AI generated code that you don't understand yourself.
08:32:40 <kuhnovic> Not trying to discourage you from using copilot, it's a great tool. But some people use it to generate code without understanding what it does and why it's good code (or bad, which is also quite likely). Use it as a learning tool, not as a way to replace your own brain 🙂
08:35:30 <goddess_ishtar> nah I'd never use that sort of thing
08:40:17 *** akimoto has quit IRC (Remote host closed the connection)
08:47:10 <kuhnovic> goddess_ishtar: It's a tool, not cocaine 😛
08:48:34 <goddess_ishtar> hey, I don't judge
08:48:34 <goddess_ishtar> whatever gets that commit in the repo
08:50:00 <_zephyris> Have look around using the repo search on the github website, super useful.
08:50:07 <_zephyris> That's how I found bits to poke
08:55:46 *** akimoto has joined #openttd
09:18:29 <peter1138> Hmm, should I make GRFv9 AND GRFv10?
09:21:19 <Rubidium> wait what... skipping GRFvA .. GRFvF ?!?
09:26:33 <andythenorth> so OpenTTD 15....grf vN
09:26:45 <andythenorth> and something about wallclock grf var or strings
09:31:22 <truebrain> GRFvF, that reads funny 😄
09:33:43 <Rubidium> I don't think GRFv\b15 would be much better
09:37:36 <andythenorth> looking if there's already a wallclock PR for grfs
09:38:14 <andythenorth> haven't had coffee yet, 99% chance I'm looking wrong
09:41:07 <pickpacket> andythenorth: I bet you look alright. Maybe a bit tired
09:43:21 <truebrain> Nice one pickpacket 😄
09:43:44 *** nielsm has quit IRC (Ping timeout: 480 seconds)
09:53:18 <peter1138> Hmm, should I document all the Extended Bytes that are now Words? (all of them)
09:54:06 <peter1138> I'm also removing properties.
09:55:11 <peter1138> case 0x1D: { // Refit cargo
09:55:12 <peter1138> if (_cur.grf_version >= 9) return CIR_REMOVED;
10:01:17 <peter1138> Remove property 1F for aircraft right? :p
10:11:31 <andythenorth> is it implemented in OpenTTD? 😛
10:18:14 <peter1138> NML already removed it.
10:19:26 <andythenorth> have I crashed the newgrf wiki 😛
10:19:36 *** orudge has quit IRC (Ping timeout: 480 seconds)
10:19:36 <peter1138> What are you doing to it?
10:21:15 <peter1138> So far NML has already removed everything I'm removing.
10:22:26 <peter1138> Ah, except indstries. What does "replaced_by" do?
10:34:04 <peter1138> Okay, have I broken FIRS?
10:36:37 <peter1138> It's less likely than me doing so :-)
10:36:50 <truebrain> yeah, you need to be an active dev to break things 😄 Sorry 😛
10:37:15 <peter1138> Hmm, maybe we could scan for Act8 before everything else, just to get the grf_version in advance?
10:37:38 <peter1138> It can stop once it's found it, so it's not going to have to scan the whole file.
10:38:02 <andythenorth> there's no metadata we can put it in?
10:38:14 <peter1138> The metadata is in Act8.
10:38:26 <peter1138> Act8 says "this file is GRFv X"
10:38:40 <peter1138> But some other actions are permitted before it.
10:38:51 <peter1138> Which means the version is not yet known.
10:39:09 *** kuka_lie has joined #openttd
10:40:14 *** Emru has quit IRC (Quit: Gateway shutdown)
10:45:00 <peter1138> Never a problem yet because all the changes happen to not be in the places that can be used.
10:53:24 <peter1138> Oh, with those removals regression tests don't break either \o/
11:02:13 <truebrain> does that also offer a solution for translations? I know little about NewGRFs, and nothing about translations therein, I just remember people talking about it needing a GRF bump to do properly 😛
11:02:45 <peter1138> truebrain, no but that's a reasonable should.
11:03:05 <peter1138> What would be needed for translations?
11:03:28 <peter1138> Perhaps it just needs a well-defined-by-the-author ID (label?)
11:03:34 <truebrain> I really don't know the details .. just something about translations being updatable without the actual GRF content being updated
11:03:53 <peter1138> There is partial support for external translations.
11:04:06 <peter1138> Which I'd forgotten (or didn't know) about.
11:04:33 <peter1138> But with NML all the IDs are dynamic, so ensuring they don't change is not feasible.
11:06:23 <truebrain> it is very ugly code 😛 Lot of hardcoded undocumented "let's just read an action like this" 😄
11:06:52 <peter1138> Just writing that in the right place ;)
11:06:54 <truebrain> owh, it is possible the translation talk was about a new container version more than a new GRF version; again, I know too little about this 😛
11:07:27 <truebrain> lastly, just so I know what to expect in terms of BaNaNaS: if that NML patch hits, it would mean all GRFs created by that NML are not compatible with OpenTTD 14 and older, right?
11:11:56 <peter1138> It would because NML doesn't do backwards compatability generation, only its current version.
11:12:20 <truebrain> cool; not a problem, but we can help users out in BaNaNaS, telling them this during upload
11:12:32 <truebrain> as in, that you have to add a restriction like `>= 15.0` in the compatibility stuff 🙂
11:12:52 <truebrain> just so it doesn't show up for OpenTTD 14 users, which will complain about it not working, etc 😛
11:14:13 <peter1138> Cool, it doesn't build any more.
11:14:37 <peter1138> Oh yes, I was busy reviewing my changes to create the changes doc, and didn't recompile lol.
11:15:24 <andythenorth> string translation table? 😛
11:16:22 <peter1138> Not a translation table. But something that gives a static ID.
11:16:40 <truebrain> from my perspective, ideally, translations would be a separate file from the GRF. That would allow updating them, both in BaNaNaS and in-game, so much easier.
11:17:35 <peter1138> So it's already possible with Action 13 to translate another NewGRF. But it's still a separate NewGRF that has to be created.
11:17:38 <peter1138> And the ID problem.
11:18:01 <peter1138> So yeah, maybe just a text format, like GS lang files are.
11:18:19 <truebrain> and compile them on first load?
11:19:02 <peter1138> Probably not even that. Loading a text file straight in.
11:19:25 <peter1138> A mighty frosch123 was awoken :D
11:21:10 <frosch123> Yes, I get NML notifications: )
11:32:15 <andythenorth> GRF lang files similar to GS lang files would be a very good solution
11:32:35 <andythenorth> for GRFs using NML it would be minimal change
11:33:40 <peter1138> So it would require the addition of a text-based string ID. On the NewGRF side that could potentially be defined as just another language.
11:34:04 <peter1138> LANG=en string="'lo Bob", LANG=label string="STR_LO_BOB"
11:34:21 <peter1138> That way the Act4 format doesn't drastically change.
11:35:27 <peter1138> And then the translation file would be "LANG=fr" and "STR_LO_BOB :Salut Bob"
11:40:09 <peter1138> I guess NML already uses "STR_LO_BOB :'lo Bob" to define the English strings?
11:40:11 <andythenorth> what was the thing I was obsessed with?
11:40:28 <andythenorth> there were zero pitchforks, so I've forgotten it all
11:40:48 <andythenorth> peter1138: yes, format is ~identical to GS
11:40:55 <andythenorth> give or take .lng extension
11:41:19 <peter1138> Is that because nobody is using your new cargo layout?
11:41:38 <peter1138> Like it took us a while to find cases that POTABLE/NON_POTABLE broke things.
11:41:56 <andythenorth> possibly I didn't implement it in Horse yet 😛
11:42:32 <peter1138> The problem is all the vehicle sets using "is the class CC_BULK" instead of "does the class have CC_BULK"
11:42:55 <andythenorth> $someone should update the nml docs eh
11:43:03 <andythenorth> to give an appropriate example
11:43:59 <peter1138> What's the highest property number so far...
11:44:23 <peter1138> Could we encode size information into the property number?
11:46:14 <peter1138> Nah, seem a bad idea.
11:47:43 <peter1138> Property description table? Fixed-size properties only need to be defined once. Variable-size properties get a length indicator?
11:48:52 <peter1138> Yeah encoding is no good, we are already up to 0x32.
12:02:19 <peter1138> Ah yes, I need to finish off the property changes list.
12:07:09 <peter1138> Okay seems it was just rail/roadtypes.
12:07:17 <peter1138> And these are mostly just for consistency.
12:08:27 <peter1138> The variable size industry cargo lists seem a bit fragile to me.
12:09:04 <peter1138> Basically all the label-based stuff still requires you to know if that label is present.
12:09:28 <peter1138> For industries this is "likely" because most of the time you are defining the cargo types as well.
12:10:02 <peter1138> Railtype / Roadtype has the extra compatibility lists which confuses me, but does the job I suppose :D
12:14:19 <peter1138> Hmm, scanning for Act8 before anything else probably makes sense, it makes the creation tooling simpler and avoids the need for _glx_'s suggestion of a hard-coded action to disable.
12:21:54 <peter1138> Although... why would you want to use any actions (other than 14, which I've not touched) before the Act8?
12:23:55 <michi_cc> peter1138: Well, e.g. media\baseset\orig_extra\orig_extra.nfo wants to 🙂
12:30:39 <_glx_> peter1138: Would still need disabling for older versions, as they won't search for act8 and may encounter stuff before it
12:45:28 *** peter1138[d] has joined #openttd
12:45:28 <peter1138[d]> Does disabling after act8 cause issues?
13:04:35 <_glx_> Looking at the diff it seems nml always put act8 first, then the version checks if any
13:07:08 <_glx_> Oh it does because we start with `grf` block in nml files
13:08:05 *** kaomoneus has joined #openttd
13:08:06 <kaomoneus> Hi folks! I've just tried feature minutes-per-year. Looks like your did a great job last year. Here is a question though, can I also scale incomes per single transfer? E.g. I bought a bus for ~$7k, and it gets like $100 per a single transfer on quite a short distance. Which actually means, that gonna be paid back in less than a week. Could we make it to be paid back like in original settings
13:08:06 <kaomoneus> somewhat between 1-3 years?
13:19:41 *** Flygon has quit IRC (Remote host closed the connection)
13:55:48 <andythenorth> kaomoneus: yes, set the game mode to 'calendar', not 'wallclock'
13:56:46 *** gelignite has joined #openttd
14:01:57 <talltyler> The new time scale settings intentionally do not affect the economy, unlike your slow time patch 🙂
14:06:38 <talltyler> For a slower game balance, you might try using the Base Costs GRF to increase vehicle prices.
14:25:24 <_zephyris> Any make gurus around? I'm trying to make a general rule for making nml files from pnml files using a python script...
14:25:24 <_zephyris> ALTERNATES = "8" # 8, 8ez, 32 or 32ez
14:25:24 <_zephyris> baseset/%_$(ALTERNATES).nml: baseset/%.pnml templates/nml_preprocessor.py
14:25:24 <_zephyris> python3 templates/nml_preprocessor.py baseset/%.pnml $(ALTERNATES)
14:25:24 <_zephyris> This gives me the error: `makefile:2: *** mixed implicit and normal rules. Stop.` But I really can't see why!
14:51:26 <peter1138> _glx_, hmm, so the act8 in NML depends on where it is in the NML file?
14:52:10 <_glx_> yes, everything in nml is done in parsing order
14:54:34 <_glx_> just moving the version check before `grf` block in station example
14:55:41 <peter1138> So we'd need NML to conditionally output technically GRFv2 files until the Act8 is emitted.
14:56:45 <peter1138> Or change action 7/9 in a way that the action itself is still compatible.
15:00:10 <peter1138> But NML/everything would still need to output in the compatible format until later.
15:00:18 <peter1138> How about not caring too much :S
15:01:36 <_glx_> easiest solution to me would be to output static GRFv2 act9+actB as first sprites, but didn't really look at it
15:02:53 <peter1138> But that still requires the Act8 to come early in the file, before the any other test.
15:03:01 <peter1138> (other than the hardcoded test)
15:03:18 <_glx_> (and really a version check can be done in a single act9, not like nmlc outputs it with 3 extra actD
15:04:39 <peter1138> Ok, ActB isn't changed.
15:05:15 <peter1138> ActD isn't changed either.
15:05:50 <peter1138> Act6 is affected by the extendedbyte to word change.
15:06:56 <peter1138> So Act6 and Act7/9 are problematic.
15:08:48 <peter1138> The spec explicitly states that container version and grf version are not related
15:08:59 <peter1138> So bumping the container version doesn't help.
15:11:51 <peter1138> Hmm, does NML prevent other actions from appearing before the action 8.
15:17:56 <peter1138> Hmm, does NML have a global I use to test if the Act8 has been output yet?
15:19:20 <peter1138> The hardcoded Act9+B wouldn't make any other Act7/9/B before the Act8 work, so IMHO is not a usable solution.
15:22:56 <_glx_> but it would just validate grf tries to load in GRFv9 aware openttd
15:23:26 <_glx_> anything after this hardcoded check will be fine using v9
15:23:48 <peter1138> Only if it's after the Action8.
15:24:24 <_glx_> oh right, I forgot the version is unknown before act8 and it's assumed to be v2 compatible
15:27:52 <peter1138> Therefore I'm looking to see if I can make Acgt6/7/9 output the old format before Act8.
15:28:23 <peter1138> Oh, did I even change Act6...
15:28:59 <peter1138> Ah yes, grfv9 means it doesn't need to insert the 0xFF
15:30:18 <peter1138> And of course grfv9 means that the offsets that action6 needs to be modify are different.
15:30:36 <peter1138> Maybe action 6 is not needed before Act8. Why am I looking that that one?
15:30:45 <peter1138> Where's the list of allowed actions :D
15:30:52 <michi_cc> Is there any actual need to have the actions before the act8? OTTD will check and report an unknown GRF version anyway. So GRFv9 could just require act8 to be the first action (with maybe act14 before). You don't get to provide a custom error message, but is it needed?
15:31:03 <peter1138> > Actions 6, 7, 9, B, C, D (except resource management sprites), 10 and 14 are valid before an action 8.
15:31:11 <peter1138> michi_cc, that's mainly what I was wondering.
15:32:34 <_glx_> hmm but nmlc happily compile any nml without needing act8 (that way you can combine multiple NFO into one in another stage
15:33:17 <_glx_> most regression tests rely on that
15:33:29 <peter1138> Okay, so any "is it before act8" test isn't going to work.
15:34:11 <michi_cc> So just tighten up the allowed action list for GRFv9?
15:34:14 <peter1138> I think I asked above, why do sets disable themselves before the Act8?
15:34:28 <_glx_> only solution would be also changing container version
15:34:36 <peter1138> What happens in the Act8 that means they can't do the Act7/9/D after the Act8?
15:34:50 <michi_cc> TTDpatch might not have had a good error message maybe? IDK.
15:35:27 <michi_cc> And then it was just cargo culted.
15:35:38 <peter1138> If the spec says "With GRFv9, Action8 MUST be the first action", what's the downside?
15:36:07 <peter1138> There's no need for weird backwards compatibility. NML doesn't (but could try) to enforce it.
15:36:29 <michi_cc> You can't provide a custom error message for an older, incompatible OTTD version. In fact, as we sort it out in the info stage, OTTD might not even allow adding it to the NewGRF config.
15:36:33 <peter1138> Readers that don't understand GRFv9 will see the Action8 that says v9 and will stop.
15:37:26 <_glx_> upgrading container to v3 for GRFv9 could solve the issue
15:37:26 <peter1138> If info/scan sees the Act8, then that is "valid"
15:38:17 <peter1138> But! The scan would see the Act8 that says it's GRFv9, and then say "This isn't compatible"
15:38:18 <michi_cc> GLS_FILESCAN looks at Act8 and Act14 and ignores everything else.
15:39:39 <peter1138> _glx_, but if you use NML to output NFO, there's no control over the container that way.
15:42:17 <michi_cc> Hmm `SkipActA` could be a problem in old OTTD versions. It reads num_sets to know how many sprites to skip.
15:47:08 <peter1138> But only if Act A is before Act 8
15:47:21 <Rubidium> what would container 3 solve? Is the primary thing: container v3+ allows GRFv9+? Will grfcodec then prevent encoding GRFv9 in container v1/2, and GRFv8- in container v3+?
15:48:48 <michi_cc> peter1138: An unsupported GRF version will not stop the file scan in current versions though.
15:49:37 <peter1138> I could undo that change.
15:49:38 <michi_cc> Just indirectly if it leads to an out-of-boudns read.
15:49:52 <peter1138> It's not super necessary.
15:50:28 <peter1138> Rubidium, I think container v3 would have to move the grf version to a header in the container, so that it is known immediately.
15:50:50 <_glx_> hmm and setting bit 7 of action type for v9+ ?
15:51:44 <_glx_> 9654 and 9655 should take care of that
15:51:58 <peter1138> Act 12 as well then.
15:52:10 <peter1138> Basically anything that needs to skip real sprites cannot be changed?
15:53:02 <peter1138> How about not caring all that much?
15:53:11 <peter1138> The NewGRF isn't going to work.
15:53:58 <kaomoneus> talltyler: OK, if I got right town growth rate also regulated by economy time. Is here any way to scale it as well?
15:54:45 <_glx_> the idea is to spilt economy and calendar so economy is never affect by calendar speed
15:54:47 <peter1138> michi_cc, It will stop at ScanInfo, won't it?
15:55:26 <peter1138> Only the Safe scan won't, but the safety scan is "rare" as I think that's just for static NewGRFs.
15:55:41 <peter1138> You need to manually fiddle with configs to set them up anyway.
15:55:41 <_glx_> /* GLS_INFOSCAN only looks for the action 8, so we can skip the rest of the file */
15:55:41 <_glx_> _cur.skip_sprites = -1;
15:55:56 <_glx_> yup it should stop at action 8
15:56:19 <peter1138> And with my changes it does read the version during SafeChangeInfo, though doesn't current stop if it's invalid, I can add that.
15:57:40 <peter1138> Town and industry *production* can be scaled separately.
15:57:46 <_glx_> we could assume only some 7/9/B/D may appear before 8
15:58:25 <peter1138> THe rules say that Act8 must appear before ActA, so.
15:58:57 <michi_cc> _glx_: You're right. I missed that line
15:59:14 <peter1138> And if we say that a GRFv9 file must have Act8 as the first action (regardless of whether NML enforces it) then old OpenTTD versions will reject the file without having parse anything else.
15:59:34 <peter1138> (We could allow Act14 as that isn't changed)
15:59:47 <peter1138> Can Act14 appear after Act8, or will it be skipped?
15:59:51 <michi_cc> If we want to keep the "skip rest of file", act14 would still have to come before act8.
16:00:26 <michi_cc> "This scanning stops when encountering an action 8, thus action 14 needs to appear earlier in the GRF."
16:01:03 <peter1138> We can "enforce" act8 being first (or at least only after act14) by making OpenTTD refuse to load a v9 file if there are other actions before it.
16:01:13 <andythenorth> kaomoneus: town growth rates can be controlled via GS
16:01:16 <peter1138> So NML/GrfCodec could allow making a file that doesn't work. Hmm.
16:02:16 <peter1138> As there are already options to scale production, a separate setting to scale growth could be allowed?
16:02:47 <peter1138> That wouldn't conflict with GS control.
16:02:50 <michi_cc> Well, GRF authors can't really miss this unless they don't test at all, so people will learn 🙂
16:03:20 <peter1138> scale growth == scale when it happens.
16:04:16 <peter1138> Excellent, that is ALREADY ANY OPTION.
16:04:29 *** Wormnest has joined #openttd
16:04:38 <andythenorth> possibly there's a case for 'very slow'
16:04:42 <andythenorth> I haven't looked what the values are
16:05:22 <peter1138> Well, when you've scaled minutes-per-year from 12 to 10080...
16:11:23 <xarick> github copilot, pressing Tab writes the suggestion instead of adding tab space
16:38:20 *** gelignite has quit IRC (Quit: Stay safe!)
17:02:08 <_zephyris> _zephyris: If anyone's wondering, it's the syntax of the `ALTERNATES` variable... Setting it using eg. `ALTERNATES = 8 # comment here` includes the space before the comment as part of the variable value.
17:05:48 <kaomoneus> andythenorth: So looks like when we set "Slow" we only reduce rate twice. But when we can increase year minutes from 12 to 10k (like 1000 times). There is a TOWN_CUSTOM_GROWTH flag though. Is here any grf extension, which can also reduce growth rate like 1000 times?
17:12:26 <andythenorth> the game doesn't do well with extreme multiples of original values
17:18:48 <kaomoneus> andythenorth: What GS means?
17:26:06 <peter1138> Why are these numbers not sequential?
17:27:04 <peter1138> Hm, I guess they are also mapped somewhere.
17:29:35 <peter1138> Ok, so they are defined in the language files.
17:30:22 <peter1138> So could we reserve language ID 0x7E for the string code?
17:30:51 <peter1138> (0x7F already has a meaning)
17:39:44 <peter1138> Hmm, then we need some way to find and load translation files.
17:41:12 <peter1138> This is all separate from GRFv9 really.
17:44:34 *** kaomoneus9104 has joined #openttd
17:44:34 <kaomoneus9104> andythenorth: Ah.. all ot seems to be complicated
17:44:47 <andythenorth> It's not a one line change, no
17:54:53 <Rubidium> peter1138: they're not sequential because someone once thought it be useful if it were the countries calling code, e.g. ++31 => Netherlands, ++39 => Italy
17:56:22 <merni> though, why is US English at zero? I would've thought UK would be at zero considering presumably TTD's original language was UK English
17:56:35 *** gelignite has joined #openttd
17:59:39 <Rubidium> UK English is the one and only English ;)
18:04:15 <pickpacket> I'm probably more of a middle/global English speaker, though
18:17:49 <kaomoneus9104> andythenorth: I'm rather concerning by making out of box year pace scaling solution preserving as much vanilla game balance as possible. As talltyler mentioned once I've done a SlowPace patch, but it seems that it didn't match the mainstream ideas, so it is complicated to maintain such a patch. So I'm trying to understand how you guys see the possible ways to integrate this feature.
18:18:32 <andythenorth> is it solved in JGRPP?
18:19:49 <peter1138> IMHO GS's town growth control is for changing the behaviour.
18:20:42 <peter1138> Scaling it is already vanilla feature, but the range could perhaps do with changing.
18:21:31 <peter1138> So where currently there's 4 settings (and none), having a much wider range to cope with the wide range of wallclock 'scales' would make sense?
18:23:47 <kaomoneus9104> andythenorth: Afaik no
18:24:53 <andythenorth> probably what peter1138[d] said then 🙂
18:25:21 <xarick> lalala, I'm here still trying to solve my rivers
18:25:55 <peter1138> Why would you fork OpenTTD 12.x?
18:27:42 <xarick> are trees placed during a generating world tile loop ?
18:28:11 <LordAro> peter1138: an existing fork*, i guess?
18:28:20 <xarick> before the actual tree generating part
18:28:59 <_glx_> peter1138: because conficts when applying changes on 13.x ?
18:29:31 <peter1138> Ooh, I misread "there is a fork" as "This is a fork"
18:29:33 <merni> isn't this the fork that was used for that one livestream
18:29:39 <peter1138> Yeah, existing fork makes more sense.
18:29:54 <peter1138> But we all know how well the last effort went :D
18:30:53 <peter1138> "This is easy, it's just a few lines" to, well... not that.
18:31:31 <_glx_> increase player count is a rabbit hole (a very deep one)
18:32:05 <xarick> I have a funny question... what triggers a tree to exist? it's not OnTick_Trees, right?
18:32:40 <xarick> or am I inventing stuff
18:32:45 <LordAro> how have you spent the last 3+ weeks in the tree generation code without understanding where trees are actually created?
18:33:52 <_glx_> look for `PlantTreesOnTile`
18:34:57 <xarick> what I changed was during trees generated by world gen
18:35:17 <xarick> my english today is abysmal, sorry
18:38:09 <_glx_> usually the method is find the function modifying the map (something like `MakeXXX`) then find callers, and callers' callers
18:40:54 <xarick> alright I figured it out, it's via OnTick_Trees which doesn't happen during world gen. So RunTileLoop in world gen won't create trees.
18:43:15 <xarick> let me try glx approach
18:44:55 <pickpacket> peter1138: the fork was made when 12 was the latest version, and it hasn't been updated since
18:45:38 <pickpacket> There's a bunch of other changes too. I don't think it's worth the effort to try to rebase it on current version.
18:46:02 <_glx_> and going up I see `GenerateTrees()` called from `_GenerateWorld()`
18:47:17 *** tokai|noir has joined #openttd
18:47:17 *** ChanServ sets mode: +v tokai|noir
18:48:24 <_glx_> VS also has a tool to directly show the call tree for a function
18:54:11 *** tokai has quit IRC (Ping timeout: 480 seconds)
18:59:00 <xarick> RunTileLoop doesn't do it, is what I was looking for
19:01:24 <xarick> I needed to ensure I only needed `IsCoast` on `TestRiverConnection` checks.
19:05:34 <talltyler> kaomoneus9104: Others have already said this, but you might look into extending the range of town growth speeds. (Similar for any other balance changes you want to make — do them separately from each other as part of existing settings where possible, rather than in one big Slow Pace feature)
19:16:59 <kaomoneus9104> 1. The whole idea is to separate all affected settings. That makes sense.
19:16:59 <kaomoneus9104> Reducing town growth rate like with factor x0.001 will also require some serious changes (
19:19:22 <talltyler> Town growth code is a mess 🙂
19:25:36 <peter1138> Oh, something is broked.
19:28:20 <peter1138> AssertionError: Expected 167 bytes to be written to sprite, got 168
19:28:34 <peter1138> firs not compiling any more. So I have done something bad.
19:29:08 <LordAro> is it "try to compile firs" ?
19:29:10 <peter1138> And I don't know where :D
19:31:01 <johnfranklin> Everyone is talking about timtam, but I don't see any in Tesco (or I overlooked)
19:44:54 <peter1138> This ... fragile :D
19:45:44 <peter1138> Hmm, does NML auto-generate strings as well...?
19:50:23 <peter1138> 60 * 72 04 0A FE \wx0004 \wxDCD4 "STR_STATION" 00 "STR_IND_BLAST_FURNACE" 00 "STR_IND_BODY_PLANT" 00 "STR_STATION" 00
19:50:29 <peter1138> 61 * 47 04 0A FE \wx0003 \wxDCD7 "STR_STATION" 00 "STR_IND_BREWERY" 00 "STR_STATION" 00
19:50:42 <peter1138> Lots of STR_STATION :S
19:54:41 *** akimoto has quit IRC (Remote host closed the connection)
19:55:02 <johnfranklin> So something like
19:55:02 <johnfranklin> NML File: string(STR_1, string(STR_2), string(STR_3))
19:55:02 <johnfranklin> is an NML feature?
19:55:51 <johnfranklin> hmm, how to express it, such modular strings behaves like switch-blocks...
20:04:37 <andythenorth> it's mildly irritating that I have to re-implement a copy of town growth in my GS 😛
20:04:56 <andythenorth> I can set 'normal' rate from GS, or my own rate, but I can't just apply a factor
20:05:29 <andythenorth> (mentioning only because growth rates came up)
20:08:22 *** moll has quit IRC (Read error: Connection reset by peer)
20:10:33 <xarick> hmm... a conflict incoming
20:25:07 <goddess_ishtar> talltyler: no kidding
20:26:45 <xarick> what's the difference between
20:26:55 <xarick> WITH_ASSERT and _DEBUG
20:27:18 <xarick> can there be a debug without asserts enabled?
20:28:51 <_glx_> peter1138: yes NML can combine multiple strings into one if the use {STRING}
20:29:19 <_glx_> (because it's simpler than trying to handle text stack)
20:30:40 <_glx_> xarick: no, assert() is always present with _DEBUG (it comes from system headers)
20:32:04 <_glx_> then for !_DEBUG we have our own optional assert() implementation (available with WITH_ASSERT)
20:34:42 <xarick> RelWithDebInfo grays out that code
20:35:00 <_glx_> yes WITH_ASSERT is only for non debug
20:35:16 <_glx_> and _DEBUG is only for debug builds
20:39:41 <_glx_> but looking at cmake stuff, WITH_ASSERT is also set for debug builds, unless it's from a release branch with OPTION_USE_ASSERTS defaulting to off
20:48:28 <xarick> GitHub copilot has its uses
20:49:23 <xarick> that's a description I could copy paste
20:49:24 *** kuka_lie has quit IRC (Quit: Lost terminal)
20:50:01 <xarick> but text isn't selectable 😐 what a missed opportunity microsoft
20:50:27 *** gelignite has quit IRC (Quit: Stay safe!)
20:57:08 <duckfullstop> hopefully the last silly question I'm going to ask: is openttd known to have issues traversing directories across file systems (specifically, say, if `/save/autosave` is submounted)?
20:58:21 <xarick> I think I'm being overly cautious with this ordeal, and yet I still find issues 😦
20:59:52 <peter1138> 48 * 1205 04 0A FF \wx005D \wxDCCF "Arable Farm" 00 "\80 Manor" 00 "Assembly Plant" 00 "\80 Automotive" 00 "Basic Oxygen Furnace" 00 "\80 Furnace"
20:59:58 <peter1138> 57 * 1547 04 0A FE \wx005D \wxDCCF "STR_IND_ARABLE_FARM" 00 "STR_STATION" 00 "STR_IND_ASSEMBLY_PLANT" 00 "STR_STATION" 00 "STR_IND_BASIC_OXYGEN_FURNACE"
21:00:23 <peter1138> I... don't know why these are STR_STATION.
21:01:38 <goddess_ishtar> ah, finally figured it out
21:02:46 <goddess_ishtar> it appears that the worldgen code just calls the town growth function repeatedly to generate the initial town buildings and roads
21:03:43 <peter1138> STR_STATION :{STRING} {STRING}
21:03:46 <peter1138> STR_STATION_FARM_1 :Manor
21:04:17 <talltyler> goddess_ishtar: I have tried and failed three times to disentangle growing roads and growing houses, to make two separate buttons in Scenario Editor
21:05:30 <peter1138> I'm not sure why you'd want to separate those, tbh.
21:06:37 <peter1138> But probably the least resistant path is to use the existing flow but either prohibit roads or prohibit houses.
21:06:52 <goddess_ishtar> presumably to easily grow houses over a custom street layout
21:07:15 <peter1138> That happens already when towns are prohibited from building roads.
21:08:22 <goddess_ishtar> "in the scenario editor"
21:08:53 <goddess_ishtar> which I'm pretty sure forces the town to always be able to build roads
21:15:35 <peter1138> Mmm, NML internally names the generated string "STR_STATION".
21:16:02 <peter1138> I'm not sure if that could be changed, or what it could be changed to.
21:16:43 <_glx_> nmlc just translates `string(STR_STATION, string(STR_TOWN), string(STR_STATION_FARM_1))` into `"\80 Manor" 00`
21:17:20 <peter1138> Yes, that's fine. I guess I'd like it to 'mangle' the name as well, instead of using the first string's name.
21:17:29 <_glx_> it's STR_STATION and it's param, so still STR_STATION
21:18:17 <peter1138> Currently, yes. But that's not suitably unique for external translations.
21:19:03 <_glx_> should be not too hard to improve, let me try
21:20:31 <peter1138> (Although _ doesn't guarantee it'll be unique)
21:21:05 <peter1138> Apparently that code is wrong./
21:21:58 <peter1138> Ah, I guess it's not a plain string.
21:22:31 <peter1138> I hate loosely-typed languages, I have no idea what type it is :p
21:27:09 <peter1138> Never mind, it's nothing as simple a list like that.
21:29:03 <_glx_> oh changing self.name is wrong anyway because it's used for --nml
21:30:01 <peter1138> Can add another property.
21:33:15 <_glx_> and of course not directly testable with just nml repo because nothing uses the string() concatenation
21:43:44 <peter1138> error(FATAL, string(STR_ERR_INCOMPATIBLE_SET, "${incompatible_grf.grfname}"));
21:43:51 <goddess_ishtar> peter1138: I love loosely-typed languages, JSFuck is so useful to code in
21:44:05 <peter1138> I guess that's a literal string and not translatable.
21:45:47 <_glx_> yeah actionB are not overridable I think
21:47:32 <peter1138> 57 * 3060 04 0A FE \wx005D \wxDCCF "STR_IND_ARABLE_FARM" 00 "STR_STATION_STR_TOWN_STR_STATION_FARM_1" 00 "STR_IND_ASSEMBLY_PLANT" 00 "STR_STATION_STR_TOWN_STR_STATION_AUTOMOTIVE" 00 "STR_IND_BASIC_OXYGEN_FURNACE"
21:47:41 <peter1138> Okay, that is... a bit clumsy but...
21:48:14 <peter1138> And technically no guarantee that it is actually unique.
21:51:11 <peter1138> The string contains a string code, so user translations are a bit iffy.
21:55:18 <peter1138> Well, because of the internal combining, the source language files are not exactly usable as a template for user translations.
21:57:26 <andythenorth> do we have a string extractor?
22:02:17 <andythenorth> can we just hash the strings in the default language?
22:02:26 <andythenorth> if they've changed between grf releases, they're outdated anyway
22:02:28 <andythenorth> and shouldn't be shown
22:02:41 <andythenorth> [brutal approach to translations]
22:03:03 <andythenorth> hash / compare also
22:03:06 <peter1138> The problem with that is when you have strings that are the same in English but different in other languages.
22:07:12 *** Extrems has quit IRC (Read error: Connection reset by peer)
22:16:55 *** Wormnest has quit IRC (Ping timeout: 480 seconds)
22:21:19 *** keikoz has quit IRC (Ping timeout: 480 seconds)
22:26:46 *** Extrems has joined #openttd
22:38:41 <goddess_ishtar> goddess_ishtar: and I think I've finally found the function responsible for actually building the house
22:45:39 *** liquidsnake0123 has joined #openttd
22:45:40 <liquidsnake0123> Hey Y'all, I just joined the discord so hopefully this is the correct channel to be posting this in. Please let me know if it's not. So, I'm a software engineering university student and for my research project I need evaluate the feasibility of turning OpenTTD into a simulator that allows researchers to test out decarbonization ideas.
22:45:40 <liquidsnake0123> What I need to do for one part of the project is account for the embodied carbon cost when you build a road.
22:45:52 <liquidsnake0123> Basically what this means is that in the game, every time the players builds a road a counter on the screen called "Embodied Carbon" goes up by a certain amount. It seems simple but I've been struggling with this for quite a while now.
22:46:07 <liquidsnake0123> I've got no Idea where to even start since the source code is so massive like I don't even know which files I should be editing and OpenTTD doesn't exactly lend itself to experimentation since after every code change I have to restart/ rebuild the game, there may be a better way out there though but I'm not sure. I'd greatly appreciate any help or advice with this since the project is supposed to
22:46:07 <liquidsnake0123> be challenging AND fun but I've been quite stressed about this.
22:46:07 <liquidsnake0123> Apologies for the long messages btw, I didn't want to leave anything out.
22:48:46 *** brickblock19280 has joined #openttd
22:48:46 <brickblock19280> liquidsnake0123: my experience with the openttd code is quite limited but I think you would want to look at the code for commands when it comes to triggering the increase of the counter
22:49:55 <liquidsnake0123> brickblock19280: I see, Where would I find that in the files ?
22:55:14 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
22:59:06 <brickblock19280> adding a function down here would probably be the correct spot for adding ECC to the counter
23:01:15 <liquidsnake0123> brickblock19280: Great thank you I'll have a look.
23:01:39 <brickblock19280> forgot to send that
23:02:11 <liquidsnake0123> What's this sorry ?
23:09:54 <brickblock19280> a part of the function which executes the command
23:09:57 <_glx_> yeah search for c->infrastructure.road changes
23:10:55 <_glx_> it's a counter for each roadtype parts per company
23:23:43 <liquidsnake0123> Thanks for the help.
23:24:15 <liquidsnake0123> I'll get to work on it and report back if I figure it out 🙂
23:46:14 *** nielsm has quit IRC (Ping timeout: 480 seconds)
continue to next day ⏵