A Flash Developer Resource Site

Results 1 to 12 of 12

Thread: Please suggest me, how to make a big map.....

  1. #1
    Senior Member bluemagica's Avatar
    Join Date
    Jun 2008
    Posts
    766

    Please suggest me, how to make a big map.....

    I am thinking of making a open-worldish game, and so the first thing needed is a big map.... i tried making a 2darray and save it outside(csv format) for a 1000x1000map! But just the array itself is about 8mb, moreover if i try making tile properties like say 8 properties per tile.....the size goes way over 50mb....

    Is there a way to make and store a huge map without the behemoth size? I am open to both design/structure suggestions and coding suggestions.
    If you like me, add me to your friends list .

    PS: looking for spriters and graphics artists for a RPG and an Arcade fighting project. If you can help out, please pm me!

    My Arcade My Blog

    Add me on twitter:

  2. #2
    M.D. mr_malee's Avatar
    Join Date
    Dec 2002
    Location
    Shelter
    Posts
    4,139
    compression.

    http://board.flashkit.com/board/show...ap+compression

    I also recommend you develop a system where tiles have default properties if none set in the map data. Therefore reducing a tile definition down to its id and amount of properties. If using binary, a tile will need to be defined by an id and the amount of extra properties it contains. When looping over, use that number so you can read all the properties for the tile and continue on to the next one.
    Last edited by mr_malee; 09-01-2009 at 04:27 AM.
    lather yourself up with soap - soap arcade

  3. #3
    Senior Member bluemagica's Avatar
    Join Date
    Jun 2008
    Posts
    766
    thanks mr.malee, that's really a lot of help....I was thinking of using binary...but still for a 1000x1000 map, the size is still huge, and I don't think players will be willing to download so much data each time to play!
    If you like me, add me to your friends list .

    PS: looking for spriters and graphics artists for a RPG and an Arcade fighting project. If you can help out, please pm me!

    My Arcade My Blog

    Add me on twitter:

  4. #4
    Hype over content... Squize's Avatar
    Join Date
    Apr 2001
    Location
    Lost forever in a happy crowd...
    Posts
    5,926
    Good luck actually designing a 1000x1000 map, I did a 200x200 and it took hours and I wasn't working with a huge tile set.

    Have you looked at png for storing the map data ? That compresses really well.

    Squize.

  5. #5
    Senior Member bluemagica's Avatar
    Join Date
    Jun 2008
    Posts
    766
    Yeh, I know its gonna take a couple of days or even weeks to design a 1000x1000map, but the memory usage and file sizes are the biggest concern. And I don't quite understand what you mean by png for map data? could you please explain a bit more?
    If you like me, add me to your friends list .

    PS: looking for spriters and graphics artists for a RPG and an Arcade fighting project. If you can help out, please pm me!

    My Arcade My Blog

    Add me on twitter:

  6. #6
    M.D. mr_malee's Avatar
    Join Date
    Dec 2002
    Location
    Shelter
    Posts
    4,139
    you could also consider grouping rectangular regions of same tile types. I doubt every tile in the map is going to be unique.
    lather yourself up with soap - soap arcade

  7. #7
    Senior Member bluemagica's Avatar
    Join Date
    Jun 2008
    Posts
    766
    rectangular regions?? do you mean something like supertiles? That sounds good, but it might make the world look a bit redundant!
    If you like me, add me to your friends list .

    PS: looking for spriters and graphics artists for a RPG and an Arcade fighting project. If you can help out, please pm me!

    My Arcade My Blog

    Add me on twitter:

  8. #8
    M.D. mr_malee's Avatar
    Join Date
    Dec 2002
    Location
    Shelter
    Posts
    4,139
    rectangle regions in your map data, store the map as a series of same tile type rectangular regions. This cutting down the map size significantly. You would store it some like:

    tiles = [0, 1, 5, 5, 10] //x, y, width, height, type. This could also be converted to binary.

    you could then define tile properties in either another file or in a different structure at the end of the map file, which defines individual tile properties.
    lather yourself up with soap - soap arcade

  9. #9
    Senior Member
    Join Date
    Feb 2004
    Posts
    312
    Not sure if you have already put any thought to this, but how are you going to manage entities that are not visible, like roaming npcs, or pcs on a 1000x1000 map? trying to compute all of their movements on a single enterFrame can be a bit of a performance issue. I only ask because i get stuck on this part all the time.

  10. #10
    Senior Member bluemagica's Avatar
    Join Date
    Jun 2008
    Posts
    766
    who in the world would put entities on the entire map at once? Even a supercomputer will blow with that......I am just gonna draw the portion that will be visible which is like 10x10 tiles (64x64 per tile) using copyPixels! Roaming NPC's and such, I will just calculate and position them on a approximate tile when they need to come in view...!

    But I need the map array stored somewhere so I can reference it, but the size of the array itself is becoming too huge to ask the players to load it each time they want to play! I guess using flash10 I can get it once and write it to a file on the users pc, but then again that is strictly opposite of the mobility of browser based games! Getting only a portion of it via php or sockets directly from the server will cause too much lag on the players side, and huge resource wastage....... Even with binary experiments I was able to get it down to about 28mb.... add the size of sounds and graphics, even with compression it is way too much to load!
    If you like me, add me to your friends list .

    PS: looking for spriters and graphics artists for a RPG and an Arcade fighting project. If you can help out, please pm me!

    My Arcade My Blog

    Add me on twitter:

  11. #11
    Hype over content... Squize's Avatar
    Join Date
    Apr 2001
    Location
    Lost forever in a happy crowd...
    Posts
    5,926
    When I suggested using a png I meant store the map values as bits in that, say you use a simple 8 bit png you can use the R for your tile number, leaving you G & B for other properties ( Or merge R & G together you give you 65,535 tiles rather than 256 ).

    It should compress down pretty well and it's easier than using your own run-length encoding system on a byteArray.

    Squize.

  12. #12
    Senior Member
    Join Date
    Feb 2004
    Posts
    312
    by entities i mean just the x,y points of each PC or NPC not the actually mc representation.

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center