Uncategorized

Before Starting – Optimization

Worried that your game is going to run slow because you don’t know the most efficient way to code things? Me too! But this can be a lethal mindset. It HAS killed at least one of my projects in the past. It’s good to want efficient code. It’s good to say to yourself, “If I do this really badly now, I’m going to have to come back and fix it later, so I should do it properly now.”


But it’s bad to have optimization be such a concern that you paralyze yourself. Additionally, optimization may or may not matter so much depending on the kind of game you’re making. My game is going to be a graphically light turn based roguelike. I don’t need heavy lifting power. I can probably be pretty inefficient with my code and still have it run at 60 fps no problem on a modern machine.


But if you’re worried about performance, do like I’m doing and develop and test your game on and older computer. I’m working off an old Dell laptop. While it has a solid amount of RAM, the onboard graphics suck. Unity is also fairly heavy on overhead. Your game will run slower while testing in Unity than it will as a standalone application. So if I can run my game at a nice, high framerate with Unity overhead on this laptop, it’ll do fine anywhere else I can install it.


All that being said, I am going to try and code some things as efficiently as I can while I go. Given my game will be tile-based, I probably want to take advantage of Unity’s Tilemap system rather than drawing each and every tile as a separate sprite. I should also probably try not to erase and redraw the whole tilemap with each step, but we’ll see how hard that turns out to be.


The moral here being – don’t paralyze yourself with trying to optimize performance too much too early. Get that working MVP first!

https://xkcd.com/1691/

Leave a Reply

Your email address will not be published. Required fields are marked *