IRC logs for #openttd on OFTC at 2025-02-25
β΄ go to previous day
00:15:18 <peter1138> badgeception: a badge that chsnges appearance based on other badges assigned to the item.
02:24:08 *** Wormnest has joined #openttd
02:28:19 *** florafex has joined #openttd
02:28:19 <florafex> frosch123: i still see that occasionally to this day :p
03:01:59 *** Wormnest has quit IRC (Quit: Leaving)
03:39:49 *** debdog has quit IRC (Ping timeout: 480 seconds)
04:43:15 <DorpsGek> - Update: Translations from eints (by translators)
07:27:35 *** keikoz has quit IRC (Ping timeout: 480 seconds)
07:37:02 *** tokai|noir has quit IRC (Ping timeout: 480 seconds)
07:39:07 *** ChanServ sets mode: +v tokai
08:08:32 *** SigHunter has joined #openttd
08:34:51 <peter1138> Hmm, {BADGE} string command?
08:35:25 <peter1138> Might be a pain for layouters.
08:38:29 *** D-HUND has quit IRC (Ping timeout: 480 seconds)
09:03:38 *** merni has quit IRC (Quit: User went offline on Discord a while ago)
09:04:19 <andythenorth> does it show the sprite or the string? π
09:11:40 <peter1138> Yeah, that was something I was thinking after.
09:12:03 <peter1138> {BADGE_ICON} and {BADGE_NAME}
09:12:12 <peter1138> {BADGE_NAME} would even be easy.
09:12:33 <peter1138> {BADGE_ICON} less so :)
09:13:18 <peter1138> Needs a way to inject a sprite ID into the string.
09:16:06 <peter1138> Strings are utf-8 internally, so it would need to be valid utf-8 value. There are 2 private use areas but only 65534 IDs in each.
09:19:20 <peter1138> We can break the spec and use a non-utf16 compatible plane, because the layouters need utf-16 internally. (Yeah, we do conversion.)
09:20:24 <andythenorth> injecting arbitrary sprites to strings via badges eh? π
09:21:06 <andythenorth> so my nukes GS could have a body count?
09:23:11 <peter1138> If you go with "only inject badge sprites" then encoding a badge id is simpler as there are less of them.
09:23:54 <peter1138> Doesn't the story book have some sprite features?
09:24:38 <peter1138> Ah, I guess only 4 pre-defined sprites that aren't reference by id.
09:24:58 <peter1138> But story book pages are not town/industry extra text.
09:26:15 <andythenorth> the story book is not a thing we talk about π
09:26:31 <andythenorth> some people have been naughty with it
09:26:47 <peter1138> Making admin intefaces?
09:28:53 <andythenorth> and crude debugger
09:28:58 <andythenorth> 'too many strings'
09:31:31 <peter1138> Badges give you a whole new way to add strings...
09:32:19 <peter1138> {BADGE_NAME} could be weird with languages.
09:32:56 <peter1138> I hate it when my CI segfaults :S
09:46:35 <xarick> desert-covered rocks next?
09:58:45 <wensimehrp> peter1138: I do have a question for badges in strings though.
09:58:45 <wensimehrp> Currently the game displays cargo icons and some other icons beside text. For example when a vehicle is lost in the vehicle window there would be a triangle warning icon drawn beside the text. For me it would make sense if those icons (and cargo icons) can be accessed via the badge string command. I tried defining a new badge item that uses default graphics though (I think it was 5021 or
09:58:45 <wensimehrp> something? The town rating one) and unfortunately it didn't work.
10:08:21 <andythenorth> we could sub out all the cargo icons to badges?
10:08:37 <andythenorth> I could convert FIRS 5 to that, it's still only beta
10:12:06 <peter1138> Action 3/2/1 chains cannot access sprites outside of the Action 1 spriteset.
10:13:23 <peter1138> Additionally those cargo icons next to text are programmatically displayed as sprites, with the text drawn next to them. They are not drawn as some combined string with icon+text embedded in it.
10:16:26 <peter1138> While automatically creating badges from cargos might be possible, I'm not sure what for.
10:22:01 <peter1138> Hmm, pondering different mastodon servers.
11:09:02 <xarick> no AI can reach 5000 trains * 15
11:09:14 <xarick> still hoping for that day to come
11:28:22 <xarick> oh, aaahogex has japanense comments π
11:32:37 <xarick> so, i'm trying to identify why Hog ends up in an infinite loop
11:35:28 <peter1138> How does an AI know what cargoes to transport between towns?
11:35:55 <peter1138> Do they built stations near towns and go by the acceptance of the stations.
11:36:03 <peter1138> Or do they perhaps just assuming passengers and mail.
11:36:51 <xarick> bad idea as it turns out mail might not even exist
11:37:45 <peter1138> Houses can produce other cargo types.
11:37:59 <peter1138> But that might be a bit too vague.
11:38:54 <peter1138> Just wondering if there should be a way to list the town production cargoes.
11:39:25 <peter1138> Possibly just a combined list of town_production_cargoes[TPE_PASSENGER] and [TPE_MAIL].
11:39:40 <peter1138> These are global, not per town.
11:40:05 <peter1138> You can get the specific info from a station though, of course.
11:46:07 <peter1138> Hmm, can script lists be strings?
11:46:27 <peter1138> Eh, can script list items be strings.
11:47:41 <xarick> items and value, both integer
11:47:43 <andythenorth> squirrel lists, or the fancy valuatable lists?
11:47:55 <peter1138> I don't know what the difference is.
11:48:39 <andythenorth> squirrel lists are just arrays, with arbitrary contents
11:48:59 <andythenorth> OpenTTD script API has a <AI/GS>List class
11:49:12 <andythenorth> which I am not qualified to explain π
11:50:04 <peter1138> Basically... get an AIEngineList, and filter by badge?
11:50:18 <xarick> I used some kind of wrap to convert GSText
11:50:25 <xarick> so i could save the data
11:51:00 <xarick> ah, not sure what badge is?
11:51:20 <peter1138> Badge labels are strings.
11:51:37 <peter1138> They have an index internally, but...
11:52:01 <peter1138> Index may change between save/load, so you can't save it.
11:52:16 <peter1138> (Maybe not a massive problem)
11:52:31 <xarick> hmm, there's a function that lets us get the error string
11:52:39 <xarick> GSError.GetLastErrorString
11:53:36 <peter1138> var restaurant = AIBadge::Something("role/restaurant_car");
11:53:37 <_glx_> Can't put badge in list, but an HasBadge valuator should work
11:55:07 <peter1138> Not sure how valuators work internally, but it would want to only look up the badgeid once.
11:55:22 <peter1138> Otherwise it has to search all the badges for name for every item in the list.
11:57:25 <_glx_> The function could do some internal caching, storing both badge string and value, and only lookup if string changes
12:03:28 <xarick> hogai puts the main constructor function in the middle of other functions... strange style
12:03:57 *** efessel has joined #openttd
12:03:57 <efessel> Good morning! Just curious if there's an idea when 15 could release? I was planning some community server infra updates to coincide with the release
12:05:48 <xarick> does this answer peter's question
12:06:02 <efessel> LordAro - probably april is perfect thanks
12:07:47 <xarick> `dayLengthFactor = "GetDayLengthFactor" in AIDate ? AIDate.GetDayLengthFactor() : 1;` this doesn't exist...
12:09:03 *** tokai|noir has joined #openttd
12:09:03 *** ChanServ sets mode: +v tokai|noir
12:13:35 *** tokai has quit IRC (Ping timeout: 480 seconds)
12:15:50 <peter1138> What about... separate window for user badge configuration.
12:24:50 <xarick> he knew already what could happen, and still commented it out
12:36:57 * peter1138 closes an issue again.
12:39:50 *** tokai|noir has quit IRC (Ping timeout: 480 seconds)
12:44:00 *** ChanServ sets mode: +v tokai
12:57:21 *** pickpacket has quit IRC (Ping timeout: 480 seconds)
13:00:41 *** tokai has quit IRC (Ping timeout: 480 seconds)
13:05:34 *** ChanServ sets mode: +v tokai
13:13:07 <xarick> sort order is still incorrect
13:24:22 *** tokai has quit IRC (Ping timeout: 480 seconds)
13:26:20 <Artea> I made bus and mail trucks in "January" yesterday
13:26:45 <Artea> and did 4 new ones and they were considered #1 to #4
13:27:21 <Artea> on "my info" says 7 road vehicles
13:27:34 <Artea> and just found #10 from yesterday
13:27:44 *** ChanServ sets mode: +v tokai
13:30:24 <peter1138> Have you consider using the vehicle list, instead of having to "find" vehicles?
13:30:50 <Artea> I'm figuring out what I need to check
13:31:22 <peter1138> Depends what you think your problem is.
13:31:48 <peter1138> Sounds like you are suggesting that vehicles are vanishing, but you haven't really said as much.
13:31:50 <Artea> hard to understand what happened in 14h
13:32:18 <Artea> why is #1 and #10 active
13:32:43 <Artea> and when I made new ones got #1 instead of continuing
13:33:02 <peter1138> Unit numbers start at the first unused number.
13:34:00 <Artea> or not, but still, is because they had accidents or not renewed ?
13:34:42 <peter1138> What is the problem?
13:35:02 <Artea> perhaps they had some crash
13:35:49 <peter1138> Road vehicles can be crashed by trains on level crossings, by flooding (rare without user interaction), or by the small UFO disaster.
13:36:55 <peter1138> But presumably you remember who many you built in the first place...
13:37:03 <Artea> roads don't cross the rails
13:37:21 <Artea> I only did 1 train to city to city
13:37:39 <Artea> and a 2 or 3 bus / mail truck to do small paths
13:38:05 <Artea> coal to power plant had 2
13:38:21 <Artea> which the time didn't had city around it
13:43:57 *** pickpacket has joined #openttd
13:45:46 <Artea> not sure what happened but to me is very odd
13:54:19 <Artea> oh well, not that big of deal
13:54:29 <Artea> Thanks anyway for inform me, peter1138
14:25:23 *** kuka_lie has joined #openttd
14:30:26 <peter1138> Hmm, just found a Celeron on the floor. As you do.
14:32:36 <Rubidium_> that'd be the tier I would expect to be on the floor
14:33:34 <xarick> how do i see what's in the stack
14:34:04 <xarick> something's not saving
14:35:02 <xarick> i mean, it seems it's saving it, but apparently it is either overwritten, or forgotten, I can't quite tell
14:35:11 <xarick> some step might be missing
14:37:28 <xarick> sorter_type is 0, seems to behave as key
14:37:55 <xarick> then there's also another 0 in the actual list as key
14:41:28 <_glx_> Oh could be the issue indeed
14:42:43 <_glx_> Maybe enclosing in an array, or invert so the key is a bool
14:42:53 <_glx_> But array feels cleaner
14:52:25 *** Heiki has quit IRC (Quit: Bridge terminating on SIGTERM)
15:00:15 *** soylent_cow[m] has quit IRC (Ping timeout: 480 seconds)
15:38:19 *** Flygon has quit IRC (Read error: Connection reset by peer)
16:26:01 *** HerzogDeXtEr has joined #openttd
17:56:25 <truebrain> iek, a _ is chasing Rubidium around. Scary.
18:11:51 <xarick> I don't know wether AAAHogEx infinite loop is actually infinite
18:12:20 <xarick> or if it actually had so many route plans it reached the limit of squirrel
18:12:48 <xarick> I don't know how this AI works
18:13:36 <xarick> maybe it doesn't understand ECS completely? I dunno, it was a bad idea of me to test ECS
18:13:52 <peter1138> Nobody understands ECS.
18:15:01 <_glx_> acceptance "randomly" changes with ECS
18:15:27 <xarick> "Search routePlan to meet the demand for the srcPlace recursivly."
18:15:39 <xarick> so it's recursively...
18:16:40 <xarick> I see hints about "Circular reference"
18:17:33 <xarick> anyway, the faulty function is somewhere around `DoRoutePlan`
18:47:18 <_glx_> now sort type and order should be correct
18:58:39 <xarick> what can I make of this?
18:59:22 <xarick> so there's two ways for it to get stuck in the loop
19:07:09 <peter1138> Hmm, I need a per-tile type function. Should I make a big switch, or should I add it to TileTypeProcs?
19:12:30 <andythenorth> is your branched named '1kb-persistent-storage-per-tile-yolo'?
19:19:18 <Rubidium_> how tile specific is it?
19:21:46 <peter1138> One each for rail, road, town, station, industry, tunnel/bridge and objects.
19:35:35 *** tokai|noir has joined #openttd
19:35:35 *** ChanServ sets mode: +v tokai|noir
19:36:38 <peter1138> Hmm, giant switch avoids need for doxygen :p
19:41:51 <talltyler> Until CodeQL complains π
19:42:32 *** tokai has quit IRC (Ping timeout: 480 seconds)
19:43:16 <andythenorth> what could we replace Squirrel 2 with?
19:43:23 <andythenorth> ~everyone seems to be Lua?
19:53:19 <peter1138> How much work is it to set a temp register?
19:54:46 <peter1138> And does NML have enough brains to not repeatedly set a temp register to the same thing...
20:15:40 <frosch123> andythenorth: SPy compiles to wasm
20:17:27 <frosch123> Yes, though it's not production ready yet
20:17:41 <andythenorth> neither is squirrel 2 π
20:18:25 <frosch123> There is an example folder to look at
20:18:47 <peter1138> Compiling it wasm is not very useful at the moment.
20:21:37 <andythenorth> what would be the most interesting thing to do? π
20:25:31 <truebrain> Am I the only one that is a bit scared about that `#!`? That `!` feels out of place π
20:26:47 <frosch123> Probably emacs crap
20:27:08 <truebrain> without the `!` I know it
20:27:11 <truebrain> but now it is a shebang
20:28:01 <truebrain> lol, other files have it without `!`
20:28:06 <truebrain> okay, going to do something else now π
20:30:19 *** Wormnest has joined #openttd
20:34:50 <peter1138> So should I have a feature include or a feature exclude?
20:35:02 <peter1138> Or neither, I suppose...
20:35:29 <peter1138> Context, a variable to test if the tile at dx,dy contains a specific badge.
20:35:57 <peter1138> House tile. Industry tile. Who knows, most likely the NewGRF does not.
20:37:28 <peter1138> I could limit it so that house tiles can only test for badges of houses...
20:38:29 <talltyler> I can see a usecase for houses querying industries, like a mansion could ask βis this too polluting for me to spawn near?β
20:38:32 <frosch123> Fences could check for residential/commercial/industrial tiles
20:40:14 <peter1138> Yes... but I'm not side-questing on to implementing NewGRF fences yet :)
20:40:28 <peter1138> talltyler, exactly.
20:43:13 <peter1138> If it's include, then everyone using the variable needs to set a specific set of features they care about. Not too bad.
20:43:23 <peter1138> If it's exclude, then if they don't it just tests everything.
20:43:55 <peter1138> Include might be better for performance as then it won't be needlessly checking the badges on a station, for instance...
20:44:59 <peter1138> Always restricting to specific features means we limit cross-"communication", potentially obstructing ideas.
20:45:25 <peter1138> I have not added this variable to vehicles ;D
20:46:52 <peter1138> (Could be funny though.)
20:53:22 <frosch123> Trains testing for railtype badge?
20:53:30 <andythenorth> snowploughs that plough snow
20:54:17 <frosch123> Tiles with "snowy" badge?
21:04:59 *** kuka_lie has quit IRC (Quit: leaving)
21:08:44 <peter1138> Getting drafty in there.
21:52:07 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
21:52:51 *** nielsm has quit IRC (Ping timeout: 480 seconds)
21:54:49 <xarick> some this-> missing in ai_gui, game_gui and script_gui
22:22:15 <xarick> glx, have you crash tested the loading part?
22:23:02 <xarick> actually trigger a throw/catch
22:27:39 <_glx_> I tested with a GS, it saves 2 tables
22:29:03 <_glx_> it properly failed to load data from previous format
22:30:56 <_glx_> are you trying to load a save from a previous version of the PR ?
22:35:59 <peter1138[d]> Something tells me I need reinforcements...
22:36:36 <_glx_> if so it's expected to get `Loading failed: Failed to load '[AI/GS][Tile]List'`
22:42:29 *** keikoz has quit IRC (Ping timeout: 480 seconds)
22:55:28 <peter1138> Oof, didn't realise it was that recent.
22:56:37 *** reldred has quit IRC (Quit: User went offline on Discord a while ago)
22:58:53 *** HerzogDeXtEr has quit IRC (Read error: Connection reset by peer)
23:09:53 <peter1138> Hmm, the script metadata strings GetName(), GetShortName() etc... they are only raw strings, right?
23:10:04 <peter1138> Or are they GSText?
23:11:00 <frosch123> There is no AIText after all
23:11:02 <peter1138> Wondering if we ever/ever need to StrMakeValid() them.
23:12:03 <frosch123> They are used in openttd.cfg, so newline etc would cause trouble
23:13:23 <frosch123> Is "ini config injection" a popular exploit?
23:14:55 <_glx_> there's some validation about GetShortName length (needs to be 4)
23:18:46 <peter1138> Basically it means I can pass them directly to DrawString(..., x) instead of via GetString(STR_JUST_RAW_STRING, x)
23:21:41 <_glx_> oh `Squirrel::CallStringMethod` does ` *res = StrMakeValid(ObjectToString(&ret));`
23:44:47 <peter1138> Urgh. String consumption.
23:54:14 *** Wormnest has quit IRC (Ping timeout: 480 seconds)
continue to next day β΅