Config
Log for #openttd on 1st March 2023:
Times are UTC Toggle Colours
06:41:42  *** nielsm has joined #openttd
14:04:02  <Xarick> how are groups deleted, where is the code?
14:04:15  <Xarick> delete g; where does this go?
14:08:30  <glx[d]> Group::~Group()
14:09:19  <glx[d]> c++ basic stuff
14:11:32  <Xarick> there is no Group::~Group()
14:11:43  <glx[d]> ah no we rewritten delete for pool items
14:11:57  <LordAro> not basic stuff :p
14:12:17  <Xarick> i wanna do something on deletion
14:12:34  <Xarick> subtract 1 to num_groups of a company
14:12:42  <Xarick> it's a company property im creating
14:12:55  <glx[d]> <https://github.com/OpenTTD/OpenTTD/blob/master/src/core/pool_type.hpp#L256-L262>
14:13:15  <LordAro> needless to say, something specific to groups should not be added to that
14:13:35  <glx[d]> yeah I just link to how we delete
14:17:06  <glx[d]> you probably need to implement Group::~Group()
14:18:38  <glx[d]> like it's done for BaseStation or Order
14:30:09  <Xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1080497207469408287/Unnamed_1937-05-14.png
14:30:09  <Xarick> nice!
14:30:16  <Xarick> 64k groups per company
14:30:55  <Xarick> when a company buys another, how are the groups handled?
14:40:27  <petern> They company gets all the groups.
14:42:16  <glx[d]> <https://github.com/OpenTTD/OpenTTD/blob/master/src/economy.cpp#L423-L429>
14:43:36  <petern> Xarick: Problem with that is when groups are cleaned up you then need to check if g->owner exists, then get the company, then update the number of groups. For very group.
14:45:55  <petern> Must better to just do it in the few places where groups are expected to be added/deleted.
14:49:52  <glx[d]> another option could be to cache the counts at pool level in a generic way
15:11:52  *** WormnestAndroid has joined #openttd
15:13:19  *** WormnestAndroid has quit IRC
15:13:29  *** WormnestAndroid has joined #openttd
15:40:38  <Xarick> need to do a num_stations too
15:43:10  <Xarick> buoys don't count as stations, but oil rigs do, right?
15:43:19  <Xarick> for station listing purposes?
15:44:37  <Xarick> how am I dealing with oil rigs
15:48:28  <Xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1080516917959340173/Gredingstone_Transport_1935-06-04.png
15:48:28  <Xarick> yeah they get listed
15:52:16  <Xarick> this means, in the current openttd
15:52:42  <Xarick> i could have a list with more than 65535 items, given enough oil rings and stations?
15:52:54  <Xarick> ah, no, the hard cap is 64k, that includes neutral
15:53:11  <DorpsGek> [OpenTTD/OpenTTD] rubidium42 commented on pull request #10527: Atomic libraries: fix build on riscv64 https://github.com/OpenTTD/OpenTTD/pull/10527#issuecomment-1450381526
15:55:02  <DorpsGek> [OpenTTD/OpenTTD] rubidium42 merged pull request #10526: Fix: O(N^2) cost of Station::RecomputeCatchmentForAll https://github.com/OpenTTD/OpenTTD/pull/10526
15:57:28  <DorpsGek> [OpenTTD/OpenTTD] matthijskooijman commented on pull request #10527: Atomic libraries: fix build on riscv64 https://github.com/OpenTTD/OpenTTD/pull/10527#issuecomment-1450388919
16:14:38  *** TROILUS has joined #openttd
16:44:46  *** HerzogDeXtEr has joined #openttd
17:15:38  *** geli has joined #openttd
17:23:04  *** tokai has joined #openttd
17:23:04  *** ChanServ sets mode: +v tokai
17:29:06  *** GeorgeVB has joined #openttd
17:29:06  <GeorgeVB> Could someone help with
17:29:06  <GeorgeVB> https://github.com/George-VB/xussrset/issues/105
17:29:07  <GeorgeVB> For some reason, ELRL trains, like from BRTrains2, are shown in non electrified depots, but I can't understand what makes them to act this way
17:29:07  <GeorgeVB> https://github.com/George-VB/xussrset/blob/main/src/rails/railtrack.pnml
17:30:04  *** tokai|noir has quit IRC
17:33:00  *** Wormnest has joined #openttd
17:46:30  <audigexJon> BRTrains track definitions are a shitshow, so it's possible it's a GRF bug not an OpenTTD one?
17:47:19  <audigexJon> <https://github.com/BRTrains/BRTrains2/blob/master/src/railtypes.pnml>
17:47:19  <audigexJon> Is it all BRTrains ELRL units showing up, or just some? If just some, which ones?
17:48:01  <GeorgeVB> Dutch trains set does not have an issue
17:48:17  <GeorgeVB> I didn't check others
17:48:53  <audigexJon> https://user-images.githubusercontent.com/100433052/219779257-0f35f65c-0783-4732-b45d-ec218d85c1f3.png
17:48:53  <audigexJon> Also the screenshot doesn't seem to show BRTrains2 - those are RUKTS units - am I missing something there?
17:49:46  <GeorgeVB> I didn't check other sets yet, BRtrains2 was just the first one to reproduce
17:54:17  <audigexJon> Looks like a bug with the track set, not OpenTTD itself - this conversation probably belongs in Discord channel #add-on-development or somewhere specific to the track set
17:55:18  <GeorgeVB> Copied there
18:03:00  <andythenorth> petern: I had sandwich spread on toast
18:04:33  <andythenorth> FLHerne: I wonder about caching the result to permanent storage and only updating it occasionally
18:04:47  <andythenorth> FIRS smacks down fps in my experience
18:04:59  <andythenorth> for that exact case of a few industries on the screen
18:05:39  <andythenorth> it doesn't need to check snowline, fence state, terrain etc on every drawing tick
18:14:39  <Xarick> what's the difference between BaseStation and Station
18:14:50  <petern> Base
18:15:26  <Xarick> do I iterate BaseStation or Station, to count the number of station indexes?
18:15:38  <andythenorth> what kind of station is it?
18:15:39  <andythenorth> 😛
18:16:07  <Xarick> trying to get who owns the station index
18:16:19  <Xarick> get a count of it
18:16:24  <Xarick> per company
18:22:57  <Xarick> number of stations cache mismatch
18:23:02  <Xarick> I failing
18:23:57  <Xarick> where is the station deleted
18:25:49  <Xarick> ah, StationHandleBigTick
18:30:12  <Xarick> this dude delays the removal of the station
18:30:22  <Xarick> or i dont know
18:31:00  <Xarick> i build a station, num_stations counter goes up by 1
18:31:17  <Xarick> i remove station, the sign remains, I am still the owner of the sign
18:31:39  <Xarick> then after a while, the sign is about to poof, but the num_stations cache is already wrong
18:32:32  <Xarick> num_stations on the cache is 1, but it's actually 0 when i count the num of stations i own
18:32:37  <Xarick> why
18:33:59  <Rubidium> because your code's logic is flawed?
18:35:18  <Xarick> yes 😦
18:37:01  <Xarick> okay i think i found the problem
18:39:11  <Xarick> got it right now
18:39:19  <Xarick> this->owner instead of _current_company
18:40:34  <glx[d]> _current_company is only usable at command level I think
18:44:00  <Xarick> okay, i partially solved the scrollbar, no more than 64k groups per company, nor 64k stations per company
18:44:25  <Xarick> the only problem is the neutral stations being counted in the station list window
18:45:26  <Xarick> that would surpass the limit of 64k
18:45:48  <Xarick> scrollbar bug will occur when there's 65535 or more items
18:46:19  <Xarick> 1535 different oil rigs is probably not gonna happen
18:46:38  <Xarick> but if someone tries enough, it can still crash the scrollbar
18:47:36 

Powered by YARRSTE version: svn-trunk