Search Unity

Orthello 2D Framework - 100% FREE

Discussion in 'Assets and Asset Store' started by mas, Jul 7, 2011.

  1. Mloren

    Mloren

    Joined:
    Aug 20, 2011
    Posts:
    83
    Is this the right place to post bugs?
    I have 2 problems with Orthello.

    1.
    I create an animating sprite, make it a prefab and then add lots of instances to the scene.
    They are created with names like "Animating Sprite (id=4594)"
    I rename them all. Then at some later point (next time I run the game I think) their names all revert back to what they were.

    2.
    My Animating Sprites seem to randomly lose settings.
    I have had several different versions of this including:
    The Sprite Container and Animation setting reverting back to "None"
    The Sprite Container and Animation changing to a different OTSpriteSheet and OTAnimation.
    The sprite's material's tiling settings change back to 1, 1 so that it displays the whole sprite sheet instead of the correct frame of the animation.
    All of these seem to happen at random, it will work fine for a while then suddenly mess up.
    Things that seem to have caused it (but not 100% reproducible) include:
    compiling a javascript.
    closing and reopening the project.
     
  2. mas

    mas

    Joined:
    Nov 14, 2010
    Posts:
    696
    mmm .. this is a strange thing ...

    I will try and reproduce but did not encounter such problems anytime during my development of the system.
    What Orthello version are you using on and what OS?

    Can you send me your project so I can check it on strange things?

    Regarding naming ...

    The only condition for an OTSprite or OTAnimatingSprite to get a 'new' automatic name, is that when an empty name is detected in the Start() function of the OTObject script. This should only occur when you first drag an object into the scene.

    Because the name is saved into your scene it should not get reset.

    Maybe something to do with you creating a 'new' prefab of an Animating Sprite (which is a prefab).
    but I will test this.

    For the other resetting of the tiling or container or animation .. I really have no clue ..
    Would be nice if we could reproduce it somehow ...

    Kind regards,

    Martijn
     
    Last edited: Sep 24, 2011
  3. rocket5tim

    rocket5tim

    Joined:
    May 19, 2009
    Posts:
    242
    Apparently you can't make a Unity Prefab from OTAnimatingSprite or OTSprite because when you make a prefab from one of these objects, the prefab looses the connection to the Sprite Container (OTContainer) and Animation (OTAnimation) since prefabs can't reference external objects. What's the workaround for this?
     
  4. mas

    mas

    Joined:
    Nov 14, 2010
    Posts:
    696
    No workaround for this at this moment ...

    But if you want to instantiate object trough code ...

    I would suggest you make an Orthello GameObject prototype, put it in OT>ProtoTypes (in your scene) and instance it in code using OT.CreateObject.

    I will focus some thoughts on an improvement ( probably by storing the name somewhere and re-linking the OTContainer and OTAnimation on activation )

    @Mloren .. Because you are also making a prefab from a configured OTAnimatingSprite it could be the case that this would have caused the 'strange' behaviour ...

    Same suggestion goes ... just try to work without prefabs but with in-scene object prototypes.

    Martijn
     
  5. mas

    mas

    Joined:
    Nov 14, 2010
    Posts:
    696
    version 1.6 released


    - Improved the atlas support : offsetSizing prop on OTContainer.
    ( trimmed images with or wihout offsetting and resizing)
    - Added OT.view.customSize ( custom camera size)
    - Added OTTween (tweening engine)
    - Added Example 7 - Tweening

    Check Info and online Demo here ...
     
  6. ColossalDuck

    ColossalDuck

    Joined:
    Jun 6, 2009
    Posts:
    3,246
    I am very impressed, and I don't know how I missed this for so long.
     
  7. mas

    mas

    Joined:
    Nov 14, 2010
    Posts:
    696
    Thanks for the compliment

    Regards,
     
  8. mas

    mas

    Joined:
    Nov 14, 2010
    Posts:
    696
    Orthello Pro Released!


    In addition to the free version , Orthello Pro will provide you with just a
    little bit more for a good price ($35) :

    Sprite Batching
    Sprite Batching is realized by the OTSpriteBatch component. You just put your sprites as children of the OTSpriteBatch and Orthello creates (and maintains) one big sprite mesh from all your sprites. These sprites can use different textures/materials and the final sprite mesh will contain a corresponding number of materials. It is also possible to enforce texture packing so that all textures are packed into 1 , leaving you only 1 drawcall.

    Sprite Sheet Generation
    Orthello Pro comes with a Sprite Sheet Generator that will generate a SpriteSheet from a collection of images. You can : scale the original images, fit all images on one , or span across multiple textures, auto create OTSpritesheet, OTAnimation and OTAnimatingSprite in the current scene.

    Path movement
    Using a circle or spline OTShape, you can let your sprites move along a specific path. the OTSpline shape has an 'in-scene' spline editor build in. Your sprite can move looping across a path or just once. By controlling the movement across the path manually, you can achieve nice movement effects. Especially if you combine the movement with an OTTween and/or OTEasing functions. Another application to implement controlled or random placement of sprites along a path in your scene.

    Action System
    The Orthello action system (programming) enables you to add simple actions to your sprites and organise them in action trees. Actions can be things like transparency fading, changing color, moving, sizing, rotating, setting or tweening variables, calling methods and more... this all combined with time and easing functions.

    This product can only be aquired using the wyrmtale website.
    (PayPal checkout)

    Check Info and online Demo here ...
     
    Last edited: Sep 29, 2011
  9. mas

    mas

    Joined:
    Nov 14, 2010
    Posts:
    696
    Orthello Pro User Guide information has been completed.

    Check it here....

    Now working on Parallax moving background layers that can hold
    any sprite or animating sprite.... so very rich and dynamic scrolling backgrounds.
    coming soon.....
     
  10. mas

    mas

    Joined:
    Nov 14, 2010
    Posts:
    696
    Version 1.1 Orthello Pro released ..

    - bug fixes ..
    - added parallax scrolling layer support ( that can include any object ) to create
    dynamic, interactive, rich animating scrolling backgrounds.
    - added Pro - example 4 - Parallax Background
    - added Pro - example 5 - Sprite Sheet Generation



    Check it here
     
  11. reissgrant

    reissgrant

    Joined:
    Aug 20, 2009
    Posts:
    726
    How have I not seen this before???

    This is great!
     
  12. mas

    mas

    Joined:
    Nov 14, 2010
    Posts:
    696
    Thanks! People miss it all the time .. :p hehe
     
  13. DeepOmega

    DeepOmega

    Joined:
    Oct 25, 2011
    Posts:
    3
    Loving Orthello - quick issue, though. The flipHorizontal and flipVertical properties don't seem to do anything to sprites I add to my scene. Is this a known issue?
     
  14. mas

    mas

    Joined:
    Nov 14, 2010
    Posts:
    696
    At this time , there is no issue with flipHorizontal and flipVertical. I use them myself a lot.
    Are you setting them run-time or in the editor? If you do it runtime, can you try it in the editor?
     
  15. clessadnade

    clessadnade

    Joined:
    Oct 29, 2011
    Posts:
    2
    The flip horizontal doesn't seem to work for me too.

    I've tried both run time and in the editor. It marks the option when asked to, but I don't see my character changing position.

    This is the best framework I've ever used in Unity to date. It's very easy to use and works like a charm. I'm in love with it. Thanks, man, for that wonderful tool.
     
    Last edited: Oct 29, 2011
  16. mas

    mas

    Joined:
    Nov 14, 2010
    Posts:
    696
    Mmm.. strange .. ( but thx for the compliment )

    Because it still works @ my side ... If someone could send me a package @ wyrmtale with some reproduce
    description.. I would defenitly dive in and squash this bug!

    P.s. please provide some additional info about your OS and Unity version as well...
     
  17. clessadnade

    clessadnade

    Joined:
    Oct 29, 2011
    Posts:
    2
    Thanks for your answer, mas

    I'm using Windows 7 Professional and Unity 3.4.1f5. I'll send it to you, so you can have a better sight of this issue.

    One thing, though, is that it works when I use a static sprite. It doesn't work with the animations I have
     
  18. DeepOmega

    DeepOmega

    Joined:
    Oct 25, 2011
    Posts:
    3
    Windows 7, Unity 3.4.2f2. I've sent you a package with my little test level. I'm also having some weird hairline pixel issues. Looks like bleed from other textures, but it's not happening at texture resolution, it's happening at screen resolution. So if I bump up the View zoom, the bleed is still 1 screen pixel wide. Very weird. Photo attached.
     
  19. mas

    mas

    Joined:
    Nov 14, 2010
    Posts:
    696
    Ah .. that sets me on my path .. I think I have a clue ..

    When animating, pre-generated uv's are dynamicly set on the mesh, and the uv's
    do not take flipping into account.

    I'll be fixing this issue tomorrow.
     
    Last edited: Oct 31, 2011
  20. mas

    mas

    Joined:
    Nov 14, 2010
    Posts:
    696
    Have you tried and set texture filtering to point. instead of bi- trilinear ?
     
  21. DeepOmega

    DeepOmega

    Joined:
    Oct 25, 2011
    Posts:
    3
    Yep. It's not a compression issue, cause it's texture independent. It also only seems to happen with sprites that touch.
     
  22. mas

    mas

    Joined:
    Nov 14, 2010
    Posts:
    696
    When you move your player, you will see that the bleeding changes as the camera is moved
    along with the player ( because of it beeing the movement target ).

    I found this tread about something a bit similar ...

    http://forum.unity3d.com/threads/90917-Scrolling-Background-Issue

    When I substract 0.01 from each x and y position of each tile, the bleeding goes away.
    Even if you are moving the player.

    I think another solution would be to create a 1 pixel transparent padding on your tile sheet.
     
    Last edited: Nov 1, 2011
  23. mas

    mas

    Joined:
    Nov 14, 2010
    Posts:
    696
    Orthello 1.6d

    - Fixed FlipVertical and FlipHorizontal on Sprites.

    | Download |
     
  24. AllSynergy

    AllSynergy

    Joined:
    Nov 1, 2011
    Posts:
    47
    I spend time to study ex2D, 2D Toolkit and now Orthello.... can't really understand why there is so much interest in ex2D and 2D Toolkit (granted, they both seem to be great but...)... about 20 pages here as well... and only 4 pages about Orthello.... Haven't seen any fundamental flaw that could explain the lack of interest. Oh, well, perhaps I'm blind again and missing something important :D.

    I'm buying some 2D-framework in 2 days and right now Orthello seems to be the one.... I'm quite impressed of what you have done. Would take quite much time to do the same so pro version seems a good bargain. Hopefully development keeps going...
     
    Last edited: Nov 1, 2011
  25. mas

    mas

    Joined:
    Nov 14, 2010
    Posts:
    696
    Hehe .. maybe because it is free .. people think it lacks the quality ... If you would find such flaw .. be sure to point it out so I can improve Orthello even more ...

    Thanks .. really nice to hear when one appreciates my development efforts ... about on going development .. the free base core will be exposed to bug fixing and performance improvements as insights grow .. I still have to do something to better support the Unity3d animation system . In addition .. when putting sprites as child of other sprites and scale and rotate them .. very strange things can happen.. have to dive into that as well.

    I am happy to receive feedback about additional functionality or orthello products that could be nice to haves...

    Regards,
     
  26. mas

    mas

    Joined:
    Nov 14, 2010
    Posts:
    696
  27. MihaPro

    MihaPro

    Joined:
    Dec 23, 2010
    Posts:
    13
    Try use localPosition and localEulerAngles .
    Support Unity3d animation system is very needed. Now if drag by mouse animation cursor, is chaotic add animation keys to curve. I think it's CheckSettings method fault.
     
  28. mas

    mas

    Joined:
    Nov 14, 2010
    Posts:
    696
    MihaPro,

    Could you please send me a unitypackage @wyrmtale.com with a little sample project and clear instructions how to reproduce your behaviour so I can come up with a solution?

    Best regards,
     
  29. MihaPro

    MihaPro

    Joined:
    Dec 23, 2010
    Posts:
    13
    Clear instructions is:
    Create a sprite.
    Open the animation editor and create a sprite animation.
    Make a few keyframes for the position and provide a smooth motion.
    Try dragging by mouse the animation cursor. At this point, random keyframes will be created and animation will be corrupted.
    I created 3 keyframes and drag animation cursor. Result is: http://prntscr.com/3ytn4

    Sorry for my bad English:)
     
  30. mas

    mas

    Joined:
    Nov 14, 2010
    Posts:
    696
    I am not hearing any ...

    Fixed auto insertion of keys when animating a sprite's position,rotation or scale using the build-in Unity3D animation system.

    System checks if animation is active and recording .. if so .. no 'checkSettings' is performed ( = setting specific linked settings across object classes like transform, OTSprite, etc etc ). I only tested it animating transform position, rotation and scale in the editor on a normal OTSprite. Could be that more small bugs will surface and need to be handled ..


    but lets see how we do with this version ...

    Let me know if it worked for you ..
     
  31. MihaPro

    MihaPro

    Joined:
    Dec 23, 2010
    Posts:
    13
    It works, but your method RecordMode() looks very brutal :) Using classes UnityEditor does not allow for make Build. Try # if UNITY_EDITOR for RecordMode() methods.
     
  32. mas

    mas

    Joined:
    Nov 14, 2010
    Posts:
    696
    Sometime there is a time to be brutal ..

    Will check into the making stuff..
     
  33. mas

    mas

    Joined:
    Nov 14, 2010
    Posts:
    696
    Stupid of me .. not to test making an executable ..
    Fixed now ... version 1.7a

    Thanks for pointing it out.
     
  34. mas

    mas

    Joined:
    Nov 14, 2010
    Posts:
    696
    I do not think this will solve anything because the distortion is caused by the parent sprite because it is scaled. This scale will be forced onto the childs as well and when rotating/scaling 'subsprites' this parent's scale will cause the distortion and render strange results.

    The parent is scaled because when sizing OTSprites, scaling is used instead of re-creating the mesh each time to a certain size and setting scale to 1,1,1. ( to avoid some overhead)

    I will implement a possibility to set a OTSprite into a kinda 'scale1' mode that will always set the scale to 1,1,1 and will auto recreate the mesh when the size is changes ( will be off default ), this way if you wanted to use a OTsprite as a parent of child OTSprites there would be no distortion ..

    Come to think of it ..

    I will do this automaticly, as soon as Orthello detetcs that children are put into an OTSprite.

    working on it ...
     
  35. WitherStudios

    WitherStudios

    Joined:
    Oct 31, 2011
    Posts:
    8
    I'm trying to add a new material class to the OT.cs so that when I make a static sprite I can choose my material by clicking one of the little check-boxes. I wanted to use the mobile-particles-multiply material shader. I've been trying to set it up but I keep getting an error: "Material multiply does not yet exist in context." How do I need to properly set up a material shader for use this way? I feel like i'm missing the link of actually calling what exact shader in Unity it is using.

    Any thoughts?
     
  36. mas

    mas

    Joined:
    Nov 14, 2010
    Posts:
    696
    The error message you are getting is strange to me but here are the steps you need to take to expand the material cache system of Orthello..

    1. Create a 'new' material somewhere in your project
    2. Set the name of this new material and link it to the right shader
    3. In your scene's hierarchy or project Orthello>Objects, increase the size of the OT.Materials array in the property inspector. This will give you a new material cache element.
    4. Name your new OT.material element and link it to the new material that you created before.
    5. If you want to use the OTSprite.tintColor or OT.Sprite.alpha value in combination with this new material, you have to enter the right shader field names as well, in your OT.Material element.

      To use this material with a sprite, just assign the OTSprite.materialReference to the name of the OT.Material element you added to the material cache elements.

    http://www.wyrmtale.com/orthello/using-OT#materials

    Kind regards and let me know if it works for you ...
     
    Last edited: Nov 18, 2011
  37. WitherStudios

    WitherStudios

    Joined:
    Oct 31, 2011
    Posts:
    8
    Okay, thanks! That worked. I was going about it all the wrong way, by trying to add my new material to be referenced in the OT.cs script itself....guess I should have known the solution was a lot easier when dealing with Orthello. :)
     
  38. mas

    mas

    Joined:
    Nov 14, 2010
    Posts:
    696
    Nice to hear it worked out for you and that you like Orthello....
     
  39. Agemoi

    Agemoi

    Joined:
    Dec 22, 2011
    Posts:
    10
    I downloaded your package (free version for the moment) and I am pretty happy to see it comes with plenty of commented examples. There is so much to learn from them. Thanks for sharing this :)

    As I just started learning programming I having some difficulties even it is well documented. Is it ok to use the thread to ask "noob" questions about how to do this or that, or how does a piece of code in the examples work?
     
  40. mas

    mas

    Joined:
    Nov 14, 2010
    Posts:
    696
    Sure , ask away .. I will try to answer them in a undestandable way and set you on the right path ...

    What language are you taking a swing at ? C# or JS Javascript.
     
  41. Agemoi

    Agemoi

    Joined:
    Dec 22, 2011
    Posts:
    10
    That's great! Thanks :) I'm trying my hand at C#

    I took a look at Example 5, which creates animated sprites at runtime, and tried to do something similar with static OTSprites to make a little tiled map. Somehow I'm unable to tell the program in which frames should the sprites be. I have this code in a function:

    Code (csharp):
    1. backgroundTile = OT.CreateObject(OTObjectType.Sprite).GetComponent<OTSprite>();
    2. backgroundTile.image = tileAtlas;
    3. backgroundTile.size = new Vector2(64,64);
    4. backgroundTile.depth = 0;
    It works fine but (obviously) renders the sprite with the whole atlas as a texture. So I tried creating a container and setting the frame:

    Code (csharp):
    1. OTSpriteSheet sheet = OT.CreateObject(OTObjectType.SpriteSheet).GetComponent<OTSpriteSheet>();
    2. sheet.texture = tileAtlas;
    3. sheet.framesXY = new Vector2(1, 3);
    4. sheet.sheetSize = new Vector2(128, 256);
    5. sheet.frameSize = new Vector2(64, 64);
    6. backgroundTile.spriteContainer = sheet;
    7. backgroundTile.frameIndex = 0;
    I'm not sure what's wrong, I think I followed the example's steps :(

    There's also a little something which I'm not sure if it's a bug or my mistake. When I try to set a Tint Color in the editor, it automatically moves to pure white. The right slider lets me choose hue, but the sliders bellow or the color square won't move. I can't seem to be able to change it at runtime either, but that may be my lack of knowledge :D
     
  42. mas

    mas

    Joined:
    Nov 14, 2010
    Posts:
    696
    Regarding creating OTObjects (sprirtes) @ runtime.


    Make sure that you have called OT.RuntimeCreationMode() before you create your components. This will set OT.dirtyChecks to true for 10 update cycles and the dirtyChecks need to be active because otherwise some settings that 'normaly' only change when using the editor, like setting a sheet's parameters, will not be handled correctly.

    If this does not work , I advise you to use the example 5 as a code base and slowly make some changes to transform it to the functionality you want to have. You could start by first changing the sheet texture and dimensions, folowed by eliminating the animation , changing it to a sprite etc etc .. If you do this in little steps , and check it a lot, you will see where things fail and you can get it working.

    Regarding the Tint Color

    The tint color can only be changed when a material reference is active that has been configured ( shader fields ) , so that it has some colouring possibility, alpha channel is the same. When you have set the right material reference like 'tint' or 'alpha' (check the materials in the OT object ), you can use the OTSprite's ColorTint and Alpha to set it .. do not try to set it on the material directly.

    GL
     
  43. Agemoi

    Agemoi

    Joined:
    Dec 22, 2011
    Posts:
    10
    Thanks for the quick answer :)

    I'll look for RuntimeCreationMode in the documentation, I'm pretty sure I didn't call that function.

    And making small changes and checking one at a time seems like a wise advise, I'll follow that too :)
     
  44. mas

    mas

    Joined:
    Nov 14, 2010
    Posts:
    696
    You will not find it, because it waqs introduced with the latest version and my documentation is not up to date yet.
    Spank me!

    But the command is OT.RuntimeCreationMode() and has to be called once just before you create/build objects from scratch runtime.
    ( is not needed when creating prototypes that are take-off ready ). If you need to create additional objects from scratch in a later stage in your game or app, you again need to call this method.

    below the code (including comments) from the OT class

    Code (csharp):
    1.     [COLOR="darkgreen"]/// <summary>
    2.     /// We are going to create orthello objects and build them from scratch.
    3.     /// </summary>
    4.     /// <description>
    5.     /// Because normaly, orthello objects are created using the Unity3D editor environment
    6.     /// some property checking and handling only takes place in editor mode. Sometimes however,
    7.     /// we will need that same handling in runtime mode, for example, when building orthello objects
    8.     /// from scratch. Using this method, all property checking and handling will be activated
    9.     /// ( OT.dirtyChecks = true ) for a few (10 should be enough) update cycles.
    10.     /// </description>[/COLOR]
    11.     [COLOR="royalblue"]public static void[/COLOR]  RuntimeCreationMode()
     
  45. apparition

    apparition

    Joined:
    Jan 11, 2012
    Posts:
    120
    Great framework, mas!

    I have a question about sprite positioning. I'm creating a new GameObject to use as a container and adding a bunch of sprites to it as children (at runtime). If I create the sprites first and then translate the container, all the sprites move with the container as expected. If I translate the container first and then create the sprites, the sprites are positioned relative to the screen and not the container.

    Here's a more specific example: I create a container GameObject and translate it by (200, 200). Then I create a sprite positioned at (0, 0) and set its parent to the container. What happens is that the sprite is then positioned at (-200, -200) (i.e. cancelling out the position on the container).

    I would prefer to able to translate the container before I create the sprites and still have the sprites positioned relative to the container. Is this possible?

    I'm new to Unity so go easy on me if I'm missing something obvious. :)
     
  46. mas

    mas

    Joined:
    Nov 14, 2010
    Posts:
    696
    Thanks :)

    At this time the OTObject.position is always world coordinates ( if I am correct .. brrr ). A normal Unity3D gameobject has a Vector3 transform.position and transform.localPosition, this is not implemented in Orthello.

    Because you are working with vectors you could do it like this after creating the Sprites.

    Code (csharp):
    1. // container = (gameObject);
    2. Vector2 containerPosition = container.transform.position;
    3.  
    4. Sprite.position = new Vector2(x,y) + containerPosition;
    This should work as well (after setting parent)

    Code (csharp):
    1.  
    2. Sprite.gameObject.localPosition = new Vector2(x,y);
    3.  
    Hope this helps
     
  47. apparition

    apparition

    Joined:
    Jan 11, 2012
    Posts:
    120
    Thanks for the quick response.

    Setting the localPosition on the sprites works as long as I don't rotate the sprites. As soon as I do the sprites move to (0, 0). :p

    I ended up adding the container position to the position of each sprite. It's a bit inconvenient but it will do.
     
  48. Octo

    Octo

    Joined:
    Dec 30, 2011
    Posts:
    5
    Hello mas,

    I downloaded your package yesterday and I've been enjoying it so far. One mysterious problem popped up, however, and I was wishing you could help me out because I partially located the problem.

    I have a sprite sheet defined with Frames XY (16,16) which means a totaly of 256 frames. Each frame is (49,49). I'm using 3 animations so far from the sheet. animIdle which is frame 48, animRun 80-89, and animJump 112-118. animIdle and animRun work as intended. The problem is exclusive to animJump, even though it is used and set the exact same way.

    Here is the relevant code:
    states is a state machine component. Now the problem comes where animJump is supposed to play. It instead only displays the first frame. When I removed anim.Play() and instead put anim.ShowFrame(113) which is the second frame in the animation, I get an error that says frame index out of range! The sheet has 256 frames. I can play this animation when I disable the animation script and instead assign animJump as the sprite animation. I can also use ShowFrame(113) when I comment out " frameIndex < animation.frameCount" from ShowFrame in OTAnimatingSprite. This indicates to me that there is a problem in animation.frameCount in OTAnimatingSprite but I haven't been able to locate it.

    Any thoughts?
     
  49. mas

    mas

    Joined:
    Nov 14, 2010
    Posts:
    696
    @Octo

    I have no clue at this time ....

    Could you create a package for me that demonstrates the problem and send it to info at wyrmtale dot com?
    I will dive in and try to Fix it.
     
  50. Octo

    Octo

    Joined:
    Dec 30, 2011
    Posts:
    5
    Thank you for the fast reply.

    PM sent with link to project demonstrating the problem.