Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Where is "Tilemap Layers Structure" ?

It's in the inspector of the Dungeon Generator component.

thank you

(1 edit)

its strange, but i dont see in my editor

(1 edit)

It seems like you're not using the latest version of the asset. In that case, you don't have to worry about that option.

It seems like that change was not yet merged to the master branch. That means that you don't have to worry about that. I'm sorry about that. It's sometimes hard to keep track of which version of the asset I have currently loaded.

Also its strange, but i see offset in rooms and "red bricks"


Yeah, it seems like the visualization of the available door positions does not work properly after a level is generated. The visualization uses Grid components in individual rooms so it's possible that there must be some offset added to their positions when not in the prefab mode. However, this should not have any effect on generated levels - it's just a visualization used when creating room templates in the Editor.

I created an issue on Github to check this later.

Also, the Isometric example is far less popular than the classic 2D ones so it's possible that there are still some problems that were not yet found. Please let me know if you find any and I'll try to fix them.

It isnot simply visual effect. Its call offset to added colliders in room template 

You’re right. ​ The problem is that I cannot simply move each room template to the position given by the generator because the position must be transformed to fit the isometric grid. Here is a hotfix for you:

using UnityEngine;

namespace Edgar.Unity.IsometricFix
{
    [CreateAssetMenu(menuName = "Edgar/Examples/Isometric 1/Position Fix", fileName = "Isometric1PositionFix")]
    public class Isometric1PositionFix : DungeonGeneratorPostProcessBase
    {
        public override void Run(GeneratedLevel level, LevelDescription levelDescription)
        {
            var grid = level
                .RootGameObject
                .transform
                .Find(GeneratorConstants.TilemapsRootName)
                .GetComponent<Grid>();

            foreach (var roomInstance in level.GetRoomInstances())
            {
                var correctPosition = grid.CellToWorld(roomInstance.Position);
                roomInstance.RoomTemplateInstance.transform.position = correctPosition;
            }
        }
    }
}

Add this file to your project, create an instance of the scriptable object, and drag and drop this instance to the “Custom post process tasks” list in the generator inspector.

It should fix both the colliders and the door positions. Let me know if that works.

it helped! thank you, veru much!

Also i found another strange moment. In template i did collisions, but after press button "Generate level" different "level 0 - floor" collisions dissepear. Do you have ideas about this?


That’s intended behavior. In the usual 2D setting, after a level is generated, all room templates are merged into a single tilemap layer (or multiple shared layers). When they’re merged, all collider layers from individual room templates are also merged into a single shared collider layer. In order to not have duplicate colliders and to ensure that it’s possible to go from one room to another, colliders from individual room templates are disabled and only the shared on is kept. This behavior can be toggled by disabling/enabling the “Disable Room Template Colliders” field in the Dungeon Generator inspector.

Also, here you can find some useful information about room template customization. The most important piece of information regarding that is that you cannot just modify a room template, e.g. by adding a collider to the “Level 0 - Floor” layer, and expect that these changes will transfer to the shared tilemaps in generated levels (“Generated Level” -> “Tilemaps”). If you want to do some modifications, you have to also change the Isometric1TilemapLayersHandler script.

Thank you very much for operative supporting! c: