Search Unity

2D Alpha Release 3

Discussion in '2D' started by ColossalPaul, Aug 14, 2015.

  1. ColossalPaul

    ColossalPaul

    Unity Technologies

    Joined:
    May 1, 2013
    Posts:
    174
    Hi All,

    We have some updates on the 2D beta features. See them all here:
    https://bitbucket.org/Unity-Technologies/2ddemos/wiki/Alpha_Release_3/

    Here are some highlights.

    Shuriken 2D


    Masking Workflow


    Sprite Mesh Editor


    SmartSprite


    Tile Map (older video for those who have not seen it)


    Please head over to
    https://bitbucket.org/Unity-Technologies/2ddemos/wiki/Alpha_Release_3/

    Download the build and give us some feedbacks. Your feedbacks will go a long way in helping us ship these in the final build.

    Thanks!
     
    Last edited: Aug 24, 2015
  2. kuchaku

    kuchaku

    Joined:
    Oct 14, 2014
    Posts:
    37
    I'm liking the look of the true alpha masking and runtime alteration of that smart sprite. Wasn't sure if smart sprite would ever be valauble in a procedural context, but this certainly would move it in that direction. I hope at least some of these features make their way into 5.2.
     
  3. Deleted User

    Deleted User

    Guest

    Hi, Paul! New features look great!

    I have a question on masking in alpha mode. How is it implemented under the hood: do you use stencil buffer or do you project mask sprite on the maskable sprites (altering their secondary UVs)?
     
  4. Kiori

    Kiori

    Joined:
    Jun 25, 2014
    Posts:
    161
    Looks great, Unity2D getting the features it deserves!
    Smart sprites:
    *Runtime Deform
    * Undo support
    :D

    Looking great so far.
     
  5. Jay-Pavlina

    Jay-Pavlina

    Joined:
    Feb 19, 2012
    Posts:
    195
  6. sandboxed

    sandboxed

    Unity Technologies

    Joined:
    Apr 6, 2015
    Posts:
    95
    Sprite masking in both modes (mesh and alpha based) are using stencils.
     
  7. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    The overview page has been updated. Thanks, Jay!
     
    Jay-Pavlina likes this.
  8. Deleted User

    Deleted User

    Guest

    Thanks for the info! Is it correct that as long as masking is done using stencils - it is 1bit masking (a pixel is either masked or not masked, no smooth transitions)?

    And another related question: if I understand correctly - while Mesh Filters may instantiate a copy of Mesh (when that property is queried), Sprite Renderers that were assigned a same Sprite always use a single shared Sprite instance. The question is - do you have any plans about exposing functionality of instantiating Sprite meshes and exposing their internals (uv2, uv3, etc.)?
     
  9. sandboxed

    sandboxed

    Unity Technologies

    Joined:
    Apr 6, 2015
    Posts:
    95
  10. Deleted User

    Deleted User

    Guest

    @sandboxed
    Yes, I've made a quick test and looks like it is a valid approach to use those Sprite properties to re-create a mesh of some sprite and render it via MeshRenderer. It is just a bit inconvenient to use SpriteRenderers for the regular sprites and MeshRenderers for sprites being rendered with advanced shaders. :)
    I guess you're interested in keeping SpriteRenderer simple (and it is good). But maybe you could consider adding (in some future Unity version) some kind of AdvancedSpriteRenderer with more internals exposed, but that can still be dynamically batched with regular SpriteRenderers when possible.
     
    PGJ likes this.
  11. DiscoFever

    DiscoFever

    Joined:
    Nov 16, 2014
    Posts:
    286
    Sorry for my 'dumb' question but ... any help on how to get brushes in the Palette ? I'm trying to make a simple platformer. Thanks !
     
  12. der_r

    der_r

    Joined:
    Mar 30, 2014
    Posts:
    259
    That's not a dumb question. Actually, doing that is pretty complicated at the moment. Your best bet is to open one of the samples and look for the objects with the brushes script on them and then try to replicate what they did! I haven't done it myself yet, so...
     
  13. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    Checking out the samples would be a fast way to start! This would be the latest version.

    There are two things you need to make to create a new brush, the brush painting script and the brush asset. The brush painting script contains the logic to paint and erase tiles, while the brush asset contains customised information for painting specific sprites.

    To create the brush painting script, you will need to extend from the GridBrush class, overriding the Paint, Erase and GetPreviewSprite functions. You will also need to have a way to create the brush asset/s itself; in the sample, we added a function CreateBrush to each brush painting script to create the brush asset. Anytime a brush asset is created, the Tilemap Palette will pick it up and make it available for selection.

    For normal sprites, all textures with sprites should appear in the drop-down menu in the Tilemap Palette. You can switch between the sprite textures by selecting the texture name in the drop-down menu.
     
  14. kbm

    kbm

    Joined:
    Aug 7, 2014
    Posts:
    84
    Hi, does the Particle 2D Collision already support OnParticleCollision() calls? If not, is it planned in the future to add this support?

    Thanks, much appreciated and I'm really excited to see significant improvements to 2D tools

    UPDATE: I ticked the "Send Collision Messages" Box but it didn't seem to do anything. Maybe a bug, maybe intended? Can anyone confirm that this does not work?
     
    Last edited: Aug 27, 2015
  15. medvedya2012

    medvedya2012

    Joined:
    May 27, 2014
    Posts:
    41
    Hi, Paul! New features are amazing!
    I saw new Component "Batched Sprite Renderer" at the demo video.
    Is it a native component of engine or a high level component(like c# Script)? Does it work like Sprite Render but with manual control of the mesh from code?
     
  16. Stonewood1612

    Stonewood1612

    Joined:
    Sep 15, 2014
    Posts:
    32
    I'm wondering if the tilemap could be used for many more things than the terrain of the gameworld. Say if you make a top-down game, could you use a separate layer above the terrain as fog of war for example. Or in a turn-based tactics game, you could highlight tiles with an overlay to indicate on which tiles one of your units could move to on your turn. I'm wondering if those could be possible uses for this tool. It is possible to edit the tiles at runtime trough scripting, right?
     
  17. bitbiome_llc

    bitbiome_llc

    Joined:
    Aug 3, 2015
    Posts:
    58
    Looks great. Would love to test it. Are there non-pro early releases? I'd make direct use of the tilemap in the title I'm working on. Pro is still too rich for my poor blood. I can't pay $75 to give you feedback, sorry.
     
  18. xCyborg

    xCyborg

    Joined:
    Oct 4, 2010
    Posts:
    633
    Can you support scaling for the edge 9-slice sprites (maybe future ffd) as to break the monotone frow of the surface, to have wavy irregular surface for example (with free form deformation or local vertical scale).
    Also can you choose the sprites when you change them (in multiple edge sprites) or are they random? thanks.
     
  19. ColossalPaul

    ColossalPaul

    Unity Technologies

    Joined:
    May 1, 2013
    Posts:
    174
    This sounds like you need smartsprite?
     
  20. Sylmerria

    Sylmerria

    Joined:
    Jul 2, 2012
    Posts:
    369
    How batching sprite renderer works ? It's a better batching system or it is for the tile map ? Does it work with isometric sprites ?
     
  21. xCyborg

    xCyborg

    Joined:
    Oct 4, 2010
    Posts:
    633
    I mean SmartSprite not 9-slice sprites, can you vertically deform the upper sprites in Smart Sprites and can you change them individually.
    Untitled.png
    Untitled.png
     
  22. ColossalPaul

    ColossalPaul

    Unity Technologies

    Joined:
    May 1, 2013
    Posts:
    174
    Judging from your drawings it seems to closely match these features that are yet to be in public:
    - Edges can vary in thickness, so you could have some parts thicker or thinner than others.

    However, this you can do now.
    - Sprite variations edges. If you add more than 1 sprite to an angle range, pressing 'N' key will let you cycle through them and decide which one to use for that specific slope.

    Are these the features you are asking for?
     
  23. xCyborg

    xCyborg

    Joined:
    Oct 4, 2010
    Posts:
    633
    Edge thickness yes, sorry I couldn't formulate it better. you seem to have everything covered.
    The last thing that remains in my checklist is the abitlity to have more than 1 sprite per edge (at the same time) and control their seperation point like the second picture above.
    Thank you and keep up the good work:)
     
  24. ColossalPaul

    ColossalPaul

    Unity Technologies

    Joined:
    May 1, 2013
    Posts:
    174
    Well, you could do it now. For the same angle range, you could use more than one sprite. To control where you separate them, you would just add another control point. That way, 2 edge with the same slope could have 2 different sprites on them.
     
  25. kbm

    kbm

    Joined:
    Aug 7, 2014
    Posts:
    84
    Hi, I just checked the Roadmap: https://unity3d.com/unity/roadmap
    It says that 2D Particle Collisions are planned for the December update, which is great!

    Will this update (presumably) also include the "OnParticleCollision2D" Functionality? I'm kind of counting on this and if this is not planned, I will have to work around this.

    Can anyone tell me more, please?
     
  26. Sylmerria

    Sylmerria

    Joined:
    Jul 2, 2012
    Posts:
    369
    What is batchingSpriteRenderer ? It is a independant system of tileMap ? I mean can I use this system for batching my sprites ( there are isometrics ) of a better way than dynamic batching without use tileMap ?
     
  27. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    The BatchedSpriteRenderer is a native component that helps us group up a bunch of sprites, for example the individual sprites and textures assigned to the SmartSprite, and render them at once. Internally, it is similar to the existing sprite renderer batching system. For now, we do not have any APIs for you to work with it, but if you do have good use-cases for it, do let us know!
     
  28. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    That would certainly be possible with the tile map. You will be able to swap in and change tiles during runtime through scripting, so the tile map could become a selection overlay or act as a fog of war overlay.
     
  29. Ash-Blue

    Ash-Blue

    Joined:
    Aug 18, 2013
    Posts:
    102
    Any word on Unity Pathfinding getting 2D support? Would be nice to use it instead of relying on 3rd party plugins.
     
  30. sandboxed

    sandboxed

    Unity Technologies

    Joined:
    Apr 6, 2015
    Posts:
    95
    Navmesh will be coming to 2d. No committed date/time; just keep an eye on the Unity Roadmap (https://unity3d.com/unity/roadmap) coz thats the first place to check for features in development.
     
  31. Sylmerria

    Sylmerria

    Joined:
    Jul 2, 2012
    Posts:
    369
    Thanks for answer.

    If I understand well I will not have any improvement until TileMap system go out ? For summarize, I have many thousand sprite ( isometric) to render and dynamic batching take huge time for that so I search for better system.
     
  32. xCyborg

    xCyborg

    Joined:
    Oct 4, 2010
    Posts:
    633
    Guys can you provide a direct link to the Unity-with-2d-alpha build besides the download assistant?
    Also something interesting I have been wondering about, is if SmartSprite and Tilemap Editor will work together: like creating the scene with the Tilemap editor and let SmartSprite assign the slope sprites based on angles.and control thickness and so on...
    Now that would definitely be raising the bar!
     
  33. jay-jin

    jay-jin

    Joined:
    Jun 22, 2014
    Posts:
    12
  34. bluefoxicy

    bluefoxicy

    Joined:
    Jan 2, 2015
    Posts:
    15
    Are there any updates that would make retro physics easier to implement? I've been struggling with the simple problem of getting a 2D tile-based character to walk to the 1-pixel edge of a platform and not fall off for ages. With a wheel collider for feet, you roll off when you get too close; with a box collider, you tend to get stuck all over the place (walls, floors between box colliders, slopes). I've been examining one person's solution for a while, and am currently looking into designing a 2D physics engine to implement this type of control.
     
  35. SVC-Games

    SVC-Games

    Joined:
    May 21, 2013
    Posts:
    137
    Tile map work with a non-ortographic camera? IE: 2D game with some 3D elements between layers.

    Also, is there any limitation in the number of tiles in the "palette" (Sprite Tile for example limits the maximum number of tiles avaliable to 32768 for the entire project, no matter how many textures do you use)
     
  36. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    The next major release 5.3, currently scheduled for December, will have an improvement for dynamic batching for sprites if your target device supports multiple threads. Hopefully that will help you out!
     
  37. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    Are you asking for the Editor installer for the Alpha builds? If you are, we can try to add it to the BitBucket download page. If it is something else, do let us know and we will see if it is possible.

    You can certainly overlay SmartSprites over a tile map to create more natural slopes. We do hope to be able to align SmartSprite points over the grid like the tile map's grid to help you plan out your levels.

    Edit:
    Doesn't look like it is possible. Do you have an issue with the download assistant? You should be able to save the downloaded installer to a directory of your choice.
     
    Last edited: Sep 30, 2015
  38. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    We will look into this as we develop our physics system for the tile map!
     
  39. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    We do intend to make it work with a perspective camera.

    If you do have a specific use-case or situation you have faced with tile maps, do share it with us!
     
  40. xCyborg

    xCyborg

    Joined:
    Oct 4, 2010
    Posts:
    633
    Yes I mean the full installer, my connection is spotty and I use a download manager to resume downloading.
    Thanks anyways for the consideration, it would've been cool but I realize it's out of your scope. But can you at least make holes in the SmartSprite? like a closed cave or a tunnel?
     
  41. AssembledVS

    AssembledVS

    Joined:
    Feb 23, 2014
    Posts:
    248
    How will colliders be implemented within the new Unity Tilemaps? Will all tilemap colliders be merged into one large polygon collider, like is usually done in Tiled Map Editor via Tiled2Unity? Or would we be able to access each individually-placed collider within the object hierarchy and code?
     
  42. SVC-Games

    SVC-Games

    Joined:
    May 21, 2013
    Posts:
    137
    Well, I believe this is the use-case many people is thinking about :p. Notice the combination of perspective + sprites shown in that editor at 14:15 (And that lighting... wow...)


    As xCyborg said, mixing Smart Sprite with Tile Editor would be indeed really awesome if people want to make a more "classic feeling" 2D game.

    Example: Metroid Fusion terrain is varied and not quite uniform (Rocks, plants, etc)...

    But in reality the whole game uses uniform tiles as seen in this video of the debug room:


    A combination of several layers of Smart Sprite + Tiles + 3D models and you could have a nice looking classic feeling 2D platformer.

    Related to this, as mentioned by bluefoxicy:
    I agree that using a wheel collider for feet can be messy...
     
    Last edited: Sep 30, 2015
  43. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    Alright, a link for the Editor installer has been added to the BitBucket page here. Do check it out!

    That sounds like a nice idea. However, it can not be done at the moment, but that is a possibility in the future and could be added to the SmartSprite roadmap.
     
  44. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    This is undecided for now. We have experimented with merging individual colliders for each tile and stripping out duplicate edges and points, and we are still looking into other options for generating the collider/s.

    When accessing the placed collider, do you mean accessing a tile's collider or the tile map's as a whole?
     
  45. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    We certainly do want to be able to this with the Sprites, SmartSprites, Tile Maps and 3D objects too. We are also working on 2D lighting, so stay tuned for that!
     
  46. AssembledVS

    AssembledVS

    Joined:
    Feb 23, 2014
    Posts:
    248
    Thanks for the info. I mean accessing an individual tile's collider. Would this be possible?
     
  47. bluefoxicy

    bluefoxicy

    Joined:
    Jan 2, 2015
    Posts:
    15
    That works for me. I may still meddle with the physics, but starting with something closer to my needs will sharply reduce my workload. I've actually looked at Platformer Pro and such, though I'm doing more calls by programming than by decorating in the engine.

    I guess we'll see when it's released. Even just the tile engine as-is is a huge step forward.
     
  48. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    for tunnels etc I expect one can just use multiple smart sprites for now?
     
  49. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    I believe that you would be able to access the collider for the tile map instead of the individual tile's collider.

    However, you should be able to access information from the tile itself, hopefully including the physics details. Would that be sufficient? What kind of details would you like to see? (eg. slope detail for the tile)
     
  50. Pix10

    Pix10

    Joined:
    Jul 21, 2012
    Posts:
    850
    Caves are just room outlines, so you should be able to do this by simply flipping the wall sprites in Y, and disabling the collision on the SmartSprite? You'd still need your own collision data for the cave, but if you're building procedurally you should already have this (or you could perhaps build it from the SmartSprite points/edges).

    Ditto Tunnels, turn off Draw Bottom, and use flipped in Y sprites for the ceiling.
     
    Last edited: Oct 5, 2015