Conversation
Member
Author
|
Another pull request (#3719) defaults the LODs when they are not set (e.g, |
…into fix-lods-of-effects
…-MadMax into fix-lods-of-effects
get there in the end
Some effects are made for certain map sizes. Their LOD is set to 4x the map size. Other effects are local, these would be either 256 or 512 depending on whether the LOD was set already.
Member
Author
|
I made a mistake and accidentally merged the branch of @MadMaxFAF 😞 . |
Member
Author
|
I'll update the track record once I'm back in a few days. For anyone else interested in working on this, please ask @MadMaxFAF which ones are still free. |
Member
Author
|
I've updated the original description with the remaining effects that have an infinite LOD cutoff - only 114 to go. |
* Fix effects of Aeon t2 Flak * Last effects from bottom-to-top
Member
Author
|
With thanks to @MadMaxFAF for all the hard work 😃 . |
Garanas
added a commit
that referenced
this pull request
Apr 13, 2022
Spikey84
pushed a commit
to Spikey84/fa
that referenced
this pull request
Jun 23, 2022
Fixes inconsistent Level of Detail (LOD) cutoffs for effects. The cutoff is used to prevent the creation and rendering of particles when they barely contribute to the final image. A lot of effects had an infinite cutoff. These particles were always created and rendered. The creation of particles has a significant impact on the sim, the rendering has an impact on your fps. We introduce a sane LOD cutoff value with which we improve the performance of the sim and your fps at the same time. With appreciation to Madmax who took the time and effort to look at more than 300 effects.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Emitters can be quite expensive on the simulation. Up to 15% of the emitters in the game render up to extreme distance. These should be culled accordingly by introducing a sane LOD cutoff in their blueprint definition.
Course of action
Claim a few projectiles by making a comment in this pull request. This prevents people from doing the same projectiles. There are a few important factors to take into account:
LOD settings
In order to be consistent, make sure that your LOD settings are on 'high':
LOD of the emitter
Effects have an impact on the simulation speed. In particular the spawning of a particle has an impact. All effects have a LOD threshold set that determines at what distance from the camera it can generate particles. The Level of Detail threshold is used to cull entities when they contribute to no more than a few pixels. The value is called
LODCutoffin the blueprint. When the LOD is not set the emitter always renders, regardless of the distance to the camera.An example is the t1 Aeon artillery, as shown in the gif: their LOD cutoffs are set to -1 by default and the unit is widely used. Therefore it can easily take up 2% to 5% of the simulation speed (2ms to 5ms / tick) during a battle, even though you're too zoomed out to actually enjoy the graphics.
Finding the unit of an emitter
We make the assumption that you are using Visual Studio Code, as described in the setup of the development environment.
It could very well be that an emitter is not used in the base game. In that case you can set it to a default value of 300. Mods can still use those emitters.
cybran_cruise_missile_launch_01_emit.CTRL + SHIFT + Fto search through all the files. use the name of the emitter (without the path!) as a search argument. This will likely take you to an entry in/lua/EffectTemplates.lua. In this case, it isCIFCruiseMissileLaunchSmoke.CIFCruiseMissileLaunchSmoke. This takes us toCIFMissileLoaWeaponwhere the effect is used as a muzzle flash.CIFMissileLoaWeapon. This takes us to the unit classURS0304, which is the Cybran Strategic Missile Submarine.The effect in question, on the water surface
Determine the settings
There are a few things that we need to take into account:
If the effect is part of a unit / weapon then one can argue:
LODCutoff: should be no higher than the LOD of the unitEmitIfVisible: should always be trueCatchupEmit: should likely be false if the effect has a short duration (and the unit has a reasonable rate of fire)CreateIfVisible: should likely be true if the effect has a short duration (and the unit has a reasonable rate of fire)If the effect is part of a projectile then one can argue:
LODCutoff: Should be no higher than the LOD of the projectile, and if none is set then it depends on the size of the effectEmitIfVisible: should always be trueCatchupEmit: if it is part of a trail then this should be true, if it is part of an explosion then it is questionable because those are quite shortCreateIfVisible: if it is part of a trail then this should be false, if it is part of an explosion then it is questionable because those are quite shortTest plan
Make a branch based on this branch. Work on at most 20 emitters per branch. Once you've reached the threshold, make a pull request to merge back into this branch. Note that the default merge branch is set to
deploy/fafdevelop. You'll have to adjust that.Make sure to mention what units / weapons / projectiles use the emitters. Your changes will be easier to review with that information. If applicable a screenshot is appreciated too.
If you're unsure about anything you can discuss it in the #game-repository channel on the FAF Discord (after giving yourself the tester role in the #role-selection channel) or you can make a comment in this pull request.
Learning goals
Feel comfortable working on the repository and with Git in general.
Pull request progress
....