Determining whether an entity is currently in view

Place to get help with not working mods / modding interface.
pindab0ter
Burner Inserter
Burner Inserter
Posts: 8
Joined: Fri Nov 01, 2024 12:27 pm
Contact:

Determining whether an entity is currently in view

Post by pindab0ter »

Is there a way to determine whether an entity is currently being rendered to any player?

I would like to improve the performance of a mod by not processing entities that are not in any view.

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.

Doe anyone know of a better way to do this?

Worst case, I'll just check whether any player is in camera view (not map view) on the surface the entity is on, without taking proximity into account.
Post Reply

Return to “Modding help”