Skip to main content
GameDev.net gamedev.net

PRO Tired of ads? Read GameDev.net ad-free and help keep the community independent with GameDev Pro — $3/month.

All the Optimize! SlingBot Boarding v0.2.5

All the Optimize! SlingBot Boarding v0.2.5

Septopus
Septopus
Septopus · · 2 min read
2,690 0

Well, maybe not ALL, but all I can fit into one of my days.

UI sprites packed into an atlas, all other materials/textures are correctly instancing and taking up as few draw calls as I can manage, it floats around 15-30 per frame, at the moment, depending on activity.

My build size has doubled though because I'm essentially using two copies of the ground terrain mesh. It's a shortcut on the way to getting better performance... hahaha

First, I exported the Unity Terrain to .obj using this handy script: http://wiki.unity3d.com/index.php/TerrainObjExporter

(it's 10000x10000 units/meters) Then I took it into Blender where I, by hand(box select) cut it up into 110 pieces, so now I can assist with the culling with some simple distance calculations.

The reason for the doubling of the mesh is because I'm currently using 1 copy of the full terrain mesh for the ground collider, and the other mesh(s) for rendering the visible texture/geometry.

This is all so the player doesn't spin out unexpectedly on a seam.. Which it did, readily.. This is also a hack I'm employing on my main project until I code a better way.

I may try to merge the meshes together at run-time instead, but that might have to be a later update.

I remodeled the board itself, so you may find it catches here or there a little(lot) differently than it did before, had to get it down to a reasonable number of vertexes for instancing. And I think it almost adds a touch of chaos which is nice. You sometimes find yourself spinning when you didn't intend to, but it's reasonable and possibly more correct, for the physics anyhow.

What else... Just lots of texture shuffling, switching out shaders to the mobile versions and adjusting lighting settings until they are tolerable.

I converted ALL the text objects to TextMeshPro(just a free version) components as they manage to instance better than the default text objects do.

I made sure to replace all the Unity default sprite objects I could find(Background,Knob,etc..) as those can't get packed into an atlas, at least I don't know how to get them there... They cause all kinds of draw calls on their own. Just a few simple images.

Nearly EVERY quality setting in Unity has been set to the lowest it goes.

So... Does it run any better? v0.2.5: https://www.kongregate.com/games/WilliamOlyOlson/slingbot-boarding

I'm not entirely sure at this point, but I want to say yes... haha.

And here's 3am again.. Enjoy.

Recommended resources

Game Engines

See full guide
Unreal Engine 5 Best Practices cover
Editor pick

Unreal Engine 5 Best Practices

Amazon · Book

Written by multi-award-winning Unreal generalist Tyson J. Butler-Boschma, Founder and Creative Director of Toybox Games Studios, this book addresses common challenges you face when advancing your expertise in lighting, environment design, and cinematic storytelling.

GameDev.net may earn a commission if you purchase through these links. This helps fund the site at no extra cost to you.

GameDev.net may earn a commission if you purchase through these links. This helps fund the site at no extra cost to you.

Discussion

Loading comments...