Player-specific graphics

trold
Inserter
Inserter
Posts: 45
Joined: Fri Jul 31, 2015 1:07 pm
Contact:

Player-specific graphics

Post by trold »

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?
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5284
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: Player-specific graphics

Post by Klonan »

trold 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?
It cannot be done at this time
trold
Inserter
Inserter
Posts: 45
Joined: Fri Jul 31, 2015 1:07 pm
Contact:

Re: Player-specific graphics

Post by trold »

Klonan wrote:It cannot be done at this time
Thank you for the quick reply. Would it be possible to tie visibility to the "additional information" layer, toggled by the alt-key?
betrok
Fast Inserter
Fast Inserter
Posts: 101
Joined: Wed Feb 28, 2018 12:08 pm
Contact:

Re: Player-specific graphics

Post by betrok »

I wonder if times have changed...
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5207
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Player-specific graphics

Post by eradicator »

Player specific overlays are something i've wanted a long time. Ghosts can already do per-force visibility. :x
betrok
Fast Inserter
Fast Inserter
Posts: 101
Joined: Wed Feb 28, 2018 12:08 pm
Contact:

Re: Player-specific graphics

Post by betrok »

Please, move this topic to interface requests.
Bilka
Factorio Staff
Factorio Staff
Posts: 3310
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Player-specific graphics

Post by Bilka »

betrok wrote:Please, move this topic to interface requests.
Done.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14337
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Player-specific graphics

Post by Rseding91 »

betrok wrote:I wonder if times have changed...
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.

That's too much overhead for mod support.
If you want to get ahold of me I'm almost always on Discord.
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5207
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Player-specific graphics

Post by eradicator »

Rseding91 wrote:
betrok wrote:I wonder if times have changed...
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.
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.

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.)
Bilka
Factorio Staff
Factorio Staff
Posts: 3310
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Player-specific graphics

Post by Bilka »

I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
Post Reply

Return to “Implemented mod requests”