IRC logs for #openttd on OFTC at 2024-06-12
β΄ go to previous day
01:01:16 <talltyler> silent_tempest: Itβs possible, but we usually wait for someone to come along to take a look on their own
01:01:55 <talltyler> Thanks for your recent contributions, itβs nice to have some fresh ideas around here π
02:01:57 *** Wormnest has quit IRC (Quit: Leaving)
02:03:13 *** herms6 has quit IRC (Quit: bye)
02:18:39 *** debdog has quit IRC (Ping timeout: 480 seconds)
03:06:06 *** gnu_jj_ has quit IRC (Ping timeout: 480 seconds)
03:23:04 <ahym> I asked Google for the c++ equivalent of a blitter and google's AI threw the most insane description at me
03:26:13 <ahym> I can't even validate if this is correct
03:27:17 <ahym> I was almost certain modern cpus did not handle data this way anymore because of parallel processing, does x64 still have a blitter subcircuit
03:33:46 <ahym> No, It does not. However the OTTD blitter is incredibly optimized holy cow
03:50:05 <yeah_its_gloria> mfw unterminated C string
03:50:22 <yeah_its_gloria> why is it using the source size
04:01:21 *** salut3585 has quit IRC (Quit: User went offline on Discord a while ago)
04:42:08 <DorpsGek> - Update: Translations from eints (by translators)
05:26:04 *** keikoz has quit IRC (Ping timeout: 480 seconds)
06:17:41 <truebrain> silent_tempest: Pff, why did I write things in the PR template for it to be ignored! π (referring to: `Please use Feature / Add / Change / Fix for player-facing changes. E.g.: "Feature: My cool new feature".`). If you have suggestions how we can make this stand out more to people so it is easier to understand what is an Add and what is a Codechange, please do let us know π
06:22:33 <truebrain> ahym: Old systems like the NES do π and the name got in to OpenTTD somehow and stuck π a software blitter π
07:00:05 *** HerzogDeXtEr has quit IRC (Read error: Connection reset by peer)
07:12:33 <silent_tempest> truebrain: Bleh. I know I read the template months ago. And now I'm operating on my vague memory of it.
07:13:13 <silent_tempest> Whether or not i should i look at the commit hooks for valid commit prefix tags
07:18:21 <silent_tempest> And okay. All of the valid commit prefixes are there but they're not documented or explained
07:19:00 <silent_tempest> Honest question are there too many valid prefixes?
07:20:38 <silent_tempest> Like does there need to be a "Fix" and a "Codefix"?
07:20:50 <silent_tempest> Update and Upgrade?
07:21:31 <silent_tempest> There's too many
07:27:32 <silent_tempest> In regards to the PR template specifically. It's hard to read on my screen TBH. I think I'll have to explain that with a screenshot later when i actually have solid Internet access for laptop instead of spotty phone access
08:07:09 <peter1139> Windows' GDI has the BitBlt function (we don't use)
08:08:06 <truebrain> silent_tempest: Explained in the PR template π and it is okay, it just made me giggle a bit π just let us know if you know a way to improve stuff π
08:08:59 <peter1139> Looks like Microsoft largely ignore the term 'blit' in their documentation for all the *Blt functions though.
08:41:27 <peter1139> I guess I still need to pass begin/end to some of those functions.
08:50:23 <peter1139> fa82dd6096e6797ebd83024f05cdbd8cf2869255 has a me-style commit message.
08:52:11 <truebrain> those we "hate" when creating the changelog, you mean? π
08:52:39 <peter1139> Fix #12030: Water infrastructure totals when using DC_FORCE_CLEAR_TILE
08:52:40 <peter1139> To remove objects on water
08:53:16 <peter1139> "To remove objects on water" :D
08:56:13 <peter1139> I guess we will hate that for the changelog, yes.
08:58:17 <peter1139> Weird, my VS Code sessions are in the wrong CWD.
09:03:06 <truebrain> wtf am I looking at π
09:03:34 <peter1139> Two VS Codes, different project directories...
09:03:41 <peter1139> Sharing a terminal...
09:07:02 <silent_tempest> The window is teeny.
09:07:13 <truebrain> still, it starts with just the information you are suppose to read π
09:08:12 <peter1139> Get a plugin called "Zoom Page WE"
09:08:18 <peter1139> It scales EVERYTHING up, not just text.
09:09:39 <silent_tempest> Okay there is a much better explanation in the codingstyle doc
09:09:51 <silent_tempest> ```For player-facing changes, we have these keywords:
09:09:51 <silent_tempest> * Feature: Adding a significant new functionality to the game. This can be small in code-size, but is meant for the bigger things from a player perspective.
09:09:51 <silent_tempest> * Add: Similar to Feature, but for small functionalities.
09:09:51 <silent_tempest> * Change: Changing existing behaviour to an extent the player needs to know about it.
09:09:51 <silent_tempest> * Fix: Fixing an issue with the game (as seen by the player).
09:09:53 <silent_tempest> * Remove: Completely removing a functionality.
09:09:53 <silent_tempest> * Revert: Reverting an earlier Feature / Add / Change / Fix / Remove.
09:09:55 <silent_tempest> * Doc: Update to (player-facing) documentation, like in the `docs/` folder etc.
09:09:55 <silent_tempest> * Update: Translator commits.
09:10:25 <LordAro> documentation exists? :o
09:10:42 <silent_tempest> Also Doc is only for player facing changes?
09:11:08 <silent_tempest> Feel like Update: Translator commits should actually just be "Translations: "
09:11:24 <LordAro> things like AI/GS documentation is "player-facing"
09:12:51 <silent_tempest> I mean updates to the OpenTTD developer docs could easily be Doc changes
09:13:06 <LordAro> they could, but they're not
09:13:28 <silent_tempest> What are they then?
09:14:42 <LordAro> maybe Codechange, if it's not actually fixing anything
09:15:09 <silent_tempest> Markdown isn't really code but okay
09:17:26 <LordAro> if it's in a cpp/h/hpp file, it's probably code
09:17:36 <LordAro> you seem to be under the impression this is up for debate
09:20:36 <silent_tempest> .md isn't cpp/h.
09:21:05 <LordAro> it is possible i'm lacking context for what you're actually doing
09:24:09 <LordAro> yeah, that's fine as Doc
09:24:31 <LordAro> TB used it in #12046 :)
09:27:24 <silent_tempest> I'll fix my things tomorrow. Sleep now π΄
09:35:31 *** reldred has quit IRC (Quit: User went offline on Discord a while ago)
09:55:11 <andriy> This is a long shot, but does anybody know how to print a local in a different stack frame in gdb?
10:14:08 <peter1139> Hmm, it's probably my turn for the Haribo.
10:25:59 <andriy> Why does it feel like I am always missing important context in this chat? :)
10:30:40 *** reldred has joined #openttd
10:30:59 <reldred> many of the folks here have been here many, many years
10:31:20 <audigex> andriy: Thatβs the one downside I find of Discord over the forums, less persistence of information
10:32:03 <andriy> Yea, andwen using IRC it's even worse, only 20 lines of backlog
10:32:19 <peter1139> There's no persistence for my random lines of thought.
10:32:53 <peter1139> If your IRC client only keeps 20 lines of backlog that's your client issue.
10:33:11 <andriy> I should get a raspbery pi to sit here and record all the conversations here :)
10:34:19 <andriy> Now just <Ctrl-F> for Haribo, and read every hit for the past 10 years :)
10:34:57 <peter1139> Now now, that goes back 17 years. Include it all.
10:35:51 <andriy> Cmon I would have to go day by day if I don't scrape it
10:36:09 <andriy> Fine, recursive wget it is :)
10:37:00 <peter1139> You might not find anything.
10:42:33 <andriy> This will take some time, it is doint ~5 days / s
10:43:52 <peter1139> I mean, don't actually do it. There genuinely is no relevance to it.
10:44:06 <andriy> yea, but it's funny :)
10:44:23 <peter1139> And scraping someone elses web service is very rude.
10:44:34 <andriy> now I can search the whole log with grep -rn and get the result in seconds
10:44:57 <andriy> it is rude, but I am only doing it once, and it's ~50 MB total, so not that big of an issue for the service
10:49:21 <andriy> Ok, I stopped at 2014, It takes much more space then I estimated, already at 378M, which is not too little for a static site
10:49:32 <andriy> I won't stress their server anymore
10:50:57 <andriy> But just to check that it works, there are 693 mentions of coffe in that data :)
10:51:24 <peter1139> Good point. Time for another.
10:53:03 <peter1139> Although this will be a dastardly cappuccino so won't mention the word.
10:53:04 <andriy> and only 414 mentions of tea
10:54:00 <andriy> 1 mention of cappuccino in the old data
10:54:02 <andriy> weblogs.openttd.org/openttd/2012/07/28.html
10:55:13 <andriy> 197 dogs and 1000+ cats
10:55:42 <andriy> but I think some of them might have been mentioning the command cat, so the data is probably not fully correct
10:56:34 <andriy> 729 mentions of "fuck"
10:56:55 <andriy> I don't like a person I am becomming by scraping that data
11:13:11 *** andriy2 has joined #openttd
11:14:49 *** andriy has quit IRC (Ping timeout: 480 seconds)
11:17:06 <peter1139> Those are the best stats :D
11:17:17 <andythenorth> who has logorrhoea?
11:18:00 <LordAro> it's still running, but there haven't been any new logs for it to process in several years
11:18:21 <andythenorth> most of my lines are just "hmm"
11:18:49 <peter1139> Oh, so the "today" is a lie?
11:19:12 <peter1139> Latest Topics, 1.11.2, 41 days ago. Yeah.
11:20:04 <LordAro> as you might be able to tell from the expired cert, i haven't exactly been looking after this server
11:20:27 <dwfreed> the cert's not expired
11:20:38 <dwfreed> issued on may 25, 2024
11:21:03 <dwfreed> expires on august 23, 2024
11:21:18 <peter1139> LetsEncrypt, allowing abandoned servers to pretend to be secure forever... ;D
11:22:45 <peter1139> Oops, my bread rolls have extra unwanted culture :(
11:24:00 <andriy2> LetsEncrypt is amazing, and https is always better then http, even if the server is outdated and can be hacked with metasploit in seconds
11:24:23 <LordAro> i definitely got an expired cert message from it a moment ago
11:25:36 <dwfreed> LordAro: the non www cert is expired
11:25:50 <dwfreed> but that redirects to www
11:27:16 <LordAro> dwfreed: that'll be it
11:27:21 <dwfreed> v:NotBefore: Dec 4 14:52:25 2021 GMT; NotAfter: Mar 4 14:52:24 2022 GMT
11:29:48 <andriy2> how do I set a breakpoint that stops when a region of memory is changed?
11:30:19 <dwfreed> what you're looking for is "conditional breakpoint"
11:32:17 <andriy2> Yea, I found rwatch, seams what I need
11:32:56 <dwfreed> oh, yeah, watchpoint is probably more accurate
11:33:07 <dwfreed> conditional breakpoint is a different thing
11:37:44 <peter1139> Shall I spend several weeks catching up on webcomics instead of working?
11:41:48 <dwfreed> I have so much media I wish to consume, I could probably do that every waking moment until the day I die and not get through the backlog
11:42:00 <dwfreed> let alone the new stuff that comes out between now and then
11:46:14 <peter1139> Phew, no more incompatible span iterators.
11:52:46 <andriy2> peter1139: mb I don't represent your best interest, but I don't see anybody else suggesting that you don't procrastinate over here :). Listen to my evil voice!
11:54:40 *** Flygon has quit IRC (Quit: A toaster's basically a soldering iron designed to toast bread)
12:07:06 <peter1139> "Poorly documented". Harsh.
12:11:48 <truebrain> CodeQL dares to say the things we don't π
12:43:04 *** andriy2 has quit IRC (Quit: WeeChat 4.3.1)
13:37:38 <andriydohniak> I am having the weirdest issues in existance! The memory of my widget is being overwritten, and I have no idea why
13:40:09 <andriydohniak> if somebody could tell me why does the size of the scrollbar is getting set to random values from random places when I open the company profit graph?
13:44:55 <_jgr_> You seem to be on Linux, so I'd suggest doing a build with AddressSanitizer enabled, this should make it clearer where the problem is
13:46:12 <andriydohniak> does asan check malloc and free?
13:46:20 <andriydohniak> or do I need valgrind for that
13:46:34 <andriydohniak> because for such a big game valgrind is just really slow
13:53:43 <_jgr_> Yes, it checks heap allocations, it should make it obvious if and where you have a use after free
13:58:45 <andriydohniak> I was thinking, I didn't do a make clean in ages, mb there is just some compilation issue, but we will see in ~5 min
14:00:04 <andriydohniak> It didn't do crap
14:00:51 <kuhnovic> Then it's consistently broken π
14:01:11 <andriydohniak> the adress sanitizer was also quiet
14:01:21 <andriydohniak> doing valgrind now
14:01:31 <andriydohniak> just to launch a window it takes ~2 min
14:02:10 <peter1139> Your NWidgetPart widget_ui array is not static.
14:02:46 <peter1139> They should be `static constexpr`
14:05:53 <andriydohniak> The code is crap, I am just experimenting, and because of my "clever" debugging it's even worse, but if you notice something I should change, please point it out, because I might just forget about it when cleaning up
14:13:03 <peter1139> I did point it out...
14:14:08 <andriydohniak> I just thought there were 100 things like that, and you saw how many there were and stopped pointing it out
14:21:41 <andriydohniak> Here is where the memory of the scrollbar->count is being overwritten:
14:24:38 <andriydohniak> the watched adress is *0x555559250188
14:25:40 <andriydohniak> because it is getting allocated by libc, I thing it somehow got free'd
14:25:59 <andriydohniak> and I don't know how to check that
14:42:27 <andriydohniak> I think I will try printing the address of that variable to the console, and using valgrind, and check if it pops up anywhere
14:46:25 <andriydohniak> How do I use fmt::println to print a pointer?
14:49:18 <andriydohniak> Where can I look up all the possible types that fmt::println accepts?
14:51:55 <andriydohniak> Are we using the latest version?
14:52:18 <_glx_> but usually we just use `{}`
14:53:05 <_glx_> and let fmt autodetect the type
14:53:31 <peter1139> Pointers must be cast to void *.
14:53:41 <andriydohniak> Ok, it works now
14:54:21 <andriydohniak> I was trying to use `{:x}`
14:54:29 <andriydohniak> and getting the weirdest templating errors
14:54:43 <andriydohniak> makes sense tbh
14:56:15 <_jgr_> `CompanySelectorWidget::RebuildList` appears to be being called much too early
14:57:29 <_jgr_> Calling CreateNestedTree on the parent window from a widget also looks wrong
15:00:34 <andriydohniak> _jgr_: it is wrong, but CompanySelectorWidget is constructed before, in the initializer list, so I don't know how to avoid it
15:01:13 <andriydohniak> And I need to initialize the list and the scrollbar somewhere
15:02:29 *** jinks has quit IRC (Ping timeout: 480 seconds)
15:02:29 *** jinks_ is now known as jinks
15:04:32 <_glx_> maybe check NetworkClientListWindow
15:04:43 <_glx_> it uses dynamic widgets
15:07:03 <_jgr_> andriydohniak: You're effectively calling it twice, with one set of widgets being orphaned
15:08:18 <_jgr_> In the CompanySelectorWidget constructor and the BaseGraphWindow constructor
15:09:08 <andriydohniak> The CreateNestedTree?
15:09:19 <andriydohniak> Ahhh! That makes a TONN of sence
15:09:47 <andriydohniak> but how can I construct CompanySelectorWidget after CreateNestedTree?
15:12:32 <andriydohniak> Ok, I have an idea
15:25:53 <andriydohniak> Ok, what's wrong now?
15:25:57 <andriydohniak> I thought I fixed it
15:26:17 <andriydohniak> I made the constructor do nothing, and created an init function
15:26:23 <andriydohniak> and called it after everything
15:36:51 <andriydohniak> Ok, I think that particular issue is fixed
15:38:01 <_jgr_> You seem to have removed both calls to CreateNestedTree?
15:40:12 <andriydohniak> _jgr_: Yes, because the OperatingProfitGraphWindow calls InitWindow, which calles CreateNestedTree
15:40:21 <andriydohniak> I put my init right after that
15:40:31 <andriydohniak> probably not in commited
15:41:51 <_jgr_> Ah OK, you added both of them in the prior commit
15:42:10 <andriydohniak> Idk what happened, look at the commit message :)
15:52:04 <andriydohniak> When I have a Company *, how can I turn it into a CompanyID
15:53:44 *** HerzogDeXtEr has joined #openttd
15:54:18 <andriydohniak> but I think it also shows all the companies that don't exist
15:54:33 <andriydohniak> Ok, Company::IsValidID()
15:55:47 <andriydohniak> _jgr_: I don't think that is correct, there is a company with index 0
15:56:06 <andriydohniak> and that's an invalid CompanyID, because it's an invalid Owner
15:56:38 <_jgr_> 0 is a perfectly valid CompanyID
15:56:38 <andriydohniak> It's not specific to the company
15:58:06 <andriydohniak> Then why does Company::IsValidID fails?
16:00:00 <_jgr_> Have you changed this in your patch?
16:00:20 <andriydohniak> I am not working on my patch
16:00:28 <andriydohniak> it's a normal base
16:00:33 <andriydohniak> rebased on top of master
16:01:39 <andriydohniak> why is this so fricking hard?
16:01:42 <_jgr_> As for the graph UI, OnResize is called from FinishInitNested, which is now before CompanySelectorWidget::init
16:04:13 <andriydohniak> Are you looking at the latest commit?
16:05:38 <andriydohniak> _jgr_: wow you are actually sacrafising your time and space and git pulling, I thought you would just look at it for a sec in github! Thanks for the help
16:07:52 <_jgr_> It's quicker to run it and look at the crash log than to step through it by eye
16:08:01 <andriydohniak> that is true :)
16:08:24 <andriydohniak> but cloning any openttd repo with full story takes at least 2 min, and 5 min to compile
16:08:51 <_jgr_> I just added your fork as another remote to my existing clone
16:09:44 <andriydohniak> look at the assert
16:56:00 *** Wormnest has joined #openttd
16:57:08 *** virtualrandomnumber has joined #openttd
17:34:41 <andriydohniak> Finally this crap works!!!
17:35:13 <andriydohniak> The layout will get changed, this is just for testing
17:35:18 <andriydohniak> filtering also works
17:41:56 <andriydohniak> alfagamma7: still need to program in a lot of functionality
17:41:59 <andriydohniak> this is just a test
17:50:15 <peter1139> our resize height (height of each WWT_MATRIX row) should be something like `GetCharacterHeight(FS_NORMAL) + padding.height`
17:51:59 <andriydohniak> what is padding?
17:52:12 <andriydohniak> I know it's a parameter
17:52:21 <andriydohniak> but how is it determined?
17:52:47 <peter1139> It's provided to UpdateWidgetSize based on the widget type.
17:53:24 <peter1139> The value is just a suggestion, but using the suggestion keeps things consistesnt.
17:56:05 *** virtualrandomnumber has quit IRC (Quit: virtualrandomnumber)
17:58:08 * andythenorth have found the OpenAI API tools
17:58:10 <peter1139> You have a patch for that?
18:12:48 *** HerzogDeXtEr has quit IRC (Read error: Connection reset by peer)
18:13:49 <andriydohniak> I can't figure it out :(
18:26:50 <andriydohniak> I set the minimal / starting size to be 1 line height, how do I make sure it doesn't have "slack"
18:33:38 <andriydohniak> I disabled fill, now it works, but when it spawns, it looks like this:
18:33:55 <andriydohniak> and as soon as I move the window, it snaps to being big again
18:35:38 <andriydohniak> I forgot that fill is not a binary, I can set it to row_height
18:35:54 <andriydohniak> sorry for spamming, but when I spam here, new ideas come to me
18:38:34 <andriydohniak> From segfaults to working! I am so happy, now I think I +- understand how the widget system works
19:36:29 *** Wormnest has quit IRC (Ping timeout: 480 seconds)
19:57:13 <andriydohniak> I made a different selection, which one is better?
19:58:00 <andriydohniak> andriydohniak: Or this one?
20:20:31 <andriydohniak> I think this one is perfect:
20:21:34 <talltyler> Graphs have needed some love for a while
20:22:29 <talltyler> I know you are just doing companies, but that highlighting would be a nice improvement to the cargo value graph, especially when the industry set has a lot of cargos π
20:26:33 <andriydohniak> talltyler: I will add it there too
20:28:10 <andriydohniak> talltyler: Now I got excited, and want to implement a better selector for cargo too
20:28:24 <andriydohniak> now I have to make my company selector, a universal selector
20:33:52 <andriydohniak> And the funny thing it will probably work well, just needs a bunch of work
20:37:41 <talltyler> Pretty soon youβll be like the rest of us, spending more time writing code than playing the game π
20:37:50 <andriydohniak> talltyler: Already there
20:38:01 <andriydohniak> I plated < 15h of openttd
20:38:33 <andriydohniak> and was "coding" (mostly trying to understand) ~80h
20:40:12 *** nielsm has quit IRC (Ping timeout: 480 seconds)
20:41:02 <andriydohniak> and I am horrible at estimating time spent, so I am probably undercounting both of those values
20:47:40 <talltyler> Oh, youβre one of those hardcore βdiscovered OpenTTD as a coding exerciseβ people π (respect!)
20:48:53 <andriydohniak> talltyler: No, I started playing, I joined an online server, and people were talking trough some replay bot with other servers. I asked why not just make 1 giant one, and they told me that there was a 15 company limit.
20:49:05 <andriydohniak> I thought "How hard could it be to change that?"
20:49:12 <andriydohniak> The game IS open source
20:49:16 <andriydohniak> so now we are here
20:49:46 <_glx_> and the usual finding is "harder than I first though"
20:50:02 <andriydohniak> _glx_: I thought I fully solved it at least 8 times
20:50:10 <andriydohniak> and 8 of them so far I was wrong
20:50:20 <andriydohniak> but it's mostly solved, with some UI bugs
20:50:59 <andriydohniak> so now I am working on the UI to make it better, with a possiblity to add my patch in the future
20:51:05 <andriydohniak> (fixed up of course)
20:51:45 <andriydohniak> I want to have a c++ function pointer that also takes `this`, how is that possible
20:52:16 <andriydohniak> Or a lambda is also fine
20:52:46 <andriydohniak> but I need to be able to assign it
20:55:11 <andriydohniak> I think I will just pass in the struct ptr as an argument for now
20:56:38 <_glx_> `this` is just a pointer π
20:58:14 <andriydohniak> but will it be passed in automatically?
20:58:40 <andriydohniak> How does c++ keep track of which "this" goes where?
20:58:54 <andriydohniak> and does it break when taking a function ptr?
20:59:07 <_glx_> you can pass it as function parameter
20:59:56 <andriydohniak> so just create `void (*fun) (StructName \*this)`
21:00:11 <_glx_> don't name it this π
21:00:21 <_jgr_> this is only for member functions, not free-standing ones
21:01:00 <andriydohniak> yea, I know I can do it as a separate name, I was asking if it's possible to have a function that is passed by a function ptr, that retains it's `this`
21:01:06 <_jgr_> It may be worth considering std::functions if you want functions ptrs with state
21:01:27 <andriydohniak> just call with args, no state
21:02:28 <_jgr_> A retained value of the this pointer is state
21:03:25 <andriydohniak> but if it's just a pointer to a static function, why that would be statefull?
21:04:11 <andriydohniak> I decided to make the function static, I can just pass in the object myself, to avoid problems
21:04:27 <andriydohniak> but in the future I might take a look at std::function
21:05:32 <_glx_> yeah just pass `this` as parameter for the function
21:17:23 *** HerzogDeXtEr has joined #openttd
21:23:59 *** keikoz has quit IRC (Ping timeout: 480 seconds)
21:27:09 <andriydohniak> Tomorrow is gona be a big day (for my GUI project)! I can feel it
21:31:52 *** Wormnest has joined #openttd
21:42:20 *** tokai|noir has joined #openttd
21:42:20 *** ChanServ sets mode: +v tokai|noir
21:49:16 *** tokai has quit IRC (Ping timeout: 480 seconds)
21:59:34 <andriydohniak> peter1138: The Haribo is a lie!
22:11:54 *** HerzogDeXtEr has quit IRC (Read error: Connection reset by peer)
22:39:52 *** Leopold_ has joined #openttd
continue to next day β΅