Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (539)
Games in Android Showcase (132)
games submitted by our members
Games in WIP (603)
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 1643 times)
0 Members and 1 Guest are viewing this topic.
Offline alcha

Junior Newbie




Java games rock!


« Posted 2003-09-30 09: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


Exp: 12 years


Where's the Kaboom?


« Reply #1 - Posted 2003-09-30 10: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 11: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!
Legends of Yore - The Casual Retro Roguelike
Offline immudium

Junior Devvie




Gorram it!


« Reply #3 - Posted 2003-09-30 13: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 Knight


Medals: 15


falling into the abyss of reality


« Reply #4 - Posted 2003-09-30 15: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! https://dl.dropbox.com/u/54785909/EliteIVsmaller.png
Offline immudium

Junior Devvie




Gorram it!


« Reply #5 - Posted 2003-10-01 02: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 Knight


Medals: 15


falling into the abyss of reality


« Reply #6 - Posted 2003-10-01 07: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! https://dl.dropbox.com/u/54785909/EliteIVsmaller.png
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.

rwatson462 (33 views)
2014-12-15 09:26:44

Mr.CodeIt (24 views)
2014-12-14 19:50:38

BurntPizza (51 views)
2014-12-09 22:41:13

BurntPizza (84 views)
2014-12-08 04:46:31

JscottyBieshaar (46 views)
2014-12-05 12:39:02

SHC (60 views)
2014-12-03 16:27:13

CopyableCougar4 (62 views)
2014-11-29 21:32:03

toopeicgaming1999 (124 views)
2014-11-26 15:22:04

toopeicgaming1999 (114 views)
2014-11-26 15:20:36

toopeicgaming1999 (32 views)
2014-11-26 15:20:08
Resources for WIP games
by kpars
2014-12-18 10:26:14

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