IRC logs for #openttd on OFTC at 2024-06-03
β΄ go to previous day
01:56:45 *** Wormnest has quit IRC (Quit: Leaving)
02:08:58 *** ChanServ sets mode: +v tokai
02:15:56 *** tokai|noir has quit IRC (Ping timeout: 480 seconds)
02:28:14 *** debdog has quit IRC (Ping timeout: 480 seconds)
02:53:53 *** gnu_jj_ has quit IRC (Ping timeout: 480 seconds)
04:42:40 <DorpsGek> - Update: Translations from eints (by translators)
06:45:37 <LordAro> some of my colleagues would beg to differ
06:46:02 <LordAro> extrapolate? actually think about the change (request)? pah
07:12:21 <pickpacket> hrrm. My if statement is all wrong
07:13:05 <DorpsGek> - Add: summary for week 22 of 2024 (by OpenTTD Survey)
07:29:27 <peter1138> I'm spreading floats throughout the game, perfect.
07:31:17 *** ialokin has quit IRC (Ping timeout: 480 seconds)
07:48:49 <peter1138> Okay, it no longer blows up Xorg.
07:51:24 <peter1138> This is not quite right π
07:51:47 <pickpacket> hate negated statements..
07:53:46 <peter1138> (Last time I tried this branch was before I changed the meaining of ZOOM_LVL_NORMAL.)
07:54:45 <peter1138> It looks about 4x too small, which is most probably not a coincidence π
08:41:08 <LordAro> clearly used the wrong constant before!
08:45:40 <peter1138> Yeah, 3c94e816 fixed that in master of course.
09:30:18 <peter1138> Build states for fishing grounds in FIRS 5 eh?
09:33:45 <johnfranklin> dinner was far more spicy than expected. icecream was consumed consequently.
10:02:43 <dwfreed> truebrain: think I could talk you into supporting multiple channels in dibridge? <3
10:17:14 <andythenorth> peter1138: bulldozers at sea?
10:17:38 <andythenorth> peter1138: 'maybe'
10:17:40 <peter1138> Such piles of dirt.
10:25:50 <peter1138> That uses bilinear scaling it seems.
10:27:12 <andythenorth> wonder how much the browser decides
10:27:15 <peter1138> Even 2x there looks blurry.
10:27:34 <peter1138> There's a css property to tell it to not apply bilinear filtering.
10:27:57 <peter1138> `image-rendering: pixelated;` I believe.
10:28:39 <andythenorth> I get by default in Chrome
10:29:37 <peter1138> That image does not have sharp edges.
10:30:11 <andythenorth> pixelated rendering does indeed make it crisp
10:33:48 <peter1138> And my scaling does not do bilinear interpolation. Maybe it should for 32bpp graphics.
10:34:35 <peter1138> MIght look bad when mixing them.
11:15:04 *** reldred has quit IRC (Quit: User went offline on Discord a while ago)
12:19:12 *** SigHunter has quit IRC (Read error: Connection reset by peer)
12:19:24 <talltyler> The new Simutrans release has Steam achievements π
12:19:40 *** SigHunter has joined #openttd
12:20:14 <talltyler> I wonder if theyβre using plugins or just braver than we are about integrating Steam code into their codebase
12:21:27 <talltyler> I guess achievements would probably be possible with our plugin
12:22:07 <talltyler> Of course, the concern about not providing a different game to users on different platforms still applies π
12:22:15 <squirejames> I've been suspicious of Steam code injections since they totally borked an old strategy game I play with their integrations and never fixed it
12:22:40 <squirejames> GoG and original CD versions work fine, Steam one constantly crashes
12:47:27 <truebrain> dwfreed: What do I get for it? π
12:47:55 <peter1138> A (tracking) cookie.
13:04:11 *** HerzogDeXtEr has joined #openttd
13:40:42 *** XYZ has quit IRC (Ping timeout: 480 seconds)
13:51:00 *** gelignite has joined #openttd
14:13:27 *** XYZ has quit IRC (Ping timeout: 480 seconds)
14:36:51 *** gelignite has quit IRC (Quit: Stay safe!)
14:44:18 <peter1138> I keep typing `nullptr` in my C# code...
14:51:30 <audigex> peter1138: Just throw a `private readonly Object nullptr = null;` in every class, problem solved
14:51:47 <audigex> Follow me for more weekly .NET tips
14:52:02 <peter1138> I think "solved" is doing heavy lifting there.
16:23:48 *** _zephyris has joined #openttd
16:23:48 <_zephyris> peter1138: It's _ok_... Presumably doesn't come with newgrf 1.5x support π
16:25:29 <peter1138> But good luck convincing GRFCodec/NML to handle it.
16:26:27 <peter1138> I fudged grf-py to do it.
16:26:35 <peter1138> But then I also have the SVG stuff.
16:26:54 <peter1138> Although SVG doesn't do "texture" very well.
16:28:39 <andythenorth> I am assigning industries on the map to GS-generated 'manufacturers'. Manufacturers have a category ('steelmaker', 'chemicals' etc), which governs which industry types they can 'own'. Manufacturers have a HQ town. Industries need to be distributed relatively evenly across the manufacturers in each category (for example there can be n steelmakers. Assignment of industries is from a list of al
16:28:39 <andythenorth> relevant candidates on the map. Candidates nearer the manufacturer's HQ town should be assigned to that manufacturer first. Different manufacturers in the same category can have the same HQ town.
16:31:07 *** Smedles has joined #openttd
16:35:34 <andythenorth> I need some kind of partitioning thing, that will be deceptively simple when someone tells me what it is π
16:42:10 <andythenorth> so how about copying all the industries for category into n lists, for n manufacturers in the category. Then valuating each list by distance to 1 manufacturer. Then taking the first industry from the list for manufacturer A, and assigning it to manufacturer A, and removing it from all candidate lists. Then repeat for manufacturer B etc
16:53:39 <andythenorth> GPT proposed just using one list and resorting it for each current manufacturer as we loop through them
16:56:23 <andythenorth> it's written me some squirrel for it, although it's not squirrel not GS
16:59:46 *** Leopold_ has joined #openttd
17:06:40 *** gelignite has joined #openttd
17:53:36 <peter1138> Imagine if you could make graphics this good.
18:04:40 *** gelignite has quit IRC (Read error: Connection reset by peer)
18:05:58 <michi_cc> Apparently they are braver, but then Simutrans is not GPL.
18:07:09 *** gelignite has joined #openttd
18:08:46 <peter1138> Hmm, seems they still use svn and that just a git mirror, heh.
18:09:18 <peter1138> Although it has a failing CI
18:36:27 <andythenorth> how can I find which industries in a list are most remote from a specific list of towns
18:36:41 <andythenorth> i.e. those that are most isolated
18:40:10 <peter1138> Urgh, I need to sort my brakes out.
18:43:04 <peter1138> Main issue is all the oil came out
18:59:42 *** bigyihsuan has joined #openttd
18:59:42 <bigyihsuan> andythenorth: maybe take the distance of each industry to each town and take the largest?
18:59:42 <bigyihsuan> though that's `O(n*m)` in both space and time so probably not the best way of doing it
19:02:55 <bigyihsuan> andythenorth: maybe voronoi with points on each manufacturer's headquarter town (for each category) and prioritize assigning to the manufacturers industries within their headquarters cell?
19:06:33 <andythenorth> bigyihsuan: that was GPT's suggestion
19:07:31 <andythenorth> it is possible to break early for the case where another industry is already known to be more remote
19:11:49 <andriydohniak> andythenorth: what if you just reverse your algorythm, instead of spawning industries first, and then assigning them to the correct manufacturer, you just spawn them yourself close to every manufacturer
19:12:28 <bigyihsuan> andriydohniak: can game scripts even do that?
19:12:30 <andriydohniak> But I might have missunderstood the problem statement
19:12:41 <andriydohniak> bigyihsuan: They cant?
19:12:52 <bigyihsuan> where's those api docs, i need to check this
19:14:10 <andythenorth> andriydohniak: this is the alternative route
19:14:19 <andythenorth> but it requires clearing the map at game start
19:15:02 <andythenorth> and it requires reimplementing some of the core game's placement routine
19:15:23 <andythenorth> it's viable, but I suspect it will lead to a degradation of the grf
19:15:40 <andythenorth> as I will spend more time on the GS placement rules, and less time on the grf placement rules
19:16:06 <bigyihsuan> doing it on the gs side is probably not a good idea
19:16:53 <andriydohniak> andythenorth: Ok, can you from GS check if a tile is an industry?
19:17:48 <andriydohniak> If so, you can start with the list of manufactureres, and go in a spiral and "collecting" all unclaimed industries, untill you have enough per manufacturure
19:18:16 <andriydohniak> How many times do you need to do that? Can you just store the result? If so, n**2 algorythm is fine
19:18:25 <bigyihsuan> looking at the docs, it looks like the api makes a list of industries public
19:19:02 <andythenorth> andriydohniak: I need a more or less equal distribution per manufacturer
19:20:00 <bigyihsuan> bigyihsuan: then you could probably sort by distance to a specific tile and go from there
19:20:21 <andriydohniak> andythenorth: yea, so you start with a number of manufactureres, for example 10, you have the number of industries of the correct type, for example 100, then you just go through each of the 10 industries, and spiriling collect 10
19:20:34 <andriydohniak> It won't be perfect, but it will be fine
19:20:57 <andriydohniak> The other option is to do voronoi, to make it actually perfect, but it's kinda hard
19:21:15 <andriydohniak> bigyihsuan: The spiral will do that too, so no need
19:21:48 <andythenorth> it needs to round-robin between manufacturers
19:21:58 <andriydohniak> andythenorth: it can
19:22:03 <andriydohniak> that shouldn't be hard
19:22:22 <andythenorth> there are two different challenges I'm trying to solve
19:22:33 <andriydohniak> but then the industries of manuf.. will overlap
19:22:40 <andythenorth> assigning industries by distance is relatively easy, it's probably about 15 lines
19:22:43 <andriydohniak> So they won't be segmented
19:22:52 <andythenorth> but finding the most remote industries seems very hard
19:23:05 <andriydohniak> andythenorth: How often do you need to do that ?
19:23:13 <andythenorth> only once at game start
19:23:25 <andythenorth> but we can't predict map size or number of industries or towns
19:23:41 <andriydohniak> bigyihsuan: That is too expencive, here we are dealing with easy distances
19:23:53 <andriydohniak> andythenorth: give me a max bound
19:24:18 <andythenorth> not sure on number of industries or towns
19:24:32 <andythenorth> I made a JGRP map that took about 5 hours to generate
19:24:33 <bigyihsuan> andriydohniak: but it's only happening once at game start, so expensiveness isn't that important of a factor (yet)
19:24:50 <andriydohniak> andythenorth: Let's just say they are small towns, and you can't place them closer than ~50 tiles in between each other
19:24:51 <andythenorth> there are limited opcodes for GS
19:25:26 <andriydohniak> bigyihsuan: It's more expencive, and uselessly complicated, this is not a graph
19:25:40 <bigyihsuan> andythenorth: what's your definition of "most remote"
19:28:32 <andythenorth> furthest from any town in list of n towns
19:30:24 <andriydohniak> I don't get it, you have manufacturures, that want to have industries close by, what are the towns again?
19:31:27 <andythenorth> manufacturers have a HQ town, but that's an extraneous detail for the purposes of calculating
19:32:44 <bigyihsuan> andythenorth: so a list of industries that are "most remote", or just one industry?
19:32:58 <andriydohniak> I would recommend to start with the simplest solution possible:
19:32:58 <andriydohniak> - have a list of avilable industries
19:32:58 <andriydohniak> - iterate through all the manufacturures
19:32:58 <andriydohniak> - sort the list by proximity to the curr manuf
19:32:58 <andriydohniak> -while not enough industries for this manuf
19:32:59 <andriydohniak> - pop the top one in the list for itself
19:36:28 <andythenorth> that's also what GPT wrote
19:37:26 <andythenorth> I don't know how expensive the sort is
19:37:50 <andriydohniak> andythenorth: n logn
19:38:08 <andriydohniak> and the distance compute is is O(1)
19:38:16 <andythenorth> well we have to calculate all the distances every time the sort is called
19:38:28 <andriydohniak> andythenorth: but that is O(n)
19:38:31 <andythenorth> 'probably fine'?
19:39:50 <andriydohniak> It's fine, at this scale you will hit other limitations way before time complexity problems with the sorting
19:40:39 <andriydohniak> And the total complexity is not n**2, because you are popping from the list
19:40:47 <bigyihsuan> if it were me i'd go with the simple solution first and optimize later
19:40:54 <andriydohniak> so it should still be n log n
19:41:48 *** Wormnest has joined #openttd
19:50:25 <peter1138> Is the simple solution something like "spend 2 months trying to train ChatGPT to write GS first"?
19:56:02 <andythenorth> peter1138: can let you know in 7 weeks?
19:57:38 <truebrain> That ... is asking for a lot of trouble
19:58:09 <truebrain> That should not be part of the GS API
20:00:50 <LordAro> does it correctly limit it to GSes ?
20:08:00 <peter1138> This is very andy... trying to work around something by doing it in GS.
20:08:53 <andythenorth> it's the next wave
20:09:05 <andythenorth> "this is the year of GS on the desktop"
20:10:04 *** michalc5706 has joined #openttd
20:10:04 <michalc5706> truebrain: Oh no!
20:10:16 <truebrain> We already have three places that do this .. console, rcon, adminprotocol .. we could better focus on improving those to supply this functionality, than to add a fourth π
20:10:51 <truebrain> michalc5706: Sorry, not sure who steered you in this direction, but it really isn't a good idea (in my opinion)
20:11:10 <michalc5706> truebrain: Er... I just steered myself!
20:11:27 <truebrain> GameScript should not be able to interact with the game like this .. Just imagine the DoS potential here π
20:12:53 <truebrain> I once did fantasise about creating a Scripting addition for the console
20:13:03 <truebrain> Instead of the current console .. "langauge" π
20:13:18 <truebrain> ConsoleScript when? π
20:14:37 <truebrain> But more short term, maybe a nice idea to make a console command that triggers a console script every N ticks?
20:15:35 <peter1138> In a different language? Something obscure and obsolete, of course.
20:16:08 <peter1138> GameScript really means GameplayScript.
20:18:12 <truebrain> There is already a new-game console hook, that calls a script when a new game starts
20:18:51 <truebrain> So maybe better to have a "trigger <script> <interval-in-ticks>", which calls the console script after N ticks
20:19:02 <truebrain> If you want to repeat that, call it again in that script
20:19:16 <truebrain> "Script" .. they are just files with console commands to execute π
20:19:33 <truebrain> Not actual scripts like GS
20:19:59 <michalc5706> truebrain: Ah that is very almost what I would like, but I did actually like the save happening on the 1st of every month... so not _exactly_ a fixed amount of game ticks
20:20:19 <truebrain> So much demand π π
20:20:48 <_jgr_> michalc5706: If you're happy with saves being output at a fixed deterministic interval you can run with `-d desync=3`
20:20:56 <_jgr_> This will write saves to the autosave folder
20:21:10 <truebrain> `trigger bla.scr on-month-change` π
20:22:22 <truebrain> `schedule bla.scr */30 * * *`
20:22:22 <truebrain> `schedule bla.scr * 1 * *`
20:22:36 <truebrain> Not sure any of these are good ideas π
20:23:29 <truebrain> Ticks, day, month, year, was my imaginary units for schedule btw
20:25:29 <michalc5706> _jgr_: Oh will have a nose around the desync thing!
20:26:39 <truebrain> Btw, don't ask why the extension is scr .. I just don't want to talk about that π
20:27:03 <michalc5706> truebrain: I wonder if `trigger bla.scr monthly`? Is reasonable... can be added to later with daily or whatever
20:28:03 <truebrain> Either "trigger next month" or "schedule monthly", but yeah, console is a bit of a mess anyway. I wouldn't have an issue with that.
20:28:37 *** gelignite has quit IRC (Quit: Stay safe!)
20:28:42 <michalc5706> Ah: so I don't need it for my case, but should there be a way of stopping the schedule?
20:29:01 <truebrain> That is why I like the trigger idea a bit more
20:29:13 <truebrain> You can set a new on in your script if you want to keep going
20:29:36 <truebrain> There is no branching btw
20:30:30 <michalc5706> To check something, do games progress during the script? It's not in a thread or anything like that?
20:30:51 <truebrain> Console is very old, like, very old
20:31:00 <truebrain> It runs in the game thread, blocking
20:31:07 <michalc5706> That is actually what I want!
20:31:35 <_glx_> but GS also run when game is paused
20:32:17 <_glx_> as it can pause and unpause
20:32:34 <michalc5706> _glx_: Ah I wasn't too conscious of that - but for my case I would have checked the game date before doing anything (but understood, Game Script is not the place for what I want)
20:33:01 <truebrain> GameplayScript would have been such a better name π
20:36:27 <truebrain> No worries. Here to help (and judge π )
20:37:05 <michalc5706> Always happy for some (friendly!) judgement π
23:48:30 *** Flygon has quit IRC (Read error: Connection reset by peer)
continue to next day β΅