Hello Guest

Author Topic: Is this for me?  (Read 4585 times)

Malsanity

  • Newbie
  • *
  • Posts: 1
    • View Profile
Is this for me?
« on: September 11, 2015, 02:41:56 pm »
I have scenes with hundreds of thousands of sprites.

A 256x256x10 grid of tiles that could potentially all be sprites (maps are procedurally generated). Obviously, this is a huge performance drain, so other devs recommended me I use this toolkit.

What I need to know is if I can use any feature of the toolkit to blend/pack/combine all these sprite into one. Please note that as they are cells, they will chance appearance over time. Think of a map, then add weather effects (dirt turns white), resource management (stone depletes, changing sprite), etc. It cannot be a pre-baked image as it's always made new with every new game.

Can I do this with this toolkit? If so, how?

Thanks!

LaserDinosaur

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 38
    • View Profile
Re: Is this for me?
« Reply #1 on: September 14, 2015, 06:46:03 pm »
You could use the tilemap feature to do this: Once all your tiles are added into the scene, tk2d 'chunks' your tiles into edge collider groups so that you don't cause the physics engine to have a complete fit. Noble Weapons has a video over on youtube that covers the settings pretty well.

If you want your tiles to change over time, you can set them as Data Tiles which just point to a prefab (see the last item in the tutorial). That prefab can have an animator attached to it and a script that changes it's tile given certain weather conditions.

However, I don't know for certain how well the performance scales if you have thousands of tiles in a scene all with their own animators and scripts attached, but a 256x256 grid isn't really that big (not sure how your fitting hundreds of thousands of tiles in there). Also, you put your measurement as 256x256x10 - does that mean your doing a 3d box full of tiles more like Minecraft?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Is this for me?
« Reply #2 on: September 15, 2015, 02:40:29 pm »
@ Malsanity

The tilemap feature could help, but you seem to want to change the actual tiles themselves - there is no support for that in tk2d.