Search Unity

Official Tilemap Extras preview package is now available

Discussion in '2D' started by rustum, Sep 2, 2020.

Thread Status:
Not open for further replies.
  1. rustum

    rustum

    Unity Technologies

    Joined:
    Feb 14, 2015
    Posts:
    190
    Tilemap Extras preview package

    We are making a selection of tools from the 2D Extras GitHub repo available via Package Manager. This will allow users to have easier access to these tools without having to go through GitHub.

    Thank you to everyone who has contributed to the repository over the years. Please continue to let us know about your project and workflow needs and we will endeavour to make Tilemap Extras an even better tool for developing 2D games in Unity!

    What’s in the package?

    Tiles
    • Animated: Animated Tiles are tiles which run through and display a list of sprites in sequence.
    • RuleTile: Generic visual tile for creating different tilesets like terrain, pipeline, random or animated tiles.
    • Isometric Rule Tile: A Rule Tile for use with Isometric Grids.
    • Hexagonal Rule Tile: A Rule Tile for use with Hexagonal Grids. Enable Flat Top for Flat Top Hexagonal Grids and disable for Pointed Top Hexagonal Grids.
    • Rule Override Tile: Rule Override Tiles are Tiles which can override a subset of Rules for a given Rule Tile to provide specialised behaviour while keeping most of the Rules originally set in the Rule Tile.
    • Advanced Rule Override Tile
    Brushes
    • Group: This Brush helps to pick Tiles which are grouped together by position. Gaps can be set to identify if Tiles belong to a Group. Limits can be set to ensure that an over-sized Group will not be picked. Use this as an example to create brushes that have the ability to choose and pick whichever Tiles it is interested in.
    • Line: This Brush helps draw lines of Tiles onto a Tilemap. The first click of the mouse sets the starting point of the line and the second click sets the ending point of the line and draws the lines of Tiles. Use this as an example to modify brush painting behaviour to make painting quicker with less actions.
    • Random: This Brush helps to place random Tiles onto a Tilemap. Use this as an example to create brushes which store specific data per brush and to make brushes which randomise behaviour.
    • GameObject: This Brush instances, places and manipulates GameObjects onto the scene. Use this as an example to create brushes which targets objects other than tiles for manipulation.
    Scripts
    • CustomRuleTileScript: This helps to create new custom Rules for the Rule Tile.
    Samples
    • Waterfall Animated Sample: An example implementation of an Animated Tile.
    • Pipe Rule Tile: An example of a Rule Tile with rules matching four-way orthogonal neighbours.
    • Dungeon Rule Tile: An example of a Rule Tile with rules matching eight-way orthogonal and diagonal neighbours.
    Getting Started
    1. Install Unity 2020.1 or newer.
    2. Make sure that Preview Packages are visible by opening Project Settings, going to the Package Manager section and checking Enable Preview Packages. Enable Preview Packages Project Setting.png
    3. Open Package Manager by going to Window > Package Manager Tilemap Extras in Package Manager.png
    4. Choose Tilemap Extras from the list and click on Install at the bottom right of the Package Manager window.
    What you can do
    We would like your feedback on how these tilemap extras contribute to your projects. Do let us know what works well, what could be improved and what is missing.
     
    ModLunar, joshcamas and NotaNaN like this.
  2. Deleted User

    Deleted User

    Guest

    At last! I've been using it for months, it's a collection of great tools.
     
    ModLunar and rustum like this.
  3. Zephus

    Zephus

    Joined:
    May 25, 2015
    Posts:
    356
    That's good news, but why is it still marked as preview? I don't see anything holding this back from a full release, and I actually think that all of these should come included with Tilemap directly.
     
    Regularry and ModLunar like this.
  4. unity_OSIv5Oqkh9M1Tg

    unity_OSIv5Oqkh9M1Tg

    Joined:
    Sep 17, 2020
    Posts:
    1
    Hi, I have a problem with my camera. I cant see my scene. can you help me ?
    tiles.JPG
     
  5. Zephus

    Zephus

    Joined:
    May 25, 2015
    Posts:
    356
    The z-position is set to 0, so it's on the same plane as the tilemap. Pull it back to -10 or so.
     
  6. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,338
    Any good way to make rule tiles interact with other tiles in a good way?

    Here's two 3x3 rule tile squares next to each other:

    upload_2020-9-18_14-17-44.png

    In the game, we don't want that kind of edges when we go from one tileset to the next one. We'd either want to do this (which I now made with normal tiles):

    upload_2020-9-18_14-23-4.png

    Or, preferably, to be able to set up rule tiles for how the edge between two rule tilesets work.


    We could of course extend the rule tiles on our own to add support for this kind of stuff, or buy an asset, but I'm wondering if this is the kind of thing that's on the roadmap to be added.
     
  7. Primoz56

    Primoz56

    Joined:
    May 9, 2018
    Posts:
    369
    I think Sprite Shape does a lot of similar things to what you're asking Baste, but yes i would love a slightly simpler way of merging tiles rather than creating 16 variations for each (and sometimes more)
     
  8. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    Unfortunately, you would need to extend the functionality of the Rule Tile. This can be done by using the Custom Rule Tile script from johnsoncodehk. I have added an example of this at 2d-techdemos, specifically https://github.com/Unity-Technologi...er/Assets/Tilemap/Rule Tiles/Custom Rule Tile. Let us know if that works out!
     
    Deleted User likes this.
  9. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    This is part of our release process where packages start off in preview before being released as verified. They are separate from the Tilemap Editor release as users may cherry pick the items they are only using from the package if they prefer to.
     
    Deleted User likes this.
  10. acecase

    acecase

    Joined:
    Mar 16, 2014
    Posts:
    7
    Is there a way to reuse the rules for other rule tiles?

    Assuming we have multiple tilesheets that are laid out and sliced the same, the sprites would be named with the same schema (name_0, name_1,... name-n) so my first idea was to create a copy of the first rule tile that I created and just find and replace the "name" part for the new sprites. Unfortunately, it doesn't use simple names (for obvious good reasons).

    I really appreciate the rule tile system, and it's one of the better ones in a lot of ways, but it isn't scalable in this one area. The way the rules are created, and the fact that those rules don't appear to be reusable components makes it a tedious process to setup. My tilesheet isn't the simplest, but it isn't the most complex by far. I have 33 tilesheets with 47 sprites/tiles each. To get everything setup, I would have to create 33 auto tile assets and then individually setup 1,551 rules. And that is just for the ground tiles, with no animations or random tiles.

    Edit: I just noticed that we can copy and paste rules. That's a huge help.

    Ultimately, it would be great if the rules could be a component that we add to a texture. The component could define the regions (tiles), and the auto-tiling rules. That would allow those components to be reused across tilesheets with the same layout. It would also make it easier to code the option to have different tiles autotile together, I would imagine.

    Just my opinions, having never written a single line of Unity extension code, so for what it's worth.
     
    Last edited: Oct 24, 2020
    ModLunar likes this.
  11. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    Thank you for your suggestion! This sounds like something we can consider implementing.
     
    ModLunar likes this.
  12. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,338
    Hi!

    We've been using version 1.1.0 of Tilemap Extras from the github repo since forever. Trying to update to the latest version (1.6.2 for 2020.1) breaks all of our RuleOverrideTiles - they become invisible. It seems like some extra data was added to the class (in particular, an extra copy of the original tile), and if that data isn't there, all methods just return nothing.

    Is this a known issue? Got any hint about how to fix it? We didn't really want to update, but I want to know if updating fixes some of our override tiles doing this:

    TaGCa7slSQ.gif
     
  13. zt3ff3n

    zt3ff3n

    Joined:
    Feb 19, 2016
    Posts:
    37
  14. RedZero95

    RedZero95

    Joined:
    Dec 7, 2020
    Posts:
    4
    Hello, I have a problem with Hexagonal Rule Tiles.
    Unity version 2019.4.15f1, I downloaded 2D Tilemap Extras from Package Manager and I have 1.5.1-preview version.

    Screen1.png

    Grid's Cell Swizzle XYZ (default value from flat top menu selection)
    Tilemap's Orientation XY (default value)
    Specific Hexagonal Rule Tile flat top checked (it's hidden in the screen but it's checked)
    I want to make cells with thick borders, like civ games, but the rules invert sprites vertically.

    Screen2.png

    I could manually mirror the rules, but it's an annoying bug I want to solve.
     
  15. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    I believe the functionality of the original RuleOverrideTile has been split to RuleOverrideTile and AdvancedRuleOverrideTile, which may cause issues for you.

    If you could file a bug using the Unity Bug Reporter with your original RuleOverrideTile, we can check out this issue better, thanks!
     
  16. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    This looks like something we could improve with the Custom Physics Shape editor to help align the shapes across multiple Sprites. We will look into this, thanks!
     
  17. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    We will check out this issue. If you could share the full rule set of this Rule Tile, that would help us ensure that all the cases are covered!
     
  18. zt3ff3n

    zt3ff3n

    Joined:
    Feb 19, 2016
    Posts:
    37
    Adding buttons for more advanced functions such as rotate / flip / mirror tiles in the tile palette would be nice. All the actions you have at your disposal should be easily found and used from that window.
     
    Regularry and Xiangting_Su like this.
  19. RedZero95

    RedZero95

    Joined:
    Dec 7, 2020
    Posts:
    4
    This?

    Screen.png
     
  20. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    Thanks for your feedback, we will take a look into this.

    @xiangtingsu
     
  21. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    Yes, thanks! We will check this out.
     
  22. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,338
    Case 1299285!
     
  23. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    Thanks! We will check this out.
     
  24. Xiangting_Su

    Xiangting_Su

    Unity Technologies

    Joined:
    Sep 22, 2020
    Posts:
    253
    Thanks zt3ff3n for your suggestion! I can imagine how those rotate / flip / mirror buttons could come in handy.
     
  25. Zephus

    Zephus

    Joined:
    May 25, 2015
    Posts:
    356
    I'd like to suggest a new kind of override tile. It would basically be a copy of another tile with the same collider, but you can swap out the sprite.

    I'm constantly facing the problem that I want to re-use colliders I've set up in the Sprite editor. So I have to open the editor, copy the custom physics shape for every single tile and paste it again. Just take these 8 simple sprites:
    upload_2020-12-25_23-55-25.png

    I need to copy every tile manually. It's extremely annoying and wastes so much time. I wish I could just select all of the tiles and copy them over all at once. But I guess that would mean an overhaul of the entire Sprite Editor. So my suggestion is a "Sprite Override Tile".

    You'd select a tile as the base and then just swap out the sprite, but without using the new sprite's collider. So nothing would change but the actual graphic. This would make it so much easier to set up your colliders once and then just re-use them over and over again for similar sets of tiles.
     
  26. tanviagarwal1955

    tanviagarwal1955

    Joined:
    Dec 26, 2020
    Posts:
    1
    This is really helpful and I got some Tilemap Extras preview package on the github repo yesterday.
     
  27. johnsoncodehk

    johnsoncodehk

    Joined:
    Feb 19, 2016
    Posts:
    14
    is it helpful? https://github.com/Unity-Technologies/2d-extras/pull/94
     
  28. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,338
    Hi!

    Did you get a chance to look at it? Any chance there's a workaround we can do on our side?
     
  29. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    Sorry about the delay! Please check the reply from the bug case, thanks!
     
  30. JoshWindsor

    JoshWindsor

    Joined:
    Jun 2, 2018
    Posts:
    24
    Hi there,
    I'm unable to add this package, is it not available for 2020.2?

    Thanks for any help! :)

    Edit: Figured it out, I had the github package installed on version 1.40, I had to remove this in order to install the preview package.

    upload_2021-1-17_21-40-44.png
     
    Last edited: Jan 17, 2021
    berber_hunter likes this.
  31. Deleted User

    Deleted User

    Guest

    It's not available in 2021.1.0b4.

    Capture d’écran_2021-02-03_15-05-45.png
     
  32. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    Sorry about this! We will make this show up on the package manager soon! In the meantime, you can add this using the + button through the package's name "com.unity.2d.tilemap.extras". Currently, the version for 2021.1 is "2.0.0-pre.2".
     
    titch_stewart and Deleted User like this.
  33. Deleted User

    Deleted User

    Guest

    Thank you for that!

    It seems that your package is not automatically added to each version of Unity; it's not available in 2019.4.19f1 either...

    I'm still using the zip you put on Git hub.

    Capture d’écran_2021-02-04_07-35-48.png
     
  34. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    Yes, it is not added automatically as not all users would need this functionality.

    To access the package before 2021.1 (where 2021.1 means when we make it show up in the Package Manager), you will need to set "Enable Preview Packages" under the Package Manager Settings (https://docs.unity3d.com/2020.1/Documentation/Manual/class-PackageManager.html). Hope this helps!
     
    Deleted User likes this.
  35. Tomatech

    Tomatech

    Joined:
    Jan 1, 2020
    Posts:
    5
    Are there any plans for inserting/duplicating a rule element? Having to drag new rules up to the top of the list can get a bit tedious with longer lists
     
    Lo-renzo likes this.
  36. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    Thanks for the suggestion! We can add this to the package. In the meantime, you can check out the implementation at https://github.com/Unity-Technologies/2d-extras/tree/ruletileeditorinsert .
     
    Lo-renzo likes this.
  37. kyuskoj

    kyuskoj

    Joined:
    Aug 28, 2013
    Posts:
    56
    Is there any way to put custom data on painted tiles?

    Could these methods be a solution? GridInformation.Set(Get)PositionProperty ...
     
    Last edited: Feb 25, 2021
  38. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,338
    You could subclass the tile kind you're interested in and put your data there.
     
  39. kyuskoj

    kyuskoj

    Joined:
    Aug 28, 2013
    Posts:
    56
  40. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,338
    Right! Sorry, I was too fast there.

    Do you want to do this as you're painting? Ie. copy some data template from the tile to instances of that data in the grid?

    You could subscribe to Tilemap.tilemapTileChanged, and then use the info you get there to write into your own virtual grid.
     
  41. MarsCitizen_1

    MarsCitizen_1

    Joined:
    Jun 2, 2016
    Posts:
    20
    Hello, we're on Unity 2020.2.3, and the package shows up by default as version 1.6.3, but even after using "+" for git URL and adding "com.unity.2d.tilemap.extras" it is still at that version.

    Are there going to be breaking changes / deprecations if we begin with 1.6.3 and upgrade later? Is there some other way to force it to find the 2.0.0 version? Thanks!

    upload_2021-2-26_9-9-25.png

    EDIT: omg I just noticed you said "2021.x" -- I'm so used to seeing 2020.x. Don't mind me, just being dense... :oops:
    I'm still curious about the question on deprecation as we'd likely upgrade in the future.
     
    Last edited: Feb 26, 2021
    ModLunar likes this.
  42. HuldaGnodima

    HuldaGnodima

    Joined:
    Oct 10, 2016
    Posts:
    110
    Tried to find answers on this, but didn't find too much so thought I could ask here.

    Is it possible to (with the the Tilemap Extra) use the autotile when calling Tilemap.SetTile during runtime (via code)?
    Thanks in advance!
     
    Last edited: Mar 1, 2021
  43. HuldaGnodima

    HuldaGnodima

    Joined:
    Oct 10, 2016
    Posts:
    110
    For anyone else wondering this, I tried around myself and found you can indeed use the autotile via code! :)
    Here's a good tutorial on how to set up autotiling. When you've done so, you can simply call it at runtime like so:

    Code (CSharp):
    1. public class TestSetTile : MonoBehaviour
    2. {
    3.     public Tilemap tilemap;
    4.     public RuleTile ruleTile;
    5.  
    6.     private void Start()
    7.     {
    8.         tilemap.SetTile(new Vector3Int(0, 0, 0), ruleTile);
    9.         tilemap.SetTile(new Vector3Int(1, 1, 0), ruleTile);
    10.     }
    11. }
    Thank you for adding this package into Unity! What an absolutely fantastic tool :)
     
  44. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    Hi, right now there are no breaking changes or deprecations. If this were to happen, we will add it in the changelog and announce it as well.
     
    MarsCitizen_1 likes this.
  45. RomainChanoir

    RomainChanoir

    Joined:
    Jan 26, 2021
    Posts:
    1
    Nice Package !
     
    rustum likes this.
  46. fbessette

    fbessette

    Joined:
    Mar 10, 2021
    Posts:
    3
    I agree, nice package!
     
    rustum likes this.
  47. Tomatech

    Tomatech

    Joined:
    Jan 1, 2020
    Posts:
    5
  48. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    Ah yes, sorry, it is indeed broken as we have merged in this change to master. Please ignore that link and you can instead retrieve the changes from the master branch (or 19.4 branch depending on the version of Unity you are using).
     
  49. DragonByte

    DragonByte

    Joined:
    Sep 30, 2012
    Posts:
    29
    Where do I find the changelog for version 2.0?
     
  50. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    Deleted User likes this.
Thread Status:
Not open for further replies.