Search Unity

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

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

  1. numberkruncher

    numberkruncher

    Joined:
    Feb 18, 2012
    Posts:
    953
    I believe so yes. Prefab instantiation seems to have become slightly cheaper in 4.5 which has made it faster to paint tiles.

    Over time lots of tiny optimizations have been made to tile painting, so those obviously add up. Since 2.3.0 tile matrices are partially pre-calculated which gave a little boost.

    In terms of tile painting, the most expensive part of the entire process is parenting the tile to the tile system after instantiation. This is because it incurs some static collider movement overhead where tiles contain static colliders. In Unity 5.0 tile painting seems faster than 4.6.

    In terms of performance whilst the demonstration runtime editor is "idle", Rotorz Tile System doesn't do anything... so those benefits can only be in the Unity engine itself.
     
  2. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    Thanks for the very informative observation.
     
  3. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    Hi NumberKruncher,

    I just saw a dungeon asset that has various levels https://www.assetstore.unity3d.com/en/#!/content/23228
    I watched most of Rotorz tutorials but haven't seen one with multi-level dungeon.

    Would love to get some ideas or best is one of your excellent tutorials on how to setup Rotorz to work with a multi-level dungeon like this set.

    Cheers.
     
  4. numberkruncher

    numberkruncher

    Joined:
    Feb 18, 2012
    Posts:
    953
    I haven't recorded any tutorials for multi-level dungeons, but essentially, to create a multi-level dungeon you can just create multiple tile systems.

    Please note that we now have forums dedicated to Rotorz Tile System:
    http://forum.rotorz.com
     
  5. x_ming_x

    x_ming_x

    Joined:
    Jan 1, 2013
    Posts:
    46
    HI NumberKruncher
    im coding a runtime editor and map generator and ive come across something which im not sure of, i want to fill the tilesystem with tiles from a single brush, is there an easy fast way to do this ?
     
  6. numberkruncher

    numberkruncher

    Joined:
    Feb 18, 2012
    Posts:
    953
    You can improve performance by using the bulk edit mode feature for this:
    Code (csharp):
    1. tileSystem.BeginBulkEdit();
    2. for (int row = 0; row < tileSystem.RowCount; ++row) {
    3.     for (int column = 0; column < tileSystem.ColumnCount; ++column) {
    4.         yourBrush.Paint(tileSystem, row, column);
    5.     }
    6. }
    7. tileSystem.EndBulkEdit();
    I hope that this helps!
     
  7. x_ming_x

    x_ming_x

    Joined:
    Jan 1, 2013
    Posts:
    46
    yes that looks like what i need, ive got this in my script

    public void FillTileSystem( TileSystem SelectedTileSystem, Brush SelectedFillBrush) // fills target tilesystem
    {
    SelectedTileSystem.BeginBulkEdit();
    for (int row = 0; row < SelectedTileSystem.RowCount ; ++row)
    {
    for (int column = 0; column < SelectedTileSystem.ColumnCount; ++column) {
    SelectedFillBrush.Paint(SelectedTileSystem, row, column);
    }
    }
    SelectedTileSystem.EndBulkEdit();
    }

    But im getting this error on compile for both row and column count

    error CS1061: Type `Rotorz.Tile.TileSystem' does not contain a definition for `RowCount' and no extension method `RowCount' of type `Rotorz.Tile.TileSystem' could be found (are you missing a using directive or an assembly reference?)

    thanks for the help, ;)
     
  8. numberkruncher

    numberkruncher

    Joined:
    Feb 18, 2012
    Posts:
    953
    It looks like you are using an older version if Rotorz Tile System. Backup your files and update from the asset store.

    This should resolve the issue :)
     
  9. x_ming_x

    x_ming_x

    Joined:
    Jan 1, 2013
    Posts:
    46
    ok will do thx ;)
     
  10. headcrap

    headcrap

    Joined:
    Jul 29, 2014
    Posts:
    37
    Hi,

    thanks for this nice asset but i have a problem drawing 2d tiles and reduce box colliders. I set up my brush as static and draw some ground but the box collider did not combined / reduced.

    Please help me :)
     
  11. numberkruncher

    numberkruncher

    Joined:
    Feb 18, 2012
    Posts:
    953
    Hey there!
    Did you specify a value for Reduce Box Colliders on your tile system?
    What happens if you set Keep Separate to Nothing?
    Does it help if you increase the Snap Threshold value?

    Please note that we now have our own forums for Rotorz Tile System here ;)
     
  12. headcrap

    headcrap

    Joined:
    Jul 29, 2014
    Posts:
    37
    Yep i specify a value
    Keep Separate Nothing - Nothing happend
    Snap Threshold = 0.1- 1000 Nothing happend
     
  13. numberkruncher

    numberkruncher

    Joined:
    Feb 18, 2012
    Posts:
    953
  14. headcrap

    headcrap

    Joined:
    Jul 29, 2014
    Posts:
    37
    Oh that works great! Thanks for your support :) It would be cool if the collider combined when i hit "refresh" or click "play". So it would be much easier testing the map in unity. 5 stars for you
     
  15. lun

    lun

    Joined:
    Dec 30, 2014
    Posts:
    4
    Hi,

    The paint behavior default is newly tile brush replace older tile brush, can it change to deline replacing tile by newly brush in runtime?
     
    Last edited: Jan 4, 2015
  16. numberkruncher

    numberkruncher

    Joined:
    Feb 18, 2012
    Posts:
    953
    I am afraid that I do not understand your question. What are you trying to do at runtime?
     
  17. lun

    lun

    Joined:
    Dec 30, 2014
    Posts:
    4
    Hi,

    My case is I will paint some tile in editor and let player paint their tile in runtime, I don't want the player replace my original tile, but I don't know how to do that.
     
    Last edited: Jan 4, 2015
  18. numberkruncher

    numberkruncher

    Joined:
    Feb 18, 2012
    Posts:
    953
    In your runtime editor script you could create a map of boolean values at the start which you can then use to determine which tiles existed prior to runtime.
    Code (csharp):
    1. fixedTiles = new bool[tileSystem.RowCount, tileSystem.ColumnCount];
    2.  
    3. for (int row = 0; row < tileSystem.RowCount; ++row) {
    4.     for (int column = 0; column < tileSystem.ColumnCount; ++column) {
    5.         fixedTiles[row, column] = tileSystem.GetTileOrNull(row, column) != null;
    6.     }
    7. }
    In your runtime script you could then check that data to see whether the tile can be painted.
    Code (csharp):
    1. if (!fixedTiles[row, column]) {
    2.     brush.Paint(tileSystem, row, column);
    3. }
    I hope that this helps, let me know how you get on!
     
  19. lun

    lun

    Joined:
    Dec 30, 2014
    Posts:
    4
    Thank you, but I'm only an unity designer could you please provide full set of script? and I'm also don't want runtime player brush replacement, which means player only can tile one time with one style pattern on the same grid box. thank you very much
     
  20. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    909
  21. Recon03

    Recon03

    Joined:
    Aug 5, 2013
    Posts:
    845
    Unity 5 ready?? I own this, and I updated everything notices some errors and was unable to use in Unity 5 ETA on fixing this ?? Thanks.
     
  22. numberkruncher

    numberkruncher

    Joined:
    Feb 18, 2012
    Posts:
    953
    Hi Recon03
    As you have found the current asset store version of Rotorz Tile System is not yet Unity 5 compatible.

    Many Unity 5 compatibility issues have already been resolved in our BETA channel.

    Please contact us via our website with the E-mail address that you prefer to use with Google Groups along with your invoice number as proof of purchase if you would like access to the pre-release BETA of Rotorz Tile System.

    Many thanks
     
  23. Gamingbir

    Gamingbir

    Joined:
    Apr 1, 2014
    Posts:
    195
    We can use 2D sprites with this? I mostly make 2d games :). Thanks
     
  24. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Yes, take a look on Asset Store.
     
  25. gshape

    gshape

    Joined:
    Aug 8, 2012
    Posts:
    104
    May I know if v2.3.4 is Unity 5 compatible?
     
  26. numberkruncher

    numberkruncher

    Joined:
    Feb 18, 2012
    Posts:
    953
    The current asset store release of Rotorz Tile System (v2.3.4) IS NOT compatible with Unity 5. An update (v2.4.0) is in the works though :)
     
  27. gshape

    gshape

    Joined:
    Aug 8, 2012
    Posts:
    104
    Thanks! I got a problem while taking a new iOS build (with Rotorz v.2.2.2), saying "ReduceColliderUtility" is not supported blah blah... exact error like this.
    "Use of undeclared identifier 'BoxCollider2D_get_offset)m40924', did you mean 'Collider2D_get_offset_m61749'?"

    I hope the coming version fix it. :)
     
    Last edited: Mar 12, 2015
  28. numberkruncher

    numberkruncher

    Joined:
    Feb 18, 2012
    Posts:
    953
    What issues are you having with "ReduceColliderUtility"? there are no known issues here.
     
  29. gshape

    gshape

    Joined:
    Aug 8, 2012
    Posts:
    104
    My project is upgraded and could take a build in Unity 5. In Xcode, when I tried to run, i got this error and it obviously stopped my action.

    Details:
    Target platform: iOS
    Unity 5: 5.0.0.f4 personal edition
    Rotorz Tile System: v2.2.2
    Xcode: 6.2(6C131e)

    ""Use of undeclared identifier 'BoxCollider2D_get_offset)m40924', did you mean 'Collider2D_get_offset_m61749'?""

    Also this...
    ""Use of undeclared identifier 'BoxCollider2D_get_offset)m40928', did you mean 'Collider2D_seet_offset_m30383'?""
     
    Last edited: Mar 12, 2015
  30. gshape

    gshape

    Joined:
    Aug 8, 2012
    Posts:
    104
    I could take an iOs build perfectly in Unity 4 a week ago, I guess the problem is caused by the incompatbabily of Unity 5 due to api changes. Yet, any workaround or solution are welcome! :) Thanks!
     
  31. numberkruncher

    numberkruncher

    Joined:
    Feb 18, 2012
    Posts:
    953
    Ah right, yes Unity renamed the property from "center" to "offset" on the 2D Box Collider and it seems that their auto-upgrader has failed.

    We have already updated our source code to use the new property name instead. So this issue should already have been resolved.

    Please do not paste excerpts of our source code here.

    If you would like pre-release access to our next update contact us on our website and provide your invoice number as proof of purchase.

    Many thanks!
     
  32. gshape

    gshape

    Joined:
    Aug 8, 2012
    Posts:
    104

    Opps! sorry~ I removed the code in my comment.
    Will contact you guys soon for pre-release!
    Thanks for great support again! :)
     
  33. Green-Jungle

    Green-Jungle

    Joined:
    Jun 10, 2014
    Posts:
    79
    Hello Numberkruncher .
    I have problems.I used Rotorz Tile System tool to create map.But when I check about Draw call.I found that it' so many .
    I only use some tiles 100*100 pixel dimension but draw call is 124.I don't know why.Please support for me.
     
  34. numberkruncher

    numberkruncher

    Joined:
    Feb 18, 2012
    Posts:
    953
    Are you using atlases for your tile sets?
    Are you working with 2D or 3D tiles?
     
  35. piotrO

    piotrO

    Joined:
    Dec 16, 2009
    Posts:
    46
    Hi,

    I have some pre-sales questions:
    1. In our game we have some 'tiled objects' with sizes like 3x2 or 4x2 (in tiles), will your system support this kind of nonuniform sizes?
    2. What is the overhead of your system? How much code does it add to the game objects? Is it possible to use your system just during the level creation and remove all the code/components during release?

    Thanks
     
  36. numberkruncher

    numberkruncher

    Joined:
    Feb 18, 2012
    Posts:
    953
    If your tile is just a prefab (like a sprite or a 3D object) then yes it can overlap many tiles like the bridge does in the following video. The bridge only occupies 1 tile, but it spans many because it is larger!



    You would need to profile your use case to determine the overhead in your project.

    The tile system component itself doesn't actually do anything on its own other than store the tile system data structure. 2D tiles are procedurally generated at runtime when the tile system first initializes; and then again whenever tiles are painted or erased.

    Depending upon the functionality that you are using, you can strip unwanted functionality away from your tile systems by optimizing them:
    http://rotorz.com/tilesystem/guide?ref=e49ffca3-9a14-4ef3-b8f0-6cf36ab8c090

    If you are using 2D tilesets then you will still need the tile system's data structure since the tile mesh is procedurally generated at runtime.
     
  37. piotrO

    piotrO

    Joined:
    Dec 16, 2009
    Posts:
    46
    Thanks numberkruncher, that was helpful.
     
  38. AndyGFX

    AndyGFX

    Joined:
    Jan 13, 2012
    Posts:
    98
    Hi,

    a lot of time I made oriented brush definition from head and many-times I spent time to study how-to ... .
    Finally I have created simple template and I think, is useful for all ...
     
  39. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Each time i come back using Rotorz i have problems figruing out how to make some tiles automatic because i don't find it very intuitive or natural. Thanks you for this usefull matrix :)
     
  40. Ben-BearFish

    Ben-BearFish

    Joined:
    Sep 6, 2011
    Posts:
    1,204
    @AndyGFX You should contact Lea and either ask him to include that with the plugin or put in his documentation. That seems rather useful.

    @numberkruncher , I was wondering what your thoughts were on this Unity blog post about native Unity support for 2D tilemaps? I know your tool is much more extensive in that it supports 2D & 3D tilemaps, but I was wondering if you planned to attempt to integrate Unity's system with yours or continue with the way you setup your tile system?
     
    zenGarden likes this.
  41. AndyGFX

    AndyGFX

    Joined:
    Jan 13, 2012
    Posts:
    98
    Today was matrix image refreshed with a few changes and with small cyan matrix, for create oriented brushes automaticaly without prefabs for all sides more in this Rotorz video

    (Less prefabs, less definitions, best option from my point of view ;) )

    A.
     
  42. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    What confused me defining tiles is you click to turn green that is to mark empty blocks. It's abit confusing and not natural.
    I would expect to clik and color blocks to design filled block , instead we click to erase and make empty blocks.

    Anyway the new feature is great.
     
  43. Gamingbir

    Gamingbir

    Joined:
    Apr 1, 2014
    Posts:
    195
    Hello sir is it possible to make maps like this using
    Rotorz-tile-system

    Example:

    1)

    2)


    thanks!
     
  44. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    If you use 3D tiles and set camera to ortho mode and set some isometric view angle, then yes it's possible.
    With Rotorz you'll make a horizontal tile system and that's it, the camera will make it look isometric :)
     
  45. Gamingbir

    Gamingbir

    Joined:
    Apr 1, 2014
    Posts:
    195
    I have only 2D assets. Not a single 3D model sadly and no one to make 3D assets :D
     
  46. mimminito

    mimminito

    Joined:
    Feb 10, 2010
    Posts:
    780
    Can you force the system to generate unity SpriteRenderers instead of its own meshes?
     
  47. numberkruncher

    numberkruncher

    Joined:
    Feb 18, 2012
    Posts:
    953
    The green/cyan cells of the orientation indicate adjacent tiles that are filled with something. In the case of that demonstration video the floor and wall tiles are a part of the same brush. You can of course do this the other way around if that feels more natural to you.

    The tile mesh that Rotorz Tile System produces is a lot more static than the mesh that the SpriteRenderer's collectively produce. In principle tiles are like sprites except way less dynamic.

    You can use Unity's sprites with Rotorz Tile System by creating one prefab from each sprite and then adding those to oriented brushes.

    I would recommend posting all future responses to the dedicated forums because you will get faster responses there:

    http://forum.rotorz.com/

    Many thanks
     
  48. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
    Does this support assigning information to the tiles that would aid pathfinding, or allow the distinction between what kind of terrain each tile represents?
     
  49. mimminito

    mimminito

    Joined:
    Feb 10, 2010
    Posts:
    780
    If you create prefabs for each tile, then you could assign your own script to define this information.
     
  50. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
    Thanks. I already have the now unsupported Tiny Tile Mapper which I have never used. But this seems to be better and still supported so I may pick this up while it is on sale today.
     
    mimminito likes this.