ID:151266
 
Alright, I was wondering, other than for the purpose of organization, what are benefits of having more than one map file? I know that having a large world map cut up into z-levels can reduce lag for the player, but what about having different Map Files? I was just wondering on the different uses of doing so.
When you have more than one map file it simply compiles them into a single map file when you run your game. The various maps will be added to their own z-level(s) in alphabetical order.
the benefits of multiple map files is that it saves disk space when u use different sized maps, for instance map a is 10x10 and map b is 5x10 u will save the disk space of 5x10 turfs. Im not sure if this also translates to memory saved when the game is compiled and run.
In response to SamuraiJei
SamuraiJei wrote:
Im not sure if this also translates to memory saved when the game is compiled and run.

It does not. In fact, it often leads to the opposite, because the developer doesn't realize how much padding is added to each map (they're all resized to the largest width/height of all the included maps)

However, now that I think about it, any padding that is added to the smaller maps would have minimal impact on the game, as I believe identical turfs actually share the same instance in memory.
In response to DarkCampainger
DarkCampainger wrote:
SamuraiJei wrote:
Im not sure if this also translates to memory saved when the game is compiled and run.

It does not. In fact, it often leads to the opposite, because the developer doesn't realize how much padding is added to each map (they're all resized to the largest width/height of all the included maps)

However, now that I think about it, any padding that is added to the smaller maps would have minimal impact on the game, as I believe identical turfs actually share the same instance in memory.

I would assume this true. The smaller maps will re-size to the maps with the large dimensions, meaning that if you have a 5x10 map, and a 10x5 map, they'll compile as a 10x10 map with padding. The null spaces however will simply be overlooked, and use only a microscopic amount of RAM since there's nothing there except for information about the coordinates. The only real benefit with multiple maps of different sizes would be downloading resources, since the padding is generated at run-time. It won't decrease it by much however, unless you have a lot of very large map files. Though the main reason for multiple map files is indeed organization, and this liberty should be used to any and every degree possible. It will surely save you a lot of headache in the future.
In response to Solomn Architect
You sure it fills it with null space?
I think it might fill it with the default map turf and area.
Darker Emerald and I use dynamic map loading with Feed for sole purpose of organization and that with wave-based gameplay it makes everything a helluva lot easier to clean up between matches.
In response to Complex Robot
I wouldn't think so. The coordinates are preserved as to keep sudden "loc=null" arguments from parsing accidentally, I think, take that with a huge grain of salt. I wouldn't think that it would be so wasteful as to fill void space generated at run-time with more useless objects. Though I have not tested this, so this is merely speculation.
In response to Solomn Architect
The space created when smaller maps get their size increased is filled with the default world/turf and world/area values, it does take up memory, the same amount as having empty maps of that size.
Medicator wrote:
A map takes up ~1 byte per tile, it seems.

No. The amount-per-tile is actually a logarithmic function of the size of a map.
My mistake. The bytes-per-tile is actually a logarithmic function of the complexity of a map, not the size. Complexity here is defined as "unique tile combinations", and the base is 52. (26 lowercase letters + 26 uppercase letters).
In response to Kumorii
Do you use a library for this? I've been thinking about switching over to map instances for a while, but I'm not sure the best way to do it.
Thanks =). I've seen this before(even a fan of it), but forgot to download it lol.

[Edit]
Been playing around with it, but I'm having trouble fitting into a game.
I find the benefit of it most is the ability to have player-made maps without needing to re-compile. You just need to have them added to a folder and load them at runtime.