Hello Guest

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - GarthSmith

Pages: [1]
1
Support / Tile Map: Per tile parameters?
« on: August 22, 2013, 12:09:59 am »
Hello!

I'm continuing to dive into the great tile map system in 2D Toolkit. Is there a way for the tile map to handle requirement #2? Using 2D Toolkit 2.1.

1) Level Designer can place Treasure Chest prefabs in a tile map. (I already know 2D Toolkit supports placing of prefabs!)
2) Level Designer can assign a string to each Treasure Chest prefab describing what item can be looted from it. Eg: Treasure Chest #1 gets string "sword". Treasure Chest #2 gets string "heart".

If this is not possible, then I can set up a system for the level designer to place interactive objects separate from the 2D Toolkit Tile Map. I just don't want to duplicate any work! I apologize if this has been asked a million times. Thanks again for 2D Toolkit!



2
Support / Re: Intended method to instantiate a tile map prefab?
« on: August 21, 2013, 10:35:03 pm »
We plan on having about 100 smallish "rooms" in our game world. As the player travels, we will be destroying the old room and instantiating a new one.

We hope to keep this room-changing time to under a second. We have a transition that occurs between room changes that should hopefully hide any load times. If performance becomes a problem, I'll have the scenes and LoadLevelAdditiveAsync method as a backup plan.

Thanks for the reply!

3
Support / Intended method to instantiate a tile map prefab?
« on: August 21, 2013, 10:02:54 pm »
Hello!

Is it intended behavior that ForceBuild() is required to display a tile map? This is how I am getting a tile map to display.

Code: [Select]
public tk2dTileMap m_tileMapPrefab; // Pre-configured tile map.

void Start() {
    tk2dTileMap instantiatedTileMap = Instantiate(m_tileMapPrefab) as tk2dTileMap; // Creates a GameObject, but tile map is not rendered.
    instantiatedTileMap.ForceBuild(); // Tile map is now visible.
}

4
Support / Re: Tilemap - Change sprite collection
« on: August 21, 2013, 08:12:42 pm »
Hello!

I'm no 2D Toolkit expert, but I have actually been looking though the TileMap code. One of the things that we may do further along in our project is "reskin" a TileMap.

It looks like each tile in the TileMap data is stored using the SpriteID integer indexes. So if you go through your two SpriteCollections and see that each corresponding sprite share the same integer SpriteID, then you should be good to go. The string "name" of each sprite is not enough.

I have not figured out a clean way to reassign the integer SpriteIDs in a SpriteCollection. It looks like it is determined by the order the sprites are added to the collection.

Please take this with a grain of salt as I haven't gotten far enough to actually test swapping in and out SpriteCollections.

 - Garth

5
Hello!

Thanks for making 2D Toolkit! It has saved us a ton of development time.

I have a SpriteCollection called "WayTooBigSpriteCollection". Under Settings -> Atlas Settings, if I check "Multiple Atlases" I get a warning:
"Sprite collections with multiple atlas spanning enabled cannot be used with the Static Sprite Batcher, Fonts, the TileMap Editor and doesn't support Sprite Dicing and material level optimizations."

All of our tiles cannot fit on a 1024x1024 atlas. So I made "WayTooBigSpriteCollection" which spans 5 atlases and ran some preliminary tests. I see no problems! I did not test the material level optimizations.

So my questions:
  • At first glance, the TileMap editor seems to support the "WayTooBigSpriteCollection" despite the warning. Is there some gotcha that'll come back to haunt me?
  • If I shouldn't use a multiple atlases SpriteCollection, is there a way to use more than one SpriteCollection in a tile map?
I'll think about material optimizations another day.

Thanks again for all your great work!
 - Garth


6
Support / Re: Mobile game - Too many atlases?
« on: August 12, 2013, 10:24:35 pm »
What devices are you targeting? This sounds similar to one of the first platformers I programmed.

We needed to run on the iPad 1 which has 256 MB(!) of memory and an old graphics chip. I quickly found out that full screen textures and full screen transparencies completely killed performance on the iPad 1, if it didn't crash from being out of memory first. We had no problems with the iPad 2 in comparison.

This was before I was using 2D toolkit and we ended up having to have a high quality and low quality version of all sprites in the game, and we redid our backgrounds to use meshes instead of a transparent shader.

Pages: [1]