Search Unity

Is a better and easier random brush possible?

Discussion in '2D' started by AssembledVS, Oct 8, 2018.

  1. AssembledVS

    AssembledVS

    Joined:
    Feb 23, 2014
    Posts:
    248
    EDIT 2/23/2019: This Random Brush functionality was added to the 2D Extras package a little while ago. You can find it here under Brushes/Random Brush: https://github.com/Unity-Technologies/2d-extras

    All of the tilemap brushes are clunky to use. The only one that I'm interested in, however, is the random brush. I see several issues with it:

    1. You have to manually set each tile. You cannot just use your selection within the tile palette window to make a brush from it. Instead, we have to define the number of tiles and then specify the tiles. I usually don't know how many tiles I have in my selection and have to count them.

    2. You need a different brush for different sets of randomized tiles. With enough tilesets/groups of desired randomized tiles, this becomes a lot of extra work. Why can't we just make a selection in the tilemap window and produce a randomized tile from that selection?

    3. The random brush has a predetermined tile for every tilemap upon creation of the brush. This means that if you want to change a randomized tile to another one, you cannot, as the randomized tile has already been predetermined.

    My reference tilemap editor is Tiled. I realize that Unity is far more complex and will almost certainly require a different approach to tiles and brushes, but I still have to say that Tiled has a far better random brush because it behaves opposite of what I listed above. You can randomize a tile simply from a selection, without creating assets, and the randomized tile is re-rolled whenever you click (or whenever you hover over to another tile position) if you don't like what you got.

    EDIT: Randomization appears to be fixed and we can drag whatever number of tiles into the Inspector window.
     
    Last edited: Feb 23, 2019
    rakkarage likes this.
  2. rakkarage

    rakkarage

    Joined:
    Feb 3, 2014
    Posts:
    683
    1. you can use https://github.com/SubjectNerd-Unity/ReorderableInspector to automatically make a decent editor list that accepts multiple dragged objects at once in the right order, and orderable

    2. would be nice, but maybe not necessary if there was a better way to do tt, besides the multiselection is already attempting to be in use so you can select and stamp groups at a time

    3. if you want that behavior use a randomTile instead of a randomBrush then u can just paint again and it re-rolls on hover etc you can drag your randomTile once it is setup onto your palette
     
  3. AssembledVS

    AssembledVS

    Joined:
    Feb 23, 2014
    Posts:
    248
    Thanks for the reply.

    Actually, I made a mistake about point #3. I think it used to be the case that the Random Brush was pre-determined (earlier this year) but that is no longer the case now. Random Brush now re-rolls. (I don't actually know how to use randomTile - I tried it by linking up a bunch of sprites, but then what? How do I go about using it? The video that shows it doesn't actually explain how it is used.)

    And actually, dragging over the tiles to the 'Random Tiles' field populates the list just fine. That's one issue solved. The other issue, and perhaps even more of an issue, is the fact that you have to drag anything to begin with. This is a problem because most tilesets are ordered in the way that my example tileset image below is ordered. If I want to drag the tiles highlighted in red, they are from a Project window that scatters them (since they are cut row by row, left to right). The fix would be to re-do the tilesets in a much less intuitive way, so that's not a fix at all. And the ordering of these tile assets in not the problem, as the behavior is normal and expected.

    So really, it's one issue with two possible fixes:

    1. We are unable to create a random brush from currently-selected tiles in the Tile Palette window. Perhaps right-clicking on the selection and selecting "Create x brush from selection" would do it.

    2. But I wonder why we'd need a brush at all. Can't a tile simply be selected randomly from the selection? With my tilesets, there would be so many different brushes! If it's not possible, #1 should be fixed.
     

    Attached Files:

  4. deLord

    deLord

    Joined:
    Oct 11, 2014
    Posts:
    306
    where did you even find any non-default brushes like the random brush? I am too stupid to find any
    OK, found some here.
     
    Last edited: Feb 11, 2019
  5. AssembledVS

    AssembledVS

    Joined:
    Feb 23, 2014
    Posts:
    248
    @deLord Glad that you found the extra brushes.

    ChuanXin has been improving the Random Brush since January and it's pretty much what I wanted in this thread. Have a look at this thread here:

    https://forum.unity.com/threads/fea...ot-a-clunky-random-brush.608050/#post-4227409

    You may want to update your current Random Brush, as it has even more functionality now. It's a shame that these "2D Extras" are extras and are not included as part of the main Unity install. The Tilemap is - why not the things that make it actually work the way people expect it to?
     
  6. deLord

    deLord

    Joined:
    Oct 11, 2014
    Posts:
    306
    Hehe OK
    But since I found out that even the Unity internal tiles will produce seams between tiles, I went for the hardcurrrr method and replaced all 32x32 tiles with 34x34 ones, staying with Tiled (Mapeditor) :X