Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (497)
Games in Android Showcase (114)
games submitted by our members
Games in WIP (563)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  How many tiles should cause lag? [libGDX]  (Read 842 times)
0 Members and 1 Guest are viewing this topic.
Offline bilznatch

Senior Member


Medals: 8
Projects: 2
Exp: 1 year


I'm bad, I'm bad, I'm really... really bad T_T


« Posted 2013-10-19 21:31:03 »

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.
Offline kpars

JGO Wizard


Medals: 79
Projects: 4
Exp: 3 years


Extreme Typist.


« Reply #1 - Posted 2013-10-19 21:40:33 »

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.

Offline bilznatch

Senior Member


Medals: 8
Projects: 2
Exp: 1 year


I'm bad, I'm bad, I'm really... really bad T_T


« Reply #2 - Posted 2013-10-19 21:49:22 »

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.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Longarmx
« Reply #3 - Posted 2013-10-19 22:16:03 »

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

Offline bilznatch

Senior Member


Medals: 8
Projects: 2
Exp: 1 year


I'm bad, I'm bad, I'm really... really bad T_T


« Reply #4 - Posted 2013-10-19 22:17:13 »

AMD Athlon x3 3.4GHz
Radeon HD 6750
windows 7
8 gb ram
Offline Dxu1994
« Reply #5 - Posted 2013-10-19 22:22:10 »

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.

Offline Jeremy
« Reply #6 - Posted 2013-10-19 22:29:36 »

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.

JevaEngine, Latest Playthrough (This demo is networked with a centralized server model)

http://www.youtube.com/watch?v=rWA8bajpVXg
Offline Cero
« Reply #7 - Posted 2013-10-20 02:14:50 »

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

Offline Phibedy

Senior Member


Medals: 8



« Reply #8 - Posted 2013-10-20 20:25:39 »

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.
Offline xsvenson
« Reply #9 - Posted 2013-10-21 08:10:36 »

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.

“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Grimmov

Senior Newbie





« Reply #10 - Posted 2013-10-21 12:09:27 »

in addition you could also calculate which tiles have to be drawn.

Does this really provide any benefit? Won't objects drawn offscreen take very little time to "draw" since they aren't actually being rendered?
Offline Phibedy

Senior Member


Medals: 8



« Reply #11 - Posted 2013-10-21 20:47:51 »

in addition you could also calculate which tiles have to be drawn.

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.
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

BurntPizza (15 views)
2014-09-19 03:14:18

Dwinin (33 views)
2014-09-12 09:08:26

Norakomi (58 views)
2014-09-10 13:57:51

TehJavaDev (80 views)
2014-09-10 06:39:09

Tekkerue (40 views)
2014-09-09 02:24:56

mitcheeb (63 views)
2014-09-08 06:06:29

BurntPizza (46 views)
2014-09-07 01:13:42

Longarmx (33 views)
2014-09-07 01:12:14

Longarmx (37 views)
2014-09-07 01:11:22

Longarmx (36 views)
2014-09-07 01:10:19
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!