Problems caused by limited graphics memory with MIDP

Hi there.

I making a game using MIDP and my target phone only has 80KB available to graphics at runtime, so any mutable images I create cannot use more than 80KB (minus the space used by the other images in the game).

I'm working on a game that uses an image as the background. The image is created at runtime from coordinates read in from a file, and scrolls around during play as the player moves about. Now I've realised due to the available memory issue my background image can only only be slightly larger than the actual screen size at most, which is a bit poor.

Can anyone suggest an alternative to using a large image for the background? I've considered working out which area of the background would be onscreen at any one time, and just drawing that, but it would mean recreating the background for every frame, which would savagely effect performance.

Thanks for any help anyone can give me!

[936 byte] By [miraclemakera] at [2007-9-29 21:01:34]
# 1

Can't you use tiles?

http://www.flipcode.com/documents/tilefaq.txt

http://www.genuts.com/api/tutorial/tiles/page3.php

http://www.gamedev.net/reference/articles/article728.asp

http://onesearch.sun.com/search/developers/index.jsp?col=devforums&qp_name=Java+Game+Development&qp=forum%3A406&qt=tile+games

shmoove

shmoovea at 2007-7-16 1:13:12 > top of Java-index,Other Topics,Java Game Development...
# 2
The TiledLayer class in MIDP 2.0 is what you're looking for.There are some excellent MIDP tutorials at MicroDevNet: http://www.microjava.comEnjoy!-Chris
cbs42a at 2007-7-16 1:13:12 > top of Java-index,Other Topics,Java Game Development...
# 3
TiledLayer probably won't do him much good since he's probably talking about the Sony Ericsson T610 which is a MIDP 1.0 device. But he can still implement that functionality himself.shmoove
shmoovea at 2007-7-16 1:13:12 > top of Java-index,Other Topics,Java Game Development...
# 4
You're exactly right shmoove, the phone is MIDP 1.0It looks like I am going to have to do my own implementation of tiles but due to the nature of the game I'm going to have to be creating and destroying the same tiles all the time. Ah well, I'll give it a go and see how it pans
miraclemakera at 2007-7-16 1:13:12 > top of Java-index,Other Topics,Java Game Development...
# 5

This is an issue I have thought about when developing games, how well established is MIDP 2.0 on phones? Is there only one phone with MIDP2 or is there more? I am developing a game based on MIDP 2.0 but the only device that i can think that runs MIDP2 is the nokia n gage (And thats just a guess based on that it is made for gaming).

Stoned_Cabbagea at 2007-7-16 1:13:13 > top of Java-index,Other Topics,Java Game Development...
# 6

Actually, the N-Gage is a MIDP 1.0 device + MMAPI + Nokia extensions.

The MIDP 2.0 devices are starting to surface. Nokia has the 6600, 7700 and 6230. Sony Ericsson has the P-900 and I think a couple more. Motorola also has a few (I think around 5). Other manufacturers are also starting to come up with MIDP 2.0 devices, like the AlphaCell M-5.

The main problem now is not how many devices are out, but how much market penetration they have.

shmoove

shmoovea at 2007-7-16 1:13:13 > top of Java-index,Other Topics,Java Game Development...
# 7
Does MIDP 1.0 still support PNG transparency though? I have heard that it does and that it doesn't which is confusing! If it doesn't support PNG transparency could I use GIF transparency instead?
Stoned_Cabbagea at 2007-7-16 1:13:13 > top of Java-index,Other Topics,Java Game Development...
# 8

It doesn't have to. The specs for MIDP 1.0 were designed with no transparency in mind (that's why there's no way to create a transparent mutable image, etc. in the API), but most phones do support transparent PNGs. To this day the only phone I have seen that didn't support transparency is the Motorola i85s (one of the very first J2ME phones). And using GIFs probably won't help.

shmoove

shmoovea at 2007-7-16 1:13:13 > top of Java-index,Other Topics,Java Game Development...
# 9
ok thankyou very much
Stoned_Cabbagea at 2007-7-16 1:13:13 > top of Java-index,Other Topics,Java Game Development...
# 10
Even though im not doing work on a phone, i will be doing a tile based system for a game and those links were very nice, thank you very much :).CoW
Cowsrulea at 2007-7-16 1:13:13 > top of Java-index,Other Topics,Java Game Development...