Random Engine Optimization ideas

+
Hey,
so I am concerned about CP's performance, especially on older hardware, and I would like to present a few ideas.

Firstly, as far as I understand from game behaviour, data miner's finds, reported bugs, etc...the game uses quite a lot of threads to run, synchronize and propagate all of its logic.
Threads seem to be prioritized, and in general, they are not getting enough CPU time.
This is currently handled by a brute force - like instantly despawning NPCs, stopping water simulation,...?
Also, there may be problems with RAM and streaming - e.g. the game utilizes pools for many things including background crowd NPCs; and based on their numbers, there may appear repetencies.

So, the ideas:
- RAM & streaming:
There is a huge difference between when a player is moving rapidly - e.g. riding a car (especially in a closed interior), and when he is walking slowly.
It could be utilized like so:

- Riding:
- stream and display only "bigger", and "important" - let's say "noticeable" meshes - like buildings, street lights,...
- don't stream in smaller filler meshes and stuff like some particle effects,...
- (always) stream in some of the worse LODs just to initially fill the scene and keep fps stable; and only then reload the most crucial meshes
- replace similar meshes - e.g. if there are some visually similar meshes, just stream in one of them as a placeholder and load the others only if necessary/when ready. Eventually, this could be masked by e.g. texture/colour override.


Walking:
- //TBC?

-
Physics:
If the game uses some sort of heavy physics library or whatnot, there's an option to completely remove it. As cyberpunk isn't a game that (heavily) relies on correct physics simulations, these could be replaced with an own, much lighter implementation.
As far as I can think of, CP can potentially use physics for car crashes, a player collision, environment destruction, maybe guns and hitboxes, and fall damage.
That's pretty much all...?

If so, I suggest the following optimizations:

- ranged weapons would hit instantly; that is, (without spawning bullets) and computing their collisions
- (if it would help, a bullet could be a particle effect rather than a mesh)
- on a (direct) crash, cars would "more likely" just stop in a place. Currently, they are able to turn upside-down and use some repositioning "physics" to fit back on the wheels
- car damage could be decided by a simple geometry check - based on a car rotation in a relation to a mesh hit. There's no need to compute hitboxes for individual parts of the car,...?
- environment destruction would be prebuilt,...? (E.g. windows would break completely on a single hit,...?)
-...?

- Threads and CPU
As mentioned above, I believe that the game runs many threads for all the game's logic. This may include "background" stuff like TimeOfTheDay, crowd AI, quest triggers, street light logic, metro logic, driving logic,...
I tend to believe that the engine may be at least partially event-driven - e.g.:
- approach a street light -> it turns green
- approach an NPC -> it will alter its path
- time of the day changes -> update skybox, reschedule NPCs,...

If so, the point could be to postpone/disable some of the threads (even more); or to "fake" the values entirely e.g.:
- metro/AVs/... won't spawn at all
- time of the day could (slightly) "fast-forward" on e.g.: going indoor and outdoor,...(or not the actual time value, but rather the skybox, effects,...)
- "some" NPCs would not be rescheduled (e.g. in a bar). At night, most of them would be completely despawned
- street light's state and much more values could be RANDOMIZED

- Lighting

I don't know too much about lighting in general, or about specifics in CP; but once again, the game stands on the atmosphere. So there's a need for tons of reflections, lights, vapors,...
The point would be to disable most of the dynamic lighting calculations (dynamic/volumetric lighting, reflections,...); and fake them with the stuff like dynamic area environments, (semi-intelligent) post-process volumes,...

TBC?
 
Last edited:
- Physics:
If the game uses some sort of heavy physics library or whatnot, there's an option to completely remove it. As cyberpunk isn't a game that (heavily) relies on correct physics simulations, these could be replaced with an own, much lighter implementation.
As far as I can think of, CP can potentially use physics for car crashes, a player collision, environment destruction, maybe guns and hitboxes, and fall damage.
That's pretty much all...?
There are things like objects rolling on sloping surfaces and while that may be something that goes unnoticed by many, that's not all of us and most importantly CP 2077 appears to have quite a few things going on that work on subconscious level and that is likely result of several things working together. While how players experience the end result isn't the same, I would still be very careful before starting meddling with this.
 
Last edited:
Top Bottom