Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We've updated our Terms of Service. Please read our blog post from Unity CTO and Co-Founder Joachim Ante here
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

Tile Map [Feature Request] Random tool via highlighted tiles, not a clunky Random Brush

Discussion in '2D Experimental Preview' started by AssembledVS, Jan 5, 2019.

  1. AssembledVS

    AssembledVS

    Joined:
    Feb 23, 2014
    Posts:
    219
    We have a real need for a "random" tool instead of the Random Brush that Unity currently has. A visual mockup is attached to this post. Notice that this tool is one of the tools listed on top of the Tile Palette window and not a Grid Brush.

    The tool should allow you to select your desired tiles directly on the tileset palette, much like the select, paint, box, and flood fill tools allow you to. From this selection, a single randomized tile is given. Whenever the tile is placed within the scene, or even better, whenever a new grid cell is hovered over in the scene, this randomized tile is re-rolled, allowing the user to quickly get a new randomized tile if the current one is not ideal. Perhaps this tool can also have variations like Random Flood Fill and Random Box for randomizing large swathes of the tilemap.

    The current workflow is simply too convoluted and difficult. I see two main problems:

    1. Needing a different Random Brush for every group of tiles that we wish to randomize. I would need a dozen or two per tile palette, and if I wish to remove or add certain tiles from this group, I have to go back and edit the brush.

    2. The difficulty in selecting the actual sprite assets. Most tiles come from spritesheets, which are organized the way my example is organized. Using my selection as an example, if I browse to the tile sprite assets, they would be disordered, as my group of selected tiles are in the middle of a bunch of other tiles (since tiles are cut row by row from left to right, even though they are organized to be visually understandable via groups of tiles the way my spritesheet/tileset is set up).

    Though this is less important, I think that being able to clarify the tile size, and getting a random tile group selection based on that size, should also be considered. For example, in my spritesheet, the tiles adjacent to the left are sized 2x2. If they are selected and this random tool is implemented, I would get a random 1x1 selection, which would jumble the placement of 2x2 tiles that are drawn to be 2x2. So ideally, after making this tile selection, you can clarify tile size 2x2 and the tool would break up the selection into 2x2 tile groups that are randomly selected instead of 1x1 tiles. Otherwise, these tiles would have to be placed on a different spritesheet or tile palette and would have to use a whole different Grid with a 2x2 cell size, even though they are very closely related to the rest of tiles.

    Another thing to consider would be random tile weights, but I'm not too sure how that would be implemented in this context.

    Is this something that is possible or is being worked on?

    If anyone wishes to vote on this idea, I have uploaded it to Unity Feedback:
    https://feedback.unity3d.com/sugges...a-highlighted-tiles-not-a-clunky-random-brush
     

    Attached Files:

    2dchaos likes this.
  2. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    99
    Having this seems possible definitely.

    As an example of 1, I have updated the RandomBrush on 2d-extras so that you can pick the Tiles which you would like to be in your random set from the Tile Palette using the Pick mode, by toggling picking functionality in the Random Brush Inspector.
     
    AssembledVS and 2dchaos like this.
  3. AssembledVS

    AssembledVS

    Joined:
    Feb 23, 2014
    Posts:
    219
    I just tried the brush and this is EXACTLY what we need, thank you! Such a simpler and more intuitive workflow! This is great. You actually fixed #1 and #2 with this brush, as we don't need a separate random brush for each group of tiles we wish to randomize and we don't have to scour through our assets to choose tiles but instead do it directly via the Tile Palette. This should be part of the main package, to be honest - it's just that useful.

    I feel like "clarifying" the size is the other thing I'd really want so that we'd be able to randomize between tiles that are combinations of tiles (like the 2x2 ones on the left) but are on the same Tile Palette and Tilemap.

    Looking forward to seeing the final implementation of the Random Brush and being able to sort our Active Tilemap List.
     
  4. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    99
    Just to clarify, does this mean that you would like to be able to randomly pick and paint between sets of 2 x 2 Tiles (or n x m), and maintain their relative order between them?
     
  5. AssembledVS

    AssembledVS

    Joined:
    Feb 23, 2014
    Posts:
    219
    I think so, yes. I am including another mockup to show what I mean.

    My Grid game object has a cell size of 1x1, which in my case, is 8 pixels x 8 pixels. My tilesets are all composed of 1x1 tiles to be used by the 1x1 Grid game object, but some of those tiles are combined to create larger tile "chunks." In my image, these chunks are 16x16 pixels, or 2x2.

    I cannot use the Random Brush that you created to highlight those 2x2 chunks for random tile placement because that would result in random 1x1 pieces of the 2x2 chunks getting picked. So if there's, say, a rock that's 2x2, I cannot place these random rocks in my scene, as only pieces of those rocks would be picked. If we can clarify a tile size of 2x2 (or n x m), then the brush would automatically select 2x2 chunks of the highlighted portion of a tileset.

    The alternative right now is to have a new Grid with 2x2 cell sizes, and another Grid for any other non 1x1 cell size, and a separate Tileset/Tile Palette for each. As you can see, my tiles relate directly to each other, meaning that a separate Grid and tileset doesn't make much sense. They're all part of the same tileset; some parts just form larger chunks.
     

    Attached Files: