Page 1 of 1

Count rich text icons as one (or a few) characters for train stops

Posted: Wed Apr 03, 2019 7:41 am
by Teraka
Train stop names are currently limited to 106 100 characters, which is fine most of the time, except that it gets very restrictive when you start using icons instead since [item=automation-science-pack] counts as 30 characters instead of 1 symbol.

Image

Given how specific 106 seems to be there might be an actual internal reason for this limit I'm a dumb, but otherwise I'd like to see icons not counting as their full name for this restriction.

Re: Count rich text icons as one (or a few) characters for train stops

Posted: Wed Apr 03, 2019 12:31 pm
by Darinth
The limit is 100 characters, the stop name you tried to use is being counted as 106 characters. This seems like an arbitrary limit set to prevent ridiculously long names, not like a limit placed due to a technical constraint. Given that information, it's hopefully possible for icons to not be counted as their total character count.

[0.17.23] Train station names are too length limited fo rich text

Posted: Sun Apr 21, 2019 6:34 pm
by mrvn
TL;DR
Trying to name stations by listing the items they request or provide quickly exceeds the length limit.
What ?
I suggest that train station names should be dynamically allocated and have arbitrary length. Or at least 65535 bytes.
Why ?
I've started to use rich text to show what factory complex a train station is in as well as the requests or provides of the station. Some low throughput stations can carry a bunch of items though resulting in this:
station-name-too-long.png
station-name-too-long.png (1.18 MiB) Viewed 2972 times
The station is in the "Washing for geodes" factory complex and provides all the low throughput garbage items. Namely Mud, Landfill (sand-3), Crushed Stone, Stone, Stone Brick, Stone Pipe, Stone Undeground Pipe. Overall that would visually easily fit into the station name list. But at 3 output items I'm already exceeding the station name length. And those are short recipe and item names. Some other names are easily twice the size, meaning half the number of icons fit in the 100 characters.

For a game that easily uses gigabytes of memory to have strings hardcoded to maximum 100 bytes length is quite ridiculous. Is the name inlined into the station struct instead of being a pointer?

Re: Count rich text icons as one (or a few) characters for train stops

Posted: Sun Apr 21, 2019 9:01 pm
by Koub
[Koub] Merged into older topic with suggestion on the same issue.

Re: Count rich text icons as one (or a few) characters for train stops

Posted: Sat Aug 01, 2026 10:49 pm
by Darkestnoir
+1 Still an issue in 2.1.x

I use parameters to fill the station names with the item icon that are delivered or requested from them, but even its possible to use all 10 default parameters, when the get swapped for the actual items, the name/icons get cut off (especially with modded ones).

Train stop with 10 parameters:
grafik.png
grafik.png (58.73 KiB) Viewed 251 times
Same train stop when parameters were swapped for the actual items:
grafik.png
grafik.png (65.1 KiB) Viewed 251 times

Re: Count rich text icons as one (or a few) characters for train stops

Posted: Sun Aug 02, 2026 12:10 am
by eugenekay
This limit was actually increased to 1024; although it is now “only” 199/200 characters. Having the higher limit returned would certainly help.

Related: 126764