THE BUG HAS BEEN FOUND


I have spent a stupefying amount of time the past couple weeks trying to find an elusive performance bug. When you press the screen, it lags on touch devices in the web build.

Today I decided I was going to try to find the cause again, it's driven me crazy how much I have deconstructed my scene, only to not be able to put my finger on it. Recently I had deconstructed my scene to a single camera, and a single plane with a collision volume on it. SURELY something about the input was causing this plane to cause lag, some sort of raycast, some kind of input anomoly in how the game handles touch input. SURELY THIS IS IT.

I spent hours getting a scene set up that I was going to send to unity in a bug report in a long shot hope they could debug it and find a bug. And just before I was about to give up I had a random thought, no more likely to be the cause than any # of other things, a raycast component on the canvas, a touch cooldown setting on the new input system, the old legacy system conflicting with the new one. These were just some of the random thoughts I had could be causing the issue. So just as I as about to export the scene, and write up a bug report and sit around hoping for  random help from above to help me solve this from people I have no direct connection to... I found it.

AND WOULDN'T YOU KNOW THERE WAS NO SOLUTION. My shaders weren't working in the web build, I adjusted every setting I could in every way I thought possible and came to realize that the new webgl stuff just doesn't work with custom shaders in the render pipeline. But what if... What if I try to built in shader graph editor? MAYBE that will work where amplify creatoins isn't quite working... Did a quick test... promising. Threw a quick test material on the terrain and disabled everything at the start of the scene and did a phone build.

Hot damn, I was finally playing the web build on the phone and the framerate was holding up. FINALLY the game seemed to be working in its destined form: Web build on a phone.

Imagine you had recently bought a new energy drink, and it glowed in the dark, and you were drinking it every morning and immediatly afterward you always got sick. You would PROBABLY think that the new drink was poisoning you, but in a strange twist, turns out you were picking up the glass in the dark and the liquid was fine! There were microscopic poisonous bugs on the glass that were biting you! WHAT ARE THE ODDS? 

This is how I feel about this not being an issue with my input system, but instead a shader issue. I mean I'm still flabberghasted, a performance bug that ONLY happens when you press down or let go with touch input... WTF? IT MAKES NO FRIGGIN' SENSE, SHADERS ARE NOT CONNECTED TO INPUT. I'm guessing maybe some console errors are being generated in relation to material texture names or something, as console messages have lagged builds in the past. It doesn't matter, all that matters is i've finally found the issue. 

So turns out that every single material in my scene was tainting the performance, and that this final plane used a shader that caused a performance issue. I'm not sure if the collider made a difference or not, DON'T CARE. Too many issues coming from these shaders and the render pipeline. It's going to be frustrating as hell, but I'm going to go in shader by shader and migrate them to new shaders rebuilt in Shader Graph, Unity's built-in shader platform. Nothing against amplify, it served this project well for years, just as Shader Forge did before that. But at some point things become deprecated because of the random changes to the engine. I anticipate I may get some improved performance and lighting as well, maybe some neat new noise generation nodes, who knows! If I wasn't so under the gun to finish this demo I'd be more excited to play with the new bells and whistles.

Wish I had better debug tools, this nightmare could have been avoided, but I'm just a moron working alone in a cave and I don't really know the best workflows. I just stumbled on a really good forum for special effects talk 

Just relieved I finally figured this out, I should have known... I was getting massive issues while migrating from the standard rendering pipeline to Universal. What a fucking month. Fantastic progress, but also debilitating technical issues and headaches.

Hoping I can put my head down and plow through this tomorrow without too much fuss.

Edit: More blathers! Just collecting my thoughts. Briefly played the game just now. Billion and a half things to do. It's always so daunting wondering, "How do I make this better?" after being so utterly burned out.

Sometimes as painful as it is, u just have to play it like you're the player and be brutally honest with yourself. "This thing you spent months on isn't fun." Gut it, fix it. Do something.

No room for mediocrity. Only the best gameplay can stay. No shit puzzles, no shit items, no shit npcs. Everything must be good, then made better. You keep shitty things, they begin to set the standard.

SeaCrit isn't perfect, but it's gotta be as good as it can be if it's going to have any chance at all. Can't obsess about perfection, just gotta do the best we can and hope for the best.

YES I'VE LINKED THIS SONG SEVERAL TIMES BEFORE AND I'LL LINK IT AGAIN

Game won't be perfect tomorrow, lots of bullshit technical stuff to sort, then gotta polish core combat, then at some point i'll get to more level areas, more fish and all that crap. So much to do... Gotta tone down the combat movement. Feels like this constant tug of war where i make combat sane, then I tweak things a bit over time and they spiral out of control again. I should probably make a "start shark" loadout that's a little gimpy and make the default test loadout a more advanced item. Generally I try to end a blog on a more emotional appeal but this blather went on too long, so whatever. ROLL THE BONES!

Get SeaCrit

Leave a comment

Log in with itch.io to leave a comment.