My layers aren't working

I am working on a patch for Castlevania Dawn of Sorrow, but when i am changing a rooms look in Tiled
the layers aren’t working. For example layer 0 with this layer i can place any tile anywhere, but layers 1,2 and 3 aren’t working like 0, I can only place tiles in the top left. Now the height and width of layer 0 is
layer_height 06
layer_width 05
But the other layers (1,2,3) are all
layer_height 01
layer_width 01
Now i have tried to change them all to 06 and 05 but that doesn’t work either.
So how do i fix this?

I think you’re on the right track - while it’s possible to put tiles on layers outside of their bounds via scripts, the GUI’s tools will prevent editing those out-of-bounds areas.

Are you loading your map’s layers via a custom map format? You probably need to set the layer size (layer.width, layer.height) correctly in that. You can also fix them by resizing the map using e.g. Map > Resize.

These “layer_height”, “layer_width” properties you’re talking about don’t sound like Tiled’s native properties, maybe they’re custom properties that tell the game how to load the data? You can only set the actual layer size via scripting, or via resizing the map.

I have no clue if i am using an custom map format. All i know is that i select a room in Dsvania editor then i press open in tiled and then i am there. But the room i am editing is custom added maybe that’s something. I know that when i change a room that was already in the game i can edit all layers (0,1,2,3) everywhere i want, but in the room i added myself its not possible.

In DSVania Editor’s code the “Open in Tiled” saves the map to a TMX file and then opens that file in Tiled. So, the bug is probably with how DSVania Editor creates/exports your custom room, looks like it sets a too-small layer size, or maybe you need to explicitly set your room’s size at some point in DSVania Editor.

Have you tried doing what I said, resizing the map in Tiled to set all the layer sizes?

No i haven’t. I don’t know how to

In the Map menu at the top, there is a “Resize Map” thing you can click, this will bring up a dialog where you can resize your map. It should be fine to just set it to the same size, but if you want to be thorough, add 1 tile to the height, resize, and then resize it again to remove the height you added.

Alternatively, select the area you want to be occupied by your map, e.g. with ctrl+A (“select all”) on one of your working layers, and then use Map > Crop to Selection.

Okay, so resizing the map works. I can now place a tile in layers 1,2,3 everywhere i want. But when i try to import it back into Dsvania Editor then Dsvania Editor crashes.

Earlier, you mentioned layer_width and layer_height properties, you probably need to make sure those match your actual layer sizes. DSV Editor seems to be using those to determine the size of the layer data, instead of using the actual size of the data, and has nothing handling the scenario where they don’t match.

If setting those properties doesn’t work, then you need to make sure you never resize maps in Tiled, and you need to make sure the layers have correct sizing from DSV Editor, as it’s presumably setting the per-layer sizes for a reason - make sure you haven’t missed some kind of room size or layer size setting in DSV Editor. If you just can’t get it to work, then you’ll need to report this to the DSV Editor devs - these issues have nothing to do with Tiled.

I’ll see what i can do. Thanks for the help :slight_smile:

Regarding resizing in particular, the DSV Editor’s README.md notes the following:

Resizing rooms

You can increase and decrease the size of rooms by going to Edit → Edit Layers and changing the Width and Height fields for each layer you want to resize.

Don’t try to change the size of a room with Tiled, that will just mess the whole room up when you import it back into DSVEdit.