Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (512)
Games in Android Showcase (119)
games submitted by our members
Games in WIP (576)
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  
  Chunk Snapshot  (Read 1804 times)
0 Members and 1 Guest are viewing this topic.
Offline Oakine

Junior Newbie





« Posted 2012-09-18 21:32:49 »

Hey guys, not sure if this is the right place for this but here it goes:
I'm working on a tile engine, like 2d minecraft or whatever.  I am organizing the blocks in chunks and draw a whole chunk if any of it is on-screen.  If I am drawing like 20 chunks or something like that then its no problem (default zoom and screen size only 12 chunks MAX are drawn anyway).  BUT, when the user zooms out and a few hundred chunks need being drawn with 256 blocks in each of them, it obviously drops the FPS quite significantly.

I was wondering if it would make any sense at all to take some sort of "chunk snapshot" where it does a one time thing and draws all the blocks in the chunk onto an image and every draw sequence after that just draws that image.  I THINK this is a good idea, and I think I picked it up from somewhere else (I'm not that clever Tongue) but just in case I need some validation xD

IF this makes sense and would boost performance, how exactly could I go about doing this? (I'm using Slick2d BTW)
Thanks

EDIT:  Also if It's unclear what I'm asking just tell me Smiley
Offline Best Username Ever

Junior Duke





« Reply #1 - Posted 2012-09-19 23:05:30 »

Have you tested the performance or are you assuming something about the computer's ability to draw pixelated blocks quickly?
Offline Sickan

Senior Duke


Medals: 9



« Reply #2 - Posted 2012-09-20 04:57:36 »

You could use an image and draw that scaled depending on how much you've zoomed. You could also opt to draw only half or a quarter of the blocks when you've zoomed out.

Cheers Smiley
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Online theagentd
« Reply #3 - Posted 2012-09-20 08:44:36 »

Have you tested the performance or are you assuming something about the computer's ability to draw pixelated blocks quickly?
Accidental medal, though somewhat deserved... xd

If you're using Slick you should be able to set up a batch once and reuse it until the chunk changes. No idea exactly how to do that with slick though...

Myomyomyo.
Offline davedes
« Reply #4 - Posted 2012-09-20 13:19:15 »

Probably because you aren't using drawEmbedded:
http://slick.cokeandcode.com/wiki/doku.php?id=performance_memory_tips

Offline Oakine

Junior Newbie





« Reply #5 - Posted 2012-09-27 22:54:58 »

Hey guys, sorry I haven't replied, computer was brokededed.. Shocked
Anyway thanks davedes, that helped alot Smiley.
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.

Longarmx (49 views)
2014-10-17 03:59:02

Norakomi (39 views)
2014-10-16 15:22:06

Norakomi (31 views)
2014-10-16 15:20:20

lcass (35 views)
2014-10-15 16:18:58

TehJavaDev (66 views)
2014-10-14 00:39:48

TehJavaDev (65 views)
2014-10-14 00:35:47

TehJavaDev (55 views)
2014-10-14 00:32:37

BurntPizza (72 views)
2014-10-11 23:24:42

BurntPizza (43 views)
2014-10-11 23:10:45

BurntPizza (84 views)
2014-10-11 22:30:10
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

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
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!