A way to determine whether an entity should be rendered

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
pindab0ter
Burner Inserter
Burner Inserter
Posts: 9
Joined: Fri Nov 01, 2024 12:27 pm
Contact:

A way to determine whether an entity should be rendered

Post by pindab0ter »

I would like to improve the performance of a mod by not processing entities that are not in any view. These Nixie Tubes serve no other purpose than to display values, so it seems like a waste to update them when nobody is viewing them.

The only way I can think of is to check every player, check whether they are in map view, if they are on the right surface, what their zoom level, resolution and display density scale are and then manually calculate whether a given entity should be able to be seen.

This sounds very CPU intensive to do every tick, and doesn't take into account a GUI camera for example.

What I would like to see is something like LuaEntity.is_in_camera() or on_pre_entity_rendered.
Post Reply

Return to “Modding interface requests”