Java-Gaming.org
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
Featured games (78)
games approved by the League of Dukes
Games in Showcase (406)
games submitted by our members
Games in WIP (293)
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  
  VolatileImage usage  (Read 1240 times)
0 Members and 1 Guest are viewing this topic.
Offline alcha

Junior Newbie




Java games rock!


« Posted 2003-09-30 11:45:56 »

Fellas...

I've got a little video game and
i was facing some speed issues in high
resolutions so i thought: "why not?let's
find out what this volatileImage stuff is all about"

The situation is the following:
Container->Canvas
BufferedImages drawing in  
Buffer (BufferedImage) and then the buffer is being
drawn to the Graphics of the Canvas using
Graphics2D's drawImage.

I knew nothing about VolatileImage so i started changing
everything i saw from BufferedImage to VolatileImage using
routines for validate() cases and contentsLost() (std procedure...)
The Result? Disastrous...(fps down 3-4 frames)

OK i have understood the redundancy of using VolatileImages
for the initial images but what about the final Buffer?
I mean it's the image(array of bytes)that should stay in the VRAM...

So,I did it again with only the final buffer being Volatile
but the results were the same.

Tell me:
Do i have a really BIG misconseption about what a
VolatileImage is and how to use it?
Does the above structure has any potential of becoming
any faster without any big changes (e.g BufferStrategy)?

I don't want so much a solution to my problem
comparably to how badly i want to find out
if i got straight VolatileImage.
Offline swpalmer

JGO Coder




Where's the Kaboom?


« Reply #1 - Posted 2003-09-30 12:40:12 »

It's hard to day where the problem would be from what you have posted so far.  Can you post the relevant code?

Offline alcha

Junior Newbie




Java games rock!


« Reply #2 - Posted 2003-09-30 13:08:04 »

So you say there IS a problem...

I mean from my description i shouldn't
face a decreasing fps but an increasing one?
Games published by our own members! Check 'em out!
Try the Free Demo of Revenge of the Titans
Offline immudium

Junior Member




Gorram it!


« Reply #3 - Posted 2003-09-30 15:06:38 »

I don't think he's saying anything about a problem with VolatileImages.  In my experience, VolatileImage is alot trickier to implement properly than it would seem at first glance.  Things have to be done in the right order and a FPS increase is not guaranteed or automatic especially if you don't do things in the order VolatileImage expects.

Abuse posted a little demo called balls.jar a couple months back.  I don't know if that code is still available, but you can find an excellent thread on the subject here: http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=2D;action=display;num=1057468145;start=3#3
Offline Abuse

JGO Coder


Medals: 2


falling into the abyss of reality


« Reply #4 - Posted 2003-09-30 17:05:43 »

yeah its still around.

http://www.pkl.net/~rsc/downloads/Balls.jar

There is also a version with Ball<->Ball collision (though its not very efficient - just a little play I had)

http://www.pkl.net/~rsc/downloads/Balls2.jar

Make Elite IV:Dangerous happen! Pledge your backing at KICKSTARTER here!
Offline immudium

Junior Member




Gorram it!


« Reply #5 - Posted 2003-10-01 04:00:50 »

Cool demo, I've been wanting to start playing around with collision detection.  As with the original balls demo, Balls2 seems to be a great example for pointing me in the right direction.  I can't wait to see what "Balls 3: Revenge of the Balls" will show us Tongue.  Thanks for posting it!
Offline Abuse

JGO Coder


Medals: 2


falling into the abyss of reality


« Reply #6 - Posted 2003-10-01 09:36:50 »

prolly have a go at 'proper' collision detection Shocked

(at the moment it isn't a true simulation of motion, just an approximation - only 1 ball is moved at a time - this can lead to balls overlaping in certain circumstances)

The solution will entail all kind of nastyness though :-/

Make Elite IV:Dangerous happen! Pledge your backing at KICKSTARTER here!
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Browse for soundtracks for your game!

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

The first screenshot will be displayed as a thumbnail.

The invasion has landed! On Mars! And you're there to beat 'em!
cubemaster21 (84 views)
2013-05-17 21:29:12

alaslipknot (92 views)
2013-05-16 21:24:48

gouessej (123 views)
2013-05-16 00:53:38

gouessej (117 views)
2013-05-16 00:17:58

theagentd (127 views)
2013-05-15 15:01:13

theagentd (114 views)
2013-05-15 15:00:54

StreetDoggy (158 views)
2013-05-14 15:56:26

kutucuk (180 views)
2013-05-12 17:10:36

kutucuk (180 views)
2013-05-12 15:36:09

UnluckyDevil (187 views)
2013-05-12 05:09:57
Complex number cookbook
by Roquen
2013-04-24 12:47:31

2D Dynamic Lighting
by Oskuro
2013-04-17 16:46:12

2D Dynamic Lighting
by Oskuro
2013-04-17 16:45:57

2D Dynamic Lighting
by Oskuro
2013-04-17 16:23:20

Noise (bandpassed white)
by Roquen
2013-04-05 17:36:01

Noise (bandpassed white)
by Roquen
2013-04-03 16:17:38

Java Data structures
by Roquen
2013-03-29 13:21:12

Topic Request
by kutucuk
2013-03-22 21:42:01
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!
Page created in 0.071 seconds with 21 queries.