Java-Gaming.org 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 Engine  (Read 4407 times)
0 Members and 1 Guest are viewing this topic.
Offline kevglass

« JGO Spiffy Duke »


Medals: 319
Projects: 25
Exp: 22 years


Coder, Trainee Pixel Artist, Game Reviewer


« Posted 2003-05-19 18:30:36 »

Sorry if this has been asked before, but searching around I can't find anything..

I'm thinking about writing an isometric tile engine, but during a few experiements I'm having trouble grasping how I'm going get the performance out of Java.

To cope with object occluding players as they walk around the map I think I need to re-render the viewable tiles every frame? Is this the wrong approach?

Has anyone got something of this nature working and could give me a few pointers (or links to web sites)?

Any help much appreciated,

Kev

Offline DarkwingGT

Senior Newbie




Java games rock!


« Reply #1 - Posted 2003-05-19 20:16:58 »

I'm not really a graphics guru but here's a suggestion to prevent refreshing all visible tiles for occlusion.  If you attribute each tile with a height value (could be as simple as 1 or 0) then you check the surrounding tiles of the player (i.e. the ones lower then them on screen) and if they have the height set then you redraw otherwise you know the player isn't occluded.

I don't know if this would be useful or not but it seems like you trade redrawing everything for about 3 ifs (and of course some memory accesses Smiley)
Offline Orangy Tang

JGO Kernel


Medals: 57
Projects: 11


Monkey for a head


« Reply #2 - Posted 2003-05-19 21:29:42 »

Depending on your game, a standard method of dirty rects and keeping a prebuilt background from your tiles on which you place sprites would probably work fine.

A note on performance: last year with CatAttack, we had an entire screenfull of 32x32 tiles (so approx 20x15), each which was built of multiple actual tile images (base + detail + shadow, often more than one detail for worst case). Add on top of this about 50 sprites and another ten or so for the HUD. All running without problems at 75fps on my machine. On a rather crappy uni lab machine (some obscure graphics card, must have had 8mb ram at most) we got an acceptable ~30fps.

The screen was rebuilt from scratch every frame. The two most important things to remember would be to use 'automatic images' and to get some accurate view clipping.

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline kevglass

« JGO Spiffy Duke »


Medals: 319
Projects: 25
Exp: 22 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #3 - Posted 2003-05-20 04:52:55 »

Guys, thanks alot to start, great to get useful responses!!!

Just using the 1 or 0 (present or not) case for tiles isn't quite as expandable as I need. What if a tile only occludes part of the player, I need to redraw that tile, but that in turn might draw over another tile.. and so on, and so on down the map..  Maybe I didn't give enough detail, but tiles might have tall objects on them, which means a tile that is 2 steps away would occlude player.

I'm using 64x64 tiles, and trying to fill a screen of 800x600. I'm not actually drawing any players yet and only one level of sprite for each tile. At the moment, I get around 4fps  :-/ (while drawing all the tiles everytime, well with the addition of clipping)

The dirty rect thing might work for me, could you elaborate on how it works.. If I just redraw the rectangle the isometric player is standing on, won't I redraw over the player with the floor?

Finally, <takes a deep breath>, I understand about the view clipping, but could you let me know what "automatic images" are?

Thanks against for the useful responses, its got me thinking again Smiley

Kev

Offline Orangy Tang

JGO Kernel


Medals: 57
Projects: 11


Monkey for a head


« Reply #4 - Posted 2003-05-20 06:09:38 »

Quote
What if a tile only occludes part of the player, I need to redraw that tile, but that in turn might draw over another tile.. and so on, and so on down the map..  


The usual method is to use a clip rectangle when updating your region.

After a quick search, i found that this site still has all its content still hanging around, even if its not actually directly linked. Enjoy: http://www.java-gaming.org/Documents/Understanding_AWT_Image_Types/understanding_awt_image_types.html Cheesy I found the numerous articles on gameDev.net were useful as well http://www.gamedev.net/reference/list.asp?categoryid=44

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline Tzan

Junior Devvie





« Reply #5 - Posted 2003-05-20 13:29:15 »

I always wondered about those clip areas.

- If you try to draw an image that does not intersect the area does Java do an intersect calc for you then drop it. So it doesnt take much time.

- When you draw an image that partially intersects does java spend the same amount of time with it as if the entire image intersected. ( If 1/10 th of the image intersected would it be 10 times faster)
Offline kevglass

« JGO Spiffy Duke »


Medals: 319
Projects: 25
Exp: 22 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #6 - Posted 2003-05-20 15:10:44 »

ok, ok, Orangy Tang, you are now officially my god!

Automatic Images, give me ridiculus speed Smiley Shame being I've worked out for my particular game I don't need it. Still, awesome!

Kev

Offline kevglass

« JGO Spiffy Duke »


Medals: 319
Projects: 25
Exp: 22 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #7 - Posted 2003-05-21 05:09:08 »

For anyone who needs a comparison in the future..

I'm now filling a 800x600 screen with 64x64 tiles. Which works out to quite a lot of tiles Smiley

I use a back buffer and only update every 50 ms (at this point, its just scrolling across a repeating map)

On my 2.6Ghz laptop, ATI 64Mb graphics, 512 MB I get around 250 fps.

On my 1Ghz desktop machine, with 4Mb Intel onboard graphics and 256 MB I get around 14 fps.

As it happens, I'm never going to display this sort of number of tiles.. but I'm still impressed at the speed you can get out of Java (with the proper advised tailoring)

Kev

Offline jbanes

JGO Coder


Projects: 1


"Java Games? Incredible! Mr. Incredible, that is!"


« Reply #8 - Posted 2003-05-21 12:13:51 »

> On my 1Ghz desktop machine, with 4Mb Intel onboard
> graphics and 256 MB I get around 14 fps.

I assume that's supposed to read "256 MB I get around 140 fps"?

BTW, has anyone noticed that 1.4.2 is significantly faster than 1.4.1? Under the later, my Shooter example for GAGE was just barely able to make 60 FPS with all the graphics being drawn. Now it runs within barely a few milliseconds per frame!

Java Game Console Project
Last Journal Entry: 12/17/04
Offline kevglass

« JGO Spiffy Duke »


Medals: 319
Projects: 25
Exp: 22 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #9 - Posted 2003-05-21 13:06:32 »

Nope, on the 4MB graphics card it runs at 14fps.

Kev

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline vydias

Senior Newbie




Welcome to my world!


« Reply #10 - Posted 2003-05-23 16:26:42 »

Most likely your getting only 14fps because your exceeding the 4mb with your tiles and therefore not all of your images can be accelerated.

This is the one limitation I've found in java. I can get tremendous speed using accelerated images but on systems with limited video card memory you will take a huge hit in performace.

Its my understanding that the only way to shrink up  your images is to direct3d's texture mapping algorithms (turning on a java vm setting) and a color model that imports your images as 16bits. Only problem is that these images are not accelerated and though Sun engineers claim they have enhanced rendering efficiencies with these textured mapped images they are still horribly slow.

Find a fix for this and I have no problems with using Java for any 2d Game application.
Pages: [1]
  ignore  |  Print  
 
 

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

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

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

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

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

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

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

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

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

buddyBro (93 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
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!