load big big image...

Hi all, i have to write a game like worms, but not turned based.

My problem is load maps. A map is a big gif or png image (4000x3000) pixel and when i try to load it i have a out of memory error...

What can i do?

The maps have to move very smooty and fast so i cant load image form file in runtime...

plz help me..

[345 byte] By [blowa] at [2007-10-3 2:46:40]
# 1
a 12 MegaPixel image is quite large are you loading it as am image?Do you really need that large of image or can you have a sean generator or tiles?
morgalra at 2007-7-14 20:35:26 > top of Java-index,Other Topics,Java Game Development...
# 2
Hi, yes i need to load it like image...i cant use tile becouse this image does not have parts that are repeated... so i can only load all image.The image have to move smooty and fast too..
blowa at 2007-7-14 20:35:26 > top of Java-index,Other Topics,Java Game Development...
# 3

You can increase the heap space available to your program by adding the VM argument -XmxnnnM where nnn is the megabytes to give to the JVM heap. So for example you could start your program like this:

java -Xmx250M YourGame

which would run the class YourGame in a JVM with 250MBytes of heap available. The default heap size is 64MBytes and that just isn't enough if you have several very large images.

TimRyanNZa at 2007-7-14 20:35:26 > top of Java-index,Other Topics,Java Game Development...