Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (753)
Games in Android Showcase (228)
games submitted by our members
Games in WIP (842)
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  
  isometric tiles in Java2D w/ scrolling  (Read 2975 times)
0 Members and 1 Guest are viewing this topic.
Offline JuddMan

Senior Devvie

Medals: 1

Your Ad Here

« Posted 2005-02-09 16:07:24 »

Here is a little isometric tiling app i wrote, which scrolls a set of tiles. it doesn't work as well as i had hoped, getting only about 100 FPS (Windowed)

it uses transparent GIFs in an array (256x256), and BufferStrategy.

the main classes have comments so anyone can hopefully follow what's going on in it. you can get the source by unzipping the .jar:


edit: if anyone knows a more efficient or better way to do this type of tiling (aside from switching to LWJGL or something like that) i'd really like to know about it.
Offline dylanjames

Innocent Bystander

Java games rock!

« Reply #1 - Posted 2005-02-19 01:10:31 »

This looks pretty nice!  I wonder how hard it would be to extend it to non-level terrain?
Offline darkprophet

Senior Devvie

Go Go Gadget Arms

« Reply #2 - Posted 2005-02-19 20:08:55 »

im getting 216FPS on a pretty naff Gfx (ATI radeon 9200).

The thing that really got to me about this is that the outside tiles are being culled, i would prefer it if the outside's outside are culled instead, so you get a feeling of your still in the terrain, and not isolated...

Its not v. good looking to see the culling happening to speed things up! Smiley


Friends don't let friends make MMORPGs.

Blog | Volatile-Engine
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline dronus

Senior Newbie

"Der CRC32-Hashwert dieses Satzes ist BA5D7983."

« Reply #3 - Posted 2005-02-20 07:28:57 »

I suggest performance by balancing:

two things you have to weight up against each other:

-time to convert data
-time to copy data

when you draw more surface than actually seen (and you do,  as rectified tiles overlap here) maybe a backbuffer-and-copy strategy would be better. i experienced that in my game. the reason is that your images (paletted gifs for example) need to be converted to screen mode which is 24/32bpp mostly and can have several different alignments of data (bitmap type; eg INT_RGB, BYTE etc..)

so there are three different ways to use:

-draw directly to a flip-buffer (as you do, if it is available)
pro: less to draw
con: every tile, and so more then actually visible surface is converted every time drawn

-draw to a backbuffer that exactly matches image-bitmap-mode (eg. paletted mode with global palette for gifs)
pro: conversion is only done once for exact the whole visible surface
con: whole surface will be converted even if less is drawn (eg. no scrolling but moving sprites), for gif's a global palette is needed

-convert all images first
pro: no conversion at runtime at all
con: heavy memory footprint

for me the last worked best
in fact i copy every loaded image to a same-sized bitmap with the exact properties of the output-screen, and use this new duplicates for drawing. if all works, no conversen is done then.
this even accelarates alpha-channel blits i used a lot, but these are allways many times slower than direct blit.

hopes that helps

Pages: [1]
  ignore  |  Print  

nelsongames (20 views)
2018-04-24 18:15:36

nelsongames (17 views)
2018-04-24 18:14:32

ivj94 (608 views)
2018-03-24 14:47:39

ivj94 (54 views)
2018-03-24 14:46:31

ivj94 (402 views)
2018-03-24 14:43:53

Solater (66 views)
2018-03-17 05:04:08

nelsongames (111 views)
2018-03-05 17:56:34

Gornova (177 views)
2018-03-02 22:15:33

buddyBro (747 views)
2018-02-28 16:59:18

buddyBro (94 views)
2018-02-28 16:45:17
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

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