IRC logs for #openttd on OFTC at 2025-01-21
            
00:00:15 <peter1138> Alright, shall I do a callback for colour remap?
00:24:44 <peter1138> CMake Error at /home/petern/src/openttd/cmake/scripts/CreateGRF.cmake:53 (message): NFORenum failed
00:24:47 <peter1138> Gee, thanks :p
00:29:21 <peter1138> //!!8bpp normal zoom sprite must appear first.
00:29:23 <peter1138> Ah, perhaps that.
00:29:33 <peter1138> Which is a lie.
00:33:29 <peter1138> Yeah, it was that.
00:34:08 <DorpsGek> [OpenTTD/OpenTTD] glx22 updated pull request #13310: Codechange: [Win32] Use language isocode for fallback font detection https://github.com/OpenTTD/OpenTTD/pull/13310
00:34:12 <DorpsGek> [OpenTTD/OpenTTD] glx22 commented on pull request #13310: Codechange: [Win32] Use language isocode for fallback font detection https://github.com/OpenTTD/OpenTTD/pull/13310#pullrequestreview-2563267385
00:34:30 <peter1138> Just need a slightly better way to bolt it onto the NFO.
00:35:15 <peter1138> As badges.grf is built with grf-py, I have to build it, decode it, copy the files to the right place, and strip the action 14 and 8.
00:35:18 <peter1138> But then it works.
00:38:05 <_glx_> like any change in openttd NFO
00:38:06 <peter1138> Hmm, now that that 32bpp->8bpp change is merged, maybe I can drop the 8bpp sprites.
00:40:18 <peter1138> Ah no, NFORenum still requires 8bpp.
00:44:28 <peter1138> Oh.
00:45:09 <peter1138> Approved but not merged.
00:45:35 <DorpsGek> [OpenTTD/OpenTTD] PeterN merged pull request #11602: Feature: Convert 32bpp-only sprites to 8bpp for 8bpp blitters. https://github.com/OpenTTD/OpenTTD/pull/11602
00:56:34 <DorpsGek> [OpenTTD/OpenTTD] rubidium42 approved pull request #13310: Codechange: [Win32] Use language isocode for fallback font detection https://github.com/OpenTTD/OpenTTD/pull/13310#pullrequestreview-2563280515
00:57:09 <DorpsGek> [OpenTTD/OpenTTD] rubidium42 merged pull request #13347: Codechange: use StoryPageID instead of uint16_t https://github.com/OpenTTD/OpenTTD/pull/13347
01:18:10 <peter1138> Oh dear.
01:22:49 <DorpsGek> [OpenTTD/OpenTTD] PeterN opened pull request #13349: Fix 7b091000b0: Missing 32bpp-to-8bpp sprites due to ZOOM_LVL_NORMAL changes. https://github.com/OpenTTD/OpenTTD/pull/13349
03:25:21 *** D-HUND has joined #openttd
03:28:43 *** debdog has quit IRC (Ping timeout: 480 seconds)
03:31:49 *** Wormnest has quit IRC (Quit: Leaving)
03:50:30 *** gnu_jj has joined #openttd
03:53:41 *** gnu_jj_ has quit IRC (Ping timeout: 480 seconds)
04:00:11 *** Flygon has joined #openttd
04:43:02 <DorpsGek> [OpenTTD/OpenTTD] eints-sync[bot] pushed 1 commits to master https://github.com/OpenTTD/OpenTTD/commit/b5b4531b7ae79000e5e55d63a2a137df48cdff6b
04:43:03 <DorpsGek> - Update: Translations from eints (by translators)
05:04:32 *** keikoz has joined #openttd
06:02:43 <DorpsGek> [OpenTTD/OpenTTD] rubidium42 approved pull request #13349: Fix 7b091000b0: Missing 32bpp-to-8bpp sprites due to ZOOM_LVL_NORMAL changes. https://github.com/OpenTTD/OpenTTD/pull/13349#pullrequestreview-2563550142
06:08:34 *** keikoz has quit IRC (Ping timeout: 480 seconds)
07:41:40 <andythenorth> well
07:44:26 <andythenorth> errors of sleeping occurred
07:51:49 <andythenorth> https://cdn.discordapp.com/attachments/1008473233844097104/1331169368318677074/image.png?ex=6790a395&is=678f5215&hm=0e7ce4d5126031b84d288f012c5b5200a999ce4d6dac3612c618a4a381ce4d0e&
07:51:49 <andythenorth> peter1138[d]: thanks 😄
08:30:49 *** D-HUND is now known as debdog
08:58:55 <DorpsGek> [OpenTTD/OpenTTD] PeterN merged pull request #13349: Fix 7b091000b0: Missing 32bpp-to-8bpp sprites due to ZOOM_LVL_NORMAL changes. https://github.com/OpenTTD/OpenTTD/pull/13349
09:05:14 <andythenorth> I had some stupid idea at 4am, can't remember why it seemed good
09:05:23 <andythenorth> wanted to give each badge an associated bool bit
09:06:09 <andythenorth> so we could effectively do (python example, but eh) `getattr("my_flags/the_best_flag", False)`
09:06:37 <andythenorth> and then allow the vehicle instance to store the bool, but the flag is on the vehicle spec
09:06:45 <andythenorth> have no idea what the point was
09:07:21 <andythenorth> think it was for caching arbitrary flags, instead of walking the consist constantly
09:07:41 <andythenorth> `horse_flags/consist_has_restaurant_car`
09:07:47 <andythenorth> or something
09:20:21 <peter1138> Seems like persistent storage would be more generic and flexible.
09:22:24 <peter1138> How can I set up a translation thing for badges.grf?
09:22:32 <peter1138> eints?
09:23:48 <peter1138> `STR_ROLE_RESTAURANT_CAR :Restaurant car`?
09:24:02 <andythenorth> seems eints-ish
09:24:12 <andythenorth> hmm, persistent storage, labelled by badges? 😛
09:24:26 <andythenorth> then could var 0x61 to neighbouring vehicle's storage
09:24:30 <andythenorth> which nobody needs ever
09:24:42 <andythenorth> for meaningless cross-grf cooperation
09:25:38 <peter1138> I think the idea would be to extend the start/stop callback to allow all vehicles in the chain to re-evaluate the chain and update their own storage.
09:26:00 <peter1138> But this could be circular :p
09:28:42 <peter1138> g.add(grf.Comment("Default Badges"))
09:28:47 <peter1138> return bytes((0x0C)) + self.data
09:28:47 <peter1138> ~~~~~~~~~~~~~~^~~~~~~~~~~
09:28:47 <peter1138> TypeError: can't concat str to bytes
09:28:48 <peter1138> Oops.
09:29:17 <peter1138> @
09:30:01 <andythenorth> did we find cases for persistent storage beyond "andythenorth has implemented a stupid loop unroll in grf" ? 🙂
09:30:55 <andythenorth> I can forsee lots of extra triggers being asked for, maybe that's ok, can always say no
09:30:57 <peter1138> Property 25 replacement?
09:31:15 <andythenorth> load/unload, servicing, railtype change, periodic etc
09:31:31 <andythenorth> "i need to record when the driver needs a nap"
09:31:39 <andythenorth> prop 25, the best of properties
09:31:48 <peter1138> I think it should be on consist-change.
09:32:06 <andythenorth> maybe this loop unroll is just a side quest
09:32:14 <andythenorth> we could agree to forget it exists
09:32:31 <peter1138> Yup, change you complex ID tests to use badges and be done ;-)
09:32:34 <peter1138> +r
09:32:36 <xarick> hi
09:33:05 <andythenorth> peter1138: have nearly done that
09:33:23 <andythenorth> I think I did measure Horse effect on FPS subjectively
09:33:40 <andythenorth> can't remember the results, but I think it cut FPS by 50% compared to vanilla vehicles
09:33:49 <andythenorth> not really science though
09:33:54 <andythenorth> maybe xarick could test it
09:34:40 <xarick> i know nothing about NewGRF, but couldn't iron horse trains that have similar properties except use the same engineID?
09:35:43 <andythenorth> I guess I'm hoping someone sets up tests and measures the effect of Iron Horse on performance 😛
09:35:56 <andythenorth> before we change anything without data
09:35:58 <xarick> from a perspective of an AI, they're all different engines :/
09:36:59 <andythenorth> that's because they're all different engines
09:37:23 <andythenorth> the AI is 100% accurate
09:37:28 <xarick> or maybe it's just a me-problem, I go through all engines to pick the "best"
09:37:35 <xarick> but 90% are clones
09:37:39 <andythenorth> yes, Iron Horse is designed to prevent "best"
09:37:56 <andythenorth> it's an offensive defense against min-maxing
09:38:12 <xarick> costs precious AI ops time :/
09:38:22 <andythenorth> it's a message to not min-max
09:38:50 <peter1138> Even so, an AI needs to be able to pick an engine.
09:39:01 <andythenorth> when the meta game is 'discover which engine the grf author thinks you *should* use' that gets old
09:39:05 <andythenorth> like 2048 gets old
09:39:18 <andythenorth> or hunting coins under cups
09:39:31 <andythenorth> AI should measure hp / ton
09:39:40 <andythenorth> and have a heuristic for that
09:40:21 <andythenorth> anyway sounds like 'no' from xarick 😄
09:41:04 <xarick> you could release an Iron-Horse redux
09:41:28 <andythenorth> already exists
09:41:51 <xarick> same iron horse, without the eye-candy variations
09:41:59 <xarick> where do i find it
09:42:17 <andythenorth> Grf parameter
09:42:40 <xarick> oh, so it was a me-problem after all 😐
09:45:08 <peter1138> Use the reduced roster option :)
09:47:25 <peter1138> Hide variants from AIs?
09:47:49 <peter1138> (Sorry all those authors using variants as a display tree)
09:48:39 <peter1138> andythenorth, there's a couple of variants even with the simplified roster.
09:48:41 <andythenorth> make it an AI param on the method call 😛
09:48:46 <peter1138> Dunno if that's intentional.
09:48:58 <andythenorth> maybe not, unless it's HST coaches
09:49:11 <peter1138> Farm Product Van
09:49:42 <andythenorth> yeah these are bugs
09:49:46 <andythenorth> and ore tippler
09:49:58 <peter1138> I need to update my IH. Everything is marked as power/steam :D
09:50:22 <andythenorth> my local branch has that 😛
09:50:28 <andythenorth> it was a test of badge compiling
09:50:30 <peter1138> Oh.
09:50:44 <peter1138> With badges included by default it's easier to see, heh.
09:51:38 <peter1138> Should the script API have a way to query badges on prototypes?
09:51:56 <peter1138> Eh, on things.
09:57:52 <andythenorth> yes
09:58:00 <andythenorth> hasbadge or hasbadges
09:58:37 <andythenorth> also everything in script is yak shaving, so it probably needs to know all the badges in current game
10:00:39 <peter1138> Can an API function return a list of raw strings...
10:05:14 <peter1138> locosage, have I misused `grf.Comment("Test")`? :)
10:05:25 <peter1138> Coffee is cold :(
10:08:47 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1331203835342884936/2025-01-21_10-06-52.mp4?ex=6790c3ae&is=678f722e&hm=d533022f3f6addd022c9f131405be69b92b952e59f4b9eca57b45e553147e723&
10:08:47 <xarick> what my poor AI does with Iron Horse 😦
10:09:42 <xarick> tests whether every wagon can be attached to every engine
10:10:05 <peter1138> 3 * 26 00 00 00 00 00 00 00 00 00 00 00 00 "Default Badges"
10:10:07 <peter1138> lolz
10:10:11 <peter1138> 3 * 15 0C "Default Badges"
10:10:14 <peter1138> Fixed it.
10:10:25 <xarick> does this per route
10:10:29 <xarick> very sad
10:11:59 <peter1138> I'll make a PR later.
10:12:25 <andythenorth> xarick: how intriguing
10:12:38 <andythenorth> O log(n) or something
10:12:42 <andythenorth> words
10:19:53 <peter1138> Wait...
10:20:02 <peter1138> You actually BUY every vehicle to test it?!
10:21:07 <peter1138> Wagon attach callbacl is, indeed, brutal for AIs, but...
10:22:11 <andythenorth> but wagon attach callback should also be deleted
10:22:25 <andythenorth> it's inappropriate for grf authors to be controlling that
10:29:21 <peter1138> It seems like you test wagon attach first though.
10:29:35 <peter1138> *xarick
10:30:44 <peter1138> Step one: find potentially suitable engines (hp/ton?), Step 2: try building and attaching them. If it succeeds, you can stop here, if it fails move on to the next best.
10:30:54 <peter1138> Possibly.
10:32:18 <peter1138> Ok, my database schemas are all in sync now.
10:32:42 <LordAro> oh yeah, that's a terrible idea
10:32:47 <LordAro> why would you do that
10:32:55 <LordAro> and why would you do it again for every route
10:33:43 <xarick> maybe I don't do for every route, my bad
10:34:04 <xarick> need to check my code again
10:35:21 <xarick> ah
10:35:28 <xarick> ::caches.CanAttachToEngine(wagon, engine, cargo, railtype))
10:35:31 <xarick> ok i cach it
10:35:37 <xarick> does once
10:35:48 <xarick> but since there's 100000000 engines... takes a while
10:36:59 <andythenorth> hmm
10:37:11 <LordAro> feels like you should be able to filter based on matching name/power/size/whatever stats if nothing else
10:37:15 <andythenorth> why not pre-provision the viable attachments?
10:37:34 <andythenorth> they could just be read in as data to the script
10:37:48 <andythenorth> calculating them in runtime *every time* seems overkill
10:38:11 <andythenorth> if you can write an AI to calculate all the possible combinations, surely you can dump that out to a data file?
10:38:47 <LordAro> AI's cannot write anything
10:38:52 <LordAro> -'
10:39:07 <andythenorth> they can log
10:39:15 <andythenorth> and log files can be parsed
10:39:35 <LordAro> i suppose arguably players don't know ahead of time what can and can't attach either
10:39:40 <LordAro> AIs can't read files either
10:39:51 <peter1138> I assume andythenorth means bake it into the AI.
10:40:06 <LordAro> that sounds exhausting
10:40:10 <peter1138> (Which is also a bad idea)
10:40:13 <andythenorth> I was a bit more agnostic
10:40:19 <andythenorth> it could be done on bananas
10:40:23 <andythenorth> or by a custom client
10:40:27 <andythenorth> or by parsing the source of grfs
10:40:38 <peter1138> Okay, there's no var 61 equivalent for houses?
10:40:55 <peter1138> I suppose it would be difficult because it might not be a house tile.
10:41:54 <peter1138> Maybe something like "count the number of houses within a radius have a specific badge"?
10:42:44 <andythenorth> nice idea
10:43:41 <xarick> <https://github.com/SamuXarick/LuDiAI-AfterFix/blob/master/Caches.nut#L142-L239>
10:43:42 <peter1138> Probably costly.
10:44:15 <peter1138> But potentially less costly than making each NewGRF work out how to do that.
10:44:37 <peter1138> I'm not sure if you would ever care about a specific direction.
10:45:14 <andythenorth> perfect is the enemy of good?
10:45:24 <andythenorth> ~circular radius seems enough?
10:45:36 <andythenorth> otherwise it might as well be an arbitrary polygon 😛
10:50:29 <peter1138> Well, could it cover any type of tiles?
10:51:37 *** D-HUND has joined #openttd
10:52:03 <andythenorth> Interesting idea 🙂
10:52:04 <peter1138> Test how many tiles in an area have a specific badge. Seems slow. More persistent storage?
10:52:29 <andythenorth> Pff 🙂 dunno
10:52:36 <andythenorth> Large maps though?
10:52:47 <andythenorth> Some kind of index?
10:52:53 <peter1138> town zoning/ class
10:53:02 <andythenorth> Hmm terrain badges?
10:53:05 *** merni has quit IRC (Quit: User went offline on Discord a while ago)
10:53:31 <peter1138> So very metadata.
10:53:55 <andythenorth> `biome/trees`
10:53:57 <peter1138> Remember ctrl-shift in the depot window?
10:54:02 <andythenorth> No
10:54:06 <andythenorth> Icons?
10:54:11 <peter1138> Quite.
10:54:20 <xarick> it's time for my static_cast PR
10:54:35 <peter1138> Oh dear.
10:54:52 <andythenorth> Terrain badges available to industry/house placer?
10:57:28 *** D-HUND has quit IRC (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
10:58:09 <_zephyris> andythenorth: Tree newgrf please!
10:58:42 <DorpsGek> [OpenTTD/OpenTTD] frosch123 commented on discussion #12339: Script API and Wallclock time https://github.com/OpenTTD/OpenTTD/discussions/12339
11:04:04 <peter1138> Okay, now I need a script to strip all 'actions' from the start until a comment.
11:04:22 <peter1138> Should I call grfcodec from python?
11:08:11 <peter1138> `sed -i '1,/0C "Default Badges"/d' sprites/badges.nfo`
11:08:13 <peter1138> Noice.
11:09:10 <_zephyris> Is there a list of badges needing icons yet?
11:09:42 <peter1138> https://petern.github.io/grfbadges-docs/badges/
11:09:55 <peter1138> I would like the steam and diesel smoke icons to be replaced.
11:10:21 <peter1138> These were created by upscaing the existing sprites that everyone uses, as they were at 1x scale.
11:10:30 <peter1138> Replaced by SVG versions, that is.
11:10:48 <peter1138> Everything else is created from SVG images.
11:11:01 <peter1138> I need to add the colour swatches :D
11:12:49 <peter1138> Oh yes, I was contemplating a callback for colour remapping badges.
11:13:20 <peter1138> Also badge icons can be different depending on feature. Maybe I should remove that.
11:14:24 <peter1138> My NML implementation doesn't support it.
11:19:52 <ahyangyi> This wouldn't interact with company colours, right?
11:20:58 <ahyangyi> I'm still working on my company colour switches and I think I'm not going to worry about RGB company colour for now.
11:26:01 *** D-HUND has joined #openttd
11:29:23 *** debdog has quit IRC (Ping timeout: 480 seconds)
11:30:17 <peter1138> ahyangyi, there's already a flag to apply company colour.
11:30:38 <peter1138> And you won't need to create switches because they'll be in the default badges.
11:31:09 <peter1138> Thing is, most things don't need a swatch, 1cc or 2cc is kinda irrelevant.
11:39:27 <ahyangyi> Whether most things don't need a switch is irrelevant when the feature I'm implementing asks for it...
11:40:17 <ahyangyi> Though I guess I can also use those advanced layout flags and duplicate the parent sprites to achieve that
11:42:06 <ahyangyi> I really don't feel like duplicating parent sprites though, there are already 2 or 3 childsprites in each parentsprite...
11:42:53 <ahyangyi> There's also an eviler plan to use a transparent catch-all parentsprite and turn everything else into childsprites, but I still need to develop that. It might make things easier though.
11:43:52 <peter1138> Oops, I meant swatch.
11:44:19 <peter1138> But if you're talking about layouts, then you're talking about something else.
11:45:24 <xarick> i tried to replace long with int64_t, it failed
11:47:13 <ahyangyi> Oh, my head autocorrects swatch into switch
11:47:54 <ahyangyi> swatch is that colourful watch brand?
11:48:03 <xarick> `long n = x + y * prime + _settings_game.game_creation.generation_seed;` I question this line of code...
11:48:17 <xarick> generation seed is an already large value
11:48:40 <ahyangyi> oh, danger of overflowing?
11:48:42 <xarick> so, i dunno what that long means
11:48:44 <xarick> yes
11:48:52 <ahyangyi> and signed integer overflow is UB, right?
11:49:00 <ahyangyi> let's change it into unsigned overflow
11:49:28 <xarick> also, the introduction mentioned something about generation seed being an int32
11:49:36 <xarick> but it's a uint32
11:49:49 <xarick> so... is this broken?
11:50:11 <ahyangyi> `long n = (long)((ulong)x + (ulong)y * (ulong)prime + (ulong)_settings_game.game_creation.generation_seed);`
11:50:14 <ahyangyi> probably overkill
11:50:56 <ahyangyi> And I think I'm (accidentally) cosplaying ChatGPT in terms of offering uninformed suggestions
11:57:57 <peter1138> Yeah, I misread switch as swatch in the first place, my bad :)
11:58:32 <peter1138> So... I don't really understand your origianl question.
12:00:26 <ahyangyi> Not really a question, just that I don't know how to be futureproof about RGB company colours, if I have to manipulate palettes with switches.
12:00:43 <ahyangyi> Of course it'd be ideal to eliminate those switches in the first place.
12:01:27 *** HerzogDeXtEr has joined #openttd
12:01:29 <xarick> okay this long is meant to mean int64_t in my view
12:01:58 <xarick> but i dunno if it's behaving like such
12:03:17 <peter1138> ahyangyi, what feature is this switch for?
12:03:29 <peter1138> Parent sprites suggest it's not vehicles :)
12:04:14 <ahyangyi> stations
12:05:16 <peter1138> So station sprites are 1CC or not.
12:05:30 <peter1138> If you are using a custom colour remap, it's not CC any more.
12:07:13 <peter1138> RGB CC is unlikely to happen anyway, it's over a decade old already.
12:07:25 <ahyangyi> And if I want to support both 1CC and "not CC", either I use a switch or I make two parentsprites and show/hide them depending on the parameters.
12:07:38 <ahyangyi> or I secretly emulate 1cc with "not CC"
12:07:50 <xarick> is it supposed to overflow?
12:08:55 <xarick> ((n * (n * n * 15731 + 789221) + 1376312589) & 0x7fffffff), with n being 431764103
12:09:05 <xarick> not even uint64_t would fit
12:09:33 <peter1138> It's a random noise function, it's meant to overflow.
12:10:04 <peter1138> I'm not sure why long was used though.
12:10:15 <ahyangyi> It probably wants to be unsigned during computation.
12:11:00 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1331234593507905586/image.png?ex=6790e054&is=678f8ed4&hm=21a8f80242195db42ff2999ca93431c62eed49e487534f68ad7dd3d268f57021&
12:11:16 <xarick> ah
12:12:59 <xarick> but then the mask
12:13:14 <xarick> is of a int32_t, but the seed is of uint32_t
12:13:30 <xarick> then divides by / 1073741824.0
12:13:44 <xarick> that number is 0x8000000
12:14:34 <xarick> oh my bad
12:14:40 <xarick> 0x4000000
12:15:26 <peter1138> It's converting the random noise value to a floating point number between -1.0 and 1.0.
12:17:13 <peter1138> ahyangyi, what is a "parameter" in this case?
12:17:40 <peter1138> NewGRF config parameter set by the player?
12:18:30 <peter1138> You can probably do magic with parameters that does the right thing at load-time.
12:19:49 <xarick> `long n = x + y * prime + static_cast<int32_t>(_settings_game.game_creation.generation_seed);`
12:19:49 <xarick> I think this is the intention
12:19:57 <xarick> but i still dunno about long
12:20:17 <peter1138> No, at that point the see is unsigned.
12:20:48 <peter1138> `long` IS an odd choice. It should probably just be `uint32_t`, along with the `long` parameters.
12:21:09 <xarick> but it wants a signed value
12:21:28 <xarick> the range you mentioned -1.0 to 1.0
12:21:55 <peter1138> Making it signed is handled by the conversion from integer to floating point.
12:22:26 <xarick> the mask seems to be of MAX_INT
12:22:55 <peter1138> The mask means it ignores the sign bit, so basically it doesn't matter if the input value is signed or unsigned, it's always going to be a positive value.
12:26:09 <xarick> let me think with a smaller number
12:26:38 <xarick> whatever value & 0x7F / 0x40
12:30:42 <peter1138> `/ 0x40` is not equivalent.
12:30:52 <peter1138> It is `/ 128.0`
12:31:00 <peter1138> Oops, `/ 64.0`
12:31:03 <peter1138> :)
12:31:29 <peter1138> `(value & 0x7F)` is converted to a double, then it's `/ 64.0`.
12:31:41 <peter1138> This gives you a floating point value between 0.0 and 2.0.
12:32:01 <peter1138> Then it does `1.0 -`, which gives you a value between -1.0 and 1.0.
12:32:38 <peter1138> (I'm not sure why it does `1.0 - x` instead of `x - 1.0` but the result is the same (inverted, but as a noise function that's irrelevant)
12:36:31 <ahyangyi> peter1138: Yes.
12:39:03 <ahyangyi> peter1138: It does make the result (-1, 1] instead of [-1, 1)
12:39:09 <ahyangyi> as noise it doesn't matter though
12:40:05 <ahyangyi> peter1138: My comment about signedess was more about "signed overflows are UB".
12:55:11 *** Extrems has quit IRC (Quit: ZNC 1.7.5 - https://znc.in)
12:55:32 *** Extrems has joined #openttd
13:49:57 <xarick> hexadecimal floating literal requires an exponent, let me google this
13:51:27 <xarick> 0x40000000P0; ah this works
13:53:16 <xarick> what's the code style of Hex numbers?
13:54:02 <xarick> ABCDEF or abcdef
13:55:53 <peter1138> Don't change that sort of thing.
13:55:55 <peter1138> https://stackoverflow.com/questions/18809346/how-does-the-noise-function-actually-work
13:56:02 <peter1138> It's basically standard magical values.
13:57:07 <ahyangyi> Just a hash function from (x,y) to values, cheaper than typical "cheap" general purpose hash functions but creates a pattern that looks good enough
14:04:25 <xarick> n = (n >> 13) ^ n; that's different than what tgp has
14:06:50 <peter1138> https://math.stackexchange.com/questions/41847/how-why-does-this-noise-function-work
14:07:36 <peter1138> There's also some misguided soul who thought ^ should be pow() :)
14:29:17 <xarick> gonna try assert(1073741824.0 == 0x40000000p0);
14:29:23 <xarick> maybe static_assert?
14:31:59 <bohaska> https://cdn.discordapp.com/attachments/1008473233844097104/1331270073955909702/image.png?ex=6791015f&is=678fafdf&hm=3f7a67bdd29b2dcae1a1735f14c625a689daca02ce04c548870238cb182186cd&
14:31:59 <bohaska> trying to make it better
14:32:56 <ahyangyi> The roof looks much more natural now.
14:34:41 <bohaska> https://cdn.discordapp.com/attachments/1008473233844097104/1331270751852040274/image.png?ex=67910201&is=678fb081&hm=165aee14ab848a54a412728c4438347bd21be1a26602f04ff31aae26da525e99&
14:35:28 <xarick> waiting for CodeQL for issues
14:39:36 <bohaska> oh whoops wrong channel
14:39:37 *** kuka_lie has joined #openttd
14:43:21 <xarick> well well
14:43:35 <xarick> there are coastal differences when i cast the seed to int32_t
14:47:53 <_glx_> but seed is typically used as a bitfield (unless very rare places where it's a number)
14:48:56 <_glx_> anyway differences in your test are not an issue, it's meant to be random
14:49:36 <xarick> going to look at the history of tgp.cpp
14:49:45 <xarick> try to get some clues
14:50:06 <peter1138> I recommend just not touching this piece of code. It does what it is intended to do.
14:50:20 <xarick> i'm under the impression generation seed used to be int32_t
14:50:47 <_glx_> as said seed type doesn't matter as long as it's 32bits
14:50:48 <peter1138> There is absolutely no reason to, e.g. change floating point values to hexadecimal floating point values.
14:51:12 <_glx_> the actual seed value is meaning less
14:53:41 <_glx_> it seems you think something happen to the stored value when converting from int to uint (or uint to int) but it's just the interpretation of the actual 32 bits
14:54:01 <peter1138> Hmm, I borrowed from NWidgetSocialPlugins, but now I'm stuck :(
14:57:14 <DorpsGek> [OpenTTD/OpenTTD] glx22 merged pull request #13310: Codechange: [Win32] Use language isocode for fallback font detection https://github.com/OpenTTD/OpenTTD/pull/13310
15:00:58 <peter1138> Hmm, needs a callback function or user_data
15:08:00 <xarick> 15.0-beta1 might not be producing the same map as current master... why do I insist testing 15.0
15:15:49 <xarick> something doesn't make sense...
15:16:09 *** D-HUND is now known as debdog
15:17:53 <xarick> could different compilers builds result in differences?
15:18:03 <xarick> or debug vs release?
15:18:08 <xarick> in map gen
15:21:26 <Rubidium> they shouldn't
15:22:18 <xarick> then it must be on me
15:22:56 <xarick> some change I did is breaking
15:23:21 <Rubidium> git bisect for the rescue!
15:25:40 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1331283580608970772/image.png?ex=67910df3&is=678fbc73&hm=4177c0011c762d338b9b4530923a15d3987f559c15c7d84ae8566aa27724f083&
15:25:40 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1331283581007302666/image.png?ex=67910df3&is=678fbc73&hm=6f432a00bfd0e567bd3e398b0f9b4fb5a370337e501d43956ccfe43653a80e1a&
15:25:40 <xarick> 15.0-beta1 vs current master
15:27:11 <Rubidium> next time, open the console and type getseed so we can be sure it's the same seed. But as I said, git bisect to the rescue
15:28:17 <xarick> game seed: 1
15:29:16 <xarick> seems to only affect coasts
15:29:25 <xarick> the interior looks equal
15:30:26 <xarick> map borders?
15:30:28 <peter1138> Have you bisected yet?
15:30:37 <xarick> no, i dunno what that is
15:31:00 <peter1138> It's a git tool to find which commit introduced a change.
15:32:39 <peter1138> Also it's exactly 4 weeks since 15.0-beta1, in case anyone has nothing else to do tonight...
15:36:01 <goddess_ishtar> bisect is basically like a binary search
15:36:23 <goddess_ishtar> you give it two commits, one of which definitely has the change you're looking for and the other of which definitely does not
15:37:21 <goddess_ishtar> and it keeps giving you commits to check out and narrow it down based on whether or not they have the change you're looking for until you find the exact commit it was introduced in
15:37:59 <goddess_ishtar> it's great for hunting down regressions
15:48:40 <xarick> could Iron Horse be affecting mapgen?
15:49:13 <xarick> nop
15:49:46 <goddess_ishtar> if it is, I think you would have a bigger problem on your hands
15:50:28 <Rubidium> it *could* if you were to use the ancient map generator (and Iron Horse replaces the right sprites)
15:52:41 <xarick> tested ce4012b7c7ae50f44964957eae545c1d72c5bc24, works fine here
15:53:02 <xarick> strange, because that's what I expected to be in error
15:54:19 <andythenorth> Iron Horse affects game start speed and newgrf scan speed
15:54:29 <andythenorth> but affecting map gen would be....exciting
15:54:55 <xarick> ah, found the issue, i think
15:54:59 <xarick> <https://github.com/OpenTTD/OpenTTD/commit/60d0d7b8b230c2f64c8c39ce8990e3eb241c5dda#diff-8463692a54e306b04c06accf493308970b084cc1a2d09c9d93160ba0dc283924R931>
15:55:09 <xarick> it was a me problem and it got into master 😦
15:55:55 <xarick> sorry
15:56:12 <peter1138> You broke a lerp.
15:57:00 <andythenorth> my lerp isn't broken
15:57:19 <LordAro> xarick: i hope you see the issue in making changes with no purpose
15:57:23 <goddess_ishtar> peter1138: sounds painful
15:57:32 <LordAro> static code does not make new bugs
15:58:13 *** Wormnest has joined #openttd
15:58:30 <peter1138> And refactoring tools wouldn't have broken that.
15:58:45 <peter1138> Which suggests you did it manually, which is a bit silly.
15:59:02 <LordAro> nevermind refactoring tools, find and replace wouldn't have done that
16:01:15 <DorpsGek> [OpenTTD/OpenTTD] SamuXarick opened pull request #13350: Codefix #60d0d7b: Typo, using incorrect variable https://github.com/OpenTTD/OpenTTD/pull/13350
16:01:37 <xarick> wrong commit message now
16:02:03 <DorpsGek> [OpenTTD/OpenTTD] SamuXarick updated pull request #13350: Codefix #60d0d7b: Typo, using incorrect variable https://github.com/OpenTTD/OpenTTD/pull/13350
16:02:05 *** keikoz has joined #openttd
16:03:59 <kuhnovic> You might want to consider this too: https://en.cppreference.com/w/cpp/numeric/lerp
16:04:15 *** nielsm has joined #openttd
16:04:20 <peter1138> I recommend not ;)
16:04:30 <kuhnovic> Not for this PR at least :p
16:07:36 <LordAro> wait, that's a thing?
16:08:50 <DorpsGek> [OpenTTD/OpenTTD] LordAro approved pull request #13350: Codefix 60d0d7b: Incorrect variable in TGP noise calculation https://github.com/OpenTTD/OpenTTD/pull/13350#pullrequestreview-2565091903
16:10:14 <peter1138> Yeah, I've used std::lerp. But I wouldn't randomly change this code, certainly not mixing it with other fixes.
16:12:30 <xarick> should i ammend commit too?
16:13:18 <LordAro> i think you should stop making changes
16:17:08 <xarick> hmm okay, I won't ammend
16:17:36 <xarick> amend*
16:23:31 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1331298141269659718/image.png?ex=67911b83&is=678fca03&hm=8a2cecc41b2a80c1c412f9bb9a6de99d6fd9fe86c963112b35d0e747a38f1189&
16:23:31 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1331298141667983400/image.png?ex=67911b83&is=678fca03&hm=f0b567af0e589eb21dbde2f2507ce49b817ca0f465405cfc132e1828d8c0392c&
16:23:31 <xarick> it fixed it
16:41:43 <DorpsGek> [OpenTTD/OpenTTD] LordAro merged pull request #13350: Codefix 60d0d7b: Incorrect variable in TGP noise calculation https://github.com/OpenTTD/OpenTTD/pull/13350
16:48:11 *** SigHunter has quit IRC ()
16:49:30 <xarick> thx, sorry about that
16:50:45 *** SigHunter has joined #openttd
16:55:42 *** SigHunter has quit IRC ()
16:58:14 *** SigHunter has joined #openttd
17:36:54 <DorpsGek> [OpenTTD/grfcodec] PeterN dismissed a review for pull request #42: Change: Allow encoding 32bpp-only sprites. https://github.com/OpenTTD/grfcodec/pull/42#pullrequestreview-2305500278
17:36:57 <DorpsGek> [OpenTTD/grfcodec] PeterN updated pull request #42: Change: Allow encoding 32bpp-only sprites. https://github.com/OpenTTD/grfcodec/pull/42
17:37:22 <peter1138> Didn't realise that had never been committed :o
17:37:25 <peter1138> Merged...
17:49:04 *** HerzogDeXtEr1 has joined #openttd
17:51:04 *** Xaroth92328 has quit IRC ()
17:51:20 *** Xaroth92328 has joined #openttd
17:51:36 *** eirc has quit IRC (Read error: Connection reset by peer)
17:51:59 *** Hirundo has quit IRC (Ping timeout: 480 seconds)
17:51:59 *** avdg has quit IRC (Ping timeout: 480 seconds)
17:52:04 *** eirc has joined #openttd
17:52:13 *** avdg has joined #openttd
17:52:43 *** Hirundo has joined #openttd
17:55:14 *** HerzogDeXtEr has quit IRC (Ping timeout: 480 seconds)
17:56:20 <Rubidium> peter1138: https://github.com/search?q=org%3AOpenTTD+is%3Apr+is%3Aopen+author%3APeterN+review%3Aapproved&type=pullrequests for other PRs you might not have realised that were approved
17:57:06 <DorpsGek> [OpenTTD/grfcodec] rubidium42 approved pull request #42: Change: Allow encoding 32bpp-only sprites. https://github.com/OpenTTD/grfcodec/pull/42#pullrequestreview-2565350298
18:06:38 <DorpsGek> [OpenTTD/grfcodec] PeterN merged pull request #42: Change: Allow encoding 32bpp-only sprites. https://github.com/OpenTTD/grfcodec/pull/42
18:20:42 <DorpsGek> [OpenTTD/OpenTTD] PeterN merged pull request #13341: Cleanup: Remove two unused PaletteType values. https://github.com/OpenTTD/OpenTTD/pull/13341
18:25:42 <xarick> is there a way to compare two map arrays?
18:25:48 <xarick> tile by tile
18:47:56 *** tokai has joined #openttd
18:47:56 *** ChanServ sets mode: +v tokai
18:54:48 *** tokai|noir has quit IRC (Ping timeout: 480 seconds)
19:07:37 *** Wolf01 has joined #openttd
19:17:51 <peter1138[d]> Yea, tile by tile
19:23:52 <xarick> but how do i get 2 maps
19:30:50 <peter1138[d]> Copy one into another pair of vectors
19:58:57 <xarick> the script died unexpectedly
20:01:50 <xarick> let's see why
20:03:35 <xarick> oh, "This script took too long in the Load function. Script is not started."
20:03:41 <xarick> but this message wasn't printed
20:03:45 <xarick> anywhere
20:03:52 *** gelignite has joined #openttd
20:04:42 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1331353802309374025/image.png?ex=67914f59&is=678ffdd9&hm=1c3e1bb65fd481c010cea8852c150a60aeb24ecac270734d88b3b0121ee53765&
20:04:51 <andythenorth> ok was it badges time?
20:04:56 <xarick> it just dies with no log
20:08:01 <peter1138[d]> andythenorth: Always
20:08:08 <andythenorth> 40+ badge
20:10:20 <xarick> <if (this->engine->IsSuspended()) ScriptLog::Error("This script took too long in the Load function. Script is not started.");>
20:10:20 <xarick> `this->engine->IsSuspended()` returned false
20:10:53 <andythenorth> peter1138[d]: if we added 'achievements' which have a (settable) bool and a (settable) date, we could give them a (static) badge prop
20:10:58 <andythenorth> then players could earn badges
20:13:37 *** Flygon has quit IRC (Quit: A toaster's basically a soldering iron designed to toast bread)
20:17:21 *** liquidsnake0123 has joined #openttd
20:17:21 <liquidsnake0123> Hey guys, I just wanted to ask. I'm working on adding a new variable that will be an attribute to all companies. I'm having a bit of hard time, and I was wondering if it's possible to do this. If so, is there any advice you could give or is there a guide somewhere that I could follow? Thanks in advance.
20:20:33 <xarick> _glx_: My GS can't load saved data back
20:21:32 <_glx_> you saved too much probably
20:21:42 *** kuka_lie has quit IRC (Quit: Lost terminal)
20:21:58 <xarick> yes, the whole map height
20:22:11 <_glx_> there's an opcode limit for loading
20:22:19 <xarick> it used to work
20:23:17 <xarick> gonna try a different method
20:23:58 <andythenorth> so
20:24:10 <andythenorth> we already know we can't store the whole map in GS 😛
20:24:13 <andythenorth> I proved that
20:26:04 <xarick> it could save, but can't load
20:33:09 <xarick> it worked on a 64x64 map
20:35:01 <LordAro> 10:20:02 < peter1138> You actually BUY every vehicle to test it?!
20:35:05 <LordAro> oops.
20:35:26 <LordAro> just as well there wasn't anything worse in my clipboard
20:36:49 <LordAro> liquidsnake0123: no guides (not really the sort of thing that happens often enough!), but company_base.h seems like a good place to start
20:37:03 <LordAro> from there, follow one of the other variables
20:37:22 <LordAro> (idk, like location_of_HQ in CompanyProperties)
20:37:35 <xarick> it works now, I must have screwed up
20:39:37 <_glx_> save and load have the same limit
20:43:37 <andythenorth> ok Horse badge quest 1 done 🙂
20:43:42 <andythenorth> do I get a badge?
20:45:04 <andythenorth> `dumpinfo badges` maybe? 🙂
20:48:00 <xarick> ``` if (table.height_map.len() == 0) {
20:48:00 <xarick> GSLog.Warning("Nothing to load!");
20:48:00 <xarick> return;
20:48:00 <xarick> }```
20:48:00 <xarick> This works.
20:48:01 <xarick> ``` if (table.height_map.empty()) {
20:48:01 <xarick> GSLog.Warning("Nothing to load!");
20:48:03 <xarick> return;
20:48:03 <xarick> }```
20:48:05 <xarick> This fails silently.
20:49:20 <xarick> so, didn't seem to be a too long to load error
20:50:01 <xarick> but a "I don't know 'empty'" error
20:52:08 <xarick> now I realise I can't use this script
20:54:02 <xarick> I have a saved height map of the current map. if I restart the game, the GS starts anew
20:56:31 <xarick> how to export this data into a file or something... json something
20:56:39 <xarick> meh, i give up
20:57:33 <Rubidium> you can also compare screenshots
21:03:35 <_zephyris> Aka exporting the data through a dedicated renderer into a standard 2D array format
21:05:03 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1331368992916377784/image.png?ex=67915d7f&is=67900bff&hm=52d81f00614f63baec69091b90ff19a1901c108481417209fdf3ceb61bc36dce&
21:09:08 <_glx_> you asking too much for GS
21:09:42 *** stenyg has quit IRC (Quit: User went offline on Discord a while ago)
21:10:17 <andythenorth> might work on 64 x 64 🙂
21:10:18 <_glx_> that's kind of stuff you could send through admin port
21:21:57 *** HerzogDeXtEr1 has quit IRC (Read error: Connection reset by peer)
21:24:00 <DorpsGek> [OpenTTD/OpenTTD] rubidium42 opened pull request #13351: Codechange: use correct type for variable to prevent casts later on https://github.com/OpenTTD/OpenTTD/pull/13351
21:39:17 <andythenorth> peter1138[d]: is it worth the git overhead for me to add var 0x64 to nml? 😛
21:39:35 <andythenorth> you have a PR already
21:57:28 *** gelignite has quit IRC (Quit: Stay safe!)
22:06:44 <DorpsGek> [OpenTTD/OpenTTD] rubidium42 opened pull request #13352: Codechange: [Script] rename BridgeID to BridgeType in the script API https://github.com/OpenTTD/OpenTTD/pull/13352
22:10:18 <DorpsGek> [OpenTTD/OpenTTD] rubidium42 updated pull request #13352: Codechange: [Script] rename BridgeID to BridgeType in the script API https://github.com/OpenTTD/OpenTTD/pull/13352
22:20:06 *** keikoz has quit IRC (Ping timeout: 480 seconds)
22:31:41 <DorpsGek> [OpenTTD/OpenTTD] rubidium42 updated pull request #13352: Change: [Script] rename BridgeID to BridgeType in the script API https://github.com/OpenTTD/OpenTTD/pull/13352
22:31:55 <DorpsGek> [OpenTTD/OpenTTD] rubidium42 opened pull request #13353: Codechange: [Script] do not redefine types in the script API https://github.com/OpenTTD/OpenTTD/pull/13353
22:45:50 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1331394353184378890/image.png?ex=6791751d&is=6790239d&hm=7372e0980678940dfe340ad4b7391b74948789297d99fcee5ea8f8e251508699&
22:45:50 <xarick> hmm im doing something wrong
22:45:57 <xarick> that's a lot
22:45:58 *** nielsm has quit IRC (Ping timeout: 480 seconds)
22:46:33 <xarick> i suspect RandomGen isn't reseted
22:55:55 <xarick> dbg: [misc:0] height mismatchs count: 0
22:55:58 <xarick> nice
23:08:17 <frosch123> Rubidium: there is also CargoID instead of CargoType
23:09:28 <frosch123> Hmm. EngineID or EngineType?
23:09:56 <frosch123> Maybe EngineType is more like train vs rv vs ship
23:13:48 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
23:28:53 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1331405188032102544/image.png?ex=67917f35&is=67902db5&hm=32d9b8e3ec90b362cb7f22b11d7515b06b6cfa767dac047c82e618f834c29a98&
23:28:53 <xarick> Results when changing `float` to `double` in `HeightMapCurves` function
23:29:12 <xarick> it's the only place in tgp with float
23:30:58 <xarick> ow, there's much more mismatchs when variety is low
23:50:01 <DorpsGek> [OpenTTD/OpenTTD] MontyMontana commented on discussion #12339: Script API and Wallclock time https://github.com/OpenTTD/OpenTTD/discussions/12339