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.


Topics - hemdanw

Pages: [1]
1
Support / Disappearing TileMaps when Committed
« on: April 16, 2014, 06:42:23 am »
Hi,

I am building a game where I generate a world by instantiating tilemap prefabs from a pool. To create those prefabs, I first create the tilemaps in the hierarchy then drag/drop them into a prefab. If the tilemap in the hierarchy was not committed, the prefabs work fine and I can see the tilemaps when I run the game. If the tilemap in the hierarchy was committed, the prefab appears as an empty tilemap??

I saw this post, but I assume it is a different case from mine... believe I should keep the "prefab" entry under the "Data" tab of the editor set to "none" in my case.

http://2dtoolkit.com/forum/index.php/topic,1900.msg9364.html#msg9364

I also found this posting on your forum:

http://2dtoolkit.com/forum/index.php/topic,1524.msg7361.html#msg7361

If I am instantiating tilemap prefabs, do I still need to call the "LoadSceneAdditive" method... I'm not sure what it is used for exactly. I am not loading any tilemaps across different scenes so maybe I don't need this method??

The last paragraph of the above post also suggested trying "ForceBuild()"? Is it suggesting I keep the prefab tilemaps uncommitted and use "ForceBuild()" to commit them at runtime? Wouldn't this affect performance?

Thanks for the help,
   hemdanw

2
Support / TileMap layers reverting to Layer = 'Default' on re-commit
« on: February 17, 2013, 12:36:54 am »
Hi,

I ran into a problem where TileMap colliders  were not working. After some investigation I discovered that my TileMap layers were reverting back to Layer = 'Default' after being edited and re-committed.

I need the ability to set the TileMap Layer and it's corresponding Tile Map Render Data + children layers all to Layer = 'Walls' to fine control collision behavior. Any chance this will be fixed soon.

I am using 2D Toolkit v1.91 beta 1 with Unity v4.0.1f2.

Thanks,
   hemdanw

3
Support / tk2d sprites not dynamic batching
« on: February 13, 2013, 12:37:02 pm »
Hi,

Using v1.80 (final), I noticed that my tk2d sprites were not dynamic batching. They are all local scale (1,1,1), not sure what other parameters to check. But, my tk2d animated sprites were all dynamic batching fine.

As an experiment, I converted each tk2d sprite into an animated sprite, duplicating the image twice (I think there's an optimization that catches same image - so I tricked it into thinking they were different images) and creating 2 identical animation frames so it looks like the original sprite. Interestingly enough, my draw calls dropped from ~100 draw calls to about ~20 draw calls. I am assuming that the animation is more CPU intensive than a regular sprite - so I would like to get dynamic batching working with regular sprites. Is there a bug with tk2d sprites preventing dynamic batching or am I doing something wrong?

Thanks,
   - hemdanw

4
Support / tk2dCamera and BC Gestures Library
« on: November 25, 2012, 08:47:57 am »
Hello,

We recently purchased and downloaded the BC Gestures Library, hoping to use it to control our player character for a 2D game using tk2dCamera.  For this we were interested in the DragGesture script to do relative motion on a touchscreen.

However, we ran into some issues due to interactions with the tk2dCamera. The tk2dCamera applies a transformation to the camera in order to achieve pixel perfect rendering.  This appears to have interacted with the BC Gestures Library and the result is that the draggable object motion was very exaggerated and wildly uncontrollable, but works correctly when the tk2dCamera script is removed.

Experimenting with ways to fix this while keeping the tk2dCamera script, we appear to have achieved a partial fix in BaseGesture.cs ScreenToWorldPosition(), we modified the following:

Ray ray = theCamera.ScreenPointToRay( screenPos );

To the following:

Ray ray = theCamera.ScreenPointToRay( theCamera.WorldToScreenPoint(screenPos) );

This seems to have achieved a partial fix, however the draggable object in our game scene only scrolls halfway through the screen when we drag the mouse across the entire screen.  We were wondering if you could suggest a more appropriate fix. Are the transformations made by tk2dCamera all covered by theCamera.WorldToScreenPoint or are there more transformations that need to be accounted for? Or is it an entirely different transformation?

Thank you,
    hemdanw

5
Support / TileMap bug with SpriteCollection containing 2+ sprite sheets
« on: August 04, 2012, 04:36:36 pm »
Hi,

Hopefully I am not doing something wrong here, but I was able to get this problem more than once.

When I create a sprite collection with 1 sheet and use it in a tilemap everything worked.

When I create a sprite collection with 2 tile sheets (1 for background tiles, and 1 for foreground collidable tiles), I started getting the error below. I split my tiles across 3 tile sheets, foreground box trimmed collidable, background, and a tile sheet for tiles that will be shared across scenes. It seems that for the shared tile sheet, if I insert it into the sprite collection I would be replicating the tiles into multiple atlases which would be inefficient... The alternative solution would be to accept multiple sprite collections in the tile map, but that does not seem to be supported at the moment??

More information about my setup. I am using tk2dCamera. Adding a sprite collection with 2 sprite sheets to a tilemap breaks the tilemap renderer. Both tile sheets are made of 16 tiles across x 16 tiles top-to-bottom, with each tile being 64x64 pixels. This required expanding my tile sheet atlas to 2048 (but I'm still using 1 atlas). When I added the 2nd tile sheet to the sprite collection it appeared correctly, and the all elements appeared in the TileMap/Paint editor, but the TileMap no longer appeared in the scene and no tiles can be added. I noticed the error below. Removing the 2nd tile sheet from the sprite collection did not fix the issue.

Other information, I'm using 2d Toolkit, v1.76 final + patch 1 with Unity 3d v 3.5.4f1 on a Win64 system.

Thanks,
   hemdanw

MissingReferenceException: The object of type 'Material' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
tk2dEditor.BrushRenderer.DrawBrush (.tk2dTileMap tileMap, .tk2dTileMapEditorBrush brush, Single scale, Boolean forceUnitSpacing, Int32 tilesPerRow) (at Assets/TK2DROOT/tk2d/Editor/Tilemap/tk2dTileMapBrushRenderer.cs:223)
tk2dTileMapEditor.DrawSettingsPanel () (at Assets/TK2DROOT/tk2d/Editor/Tilemap/tk2dTileMapEditor.cs:767)
tk2dTileMapEditor.OnInspectorGUI () (at Assets/TK2DROOT/tk2d/Editor/Tilemap/tk2dTileMapEditor.cs:1020)
UnityEditor.InspectorWindow.DrawEditors (Boolean isRepaintEvent, UnityEditor.Editor[] editors, Boolean eyeDropperDirty) (at C:/BuildAgent/work/d9c061b1c154f5ae/Editor/Mono/Inspector/InspectorWindow.cs:888)

Pages: [1]