Skip to main content
GameDev.net gamedev.net
🔒 Locked

Isometric questions

Started by fatjaba Jun 28, 2004 at 4:32 PM 2 replies 2k views
Original Post
fatjaba
fatjaba
Hi, I am working on an Isometric J2ME game, I am very new to writing J2ME and even newer to Isometric projections but have read quite a bit..however bare with me and hopefully I can ask some sensible questions you clever people might be able to help me with if you would be so kind! 1.Because of the limited resources on a mobile phone, what would be the best format for map data, storing information about the tiles, the objects in the tiles and the enemies in them. What data structure would be appropriate for holding this data? 2. Drawing everything, currently I create a floor buffer at the start of each room and updating it when the floor changes, such as trap doors being opened, falling platforms etc.. I then draw all the items on top of this, such as doors, blocks, NPC's etc... I have trouble with the draw order and have people walking behind doors and stuff, how do I get the correct draw order? 3.Is there a faster way of drawing things than the way I am doing above? Any advice on this would be much appreciated. My game is a dungeon kind of adventure where rooms are 9x9 tiles and the player walks through a door, either north south east or west to get to the next room... Any advice would be much appreciated! Jaba
EDI
EDI
hello there, =)

ok, lets give this a shot.

/*
1.Because of the limited resources on a mobile phone, what would be the best format for map data, storing information about the tiles, the objects in the tiles and the enemies in them. What data structure would be appropriate for holding this data?
*/

Given the nature of 2D isometric graphics I would say this combination would yeild the best results.

low color graphics, 8 bit if that is possible, using a single color for a color key.

graphic storage should probably be done using RLE compression, due to the nature of large 'dead spots' on isometric graphics, this can mean big space savings.

depending on how you are rendering graphics, it would be best to keep graphics in RLE format in memory, this can be done if you are 'manualy' rendering your graphics, or if the hardware supports such an on-board format.

given the small amount of memory on the phone you can probably assume to store width and height as 16 bit integers instead of 32 bits, also depending maybe even 8 bits.



/*
2. Drawing everything, currently I create a floor buffer at the start of each room and updating it when the floor changes, such as trap doors being opened, falling platforms etc.. I then draw all the items on top of this, such as doors, blocks, NPC's etc... I have trouble with the draw order and have people walking behind doors and stuff, how do I get the correct draw order?
*/

I had this problem a long time ago, and with the help of 'crazy' mike, on these boards we were able to develop a system called 'LORM' known as Large Object Rendering Method.

it is a way to draw your tiles so that things on them are overlapped properly, you can search for LORM on this forum and probably find it.


/*
3.Is there a faster way of drawing things than the way I am doing above? Any advice on this would be much appreciated.
*/

the fastest way to draw, is not to draw, so developing a system that allows for graphics to only have to be updated at certain times is key, also, lower color graphics, will tend to copy faster *as long as there isnt some color management going on* due to the smaller byte copy needs.

hope that gives you some help=)
fatjaba
fatjaba
Thank you very much for your reply and it has given me some ideas, however with RLE compression, the images are already in PNG format will this not be less effecient?
I was also enquiring about the map data format, what would be the best way to store the data, I currently use a two-dimensional 32 bit integer array to save space, each int is then split up into 4 bytes which are used to indicate tile types, objects, sprites and identifiers..Is there a better way than this, because I am now finding this rather restrictive!

Your point about not drawing things is so true its not real, I just cant think of any way of culling what I draw, could you elaborate on this or point me in the right direction? Currently almost the entire room is visible on the screen at once as they are only 9x9 tiles.

Also I forgot to mention that this is in java so I have little control over the phone!

Thank you so much for any further help!
Puzzler183
Puzzler183
For actually storing maps, a simple 2D array setup may be good, perhaps stored compressed with RLE. The compression would be good for most maps where you have repeated tiles of the same type, over and over. For items and NPC's, just have a list of them and their locations instead of having it each tile.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.