Porting my game to the Quest, and challenges of doing so.



The porting process

The first version of the port was basically baked and atlased environment, into 4 - 5 lets call them macro models, the entire map segmented basically into what's visible on the left, right, back and front.

The FPS that I had once I pushed it on the Quest 2 was...sad, barely hitting 30 fps, which for VR is a big no-no.

The goal was 72 at minimum.

The draw calls

The draw call count was still huge, the lights were baked, badly, everything was a jumbled mess, never treaded in the days of building the version for the PC.

 The entire vert count for the scene was basically 1 mil.

That was crazy, considering the geometry in the scene was very poor, low poly assets.

But as I've said I baked it...what I didn't do was veld the verts, and this was created out of modular walls, pillars, floors....so that was the first thing I had to clean up.

Post processing was another pain, as it usually is in VR, so that had to go, and I pushed it to Vulkan.

The game started to run better and better, I started hacking away at the models, welding more and more, lowering texture resolution, lowering lightmap resolution, basically crappyfying the scene.

And I reached lower vert count....but still, I was struggling. I was far away from 72fps.

The characters



The characters....the skinned mesh renderers....those were my next target, and oh boy...

30k verts per character, and that's just the body, not including the head, 21 characters on the screen, not culled...you do the math.

We had a problem.

Getting new characters would also mean reworking and retargeting the constraints and that was just not going to happen, I just couldn't allow myself to do it.

So I opened up youtube, and went into tutorials for retopology.

The result was 1.7k verts, with the head, and with the shader I created, there was just no reason to have a high poly character.

...we hit 72, well, 69, and sometimes 73, and sometimes 71, and sometimes 72.

So I hacked away more, the pistol was rigged, but not in a way a smart person would rig it. It wasn't a single mesh, with parts skinned to bones, no...no...it was separated into multiple meshes, each mesh having a material on it, and oh, yeah, all of the were skinned mesh renderers, but separate objects, dear god.

I had 18 drawcalls just from the pistol, that was pathetic to say the least. Now that pistol has two drawcalls, because I didn't put it on an atlas, but still on two different materials.

and we had 72...

I was kinda happy, and everything was smooth.

Moving the goal post



So I decided hey, lets cap the framerate at 90 now, expecting to get barely more than 72 fps I booted up the game, and...we hit 90 already, well, 87 - 90 fps.

That was an amazing feeling.

I started optimizing the project more, refactoring the code, removing empty scripts, empty functions, unused variables etc. 

By this time I discovered the Project Auditor, something that exists in Unity, only if you add it through the package manager, but instead of having it visible there you need to put in a link to the repository...

This tool is a life saver.

It's insane how much information about your project is there, basically it shows you any get component call that could have been too expensive, if you used Find for anything, if you didn't CompareTag on something, it's insanely powerful, still hurts my head as to why this isn't just there, in unity, a click away.

The project now runs at 90fps, and I'm not uncapping it further than that, there's no need, I don't want to move away from it, but I am really happier than ever now that everything works after 2 weeks of sleepless nights, optimizing, baking, testing, cleaning up, retopologizering, reinventing the wheel...




Files

XXI-Conduit - Native Quest Demo 62 MB
Jun 08, 2024

Get XXI Conduit - Quest and Windows

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.