Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (739)
Games in Android Showcase (224)
games submitted by our members
Games in WIP (820)
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 3263 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)

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

Junior Devvie

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

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

Probably because you aren't using drawEmbedded:

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.

Ecumene (51 views)
2017-09-30 02:57:34

theagentd (76 views)
2017-09-26 18:23:31

cybrmynd (183 views)
2017-08-02 12:28:51

cybrmynd (182 views)
2017-08-02 12:19:43

cybrmynd (189 views)
2017-08-02 12:18:09

Sralse (197 views)
2017-07-25 17:13:48

Archive (747 views)
2017-04-27 17:45:51

buddyBro (881 views)
2017-04-05 03:38:00

CopyableCougar4 (1429 views)
2017-03-24 15:39:42

theagentd (1319 views)
2017-03-24 15:32:08
List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05

SF/X Libraries
by SkyAphid
2017-03-02 06:38:56

SF/X Libraries
by SkyAphid
2017-03-02 06:38:32

SF/X Libraries
by SkyAphid
2017-03-02 06:38:05

SF/X Libraries
by SkyAphid
2017-03-02 06:37:51 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‑
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!