
The borderlands 4 issues with unreal (see: https://www.pcgamer.com/games/fps/borderlands-4s-latest-patch-triggers-a-flurry-of-performance-complaints-but-gearbox-says-new-stuttering-problems-should-resolve-over-time-as-the-shaders-continue-to-compile/ ) made me realize I was doing all of my materials wrong.
Originally the way I pulled in 3d meshes generated a material of each slot in the mesh. So I thougth I was being clever by using material slots to determine colors (so I didn’t have to texture paint), however the issue above made me actual look into things. So I was taking materials for granted as things that were inherent to unreal, however materials themselves are nothing more than giant HLSL files (see https://en.wikipedia.org/wiki/High-Level_Shader_Language). This means that every material I made has to be complied for whatever graphics hardware the user is using (which is the borderlands 4 problem from the article above.) The solution is to use material instances (see https://dev.epicgames.com/documentation/en-us/unreal-engine/creating-and-using-material-instances-in-unreal-engine)! These are parameterized unreal materials which allow for the developer to expose parameters into compiled base materials so we dont have to deal with as much shader compiling.
Sooo from just imports and optimized development had 30-40 plus materials which would come from asset imports, most I could categorize into:
-Painted Metal
-Exposed Metal
-Wood
-Plastic
-Rubber
-Concrete
-Brick
-Glass
So instead of 30-40 compilations for all of the materials I could whiddle things down to 8 compilations to save myself from making the user wait with no colors on their screen. After 30 painstaking minutes I was able to remove all other materials (minus a few specialized ones) to the 8 materials above and instances thereof.

Now things look a little shinier and more visually consistent



The side effect that I wasn’t expecting is that the game is now BLAZING FAST. I went from around 60-70 fps on light load and 40-50 on heavy load on average to pretty much locking to 120fps in light load and 80fps in high load. I had plans to re-write how I handle some of the animation data transferring but I’m thinking now that might not be needed.
I also did some work on the ai so they stayed a bit more mobile. I also added recoil to the bots
Also bots now have a pitch when aiming:
Finally I added in weapon switching via the num keys:
I want to add a half-life style cross selection bar but that will probably happen later with another hud pass.
The gameplay test map has now gone from a placeholder dev map to a low effort source engine map:

The whole level I would argue is pretty bad for gameplay also the only thing I want to add is some rain effects just to get a vibe then I’ll move onto a kind of multi-lane style of map.