IRC logs for #openttd on OFTC at 2024-11-21
⏴ go to previous day
00:24:40 <peter1138> Okay, now I know how this all works.
00:25:10 <peter1138> Deleting and never touching again 😉
02:00:14 *** Wormnest has quit IRC (Ping timeout: 480 seconds)
02:32:16 *** ChanServ sets mode: +v tokai
02:39:00 *** tokai|noir has quit IRC (Ping timeout: 480 seconds)
02:48:30 *** Wormnest has joined #openttd
03:00:09 *** herms has quit IRC (Quit: bye)
03:02:26 *** Wormnest has quit IRC (Quit: Leaving)
03:11:36 *** Zathras has joined #openttd
03:14:50 *** debdog has quit IRC (Ping timeout: 480 seconds)
03:15:00 *** D-HUND has quit IRC (Ping timeout: 480 seconds)
03:46:43 *** Zathras is now known as debdog
04:20:33 *** aperezdc has quit IRC (Ping timeout: 480 seconds)
06:12:39 *** aperezdc has joined #openttd
08:31:32 *** HerzogDeXtEr has joined #openttd
09:02:13 <peter1138> Brrr, fingers coooold
09:03:10 <Rubidium> and you got no hot cup of tea in them?
09:04:38 <peter1138> My coffee's gone cold as well.
09:47:35 <truebrain> orudge: I do have it on my list, but free time is an issue 😛
09:47:45 <truebrain> I only need to check out if eints will pick this up correctly
09:48:08 <truebrain> the rest of the PR is fine by me; worst case, something breaks ... 😛
09:48:27 <truebrain> so soon I just want to merge it, and see what eints does
09:48:34 <truebrain> but I need to make sure I have a backup etc first 😄
09:48:36 <orudge> It shouldn't really affect anything else, but yes, I'm hoping it gets picked up, then folk translate it :)
09:50:30 <truebrain> That would be the dream 😄
10:07:41 *** XYZ has quit IRC (Ping timeout: 480 seconds)
10:29:57 <peter1138> Stupid smart thermostat.
10:30:30 <peter1138> Likes to reset itself to 16.5°C during the day...
10:33:21 <peter1138> I'm warm enough apart from fingers.
10:35:44 <exceptik> then its time for a smoke break, suddenly it becomes even warmer
11:44:54 <exceptik> replace smoke with tea 😆
11:58:11 <_glx_> It's my turn to get snow
11:58:58 <johnfranklin> I wore some very thin trousers, I regretted.
12:00:20 <johnfranklin> I wore them yesterday and it was not cold, since I also wore down coats
12:00:39 <johnfranklin> And it was warmer inside buildings
12:00:49 <johnfranklin> But today is much colder
12:31:56 <peter1138> ```ScriptListMap *list_items = &list->items;
12:31:56 <peter1138> for (auto &it : *list_items) {```
12:32:00 <peter1138> Good use of pointers there.
12:32:25 <kuhnovic> References? Never head of
12:32:36 <peter1138> It does not even need a reference.
13:03:42 <peter1138> Hmm, the sprite sorters a bit complex eh?
13:04:49 <peter1138> JGRPP changes it all.
13:05:32 <peter1138> But using a temporary std::stack and a temporary std::forward_list seems not cache friendly.
13:06:07 <locosage> is jgrpp sort order the same?
13:07:59 <peter1138> The algorithm is different because JGRPP has all sorts of optimisations.
13:08:25 <peter1138> The "but using" refers to vanilla code, not JGRPP.
13:11:06 <locosage> ah, well, I compared quite a lot of options and stack+list list is the best I came up with
13:12:03 <peter1138> Lots of pointers and allocations in a list.
13:12:27 <peter1138> std::stack is a deque so it's a chunk at least.
13:13:41 <locosage> I tried vector instead of list, was slower
13:16:26 <locosage> don't remember why exactly but it removes stuff from the middle it seems
13:53:44 <peter1138> Someone's having a Discord 'call'.
13:54:15 <peter1138> Go on there and make eating noises at them.
14:02:54 <peter1138> z-buffer instead of sorting?
14:03:54 <peter1138> (Doesn't work with alpha)
14:08:38 <_jgr_> The vanilla sprite sorter works better if you sort a whole full-screen's worth in one go
14:09:49 <_jgr_> I took the approach of just slicing the screen up in that case, which also allows sorting and drawing the slices to be done in parallel
14:10:50 <_jgr_> The one in my branch is close to the old vanilla sprite sorter
14:30:07 <peter1138> How many recolour sprites though?
14:30:49 <peter1138> And no, I don't think lots of recolour sprites is wrong, although if any of them are the same and could be reused then that would reduce memory usage.
14:34:42 <peter1138> (grf-py's trick of deduplicating sprites doesn't work for recolours, and the deduplication only applies to the file, they're still separate sprites in game)
14:35:56 <peter1138> ParentSpriteToDraw is a bit too big to just be moved around quickly...
15:12:18 <xarick> Copilot is learning the coding style of openttd quite easily
15:14:39 <xarick> eh, I guess that's why they're called machine learning
15:17:29 <xarick> I need a way to compound kdtree with townindustries in a manner that you guys can accept
15:18:30 <xarick> currently they're separate, but they operate on the same thing which is counting industry types
15:18:37 <xarick> I want to unify that somehow
15:19:12 <xarick> Once I have achieved that, I will PR
15:34:20 <LordAro> machine learning is applied to the initial training, not the output
15:34:34 <LordAro> it's not learning anything from you talking to it
15:34:48 <LordAro> other than a bit more context, perhaps
15:50:59 *** XYZ has quit IRC (Ping timeout: 480 seconds)
16:11:41 *** ufo-piloot has quit IRC (Quit: you click on fancy icons. i execute code !)
16:12:53 *** ufo-piloot has joined #openttd
16:36:15 <peter1138> Correct, prop 28 is required for prop 32 to do anything.
16:37:57 <peter1138> Changing how it works so that it can work without 28 might make it easier to describe?
16:39:34 <peter1138> Currently, if you want classes 0 or 1, you set 28 to 0b11. If you want classes 0 and 1, you need to set 28 to 0b11 and 0x32 to 0b11.
16:40:44 <peter1138> Would it make more sense to allow setting just 0x32 to 0b11?
16:41:03 <peter1138> Filter might be a way to describe it.
16:41:20 <peter1138> (And use, I'm aware those two classes are not sensible choices :))
16:42:06 <michi_cc[d]> Changing prop 32 would not be the same though, if you have cargos with classes 01 and 11 and 10. prop 32 as 01 and 28 as 01 would be an example.
16:42:27 <michi_cc[d]> Make that one 10 of course.
16:45:27 <peter1138> Yes, the callback is recipe for running out of act2ids, or just including more of them.
16:46:03 <peter1138> Has anyone hit the limit of 1 billion act2s yet?
16:46:57 <peter1138> The property will be simpler, and smaller.
16:47:48 <peter1138> NML does, at least, hide the fact that you are writing lots of bytes when use varacts2, I guess..
16:48:38 <_glx_> nml hides the fact you actually may write more than one varact2 with a single switch
16:53:36 <peter1138> And due to how OpenTTD loads varact2, every callback result is a "spritegroup" as well, with its own pool index...
16:54:30 <peter1138> Because a switch result could be a link to a previous act2, or a callback result. So internally a callback result is a "previous result".
16:55:06 <peter1138> JGRPP probably rewrites all that :p
16:55:31 <_jgr_> I just re-use callback result sprite groups for the same value
16:55:51 <peter1138> Do you search for them or keep a list?
16:56:08 <peter1138> I guess I could just look.
16:57:06 <peter1138> const CallbackResultSpriteGroup *&ptr = _callback_result_cache[result];
16:58:15 <_glx_> andythenorth: a name or a mechanism/syntax to do both 0x28 and 0x32 with `refittable_cargo_classes`
16:58:21 <peter1138> If we were evil we could use point manipulation...
16:59:30 <_glx_> single value or an array of 2
17:01:07 <_glx_> exclusion is unchanged 🙂
17:06:00 <_glx_> there's an existing mechanism, let me try something
17:09:45 <xarick> Copilot is just awesome at describing things with clarity
17:12:45 <peter1138> An array of vectors of vectors. Probably not going to fly?
17:13:34 <mnhebi> You trying to summon our lord and saviour, blue screen of death?
17:14:14 <peter1138> Dunno but my VS Code just disappeared.
17:14:29 <mnhebi> Well thats positive news since VS Code is cancer.
17:15:12 <peter1138> And yet I'm so much more productive with it than Vim.
17:15:39 <mnhebi> Like any AI it bullshits its way through life
17:15:48 <mnhebi> so sure, its correct. At bullshitting.
17:15:54 <peter1138> Okay, ninja somehow was not stealthy and trigger OOM killer.
17:16:23 <mnhebi> Your dreams are the LLM, you are not
17:16:34 <mnhebi> LLMs are like dreams, not minds.
17:17:35 <mnhebi> Pretty much all the research about LLMs say they are similar to dreams, and anyone who uses them in any capacity can notice that
17:22:55 <mnhebi> andythenorth: nah its a nightmare.
17:23:11 <LordAro> invisible andy still invisible
17:27:38 *** XYZ_ has quit IRC (Read error: No route to host)
17:31:12 <peter1138> Iron Horse: 962 different callback results, reused 79383 times.
17:35:33 <peter1138> Of course it probably 50MB caching it 😉
17:37:16 <peter1138> 962 * 16, I suppose, so about 15KiB.
17:41:59 <peter1138> Or 962 * 8 if I use SpriteGroupID instead of SpriteGroup *.
17:43:49 <peter1138> In theory other things might be reused but realistically callback results is it.
17:44:17 *** XYZ has quit IRC (Read error: No route to host)
17:45:04 <peter1138> I added a load more GRFs and it was 228993 reused.
17:46:41 <peter1138> Okay, so if a NewGRF returns every value from 0 to 32767, and then only used it once, we'd be allocating 256KiB for no reason.
17:46:55 <peter1138> (+ whatever overheads)
17:52:14 <_glx_> andythenorth: but it optimise when generating the warnings 🙂
17:53:31 <_glx_> when you see the "result is constant" it actually uses the constant and not the switch at "call" location
17:54:57 <_glx_> you can check nfo output and see your switch is actually not generated
18:09:20 <peter1138> Well, my heating is on but it's not feeling warm.
18:10:00 <peter1138> I hate outsourcing... give task to developer. Spend hours explaining task...
18:14:00 <_glx_> current examples don't really need AND
18:22:06 <xarick> i only moved the kdtree into Industry struct
18:22:59 <xarick> ```#include "core/kdtree.hpp"
18:22:59 <xarick> struct Kdtree_IndustryXYFunc {
18:22:59 <xarick> inline uint16_t operator()(IndustryID iid, int dim)
18:23:00 <xarick> return (dim == 0) ? TileX(Industry::Get(iid)->location.tile) : TileY(Industry::Get(iid)->location.tile);
18:23:02 <xarick> using IndustryKdtree = Kdtree<IndustryID, Kdtree_IndustryXYFunc, uint16_t, int>;```
18:23:58 <xarick> I tried including industry_type.h
18:25:35 <xarick> oh, I think i see what's missing
18:26:52 <xarick> nop, i don't. still failing
18:29:00 <LordAro> _glx_: invalid unicode?
18:29:32 <_glx_> data unavalilable in dump
18:35:20 <xarick> I don't understand what I'm missing
18:36:07 <xarick> probably something tiny that I'm not aware
18:36:29 <xarick> I din't change the includes, it makes no sense why it doesn't work now
18:36:34 <_glx_> error seems to be about using Industry without knowing Industry
18:39:08 <_glx_> our validation is incorrect
18:42:11 <xarick> is there any tool that would help me identify the problem?
18:44:08 <_glx_> is industry_type.h included before industry_kdtree.h ?
18:45:00 <xarick> no, industry_type.h is not even in the list
18:46:13 <_glx_> that's the error, if nothing includes industry_type.h before industry_kdtree.h then industry_kdtree.h can't use Industry
18:57:14 <peter1138> Hmm, I think it actually loads a bit quicker as well, because it's not adding so many pool items.
18:58:12 <peter1138> Nothing really noticable mind you.
18:58:14 <xarick> makes no difference whether I include industry_type.h in industry.h or industry_kdtree.h
19:01:30 <xarick> _glx_: if you have time/patience, help me figure out what's wrong here:
19:33:12 <peter1138> Get back to drawing your badges
19:43:14 *** nielsm has quit IRC (Ping timeout: 480 seconds)
19:45:29 <xarick> doesn't build no matter what I do... I ruined this big time
19:49:33 <xarick> omg the more i touch the includes the worse it gets
19:59:32 <peter1138> I think I pushed it with a bit missing.
20:13:09 <xarick> I guess this is what peter is doing all the time
20:14:17 <_glx_> yeah, but this one has no hole, so no need to shuffle
20:14:18 <peter1138> Not exactly all the time.
20:14:57 <_glx_> btw maybe your changes in industry.h cause the issue for Industry
20:17:31 *** gelignite has joined #openttd
20:18:43 <_glx_> oh I see, you do a circular reference
20:19:12 <_glx_> Industry depends on IndustryKdtree and IndustryKdtree depends on Industry
20:19:53 <xarick> oh, nice of you to figure that out
20:20:33 <_glx_> yes don't use IndustryKdtree in Industry, or don't use Industry in IndustryKdtree
20:21:21 <xarick> so the move to unify the whole thing... falls apart
20:22:40 <xarick> gonna try move the kdtree stuff into kdtree file itself, but not sure how the Inc and Dec count will work
20:36:06 <xarick> dang, can't find a spot for these things
20:45:13 <talltyler> Heh, when I was writing NotDaylength I opted to not allow the timekeeping mode to be changed in-game. Somehow I missed blocking the Scenario Editor workaround, and now Master Hellish is streaming a game where graphs will be broken for 1499 periods. 😬
20:46:31 <talltyler> Economy year is 1, company GUI won't show anything until 1950
20:46:36 <talltyler> Silly company data GUI
20:48:08 <peter1138> Reset whatever field it is that stops it?
20:48:34 <talltyler> I have no idea how that storage works, to be honest. I've looked.
20:49:05 <peter1138> Presumably something says 1950 and that just needs to be set to the current economy year if the mode is switched. Right?
20:51:21 <talltyler> I forget all of the reasons why mode can't be changed, but there are multiple factors. More relevant here is getting the GUI to draw the most recent data instead of waiting for the year -- date cheat breaks it in the exact same way
20:51:42 <talltyler> (If you change the year before the start date of the game)
20:51:45 <_glx_> `mytable[0] = 0;` is accepted but it's not supposed to
21:02:43 <peter1138> Okay, I just saved as scenario, then converted it to wallclock, and loaded it as a new game.
21:03:04 <peter1138> There's a little spike, but otherwise the chart is working fine.
21:03:14 <peter1138> The in-game year is the same as well.
21:03:25 <talltyler> Sorry, I mean company financial data (the table, not a graph)
21:03:55 <talltyler> (Not a bug, but the reason it behaves this way)
21:04:13 <talltyler> What happens if you start a new company after changing the mode?
21:05:09 <peter1138> Reset inaugurated_year (either relative or absolute)
21:05:40 <peter1138> My chart is still going, but then again the game year didn't change when I switched to wallclock.
21:06:24 <peter1138> I think it did reset as it shows only 1 period to start with, but it fills in fine.
21:07:07 <peter1138> Of course, this is an established game, way past 1950.
21:07:18 <talltyler> Was your table blank after changing modes? I'm having trouble reproducing, for some reason
21:09:32 <peter1138> One potential solution is to ignore inauguration year and just check if that expenses column is all zeroes.
21:09:54 <peter1138> This seems like such a tiny thing that shouldn't block anything, tbh.
21:11:45 <talltyler> I am happy to revisit changing modes in a game, but this is an old behavior that also happens with the date cheat so I wouldn't mind fixing it in a way that works for both
21:12:16 <talltyler> I got a new computer and haven't set up a development environment yet 😕
21:12:46 <talltyler> My old machine was hilariously underspec for my new job developing for Unreal Engine 🙂
21:12:49 *** Flygon has quit IRC (Read error: Connection reset by peer)
21:14:50 <talltyler> Okay, so company expenses are saved in `c->year_expenses[]`, that makes sense. So we just need to align the data to the correct column?
21:16:12 <talltyler> OpenTTD now supports BC 😛
21:16:28 <talltyler> (although I recall someone explaining to me why there was no year 0)
21:16:30 <peter1138> Is that acceptable on a new game?
21:16:49 <peter1138> Yeah, we can hide if it's < 1.
21:17:45 <peter1138> Current behaviour is to fill from the left until it's full.
21:20:11 <talltyler> Is that with your change? Looks perfect.
21:23:09 <peter1138> So my converted game shows -1, 0, 1 still, becuase there is data there.
21:23:31 <peter1138> Right, what should the columns show...
21:24:03 <talltyler> I don't mind incorrect headers if the game has been forcibly converted
21:31:55 <peter1138> (Oh no, more ranges)
21:32:05 *** HerzogDeXtEr has quit IRC (Read error: Connection reset by peer)
21:33:15 <peter1138> Is being fixed a problem?
21:39:10 <peter1138> The issue is... badges are only displayed in purchase lists.
21:40:04 <peter1138> Where you show them?
21:40:44 <peter1138> So you made up a contrived example because you want per-instance badges.
21:41:42 <peter1138> std::multimap<TileIndex, Badge>
21:44:44 <peter1138> How many badges can an instance have?
21:45:14 <peter1138> std::array<std::string, UINT16_MAX> sounds perfect.
22:05:55 <talltyler> Thanks for figuring this out, peter1138. 😄
22:05:55 <talltyler> I triggered a preview build so I can test it out before approving. Not that I don't trust your tests, just curious. 🙂
22:06:15 <peter1138> Well, I could've posts screenshots, but... uh... lazy? Hmm.
22:08:27 <talltyler> Note that this won't be released into stable until the next major release (April 2025 if we follow the usual schedule), so you and any players who want to follow along would have to play the Nightly version, available in Steam betas and from OpenTTD.org.
22:10:37 <talltyler> Another possible workaround is to change the company inauguration date, since that's the wrong number. If you don't want to lose your progress, you could try:
22:10:37 <talltyler> 1. Create a new company
22:10:37 <talltyler> 2. Make the old company an AI company
22:10:37 <talltyler> 3. Forcibly purchase the old company
22:10:37 <talltyler> 4. (See your) profit???
22:14:44 <peter1138> Unable to resolve github.com :S
22:18:42 *** masterhellish has joined #openttd
22:18:42 <masterhellish> Tahnks I will ahve a look at this tomorrow morning
22:23:27 <peter1138> talltyler: oh did I 'break' a WontFix? hah
22:24:38 <talltyler> If only it was in `known-bugs.txt`
22:25:18 <talltyler> Then you could feel truly accomplished 😛
22:28:12 <peter1138> In that case, is #8625 valid?
22:29:56 <peter1138> Oh maybe that is recent. And the year is baked into the sprite. Never mind.
22:35:08 <xarick> yay _glx_ this was so difficult to solve. Thx for the help. It finally compiled
22:36:13 <xarick> Copilot pointed me to the right direction too, explaining forward declarations and whatever
22:37:11 <xarick> I was also missing a default constructor for the kdtree, it also helped me out on that
22:42:22 <peter1138> Kdtree has a default constructor...
22:43:39 <xarick> * Struct representing the cache of industry counts for a specific industry type.
22:43:39 <xarick> struct IndustryTypeCountCaches {
22:43:40 <xarick> IndustryKdtree kdtree; ///< A k-d tree for spatial indexing of industries.
22:43:40 <xarick> std::vector<IndustryTownCache> towns; ///< A vector of IndustryTownCache entries, each representing a town and its associated industries.
22:43:42 <xarick> /* Default constructor to initialize the kdtree */
22:43:42 <xarick> IndustryTypeCountCaches() : kdtree(IndustryKdtree()) {}
22:48:59 <_glx_> constructor is not needed
22:50:04 <xarick> it didn't let me compile without that line
22:51:11 <xarick> wow... what the heck? now it compiled
22:58:54 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
23:05:18 *** keikoz has quit IRC (Ping timeout: 480 seconds)
23:06:34 *** gelignite has quit IRC (Quit: Stay safe!)
23:18:30 <xarick> alright, I got it done!
23:19:13 <_glx_> in worst case key will be "typename : 0x..."
23:22:26 *** jlx__ has quit IRC (Read error: Connection reset by peer)
23:26:24 <peter1138> Okay, squirrel parameters still eludes me.
23:27:06 <_glx_> yeah you take value at stack -2 and push the result
23:27:16 <_glx_> so the result is now in -1
23:31:30 <peter1138> so sq_tostring does a hidden stack operation...
23:46:35 <_glx_> all sq_ function works directly with the VM and the stack
23:47:50 <_glx_> sq_next pushes key and value, we convert key to string and it's pushed
23:50:21 <_glx_> working with squirrel stack is fun (but it's easy to do mistakes)
23:50:57 <_glx_> usually the error is a missing pop, or too many
continue to next day ⏵