This week was mostly a week off, but I did manage to make a pretty significant performance improvement/bug fix. I took some time off of PogoChamp this week to work on a different project I made: FeedbackBot. A Discord policy change means that I need to rewrite the bot before April 2022. Since I didn't have any great level ideas for PogoChamp right now, I figured I'd start working on that rewrite while I think of some new ideas. I've also been playing a bunch of Forza, lol.
Bug of the Week
Something that had been on my "I should look into this" list for a long time was that the performance of the Level Select area was actually pretty bad, especially while moving on laptops or other mid/low-end computers. I'd known about this for a long time, but hadn't actually decided to look into it until early this week.
So I popped open the Level Select and Unity's Stats panel and saw this:

Pretty much all of the geometry in the game is made out of VERY simple shapes. Almost everything is made out of a few hundred or a few thousand vertices, and while the Level Select is big, it's not
112.7 MILLION vertices worth of "big".
After some quick binary search (turning off half the objects in the scene, then checking the number of verts, repeat until culprit found), I found the culprit:

It turns out each one of these visual effects used around 500 particles (100 per ring, 5 rings). That's a pretty reasonable number right? 500 particles x 100 entry points is only 50,000 particles. Well the problem was that I'd set the "capacity" in the VFX graph to.... 320,000. So about 640 times as much as I actually needed. Simply turning the capacity down to a reasonable amount (512) resulted in around a
99% reduction in vertices.
After a few other small tweaks to lower the numbers even more, these are the results:
[table]
[tr]
[th][/th]
[th]Tris[/th]
[th]Verts[/th]
[th]Moving FPS (on my laptop)[/th]
[/tr]
[tr]
[td]Before[/td]
[td]37.8 million[/td]
[td]112.7 million[/td]
[td]20-30[/td]
[/tr]
[tr]
[td]After[/td]
[td]597.7 thousand[/td]
[td]1 million[/td]
[td]60-70[/td]
[/tr]
[tr]
[td]Improvement[/td]
[td]-98.5%[/td]
[td]-99.1%[/td]
[td]+200%[/td]
[/tr]
[/table]
It just goes to show, sometimes the solutions are pretty simple (because you caused them by being stupid in the first place).
Changelog
- PERF: Drastically improved FPS/performance of the Level Select.
- UX: Added some hint text on The Pits and Repeater if you haven't completed the level yet and crash a lot of times. Should help people who are struggling to understand the jump mechanics".
- DEV: Experimenting with Linux support.
- DEV: Experimenting with Character Customization.
[ 2021-11-13 19:08:57 CET ] [ Original post ]