Hello Guest

Author Topic: 2D Toolkit 1.90 beta 1  (Read 18445 times)

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
2D Toolkit 1.90 beta 1
« on: January 10, 2013, 04:35:06 pm »
As with all beta releases, exercise caution when upgrading. Make sure you have a back up!

Features:
- New sprite animation editor. You can preview animations and it has a really flexible plugin system. Data is (should be) 100% compatible.
- Documentation isn't done yet but I expect it to be in the next few days.

Bugfixes and improvements:
- New sprite thumbnail cache system, much much more efficient and doesn't care or use source images even in the inspector.
- Runtime sprite collection warns when shader is inaccessible (due to not being in resources) instead of displaying a black quad
- Script execution order. All tk2d scripts execute early, hopefully earlier than any user scripts. Avoids ambiguity and situations where awake happens after user script awakening causing nasty runtime issues.
- "1:1" fix, wasn't working in certain situations
- tk2dCamera has internal zoomScale which can be used to zoom into the screen
- tk2dIndex copes with uncommitted fonts
- tk2dTextMesh InitDictionary bugfix
- Material id corrected with multiple atlases
- Runtime sprite collection code creates unset collider instead of None.
- Creating a new tk2dCamera will set camera.main if one doesn't exist already.
- Collidertype is Unset by default instead of None.
- Fixed tangent generation for sprites.
- Shaders use float texcoord instead of half, fixes a filtering/precision issues on iOS (PVR)
- Blank sprite / animation names not displayed in the selection popup
- When creating and deleting entries in a sprite collection, surplus files are deleted instead of being orphaned, eg. creating and deleting a font will delete the font prefabs.
- Error when sprite collection is in a resources directory, warn when sprite source textures are in a resources directory.
- Physically double sided sprite option instead of relying on a double sided shader.


fsadeq

  • 2D Toolkit
  • Sr. Member
  • *
  • Posts: 353
    • View Profile
Re: 2D Toolkit 1.90 beta 1
« Reply #1 on: January 10, 2013, 05:20:21 pm »
Awesome. The new animation editor rules. Small bug I noticed: In the animation editor, the mouse wheel zoom in/out seems to be reversed. Scrolling down zooms in the sprite, and vice versa.

marceloSpiezzi

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 35
    • View Profile
Re: 2D Toolkit 1.90 beta 1
« Reply #2 on: January 10, 2013, 07:45:32 pm »
Really awesome the new Animation Editor, it'll make things lot easier!
Just the wheel zoom that is also reversed here.


and now my problem creating Animated Sprites from the menu has stopped! =]
« Last Edit: January 10, 2013, 07:50:34 pm by marceloSpiezzi »

mfcas

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: 2D Toolkit 1.90 beta 1
« Reply #3 on: January 10, 2013, 08:10:53 pm »
When I change the animation I want to currently edit I have to click play or click on a frame to display it, shouldn't it display the first frame immidiately after an animation is selected? Also when clicking play on an animation that is a 'single', it doesn't display.

When stopping an animation it disappears entirely, shouldn't it simply stop?

We still have to increase FPS to increase a frame length precision, is it done for performance reasons?

When adding new frame (clicking the '+' icon) a new frame is a copy of last frame, now that we can select frames can't the selected frame be repeated?

Please add a color picker for the background as an option.

One more thing, the new editor doesn't work well with monodevelop - it doesn't get the syntax here:

DrawFrameGroupEx(r, clip, fg,
               highlighted: currrentFrameGroup == state.selectedFrame,
               showTime: currrentFrameGroup == state.selectedFrame,
               playHighlight: clipTimeMarker >= fg.startFrame && clipTimeMarker < fg.startFrame + fg.frames.Count);

It works without 'highlighted:' and so on though.
« Last Edit: January 11, 2013, 03:29:53 pm by mfcas »

meta87

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: 2D Toolkit 1.90 beta 1
« Reply #4 on: January 12, 2013, 07:57:51 am »
Awesome this looks like a great update. Thanks.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2D Toolkit 1.90 beta 1
« Reply #5 on: January 12, 2013, 01:12:39 pm »
When I change the animation I want to currently edit I have to click play or click on a frame to display it, shouldn't it display the first frame immidiately after an animation is selected? Also when clicking play on an animation that is a 'single', it doesn't display.
There is a bug there with handling animations with "single" set.


When stopping an animation it disappears entirely, shouldn't it simply stop?
I'm not sure . What happens then when play is pressed again? Restart? Wouldn't it be confusing? If it stopped on the last played frame, I'd expect it to resume from then. The way I / other people I work with use the play functionality it is just to tweak the animation - with looped animations, we just leave it running while editing it, and with one-shots, we just cycle tweak, press enter to play. Adding one more state (rewind, pause, play) would just slow things down.

We still have to increase FPS to increase a frame length precision, is it done for performance reasons?
Yes, it is far more efficient working this way. I'm considering adding "1. resample to 30/60hz. 2. optimize to best framerate" which will effectively let you tweak frame times with almost all freedom.

When adding new frame (clicking the '+' icon) a new frame is a copy of last frame, now that we can select frames can't the selected frame be repeated?
That just adds one more frame you can change the sprite. You don't need to use the + button to extend the length of the current frame. Perhaps I should pick another sprite in the sprite collection to make it more obvious, or add a "no frame set" state.

Please add a color picker for the background as an option.
This was in the todo, but is far lower priority than most things. If you need something in the interim, you can tweak GridTypes and Init() in tk2dAnimationPreview.cs

One more thing, the new editor doesn't work well with monodevelop - it doesn't get the syntax here:
DrawFrameGroupEx(r, clip, fg,
               highlighted: currrentFrameGroup == state.selectedFrame,
               showTime: currrentFrameGroup == state.selectedFrame,
               playHighlight: clipTimeMarker >= fg.startFrame && clipTimeMarker < fg.startFrame + fg.frames.Count);

It works without 'highlighted:' and so on though.
This is likely because of the annoying .net framework version bug in MonoDevelop. You can work around it there by changing the .net version in the MD project, but I will also change the syntax in the file so it complies with the default settings. Thanks for pointing it out.

MaaS

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 39
    • View Profile
Re: 2D Toolkit 1.90 beta 1
« Reply #6 on: January 12, 2013, 03:33:50 pm »
Hi!

Great great work with the Animation Editor! :) Just some suggestions for it...

- The timeline has no "interactive cursor" in it... it exists, but it's only visible when playing (the red line), but lots of time when working with timelines you drag that line around to see a part of an anim or position yourself (not at the start of a keyframe, which I can do it by clicking a keyframe, but at the exact time position of a timeline).
- Timeline zooming in/out... sometimes you need to see more without scrolling :P
- It seems you can move inside the timeline with the cursor left/right... i would add also ";"=left and "."=right (commonly used on video editing programs)
- Multi-select frames for moving them... and Copy & Paste them... maybe it's already there but i dont know how to do it :P
- I would also add a sprite palette to chose from... because if you have a collection with 50 poses of a character its a bit harder to select the one you want from a combobox...

Those would be the main ones......

But if possible (please pretty please! hehe :))... I would love to see another push to the animation system with "moving" sprites (without bones/animated mesh renderer to enable batching) and multi-sprite animations...

It seems that when an animation is playing, at each keyframe, a poly of the appropriated size is created with the frame coordinates from the collection atlas, and positioned in the world based on it's anchor relative to the gameobject position (and the gameobject coords doesn't change at all). What i'm suggesting is the same, but position the sprite using the anchor position/rotation at each frame (not the anchor defined at the sprite collection). In the animation editor then, if we want, we could reposition/rotate a frame. Another addition to this would be, to be able to tween the position and rotation of a frame with the next one.

With that in mind... the multi-sprite animation, would be just adding more tracks to the Animation editor timeline, as I think it's very common to have an character divided in parts... so you can have an Sprite Collection with legs, another one with the rest, and make an animation based on both, one track for leg sprites, another track for the rest of the body...

At the end, when playing an animation, we would have at each frame, a poly of each track keyframe, with the correct size and UV coords for it frame, positioned and rotated based on the sprite position/rotation on each frame from the animation editor.

I hope you like the idea and I explained it like it's not impossible hehehe :P  Keep the great work and thanks!! :D

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2D Toolkit 1.90 beta 1
« Reply #7 on: January 13, 2013, 02:18:41 am »
- The timeline has no "interactive cursor" in it... it exists, but it's only visible when playing (the red line), but lots of time when working with timelines you drag that line around to see a part of an anim or position yourself (not at the start of a keyframe, which I can do it by clicking a keyframe, but at the exact time position of a timeline).
I feel as though that adds a lot of complexity to what essentially is a really simple frame list editor. I understand why you'd need it for the request further down though :)

- Timeline zooming in/out... sometimes you need to see more without scrolling :P
You can do that already, click on a frame, control mousewheel or 2 finger scroll on mac. Wanted to put a slider, but I cant find any where, interface is too cluttered already. Maybe a settings panel later.

- It seems you can move inside the timeline with the cursor left/right... i would add also ";"=left and "."=right (commonly used on video editing programs)
Easily added, but ; and . aren't next to each other on my keyboard. On my keyboards (US layout) its ; and '. Maybe I could add some advanced options somewhere. Hmmm... For now look for KeyCode.LeftArrow in tk2dSpriteAnimationClipTimelineEditor.cs, and modify it so it reads:
case KeyCode.LeftArrow: case KeyCode.Semicolon: newFrame--; break;

- Multi-select frames for moving them... and Copy & Paste them... maybe it's already there but i dont know how to do it :P
This is intentionally not there as it would take significantly more work, and I have a few larger features I plan on doing which are higher priority.

- I would also add a sprite palette to chose from... because if you have a collection with 50 poses of a character its a bit harder to select the one you want from a combobox...
Coming soon in an update - this was planned for the first beta, but I didn't have time to get around to it.

Those would be the main ones......

But if possible (please pretty please! hehe :))... I would love to see another push to the animation system with "moving" sprites (without bones/animated mesh renderer to enable batching) and multi-sprite animations...

It seems that when an animation is playing, at each keyframe, a poly of the appropriated size is created with the frame coordinates from the collection atlas, and positioned in the world based on it's anchor relative to the gameobject position (and the gameobject coords doesn't change at all). What i'm suggesting is the same, but position the sprite using the anchor position/rotation at each frame (not the anchor defined at the sprite collection). In the animation editor then, if we want, we could reposition/rotate a frame. Another addition to this would be, to be able to tween the position and rotation of a frame with the next one.

With that in mind... the multi-sprite animation, would be just adding more tracks to the Animation editor timeline, as I think it's very common to have an character divided in parts... so you can have an Sprite Collection with legs, another one with the rest, and make an animation based on both, one track for leg sprites, another track for the rest of the body...

At the end, when playing an animation, we would have at each frame, a poly of each track keyframe, with the correct size and UV coords for it frame, positioned and rotated based on the sprite position/rotation on each frame from the animation editor.

I hope you like the idea and I explained it like it's not impossible hehehe :P  Keep the great work and thanks!! :D
Definitely not impossible, but this isn't planned for any updates in the immediate future. There are a few subsystems I need to sort out / update befofe I could even consider something like this. I would ultimately like to pursue something like this, with a different focus to SmoothMoves and other similar plugins.

MaaS

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 39
    • View Profile
Re: 2D Toolkit 1.90 beta 1
« Reply #8 on: January 14, 2013, 11:53:43 am »
Thanks for your reply :)

About the keyboard layout, i'm sorry I wrote it wrong... it wasn't semicolon and dot, I meant comma and dot= "," and "."... I use Spanish layout, but it seems they are at the same place in the US layout, next to "M".

I'm working with beta 1 and so far I didnt find anything wrong :D... but I've been thinking about other things... I'm dealing right now with tilesets... I have seem somewhere in the forum that there is a source patch to activate normal creation on tiles (for lighting), I would add that in a check setting. And also... thinking about tiles, it would be great to be able to flip V and H a tile individually or a portion of a map. Maybe the easier way would be to be able to duplicate a sprite in a sprite collection... using the same source and UV coords, but with different settings (name, collisions, etc), and add to this settings a flip vertical and horizontal... this way, in a tileset atlas (and sprite collection) with a ramp up, you could have ramps up and down only flipping them, but using half the texture space, and this way there would be both, ramp up and ramp down, on the tileset palette :)

fsadeq

  • 2D Toolkit
  • Sr. Member
  • *
  • Posts: 353
    • View Profile
Re: 2D Toolkit 1.90 beta 1
« Reply #9 on: January 15, 2013, 05:50:55 pm »
Love the animation editor, much easier to use. Seems to be a bug with the framerate setting though. Editing the framerate and committing has no effect on the clip after the initial commit. The first time it works as expected, but if I want to edit the framerate, nothing happens. This is for the actual animated sprite object, not the editor. The preview in the editor runs at the desired framerate.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2D Toolkit 1.90 beta 1
« Reply #10 on: January 15, 2013, 06:44:43 pm »
Is this while the game is running? If so, is it fixed after restarting?

fsadeq

  • 2D Toolkit
  • Sr. Member
  • *
  • Posts: 353
    • View Profile
Re: 2D Toolkit 1.90 beta 1
« Reply #11 on: January 15, 2013, 09:43:37 pm »
Nope, when it's out of play mode.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2D Toolkit 1.90 beta 1
« Reply #12 on: January 17, 2013, 11:15:53 am »
Found the issue and solved it, though I'm not particularly happy about the current solution, it'll have to do for now. I might get some time to polish this up for the final release.

It was due to the internal lists getting serialized and deserialized when Play was pressed - and internal references were all getting mixed up - the clip you were editing wasn't the clip that was in the database to get saved. This was affecting all clip settings including frames.
« Last Edit: January 17, 2013, 11:17:25 am by unikron »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2D Toolkit 1.90 beta 1
« Reply #13 on: January 18, 2013, 05:26:15 pm »
@fsadeq - the problem has been resolved properly now.

I've posted some docs here:
Animation editor reference: http://unikronsoftware.com/2dtoolkit/doc/reference/sprite_animation_190.html
Animation editor operators: http://unikronsoftware.com/2dtoolkit/doc/advanced/animation_editor_operators.html

Check out animation editor operators - it is really flexible and will let you extend the editor without having to change core tk2d source code, essentially a plugin system for the editor.