FPS death with lots of map tags

We are aware of them, but they have low priority. We have more important things to do. They go here in order not to take space in the main bug thread list.
Post Reply
darklich14
Long Handed Inserter
Long Handed Inserter
Posts: 94
Joined: Sat Feb 24, 2018 3:07 am
Contact:

FPS death with lots of map tags

Post by darklich14 »

I play on a server that uses a scenario that had a bug that generated a lot of map tags (say, 5000+). For whatever reason, the render is fine when zoomed out but as you zoom in to where the stacked tags were located, the FPS would drop lower and lower (to less than 1FPS eventually) when zooming in closer and closer. One thing in particular that seems odd is that it gets even worse when the map tag isn't even visible any more and you're viewing the main game rather than the map representation, suggesting that the tag icons are rendered but not displayed even when they shouldn't be rendered and displayed. On running a profiler, the functions consuming the most time are

Code: Select all

RealOrientation::RealOrientation
,

Code: Select all

SignalID::isZero
and

Code: Select all

SpriteDrawOrder::SpriteDrawOrder

I have an intermediate understanding of computer graphics and it seems as though scaling a sprite or raster would cost the same whether zoomed in or zoomed out when done properly so I'm not sure if maybe some OpenGL call is either not available or not used or the scaling is done in software.

Reproduce this by creating 8000 map tags with icons at {0,0} and zoom into the location in map view.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13173
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: FPS death with lots of map tags

Post by Rseding91 »

Can you please post a save file that shows the problem?
If you want to get ahold of me I'm almost always on Discord.

darklich14
Long Handed Inserter
Long Handed Inserter
Posts: 94
Joined: Sat Feb 24, 2018 3:07 am
Contact:

Re: FPS death with lots of map tags

Post by darklich14 »

Hi Rseding. Thanks for considering this investigation-worthy.

Attached is a map and a few screenshots.
factorio chart tag bug.zip
(1.88 MiB) Downloaded 72 times
Screenshot from 2018-06-24 22-15-44.png
Screenshot from 2018-06-24 22-15-44.png (3.67 MiB) Viewed 1285 times
Screenshot from 2018-06-24 22-16-06.png
Screenshot from 2018-06-24 22-16-06.png (3.53 MiB) Viewed 1285 times
Here's the snippet to generate more:

Code: Select all

 /c for x=1,1000 do game.player.force.add_chart_tag(game.player.surface, {position={0,0}, text='Test', icon={type='item', name='electric-energy-interface'}}) end
The map was created by making a default map with all defaults and running the snippet above. you can see in the screenshots, 100 chart tags makes for a drop to 18 fps and 1000 tags drops it to 5 fps. I'll let you take it from there.

posila
Factorio Staff
Factorio Staff
Posts: 5201
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: FPS death with lots of map tags

Post by posila »

It's because in zoom-to-world view map is still rendered to offscreen buffer which it then used to cover areas out of radar range. In that zoom level the icon will cover pretty much whole screen, and redrawing screen-sized area 1000 times takes quite a lot of time even on high-end GPUs.

I am calling it minor issue for now. In the future the icons might not scale lineraly with map zoom, so that would not be as much of a problem.

Post Reply

Return to “Minor issues”