I get quite a few comments saying “I DON’T LIKE YOUR GAME, IT LAGS”’. I’m going to try my best to write this so it doesn’t come across as ‘passing the buck’, but hopefully people will understand a little more how things work. After all, it’s only running on an Xbox!So, does each patch make the game slower? No. Far from it. I spend several days a month optimising the game, profiling everything, and doing my very best to push squeeze every erg of performance out of the Xbox. Not that you measure performance in ergs.So, why does the game apparently run worse than it did when it shipped?
A good simile would be a car; so you’ve just bought a brand new sports car, with 200bhp, and it goes really fast! But then, one weekend, you get it upgraded to 300bhp, but you also, for some reason, fill the boot with gold. Why is the car going not going faster? It has more horsepower!
FortressCraft has gained more and more horsepower with each patch. But people are putting more and more gold in the boot. Sorry, trunk. And by gold, I meant custom objects, doodads, etc.
When you join a server, and it’s laggy (Don’t even get me started on using that word incorrectly – laggy refers to high latency, NOT low framerate!), it’s not my fault. Not ever. Sure, I can optimise things away, but there are finite limits. It’s the server’s responsibility to ensure their worlds run smoothly.
Don’t get me wrong, I am doing everything I can do optimise my code, but… well, let’s take custom objects.
A worst-case custom object can have 8,000 polys in it; the Xbox can transform 500 million triangles per second. Assuming you want the game to run at 60 fps, you only have 8,333,333 polys per frame to deal with. That is also assuming you’re using a very simple vertex shader! Real world performance is likely to be a lot less :-)
So, 8.3 million polys/frame max, and 8,000 polys per object. That means, if you want 60 fps, you can only draw 1041 objects.
So when someone says YOU NEED TO OPTIMISE THIS!, what can I do? There’s literally no performance left to wring out of the Xenos GPU in this instance, and this situation is also pretending that we aren’t drawing the sky, water, other players, the landscape, your axe, particles… and reflective water is TWICE as slow; refractive water is THREE times as slow! (sorry, them’s the breaks!)
“I DON’T LIKE YOUR GAME, IT LAGS”
Well, I AM sorry; truly. As my twitter feed has seen me say a hundred times – “It’s only an Xbox”. It’s an 8 year old piece of hardware, with a limited ram set, slow I/O performance and really quite pisspoor FPU performance.
But all is not lost! So here are a few handy hints.
1) Tell the guy running the server. The Xbox has voice chat, use it. You might even make a friend. Remember, it’s the server’s responsibility to make sure that his world isn’t overloaded.
2) If you regularly run a server, it’s recommended you run on a high detail; that way, clients who are running on high detail will see the same performance as you. If you, as a server, run on low detail to keep it running fast, then clients who join on high detail are going to complain that the game lags.
3) Be careful about custom objects. They are awesome, and they ARE fast, but they have distinct limits.
4) Optimise your custom objects. Yes, I know the workshop HUD is big and annoying, but that’s so you don’t ignore it. I’m not going to allow you to disable it, as how complicated your object is (it surprises me how many polys objects have sometimes, and I know exactly how it all works!)
5) Adding blocks to custom objects can make them less complicated. Avoid transparent blocks in custom objects if you can; they are really expensive.
6) Try and strike a balance between the number of custom objects, and their complexity; a middling amount of middling complex objects is the best bet.
1,000 objects, 1 type, 2,000 polys = good
1,000 objects, 5 types, 1,000 polys = good
10,000 objects, 1 type, 1,000 polys = bad
1,000 objects, 64 types, 1,000 polys = bad
1,000 objects, 64 types, 8,000 polys = bad.
It’s only an Xbox!
7) Be aware of the view frustum; if you fill an underground cave with custom objects, the game still has to render them, it doesn’t know they can’t be seen (a curse of a fully destructible world); try to spread out your creations a little bit; use Z on a keypad/keyboard to show exactly how much is being drawn of each type. If you want a forest and a factory, try putting them in different directions, rather than where a player will see both of them. It’s only an Xbox!
8) If your game isn’t rendering water, then it doesn’t matter your water detail. Try and use water creatively, rather than all willy-nilly.
9) Doodads are fairly cheap, and fairly efficient; lasers, conveyors, jumpads, factories can be used to a fairly large degree. Doodads that come to a complete halt on a normal surface; if you’re done with a chain, get rid of them as soon as possible. The left-click-stick shows you the number of active doodads. Remember, if you’re not drawing anything else, you’re only allowed 1,042 complicated custom objects at 60fps! I’ve joined worlds where people have well over 10,000 active doodads; if they were complicated ones, that means the best framerate you’ll see is only 6fps! Try and keep them simple; it’s only an Xbox!
10) Rendering the world is incredibly cheap and efficient; if you never use any of the cool shit that FortressCraft as, the game will run at a lovely solid 60fps.
11) Remember that there are detail settings for a reason. A huge amount of people run at full draw distance, full water detail, and full world rendering, with particles on. You’ll never get a good framerate like that if you also combine it with 10,000 custom objects. Try running the game in Safe Mode once in a while (hold Y when you Join or Enter the world); that puts the game on absolute minimum detail – then notice how nicely the game runs. I‘d love you to be able to run the game at max detail at 60 fps but, hey… it’s only an Xbox.
I’m sure someone will suggest that the game should be doing the limiting. However, it’s just not that simple. You can have high detail custom objects, if you use it them sparingly. But if you want to place them down in large numbers, it’ll need to be simple. But, if there’s water there as WELL, then it might run slowly… the number of variables involved in ‘framerate’ are far, far too many to be easily summed up and analysed and limited. Sorry.
Oh, and just for the 20 people who said “Don’t render things you can’t see!”… seriously? You might as well tell me that I should put round wheels on a car; it’s pretty obvious!