Filesize and proximity to the edge of the blockmap

Status
Not open for further replies.

Fawfulfan

The Tortured Planet guy
This isn't really a huge problem, but it is a curiosity. I just want to know if anyone else has observed this, and if you have any ideas as to why it happens.

Recently, I started shifting around the maps in Tortured Planet so that they would be roughly in the center of the blockmap. It's just a thing about making everything appear neater in the editing stages. But I noticed something peculiar: when I move a map to the center, it increases the filesize by maybe 15 or 20 kb. Nothing else was changed...it was just shifting the existing stuff. What could be causing this?
 
Here's what I think might be happening:

blockmap1.png


Let's say that the white area represents your level. The green cross is (0,0).

blockmap2.png


If you attempt to build the level, the nodesbuilder will create the blockmap by cutting up the entire map into smaller squares. In game, this is so that objects don't have to test for collision on walls that aren't in the same section of the map as they are -- they only test collision against walls which are in the same square as they are.

blockmap3.png


In this case, the blockmap requires 4 sections.

blockmap4.png


Now let's imagine you arbitrarily decide to move the map around a smidgen.

blockmap5.png


The same exact algorithm splits the level into the same squares, and checks which squares actually have any lines in them.

blockmap6.png


This time, though, the blockmap will need 9, not 4 entries, and thus require more than twice the space, even though the level did not change.

In short, this is something you should ignore, as there is no practical way of avoiding it. You could check whether or not it's the blockmap whose size is fluctuating so radically, though.
 
Heh, somehow I imagined it would be something like this. I was just curious; it wasn't a huge problem.
 
I doubt it's the blockmap, since the blockmap uses its origin (0,0) as the bottom-left corner of the map, not a fixed grid.

I'd blame the nodes.
 
Status
Not open for further replies.

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top