Player-specific graphics
Player-specific graphics
Kane Hart expressed a wish (https://github.com/troelsbjerre/Bottleneck/issues/24) to have Bottleneck's lights be toggleable for each player individually. It's a really good idea, but as far as I understand, it would require a drastically different approach. Currently, the lights are added to the map as entities that all players see the same way. Any idea how to make the lights only visible to a subset of the players?
Re: Player-specific graphics
It cannot be done at this timetrold wrote:Kane Hart expressed a wish (https://github.com/troelsbjerre/Bottleneck/issues/24) to have Bottleneck's lights be toggleable for each player individually. It's a really good idea, but as far as I understand, it would require a drastically different approach. Currently, the lights are added to the map as entities that all players see the same way. Any idea how to make the lights only visible to a subset of the players?
Re: Player-specific graphics
Thank you for the quick reply. Would it be possible to tie visibility to the "additional information" layer, toggled by the alt-key?Klonan wrote:It cannot be done at this time
Re: Player-specific graphics
I wonder if times have changed...
- eradicator
- Smart Inserter
- Posts: 5207
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Player-specific graphics
Player specific overlays are something i've wanted a long time. Ghosts can already do per-force visibility. :x
Re: Player-specific graphics
Please, move this topic to interface requests.
Re: Player-specific graphics
Done.betrok wrote:Please, move this topic to interface requests.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
Re: Player-specific graphics
They haven't. Per-player rendering that's readable and adjustable by mods would mean everything that's rendering per-player would need to store which players it's rendering for in memory and in the save file.betrok wrote:I wonder if times have changed...
That's too much overhead for mod support.
If you want to get ahold of me I'm almost always on Discord.
- eradicator
- Smart Inserter
- Posts: 5207
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Player-specific graphics
They definetly don't need to be readable (same as there's no specific function to tell if a ghost can be seen by player_x).. If it was linked into alt-view there would be no adjusting either. Entity_X would simply be visible to any player that has alt-view enabled and is on the same force, and be invisible to players who have alt-view disabled or are enemies to its force. Thus the "visibile or not" state would not be part of the game state.Rseding91 wrote:They haven't. Per-player rendering that's readable and adjustable by mods would mean everything that's rendering per-player would need to store which players it's rendering for in memory and in the save file.betrok wrote:I wonder if times have changed...
It could even be made to work with arbitrary "info layers" (pseudocode):
1) In the prototype stage the entity is defind with .info-layers = {'alt-view','my-custom-layer'} (multi-layer is probably overkill)
2) In control stage a mod can do LuaPlayer.set_visible_info_layers{'my-custom-layer'}
3) When the renderer starts it asks LuaPlayer what layers it should render and skips any entity that isn't in any of those layers.
That way the game state only needs to store one additional table per player, and does not need to know about visibility. If this can be done with reasonable performance i don't know. (Also obviously .info-layers should only be available for "simple-entity-with-info-layer" and not to every prototype.)
Re: Player-specific graphics
Heyo, I implemented this for 0.17: https://lua-api.factorio.com/0.17.0-pre ... ering.html
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.