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 - 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
Releases / Re: 2D Toolkit 2.1 beta 1
« on: July 14, 2013, 06:20:06 pm »
Hi,

This code no longer works:

screenHeight = (int)tk2dCameraScript.ScaledResolution.y;

It gives the following error:
error CS1061: Type `tk2dCamera' does not contain a definition for `ScaledResolution' and no extension method `ScaledResolution' of type `tk2dCamera' could be found (are you missing a using directive or an assembly reference?)

I could not find any mention for this in the migration guide??

Thanks,
   hemdanw

3
Support / Re: tk2d sprites not dynamic batching
« on: April 22, 2013, 04:40:55 am »
Hi,

I have an update on what was happening in my particular case and what was preventing dynamic batching on my tk2dsprite objects... though I don't quite fully understand it yet.

I had a component on my prefab that had 2 shader class member variables. The variables were being initialized in the start method:
flashShader = Shader.Find ("BlendAdditiveVertexColor");
origShader= renderer.material.shader;

I was intending to use these shaders in the code, but had not implemented that part of the code yet, so the variables were assigned but never used. Interestingly enough, even though these variables were NOT being used anywhere else in the component, this simple initialization somehow resulted in dynamic batching on tk2dsprite's to break. Having the same component on tk2d animated sprites did not break dynamic batching.

Thanks,
 - hemdanw

4
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

5
Support / Re: tk2d sprites not dynamic batching
« on: February 14, 2013, 12:30:31 am »
Hi,

I'm using unity 4.0.1f2.

I'm displaying ~100 copies of the same sprite, I tested overlapped and non-overlapped - no difference. The draw calls goes up by exactly 100 to 120 draw calls. When I made it an Animated Sprite, the draw calls fell to 20 with both overlapping and non-overlapping scenarios... it's definitely not batching at all...

Any suggestions to further test this out are welcome.

Thanks,
   - hemdanw

6
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

7
Releases / Re: 2D Toolkit 1.91 beta 1
« on: February 12, 2013, 01:22:21 pm »
Hi,

I ran into one incompatibility issue with v1.91 beta, but was easily fixable. Everything else worked well.

I'm assuming that now I need to go through the script component to get to the collection data (which I tested and works with 1.91 beta - but not sure if you were planning to deprecate that too, seems that the deprecation warning is only for "set", not "get")?

I need a "collection" to use with SwitchCollectionAndSprite(), example:
mySprite.SwitchCollectionAndSprite(mySprite.collection, id2);   

Thanks,
   hemdanw

8
Support / Re: tk2dCamera and BC Gestures Library
« on: November 26, 2012, 03:33:02 am »
Hi Unikron,

Thank you for the quick response. You were right, I tried your tk2dCamera example with the DragGesture script and indeed it worked. The problem turned out to be due to camera position updates in LateUpdate(). I worked around the problem and everything works now.

Thanks again,
   hemdanw

9
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

10
Support / Re: Expanding TileMap's Alt to copy from all layers
« on: October 15, 2012, 12:46:42 am »
Hi,

Has this feature been added yet? Is there a way to add support for selecting multiple layers for copy/paste even if it is a temporary workaround in code until full support is made available?

Thanks,
   hemdanw

11
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]