Removal of the Blinking lights
-
How about a compromise? We get rid of the complicated color changing logic but keep the lights. We just have to decide on the color we want them to have.
I think a lot more people are aware that the lights exist than know that they change color on conditions. And I agree that keeping them for visual detail would be nice -
Is it possible to change light color globally in some way, some shader magic or such? We could then have a single loop that checks stall status. All the factories and such would then only have to change the color when they start/stop producing, which is probably cheap.
-
How much performance impact does the blinking have?
Curious how you measure the performance before/after this change reliably, because that sounds quite hard to do.
Probably not possible but would be cool if blink effects didn't affect sim state - then enabling such fx could be a setting. And then we could have adaptive performance where the game automatically reduces settings when your fps sucks.
-
@blackyps said in Removal of the Blinking lights:
How about a compromise? We get rid of the complicated color changing logic but keep the lights. We just have to decide on the color we want them to have.
I think a lot more people are aware that the lights exist than know that they change color on conditions. And I agree that keeping them for visual detail would be niceI'd be fine with this compromise - as long as it entails it is a 'run and forget' action and no intermediate updating. There is really no value in that especially considering the low number of people that were actually aware of these lights to begin with.
@nine2 said in Removal of the Blinking lights:
How much performance impact does the blinking have?
Curious how you measure the performance before/after this change reliably, because that sounds quite hard to do.
Probably not possible but would be cool if blink effects didn't affect sim state - then enabling such fx could be a setting. And then we could have adaptive performance where the game automatically reduces settings when your fps sucks.It isn't about the frames per seconds, it is about the simulation speed.
It involves logic that can cause a desync, but one that can be ignored as we're just skipping on emitters and not doing less damage or anything like that. Therefore one can make a comparison by running a saturated replay twice on the fastest possible speed: one with the blinking lights and one without and compute the difference in time. I've done this in the past for other pull requests - it is possible but tricky to setup.
Note that the expense is not so much in the lights itself, it is in the bookkeeping of the lights:
- inserting a new unit with blinking lights: https://github.com/FAForever/fa/blob/deploy/faf/lua/aibrain.lua#L329
- removing a unit with blinking lights: https://github.com/FAForever/fa/blob/deploy/faf/lua/aibrain.lua#L349
- and the update procedure: https://github.com/FAForever/fa/blob/deploy/faf/lua/aibrain.lua#L361
- and of course, the actually change of lights: https://github.com/FAForever/fa/blob/deploy/faf/lua/defaultunits.lua#L775
- that involves re-allocations of roughly the same emitter and tables: https://github.com/FAForever/fa/blob/deploy/faf/lua/defaultunits.lua#L275
All of these involve table operations, in particular when changing the lights. And to make matters worse: the table.remove has a complexity of O(n). Every factory and storage has these lights (but is not limited to those) the table can easily have dozens if not more than a hundred entries. And as the destruction of factories and / or storages are not unusual this has an additional load on the simulation when fighting.
@mazornoob said in Removal of the Blinking lights:
Is it possible to change light color globally in some way, some shader magic or such? We could then have a single loop that checks stall status. All the factories and such would then only have to change the color when they start/stop producing, which is probably cheap.
Yes, this is possible in a similar fashion to what Nomads did. But that would be on an individual basis. But again - for what purpose? You can see a unit is being made by looking at the factory. The lights do not work through the fog of war.
I'll re-iterate what I've said in the past: there is a line where we as a community have to choose between features and performance. Some features are so critical that we take a hit on the performance and in return we get better gameplay. One example is the overspill feature, that we managed to improve with a factor of ~ 7 last month (going from 60 ms /tick to 10 ms / tick with a base line of 2ms / tick). Other features are so key to visuals (like tank tracks, explosion effects) that I too agree that it is best to take a hit on performance in trade for some visuals.
But is this feature worth taking a hit on the performance for?
I'd say no .
-
@jip
Wouldn't it be relatively low-cost to do something like have a loop that runs once every X seconds, and then for each player, gets the player's relevant eco data, determines the blinking light status, and then if the status is different from what it was the previous cycle, sets the blinking light status for that player's blinking light units? I imagine this could be done in a way that does not conflict with what you want to do to improve intel/shield processing.Alternatively, if that wouldn't be relatively low cost, perhaps we should just do blinking lights by player color.
-
The simulation is already run for each client, where the info is grabbed from currently afaik for the lights. That loop sounds like just another layer on top or replacement of current control system, just added complexity and not really resolving the need for the mentioned bookkeeping? If the loop would process each factory you'd have to bookkeep the factories to be included and run them in a batch or start a separate loop for each factory and kill it once not needed anymore.
I'm not familiar with all the technical bits regarding the lights, but in general triggers that rely on game engine functions are usually way more optimized than manual loops done on the scripting side.
And all that complexity for lights that most don't even know about
-
Are the lights all or nothing, could we get rid of ones some units but not others?
I think the blinking lights when storages are near empty are kinda cool
-
LOUD removed those lights pretty much at the first release - they were never missed. No one even noticed until it was pointed out. Just saying......it's a great deal of code execution for a whole lot of almost nothing.
-
Well i know those lights and saw them from the beginning.
But i am colorblind (red/green) and i never see to what color those lights change.So my personal opinion;
I like the lights, it makes the game more "colorful", but they don't need to change
or show something special with their color, i can't see it anyway.I'm still mourning the removal of SACU wrecks
They looked good and were removed as a balance decision due to mass on reclaim. A crime in my eyes!
(Setting the mass inside the wreck to 0 would have the same balance change without removing grafics from the game.)Please try to hold as much effects / grafics as possible in the game.
My suggstion:
Create those lights when a unit gets created and let them shine in a fixed color.
So we still have nice grafic, and less CPU power used for unessisary colorchange checks on many events. -
SACU wrecks are still part of the game.
-
If they wouldnt be you'd have me crying about it all day
-
Sleep tight blinking lights, jip is gonna flip the switch off.
-
@jip said in Removal of the Blinking lights:
SACU wrecks are still part of the game.
well, they were removed on 25 May 2020
https://github.com/FAForever/fa/commit/dbaf939f45671a9f77d9cabe099e25068729d452But it looks like those changes were reverted half a year later (25 Nov 2020).
Ok, the SACU wreck question is solved, lets get back to the blinking lights.
-
I'm fine with having some form of lights, made once when the unit is finished and then 'forgotten'. But I'd like to stress: if only a few individuals actually knew about the lights, then why do we bother .
-
What the lights? Player with low graphics settings
-
@jip said in Removal of the Blinking lights:
But I'd like to stress: if only a few individuals actually knew about the lights, then why do we bother
Because we try to preserve the game SC:FA here. If there is no pressing reason to remove nice details then why should we do that?
If we remove the color changes that are a performance hog, then what do we actually improve if we completely remove the lights? At that point we are just taking stuff away for no good reason.
-
Fair enough - I'll add them back in but without the color changing. Suggestions for a color?
-
@jip said in Removal of the Blinking lights:
Suggestions for a color?
Well i can see yellow and blue best.
-
I would obviously vote for yellow or blue.
-
Also nice; light in faction color
-
Or just white light (in this case yellow white like an old light bulb)
-
Increase the size of the light.
(maybe people will see a "new" feature in the game - "ambient lights" )
And thanks for keeping the lights!
-
-
Could we not do some sort of vote? I see no point in the lights if they have a performance cost.
-
There was some discussion on preserving current behaviour without the performance penalty. Maybe that's the best option?