ID:2148278
 
(See the best response by Ter13.)
BYOND Error: corrupt map data in world file

Problem description:
After developing a new z level for one of my projects, I received the above message. After sharing my experience with another developer, it was explained that there's some glitch or weird object limit. I currently have 2 separate map files. One of them 400x400x12, and the other is 100x100x8. If I disable either of the maps the game successfully launches, so I'm definitely under the impression there's some sort of limit. If you have any suggestions or explanations please let me know.
The map limits it self to around 16 million object,So it cant be the map it self causing that
Best response
Yup, you are only at roughly 3 million turfs on the map.

There is also a limit of roughly 65K unique tile pops. If it is a tile pop limit, that may be the problem.
what do you mean by unique tile pop?
Open up your .dmm file in notepad.

The DMM format is split into two regions:

1) Pop table

2) Turf table(s)

A pop is formatted like so:

"[ID]" = {/movable,/turf,/area}

The IDs use a 52-character code, with a-z, A-Z being the character range for each digit. The number of digits used is based on the maximum number of unique pops used in the DMM.

When maps are merged, the pop tables merge, creating a total number of pops less than or equal to the sum of both pop tables in both DMMs. (duplicate pops are discarded).

I believe that the current maximum number of pops in said table is approximately 65K, but I may be wrong about this number. I recall saying in the past that the pop limit was 4 bytes now, but I'm not sure whether this was accurate.

The turf table is simply formatted as such:

(1,1,1) = {
[POP_ID][POP_ID][POP_ID],
[POP_ID][POP_ID][POP_ID],
[POP_ID][POP_ID][POP_ID]}

(1,1,2) = {
[POP_ID][POP_ID][POP_ID],
[POP_ID][POP_ID][POP_ID],
[POP_ID][POP_ID][POP_ID]}
Individual maps still have a limit of 65K, but I believe it should be possible to compile several maps with a total over that limit.
interesting.
If I manually combine maps, what are the chances of it fixing the problem if its pop related? Which it most likely is. Probably the same results right?
The first map is 3.9 megabytes, the second one is 172 kilobytes. So my best solution is to do some remapping and try to reduce my unique pops? Or I could try moving some of the bigger map to the smaller map.
I finished mapping the level and now it wont even launch with that one map selected. Is there an easy way to count unique tile pops?
Is it just taking a long time to load, or is it crashing, or is it spitting out an error message?

If it's just taking a long time to load, open the DMB with DreamDaemon with profiling enabled. Then report back with the code of the functions that made it take forever to load.
BTW, don't be too put out by this problem. You are about to have the realization that Yut Put had about three years ago during the development of Epic: Legend that led to him becoming an infinitely better programmer. This is an exciting time!

Is there an easy way to count unique tile pops?

Yes! Open your DMM in notepad. Turn off word wrap. Then scroll down to the last tile pop and click somewhere on that line. Now click Edit->Go To... A dialogue box will pop up with a text field. In that text field there will be a number. That's the current line number. If you are at the last tile pop, that's how many tile pops are on the map.
I'm guessing that "Realization" is that "Bigger maps" is not allways the best route to go
In response to Fat Albert
Fat Albert wrote:
The first map is 3.9 megabytes, the second one is 172 kilobytes. So my best solution is to do some remapping and try to reduce my unique pops? Or I could try moving some of the bigger map to the smaller map.

Moving the bigger map to the smaller is a good idea. Or even splitting them into different files; there's really no reason to put everything in the same map file.

Sometimes authors try to force maps to have Z levels in a certain sequence, and hard-code a lot of locations like possible start areas and teleport coords and whatnot. If that's the case for you, I suggest switching to a system that uses tags. You can create a unique tag for each of the special turfs on your map, and use locate() to find them. E.g.:

var/list/start_zones = list(\
"Falaland",
"Clichea",
"MysticBSVillage",
...
)

...

var/newloc = locate(pick(start_zones))

Likewise for teleporters, each teleporter can have a var that provides the tag of its counterpart, making looking up the destination a snap.
I'm guessing that "Realization" is that "Bigger maps" is not allways the best route to go

No. The realization is a series of understandings about how the VM actually works and how to harness it without generating per-instance-level overhead.
In response to Zeex00
That's some bizarre quote placement you got there.

But no, the problem isn't map bigness; it's map complexity, especially as it pertains to trying to cram too much into one file. There comes a point where trying to cram one more Z-level into the same file gets ridiculous.
But no, the problem isn't map bigness

More likely what this problem actually is, is that patterns involving for(x in world), atom/New(), turf/New(), etc. require a lot of care.

I have the feeling that Fat Albert is stumbling into not one, but a myriad of problems, as Yut Put managed to do with Epic: Legend.

Part of how we helped Yut Put keep from quitting BYOND and made his games actually functional was getting rid of Forum_Account's libraries. The other part was teaching him about observer patterns and polymorphism. Another benefit was swapping him from polling to push updates. As well as other techniques like taking advantage of o(1) or o(log n) algorithms rather than o(n) and o(n^2) algorithms.
YutPut is actually the developer I shared my problem with, I had the impression he wasn't able to conquer the problem he ran into. And I would be very happy if this experience greatly improved me as a developer/programmer. I'm about to remove features/maps that aren't really needed, hopefully that makes room for my new map.

The map file doesn't take long to load, the only problem is I'm inhibited from launching the game. Could you also link me to information about o(1)/o(log n),o(n)/o*n^2) algorithms cuz right now its above my head. Also how would polymorphism help with this particular problem. A child and a parent would have different pop_ids wouldnt they?

Also, most of my if not all my teleporters/spawns are relational. Except, I don't use tags. I use locate(type). My past experience with using tags was kind of confusing, and sometimes they would disappear.

One feature that comes to mind that probably creates a lot of pops is, my mission system. Basically if a player has a certain mission activated and enters a particular area a boss will spawn. This area is marked by a range of objects, highlights the area when activated, and spawn the boss when crossed(). Originally this feature was based on areas, but I started doing other things with the maps areas that would create visual conflicts. Some of these areas highlighted are as big as 80x100 tiles... And there are approximately 15+ of these areas.
Fat Albert Wrote:
I'm inhibited from launching the game.

Ter13 wrote:
Is it just taking a long time to load, or is it crashing, or is it spitting out an error message?

If it's just taking a long time to load, open the DMB with DreamDaemon with profiling enabled. Then report back with the code of the functions that made it take forever to load.

You are really, really good at describing your problems in a completely nebulous and troubleshooting-proof manner. We're gonna need you to stick with the script.

Problem solving requires minimizing the relevant information to the task at hand, and sticking to a set of targeted inquiries. If we deviate from these targeted inquiries, we will never solve the problem.

Please follow along with what you have been asked to provide and we'll go through it step by step.

Could you also link me to information about o(1)/o(log n),o(n)/o*n^2) algorithms cuz right now its above my head.

This is for later. Focus on this later. For now, let the game successfully launch. Give it a few hours with the profiler running until you either get a crash or an error message to bring back. If your game goes into "Windows has detected X is not responding", that's fine. Don't kill the process. Let it run. This isn't a crash. This is a hang. The hang may either be temporary or permanent.

https://en.wikipedia.org/wiki/Big_O_notation

This area is marked by a range of objects, highlights the area when activated, and spawn the boss when crossed()

This is 100% one of the biggest issues and what killed Epic: Legend. Using /objs as pseudo-areas is just not viable in DM. You are going to have to handroll your own system that doesn't use visual objects, but rather some form of binary space partitioning, like chunking or quadtrees.
Yes, the only problem is I'm getting the error message when trying to launch the game.
Page: 1 2