Hello Guest

Author Topic: 2D Toolkit 1.70 beta 2  (Read 25792 times)

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
2D Toolkit 1.70 beta 2
« on: April 16, 2012, 12:20:40 am »
Improvements to tilemap editor and other bugfixes / features. 1.70 is shaping up to be the biggest update yet.

BUGFIX: Button class events weren't firing correctly
FEATURE: Custom sprite geometry - Draw custom geometry to define the shape of a sprite. Save fillrate, and lets you use solid shaders for even more performance. Also, it will now be possible to do ortho / hex tiles efficiently (no more tons of overlap and blending is no longer essential)
FEATURE: Solid variants of shaders
BUGFIX: Automatically build tilemap when spritecollection is changed
FEATURE: You can assign different materials to various sprites within a sprite collection. Useful for mixing solid and transparent objects within the same sprite collection (these won't be able to be batched, but is essential for tilemapped games where a large number of tiles can be solid.
FEATURE: More layer options for tilemap, you can associate a Unity "Layer" to a tilemap layer for use with the parallax script.
FEATURE: Anchors on sliced sprites
TILEMAP: Tiles on tilemap can be ordered, overlapped tiles are now supported again.
TILEMAP: tilemap.Build() function, does an incremental build of the current tilemap. Call at the end of the frame after changing any tilemap contents to rebuild the changed cells.


NOTE: If you are using JavaScript, you will need to move the tk2dSpriteCollectionInterfaces class to the same location as tk2dSprite
« Last Edit: April 16, 2012, 12:23:39 am by unikron »

fsadeq

  • 2D Toolkit
  • Sr. Member
  • *
  • Posts: 353
    • View Profile
Re: 2D Toolkit 1.70 beta 2
« Reply #1 on: April 16, 2012, 02:47:14 am »
These updates are AWESOME, thanks!

Small thing, I'm noticing I can no longer set a negative value for the depth field in the layer options of the tilemap. Is this a bug, or did you remove this for some reason?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2D Toolkit 1.70 beta 2
« Reply #2 on: April 16, 2012, 10:28:57 am »
These updates are AWESOME, thanks!

Small thing, I'm noticing I can no longer set a negative value for the depth field in the layer options of the tilemap. Is this a bug, or did you remove this for some reason?

Thats an intentional change. With the old method, it was possible to position a layer further back than a previous layer. Now the z value is just a distance from the previous layer, and the order of layers determines cumulative distance from the base layer. That way, the "Move up & down" buttons actually do something.

spartan

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: 2D Toolkit 1.70 beta 2
« Reply #3 on: April 16, 2012, 02:32:49 pm »
I've detected a small bug, Click con Set Up for Javascript. It is missing to move "tk2dSpriteCollectionInterfaces" to Plugins/tk2d/Sprites

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2D Toolkit 1.70 beta 2
« Reply #4 on: April 16, 2012, 02:43:15 pm »
Thanks for that - I will add that.

dnv190

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: 2D Toolkit 1.70 beta 2
« Reply #5 on: April 18, 2012, 11:23:43 am »
I've detected interesting  bug with tile map editor.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2D Toolkit 1.70 beta 2
« Reply #6 on: April 18, 2012, 02:03:58 pm »
Thats an interesting bug indeed. I can think of a reason why that would happen - the size of each tile is determined by the size of the first valid tile (probably the grass tile). If your red texture has a lot of empty space (i.e. texture comprising of area on top, or something like that, then this could happen).

I've got a task in my list to fix the tile preview, etc, but its quite low priority. Can I ask why the sizes are so different? If they are that different would there be any benefit in using a tile editor? I just need to understand the requirements to work out if there is an urgent need to reshuffle priorities.

flying_hamster

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: 2D Toolkit 1.70 beta 2
« Reply #7 on: April 18, 2012, 04:51:03 pm »
Were you able to implement being able to have Tilemaps in prefabs in this update?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2D Toolkit 1.70 beta 2
« Reply #8 on: April 18, 2012, 06:22:56 pm »
No it isn't, unfortunately. It will be in the next beta - hopefully this weekend.

I implemented something, but ultimately wasn't happy with how it worked. I'm thinking of something far more efficient to solve this problem, but obviously requires a bit more work. Basically the proposed workflow is as follows.

1. You create a separate scene, and create a tilemap in there, ticking the Export To Prefab option.
2. Save a prefab into a directory using the newly revealed buttons. This will save the file in there, and create a Meshes directory with the prefab name.
3. In your other scenes, you simply drag this prefab into the scene and use it in whatever way you'd like.

The important thing is that the prefab is just a mesh, and doesn't have any overheads of using it in game (apart from what a normal mesh would). This means that its super efficient to instance these, and all the usual stuff that applies, just works. The source scene doesn't need to be distributed with your game either.

The one downsides are:
* You can't edit your object "live" in the active scene.
* If the atlas changes, you will need to load your source scene and click rebuild all tilemaps to apply the changes. I'll perhaps work on some form of auto-build in the future, but the approaches I can think of now will not scale well with large numbers of sprites, and ultimately scalability is really important.
* In my tests I'm putting multiple tilemaps into the same scene so one click of "Rebuild all" will update all associated meshes.

What are your thoughts on this? Would this suit what you're trying to do?

I possibly still have time to change the workflow to accomodate other things, so this isn't final

flying_hamster

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: 2D Toolkit 1.70 beta 2
« Reply #9 on: April 19, 2012, 03:56:48 pm »
I cant say it sounds ideal to have a separate scene to create the tilemaps in order to have them in prefabs. However it also doesn't sound like the worst possibility. I assume that you cant delete the tilemap in your separate scene once your done if you ever want to edit it again?

I do like the fact that the prefab is just a mesh and not the entire tilemap system to deal with in every scene. Especially since there would be multiple.

Over all I think it can suit well enough.

dnv190

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: 2D Toolkit 1.70 beta 2
« Reply #10 on: April 19, 2012, 04:50:27 pm »
it was just test ). No practical usage of tile editor.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2D Toolkit 1.70 beta 2
« Reply #11 on: April 19, 2012, 07:23:04 pm »
I cant say it sounds ideal to have a separate scene to create the tilemaps in order to have them in prefabs. However it also doesn't sound like the worst possibility. I assume that you cant delete the tilemap in your separate scene once your done if you ever want to edit it again?

I do like the fact that the prefab is just a mesh and not the entire tilemap system to deal with in every scene. Especially since there would be multiple.

Over all I think it can suit well enough.

I've thought of one possible way to work around this (i.e. auto build when changed). I will investigate a bit further before committing to a decision.

edwood_grant

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: 2D Toolkit 1.70 beta 2
« Reply #12 on: April 21, 2012, 07:00:04 pm »
Hello, been testing the tilemap features and I'm super happy about it n_n.

However I do hav an issue and I don't know how can you handle it..

Right now I'm using the tile system rotated (in the X-Z plane). And I just rotated both objects on the ground. And it work fine, except that when I pres ctrl-z the tiles rotate again to the default position...

Maybe there's is a chance that you could be able to choose the plane you want to edit the tiles?... or maybe that you can rotate the tiles without any inconvenient...

Thanks a lot.
Italo F. Capasso B.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2D Toolkit 1.70 beta 2
« Reply #13 on: April 21, 2012, 08:25:27 pm »
Hello, been testing the tilemap features and I'm super happy about it n_n.

However I do hav an issue and I don't know how can you handle it..

Right now I'm using the tile system rotated (in the X-Z plane). And I just rotated both objects on the ground. And it work fine, except that when I pres ctrl-z the tiles rotate again to the default position...

Maybe there's is a chance that you could be able to choose the plane you want to edit the tiles?... or maybe that you can rotate the tiles without any inconvenient...

Thanks a lot.
Italo F. Capasso B.

This is because the objects get recreated at that point. I'm going through and making this not happen for a future release for other reasons, hopefully that will fix your problem too.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2D Toolkit 1.70 beta 2
« Reply #14 on: April 24, 2012, 07:01:07 pm »
Thats fixed - will be in the next beta due out any time now. Just testing some additional features & changes which went in.