TLDR
Please allow mods to add a LuaRenderObject that is visible both in "game" and in "chart" mode! This would reduce overhead in mods that create renderings visible to all players on a force.Use case
My mod Autodrive allows players to order vehicles to path and move to a selected position. After the vehicle has successfully requested a path, the path (a sequence of line renderings) is rendered to all players on the vehicle's force. Currently, I only render the path in "game" mode – but this is invisible to players who are in remote view.The problem is that the renderings should be visible to all players on the force, but in multiplayer games, there may be some players have opened the map while others are in normal game mode. This makes it impossible to use one rendering for the whole force.
Currently, I could work around with in two ways:
- Create a separate path rendering for each player (visible to only that player), then change the render_mode of each path segment of players triggering on_player_controller_changed. PRO: Each player can see the renderings in their current mode. CON: Vastly incresed overhead for storing/creating/deleting/changing LuaRenderObjects. (In multiplayer games, the number of renderings required could be multiplied by a factor of >2. For players toggling between normal and remote view, the render_mode of all path segment renderings must be changed. Also, if a player joins the force, all path segment renderings for all vehicles of the force that have a path must be replicated for that player; and if a player leaves the force, all path segment renderings visible to that player must be removed.)
- Create 2 renderings for each path seqment (both visible to all players on the force), set render_mode of the first to "game" and of the second to "chart". PRO: Number of renderings per path segment is limited to 2. No need to change render_mode in response to on_player_controller_changed; no need to create/delete renderings when players join/leave a force. CON: Overhead for handling (which includes storing renderings with vehicle/path data) an additional rendering per path segment.
