How many tiles should cause lag? [libGDX]

Say you were to write a simple tile rendering system with collision and the like, what amount of 64 x 64 tiles should you aim to be able to render with 30+ fps?

I know this isn’t necessarily a good question, more just a way for me to gauge how much better I can make my rendering/collision methods. (I’m using libgdx and I know there’s plenty of room for improvement for me.) Basically I’m just looking for what amount I should aim for.

Don’t render all of the tiles if some of them aren’t visible in the frame.

Which, if you are only rendering tiles in the frame, you shouldn’t get any lag at all, depending on how big your tiles are and how many of them are rendered.
64x64 tiles being rendered with that method shouldn’t cause any lag.

  • Jev.

Well of course, but that isn’t my point.
The point is to render as much as possible even if it’s not in frame because I want to see if my core methods are well written. I suspect they aren’t, which is why I’m asking ideally how many tiles should I be able to render, regardless of if they’re in frame or not. I know if my core rendering is poorly done if I make my game more complex it can lead to slowing down even with small numbers of tiles.

Can’t really say anything with no information about your computer.

AMD Athlon x3 3.4GHz
Radeon HD 6750
windows 7
8 gb ram

If you can’t render 10K 64x64 tiles at a framerate higher than 30 FPS (without taking into account culling), then I’d say your code is badly written.

This is an absolutely terrible way to optimize anything.

All the CPU time will be spent on the draw calls themselves (since they can be relatively expensive sometimes) You should make sure all you operations are hardware accelerated in Java2D if you are experiencing performance issues.

X draw calls at Y FPS is an absolute crap benchmark. So is drawing any conclusion like “all your draw code is bad.” Use a profiler, it is probably less than 5% of the code that is inducing that bottle-neck. Find it and it is probably an easy fix.

look at what the SNES could do.
You’ll be fine.

If you want to draw a lot of tiles, you should use framebuffers (in most cases).
Otherwise just create chunks and determine which is visible/not visible, in addition you could also calculate which tiles have to be drawn.

As Jeremy said, this is a terrible test.
Rather better one is to make Your game/application work as expected and then see if the performance is acceptable on the platforms You intend it to run.

Does this really provide any benefit? Won’t objects drawn offscreen take very little time to “draw” since they aren’t actually being rendered?

If your chunks aren’t to big, it won’t make a huge difference. I am using 8x8 Cunks. It depends on how many objects are drawn outside.