×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    25

    Efficiently implementing a scrolling map system in J2ME

    Hey folks,

    A friend and I are starting on a sidescrolling platformer for Series 40 and 60 Nokia devices. We were trying to decide how we were going to do the map system today when I realized that loading in a map file generated with a freely available map editory like Mappy would suck up pretty much all the app space we have available. Also, exporting map data to a comma delimited text file produced a 10k file with only a 50x50 tile map. This is not acceptable, as the Series 40 devices generally have a 64kb app size limit. If I was to hardcode the map data, it would take up probably the same amount of space, since all of the data would be stored in the class file. Does anyone have a suggestion about how I could implement a map system that would be efficient on file size as well as processor? I've seen a few games available for various handsets that have a scrolling map engine like I'm planning on writing. I know that this must be possible, but I haven't been able to figure anything out yet.

    Thanks in advance for any help.

    Dave

  2. #2
    Regular Contributor
    Join Date
    Apr 2003
    Location
    Slovakia/Bratislava
    Posts
    67
    Don't know much about map systems, but i guess map is nothing more than a 2D vector data...

    you personaly wrote about limitations of wireless devices you decided to code for. The only way I see is to forget that you embed you map data in any form into jar file. You should start thinking about client - server [web service] design...

    I would follow this way...

    at first user downloads map data with low details, (but he is able to zoom - vectors), when he zooms and moves in some place and he wants to see more details, he will use some command for downloading details for this part [you can let him choice what level of details]...

    so this is much complicated, this requires inteligent caching system client side, more complicated bussiness logic server side, generation of more levels on map details, and this system would take money and time of user

  3. #3
    Registered User
    Join Date
    May 2003
    Posts
    3
    Create a 50x50 pixel .png file made up of colors per pixel. You can load up/create the map data by looking up the individual pixels.

    A 50x50 pixel map is less than 2KB

    Hope that helps.

    Cheers,

    m.s.

  4. #4
    Registered User
    Join Date
    Mar 2003
    Posts
    6
    I changed the code in Mappy so that it exports the map as a long text string with no sepeartions. Each unique tile would be represented by an ASCII charater, so there be a 256 limit on tiles minus the quote. But 256 is more than enough.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×