Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Rotorz Tile System for painting 2D and 3D tiles!

Discussion in 'Assets and Asset Store' started by numberkruncher, May 10, 2012.

  1. Deleted User

    Deleted User

    Guest

    If I understand correctly, method 1 uses the same collider prefab for all tiles, while method 2 uses a different collider prefab for each tile. I'll give method 2 a whirl and see if i can figure it out, I think I got just enough from your video

    Sorry didn't see your Youtube channels before, probably should check out a few more of those videos! I am fairly new to Unity and this being my first forum post I was very pleasantly surprised with the quality and assistance you have provided, and am very satisified with my purchase. Thank you! Definitely wasn't expecting this level of detail so quickly and it was extremely helpful.
     
  2. Contract-killer

    Contract-killer

    Joined:
    Sep 21, 2012
    Posts:
    42
    Hi I want to ask for the 2d tile system . I have already buy that but seems issue in conveying the kind of art required to the designer..
     
  3. numberkruncher

    numberkruncher

    Joined:
    Feb 18, 2012
    Posts:
    953
    I just received an E-mail with a very similar question so I am guessing this may have been you.

    The tileset atlas is a texture which should be square and power-of-two in size (i.e. 128x128, 256x256, 512x512, etc). Each tile must be of the same size and should ideally contain additional borders to counteract the effect of edge bleeding.

    Here are some links which may be of use from the user guide:
    If you are asking about the composition of your tileset atlas then you can use any graphics package. You may prefer to use a tool like TexturePacker which provides an option to automatically add borders by extruding the edges of your tile artwork.

    I hope that this is of help to you :)
     
    Last edited: Aug 1, 2013
  4. Contract-killer

    Contract-killer

    Joined:
    Sep 21, 2012
    Posts:
    42
    It help a bit but my question is like what would be the criteria for creating the image.. and as you said we can make the sprite from the texture packer but your system also make the sprites right
     
  5. numberkruncher

    numberkruncher

    Joined:
    Feb 18, 2012
    Posts:
    953
    Some customers prefer to author their tile artwork as separate images and then compose them afterwards using TexturePacker. One of the benefits of this approach is that TexturePacker can automatically extrude tile edges for you. Though it is important to select the correct options in TexturePacker in order to achieve this. When I have a spare moment I will create a video tutorial demonstrating the usage of TexturePacker for this.

    Rotorz Tile System is not a sprite system, it is purely for painting tiles. However, you can create tile brushes from sprite prefabs that have been created using a sprite system like Sprite Manager 2 (amongst others). You can then easily paint instances of your sprites on a per-tile basis.
     
  6. numberkruncher

    numberkruncher

    Joined:
    Feb 18, 2012
    Posts:
    953
  7. Contract-killer

    Contract-killer

    Joined:
    Sep 21, 2012
    Posts:
    42
    $Screen Shot 2013-08-01 at 7.56.03 PM.png that will be helpful but this is not , for which I am looking...I want to create the game like jet pack joy ride....soon I will post the image of environment
     
    Last edited: Aug 1, 2013
  8. Contract-killer

    Contract-killer

    Joined:
    Sep 21, 2012
    Posts:
    42
    can we chat for a while my skpye contact is ashish.verma303...I will get the close details from you..and speed up my work ....because of environment I am stuck...
     
  9. numberkruncher

    numberkruncher

    Joined:
    Feb 18, 2012
    Posts:
    953
    Can you please explain the part which you are having difficulty with and perhaps attach the tileset atlas that you are attempting to use. This might help me to understand why you are having difficulties.

    As mentioned above, I will record a video demonstrating how to compose an atlas using TexturePacker when I get a spare moment.

    Many thanks
     
    Last edited: Aug 1, 2013
  10. numberkruncher

    numberkruncher

    Joined:
    Feb 18, 2012
    Posts:
    953
    Here is a video showing how to combine multiple tile images into a single atlas using TexturePacker using the "Extrude" option to surround each tile within an extra border:

     
  11. Contract-killer

    Contract-killer

    Joined:
    Sep 21, 2012
    Posts:
    42
    HI there,
    thanks for the video it help me alot. now my question is to make the environment like creating the platform but how they choose the patter like jetpack joy ride... how that kind of stuff will be create.
     
  12. Contract-killer

    Contract-killer

    Joined:
    Sep 21, 2012
    Posts:
    42
    HI there,
    thanks for the video it help me alot. now my question is to make the environment like creating the platform but how they choose the patter like jetpack joy ride... how that kind of stuff will be create.
     
  13. numberkruncher

    numberkruncher

    Joined:
    Feb 18, 2012
    Posts:
    953
    What do you mean by "choose the patter"?
     
  14. anteevy

    anteevy

    Joined:
    Nov 7, 2012
    Posts:
    5
    Hi, I'm currently trying to create my own top-down brush (since the demo brushes only seem to work in sideways-levels), but the whole tile orientation thing simply destroys my mind. :D I want to be able to draw my level similar to what is shown at the end of http://www.youtube.com/watch?v=W3Ug62clF8k , i.e. that I'm actually drawing the floor with the walls being drawn around the floor automatically. For the sake of simplicity, I just have one wall model (a cube) and one floor model (a plane). I just can't figure out the necessary orientations... any help? :)

    Two small additional questions:
    - pressing B to activate brush painting does not seem to work (neither does G für fill)?
    - there is no undo/redo for tile painting, right? I sometimes accidentially right-click in the scene to move the camera while in paint mode and erase some tiles, because the erase function is mapped to the right mouse button :p
     
  15. numberkruncher

    numberkruncher

    Joined:
    Feb 18, 2012
    Posts:
    953
    The way in which orientations behave varies depending upon whether you want to a) paint the floor (with surrounding walls) or b) whether you want to paint the wall and floor tiles separately. In the video above, approach a) was used.

    - The black square in the middle of the orientation is the tile that you are describing.
    - The white squares represent empty spaces.
    - The green squares represent the presence of adjacent tiles.

    I have annotated the dungeon tiles with their respective orientations for you:
    $annotated-orientations.jpg

    These shortcut keys will only work if the Tools/Brushes/Scene View window is focused and a tile system is selected.

    Undo functionality is not available for painting since the Undo system in Unity does not provide a good way to achieve this without killing painting performance.

    You can move the camera using the left/middle mouse button and holding the Ctrl or Alt key I believe, but the functionality of the right mouse button is used for erasing tiles. If you are comfortable with shortcut keys then you might want to consider the following:
    • Temporarily select another unity tool using one of the hotkeys Q(hand), W(Move), E(rotate), R(scale).
    • Do some navigating!
    • Press B(paint) to resume painting (provided that tile system remains selected after above).

    I hope that this helps with your questions :)
     
  16. anteevy

    anteevy

    Joined:
    Nov 7, 2012
    Posts:
    5
    Thanks for the quick answer, it helped!
     
  17. anteevy

    anteevy

    Joined:
    Nov 7, 2012
    Posts:
    5
    I'm having some glitches between my (yet untextured) tiles (white dots and lines that move when the camera moves):
    http://www.anteevy.de/upload/temp/RPG 2013-08-19 13-22-40-62.jpg
    http://www.anteevy.de/upload/temp/RPG 2013-08-19 13-21-55-46.jpg

    I tried the vertex snapping option as well as making the brush static + smooth (well, that didn't work as expected: http://www.anteevy.de/upload/temp/RPG 2013-08-19 13-29-06-32.jpg).

    Maybe I'm missing some settings on my meshes (simple cubes from Blender with some sides and the bottom removed depending on the tile position/orientation).

    Thanks!

    Edit: Maybe it has something to do with the tile positions being "0.0007995486", "-3.671162e-10" etc.?
     
    Last edited: Aug 19, 2013
  18. numberkruncher

    numberkruncher

    Joined:
    Feb 18, 2012
    Posts:
    953
    The smoothing option behaves in much the same way as "Smooth Normals" in modelling packages, so this result is as expected. How does this look if you set your brush to "static" without "smooth"?
     
  19. anteevy

    anteevy

    Joined:
    Nov 7, 2012
    Posts:
    5
    Static without smooth does not help either (looks the same as without static).
     
  20. numberkruncher

    numberkruncher

    Joined:
    Feb 18, 2012
    Posts:
    953
    I wonder if the flickering line is caused by the inside faces of adjacent cubes...
     
  21. anteevy

    anteevy

    Joined:
    Nov 7, 2012
    Posts:
    5
    Well, they aren't really cubes anymore since I removed all unnecessary faces in Blender. I really think now that it's the position of the tiles that is causing this issue. They are at positions like (21.49992,-18.50084,-1.54877e-10) and if I correct the positions of two adjacent tiles (e.g. to 21.5,-18.5,0), they are seamless. Any idea how to correct this automatically for all tiles?
     
  22. numberkruncher

    numberkruncher

    Joined:
    Feb 18, 2012
    Posts:
    953
    I suspect that you may need to adjust the vertex snapping threshold on your tile system.

    Like I said in the private message I sent you, if you send me an example project accompanied with your invoice number I would be happy to examine this in closer detail for you :)
     
  23. yuewahchan

    yuewahchan

    Joined:
    Jul 2, 2012
    Posts:
    309


    Is it possible to have a feature that can change the origin ( row = 0, col = 0 ) of TileSystem ( Tiles facing Upwards ) to match the collision matrix grid shown in the bottom.
     
  24. numberkruncher

    numberkruncher

    Joined:
    Feb 18, 2012
    Posts:
    953
    Okay, I think I understand what you are asking. The first tile in a tile system is taken from top-left with a row and column index of 0.

    If this is for runtime painting or access then you could make the simple transformation:
    Code (csharp):
    1.  
    2. void YourPaint(Brush brush, TileSystem system, int row, int column) {
    3.     brush.Paint(system, system.rows - row - 1, column);
    4. }
    5.  
    6. // Paint cell at bottom-left corner of tile system
    7. YourPaint(brush, system, 0, 0);
    8. // Paint cell at top-left corner of tile system
    9. YourPaint(brush, system, 9, 0);
    10.  
    11. TileData YourGetTile(TileSystem system, int row, int column) {
    12.     return system.GetTile(system.rows - row - 1, column);
    13. }
    14.  
    15. // Get tile at bottom-left corner of tile system
    16. TileData tile = YourGetTile(system, 0, 0);
    17. // Get tile at top-left corner of tile system
    18. TileData tile = YourGetTile(system, 9, 0);
    19.  
     
  25. yuewahchan

    yuewahchan

    Joined:
    Jul 2, 2012
    Posts:
    309
    sorry, I am concern about the editor, hope that you will add this feature in the future.
     
  26. numberkruncher

    numberkruncher

    Joined:
    Feb 18, 2012
    Posts:
    953
    The only part in the editor which makes reference to tile indices (if I recall) is the status window at the bottom. You want to be able to change the reading in there as well?
     
  27. yuewahchan

    yuewahchan

    Joined:
    Jul 2, 2012
    Posts:
    309
    I think your workaround is work for me right now.
     
  28. yuewahchan

    yuewahchan

    Joined:
    Jul 2, 2012
    Posts:
    309
    I have set the Stripping preset of the TileSystem to Strip Everything, when I attach the debugger in runtime, the tilesystem still allocate chunk and tiles memory, i.e. tilesystem._chunks[0].tiles -> { Rotorz.Tile.TileData[3600] }

    my tilesystem contains procedural Mesh, is it the problem ?
     
  29. numberkruncher

    numberkruncher

    Joined:
    Feb 18, 2012
    Posts:
    953
    Stripping capabilities are reduced when procedurally generated tiles are present (unless they are pre-generated by selecting Pre-generate Procedural option). This is because tilesets and tile data are required to generate procedural tiles.

    Pre-generate Procedural
    Causes all tiles that are painted using procedural brushes to be pre-generated. Selecting this option allows tile data and brush references to be stripped. Procedurally generated meshes will be saved into the optimised scene which will naturally increase its file size.

    Procedural tiles will be generated at runtime if this option is not specified.
     
  30. runerask

    runerask

    Joined:
    Mar 30, 2013
    Posts:
    9
    Hey!

    I recently got this awesome asset and so far im having a blast! However i do have some questions! :)

    It seems like a lot of manual work when creating oriented brushes, a lot of the orientations will naturally (in my case at least) be a lot of duplicates (corners, junctions, half-junctions) with different rotation, and theres a few things make the work really tedious (especially when u want to iterate fast)

    a) not being able to define one orientation and have all the mirrors automatically created/rotated(creating duplicate prefabs automatically if need be),

    b) no sorting of orientations in the brush creator(i.e they are all over the place meaning you u have to scroll a whole lot up and down) - even grouping them in a drop down seems perfectly sensible to me - whereas just having a list of 30-40 orientations randomly all over becomes really frustrating fast).

    c) having auto-rotated tiles would make it a lot less tedious to add variations (right now: add variation, create prefab, duplicate times 4 or 6, rotate/rename as need, add to brush = a lot of work, why no just drag it into one corresponding master orientation? ))

    Ofcourse i might be missing this feature somewhere but it seems like it's not on there. Even just an option to mirror/rotate tiles with a hotkey before you paint them would be nice!

    Again thanks a lot for the asset, besides the aforementioned bottle-neck, it's a solid tile-mapping tool!
     
  31. numberkruncher

    numberkruncher

    Joined:
    Feb 18, 2012
    Posts:
    953
    Awesome, I am glad that you are enjoying it!

    To speed up your workflow you could define a brush with each of the corners, junctions and half junctions generally desired in your brushes:
    • Create new brush called "My Template".
    • Add all the empty orientations generally desired.
    • Convert the brush into a Master Brush.
    • You can now duplicate this template brush giving you a quicker starting point each time. Surplus orientations can be removed from new brushes and special case ones can be added.
    This is something which I hope to introduce in the future.

    Orientations are currently sorted numerically which means that if all orientations are defined, the "alone" one appears at the top and the "fully surrounded" one appears at the bottom.

    I understand what you are saying and agree that it would be nice if these could be sorted by symmetry. I have made a note of this since I think this would be quite a nice addition.
     
  32. numberkruncher

    numberkruncher

    Joined:
    Feb 18, 2012
    Posts:
    953
    ANNOUNCEMENT

    The current version of Rotorz Tile System is the final version which will function in Unity 3.5.7.

    When the next version of Rotorz Tile System is released, please do not unpack using the Unity 3.5.7 interface since this may cause data loss. Instead it is important that you unpack using the latest version of Unity 4.

    This decision was not taken lightly and now seems to be a good time to finally make this transition in order to take advantage of some of the great new features which Unity 4 has to offer.
     
  33. runerask

    runerask

    Joined:
    Mar 30, 2013
    Posts:
    9
    Thanks a lot for the quick response!

    Again, i enjoy the system immensely, and i hope i didn't come off as demanding or annoying :)
    I didnt know about the master brush in detail, will check it for sure! I ended up automating most of the process my self, but it would be nice to have it being part of the package. Other than that, not much to say the API is solid and the workflow is in general fast, slick and intuitive :)
     
  34. runerask

    runerask

    Joined:
    Mar 30, 2013
    Posts:
    9
    damn, double post
     
    Last edited: Sep 10, 2013
  35. yuewahchan

    yuewahchan

    Joined:
    Jul 2, 2012
    Posts:
    309
    I would like to select multiple tiles on the TileSystem and assign a tag or other custom data on them.
     
  36. numberkruncher

    numberkruncher

    Joined:
    Feb 18, 2012
    Posts:
    953
    You can do this in the regular Unity fashion, select them and tweak using the inspector :)

    This cannot be done for 2D tiles since those are procedural. If you need to attach and tweak components to 2D tiles then you may want to consider using non-procedural 2D tiles instead since those are individual game objects which an be selected more easily. Non-procedural 2D tiles can be batched using the provided "Build" feature.

    If you want to select objects that are attached to procedural 2D tiles then you can do this using the "Hierarchy" window. Though this can be tricksy, so you might want to add a custom gizmo to your attachment to make it easier to select in the editor.
     
    Last edited: Sep 13, 2013
  37. vin6013

    vin6013

    Joined:
    Sep 11, 2013
    Posts:
    2
    Hi. i have a big problem. After build tile system as prefab resulting asset is too large. Please help reduce the size of the asset.
     
  38. numberkruncher

    numberkruncher

    Joined:
    Feb 18, 2012
    Posts:
    953
    A tile system containing non-combined tile meshes has a considerably lower memory footprint than when tile meshes have been combined. The resulting asset contains your combined tile meshes and so will naturally be larger.

    This is similar to the way in which static batching works in Unity Pro, and the same advice applies:

    - http://docs.unity3d.com/Documentation/Manual/DrawCallBatching.html

    You can control which tiles are combined by selectively marking brushes as "Static".

    I hope that this helps :)
     
  39. vin6013

    vin6013

    Joined:
    Sep 11, 2013
    Posts:
    2
    Thank you I will try
     
  40. numberkruncher

    numberkruncher

    Joined:
    Feb 18, 2012
    Posts:
    953
    You can also disable mesh combining on a per tile system basis if desired (see "Build Options" section of tile system inspector).
     
  41. 2dchaos

    2dchaos

    Joined:
    Sep 11, 2013
    Posts:
    63
    Hi, Rotorz is giving me this error when I try to create a new tile system:
    MissingMethodException: Method not found: 'UnityEditor.Undo.IncrementCurrentEventIndex'.
    Rotorz.Tile.Editor.CreateTileSystemWindow.OnGUI_Buttons ()
    Rotorz.Tile.Editor.CreateTileSystemWindow.OnGUI ()
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
    Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
    System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
    UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/BuildAgent/work/d3d49558e4d408f4/Editor/Mono/GUI/DockArea.cs:231)
    UnityEditor.HostView.Invoke (System.String methodName) (at C:/BuildAgent/work/d3d49558e4d408f4/Editor/Mono/GUI/DockArea.cs:224)
    UnityEditor.HostView.OnGUI () (at C:/BuildAgent/work/d3d49558e4d408f4/Editor/Mono/GUI/DockArea.cs:120)

    Can you help me?

    Also, will Rotorz use the 2d capabilites of Unity´s next version?

    Thanks
     
  42. numberkruncher

    numberkruncher

    Joined:
    Feb 18, 2012
    Posts:
    953
    Hi there, I see that you are using Unity 4.3 beta :)

    This is a known issue and has already been resolved for the Unity 4.3 release.
     
  43. Grespon

    Grespon

    Joined:
    Apr 13, 2012
    Posts:
    388
    Hi Numberkruncher,
    With Windows it's working fine, but when I try with my Mac Mountain Lion, It gives an error like this:
    $Captura de Tela 2013-10-22 às 21.37.55.png

    You see, some blocks have the laterals cut in half..
    Am I doing something wrong?
    I selected 'Tiles Facing' : upwards

    Edit: btw, I'm using Unity 4.2.2f1
     
    Last edited: Oct 23, 2013
  44. numberkruncher

    numberkruncher

    Joined:
    Feb 18, 2012
    Posts:
    953
    Hello there,

    This should occur on both Windows and OS X since the smooth platform tiles are not designed to work on top-down (Upwards facing) tile systems. Though you can make a top-down brush by following the following video:



    The video is a little outdated, but hopefully you should see the basic idea behind this.

    I hope that this helps!
     
  45. Grespon

    Grespon

    Joined:
    Apr 13, 2012
    Posts:
    388
    Thanks!

    I didn't notice the problem on Windows. I'll follow the video tutorial.

    Edit: Pretty easy! Amazing asset. Thanks!
     
    Last edited: Oct 23, 2013
  46. AntFitch

    AntFitch

    Joined:
    Jan 31, 2012
    Posts:
    243
    I've got a quick question about painting at run-time. Is it possible to paint a tile that hasn't been assigned to a brush, but is part of a tileset that is being used to draw a scene? I have a door that needs to open and close and I want to swap the open/closed door tiles at run-time when an NPC enters/exits a house.
     
  47. numberkruncher

    numberkruncher

    Joined:
    Feb 18, 2012
    Posts:
    953
    Generally it is better to create a brush for each tile since this will handle underlying updates for you.

    Alternatively you can change the tileset index of the tile data and then force the chunk's procedural mesh to update. If your tile is on the same atlas then you can perform a lighter weight update:
    Code (csharp):
    1.  
    2. var tile = system.GetTile(doorRow, doorColumn);
    3. tile.tilesetIndex = doorOpen ? doorOpenIndex : doorClosedIndex;
    4.  
    5. var chunk = system.GetChunkFromTileIndex(doorRow, doorColumn);
    6. chunk.UpdateMeshUVs(); // a little faster than chunk.UpdateMesh();
    7.  
    An opening/closing door is actually quite a good candidate for a sprite (which as you know can be painted as a tile).
     
  48. AntFitch

    AntFitch

    Joined:
    Jan 31, 2012
    Posts:
    243
    I'm currently using layer.RefreshSurroundingTiles. Is faster than the chunk code?
     
    Last edited: Nov 5, 2013
  49. numberkruncher

    numberkruncher

    Joined:
    Feb 18, 2012
    Posts:
    953
    Only call chunk.UpdateMeshUVs if you are updating tile data directly since tileset brushes will do this automatically. This function only applies to 2D procedural tileset tiles.

    To improve performance when using brushes you should use bulk edit mode.
    • RefreshSurroundingTiles is essentially a shortcut for repainting the 8 tiles which surround the painted tile. During bulk edit mode tiles are marked as dirty without actually painting them. All dirty tiles are refreshed by the closing system.EndBulkEdit() call. This greatly reduces the amount of effort when painting multiple tiles in sequence.
    • chunk.UpdateMeshUVs is called after all bulk changes have been made. This helps to improve performance since chunk.UpdateMeshUVs would otherwise occur each time a brush paints a tile.

    I hope that this helps to clarify the difference. Please let me know if you have further questions or are confused and I will do my best to explain :)
     
  50. Ben-BearFish

    Ben-BearFish

    Joined:
    Sep 6, 2011
    Posts:
    1,204
    I was wondering if it is possible to get the updated dll/code for the Rotorz-Tile-System for the Unity 4.3 release? I'd like to be able to use your Tile System now if possible. Thanks.