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 - cloudcamaleoniv

Pages: 1 [2]
16
Support / Re: General mobile performance
« on: June 07, 2013, 09:57:38 pm »
Thanks guys, you were a lot of help!! These tips really improved my game performance!

17
Support / General mobile performance
« on: June 03, 2013, 08:26:06 am »
Hello again, well... I'm designing for mobile, but I don't know exactly the best methods to improve performance on these devices.

Things like "enable or disable dynamic batching on 'Other Settings'"?

Inside collection settings, there's a lot of options, like Filter Mode and Compression.

I wanted to know IF there are good practices for everyone designing mobile games, generally speaking.

Thanks.

18
Support / Re: SetSprite, polygon colliders not updating
« on: May 27, 2013, 12:27:07 am »
Oh hell, that was great! I used my SpriteCollectionData as a reference to the script and iterate throught its spriteDefinition array on the Start() method to create the references. Now everything is running smoothly.

Thanks man!

19
Support / Re: SetSprite, polygon colliders not updating
« on: May 26, 2013, 10:10:09 pm »
Thanks, but the obstacles are totally random. Like.... uhn.... like Jetpack Joyride. So, creating static sprite batchers are not an option. (at least not by what I understood)

You've said that updating mesh colliders is slow. But even so, how can I do this with the sprites? I reached out an array of Vector3 objects within each Sprite, describing each of its vertices position, but I couldn't pass this information to the mesh.

Anyway, I'll explain my issue again. I have a tk2dSprite prefab. This tk2dSprite is linked with a SpriteCollection that have 5 sprites, each one with a differente "polygon collider". I want to instantiate this tk2dSprite prefab using a random sprite of the collection. What is the best way to achieve this? Keeping the polygon colliders intact?

Thanks.

20
Support / SetSprite, polygon colliders not updating
« on: May 24, 2013, 10:19:58 pm »
First, sorry for my "questions spam". I've got A LOT of questions cos I'm newbie with unity and 2dtoolkit. Most of them I find easily in the forums, but some of them don't.

Well, ok. I got a Collection with 2 sprites in it. It's two 'pointy rocks'. The first one is bigger and the second is smaller. Since they're so pointy, I can't use box colliders. Then I used Polygon colliders.

I've created a tk2dSprite and selected the newly created Collection and selected one of the sprites.

Now, to Instantiate it randomly, I've created a Prefab with this Sprite, and linked the Prefab in a script.

This script is now responsible for instantiating the Prefab in the scene. So, I use the following code:

(I created more variables to make the code easy to follow)


GameObject go = (GameObject)Instantiate(rocksPrefab);

tk2dSprite sprite = go.GetComponent<tk2dSprite>();
int numSprites = sprite.Collection.spriteDefinitions.Length;

sprite.SetSprite(sprite.Collection.spriteDefinitions[Random.Range(0, numSprites)].name);


This is enough to instantiate the tk2dSprite with the RocksCollection in it. But when I do the SetSprite part, it changes randomly to one of the sprites nicely, BUT do not UPDATE the collider. I keep getting the collider which the prefab is set. Why is that? And how can I fix this?

Thanks again.

21
Support / Re: Possible Bug
« on: May 24, 2013, 09:04:47 pm »
Oh, thanks. It really confused me the "Count" definition. Didn't know also that the spriteDefinitions worked that way. I can use that array to achieve the same random result now.

Thanks for your fast replies.

22
Support / Possible Bug
« on: May 24, 2013, 08:35:31 pm »
I've asked a friend to follow the same steps, and the bug still occurs.

1. Create a Sprite Collection, rename it to "SomeCollection" (doesn't matter)
2. Open it, drag 2 textures to it. Commit.
3. Create a tk2dSprite, select the collection "SomeCollection", select one of the sprites (does not matter which)
4. Rename the sprite "MySprite" (doesnt' matter)
5. Create a C# script and drag it to something on the scene (could be the camera).
6. On the 'Start' method of the script, write Debug.Log(GameObject.Find("MySprite").getComponent<tk2dSprite>().Collection.Count).
7. Test the game.

It should appear "2" on the Debug Log, 'cos the collection has 2 textures in it. Okay. Stop the game.

8. Open the "SomeCollection". Select one of the textures, do you see "Sprite ID" on the top? Well, select the texture with SpriteID "0". It must be the one with 0.
9. Delete the texture with SpriteID 0.
10. Test the game.

It should appear "1" on the Debug Log, after all, the Collection only have 1 Sprite, but it shows "2".

This is breaking the randomness of my random sprite generator.

Just want to expose it to see if it's a bug or not.

Thanks.

23
Support / Re: Parallax scrolling
« on: May 24, 2013, 08:21:56 pm »
Oh yeah. I've tried your slolutin unikron. Now it works. So simple huh? Thanks man.

24
Well... I did some more tests with what you've said - "Don't copy the folder from one project to another".

I feel kinda stupid right now, lol. But doing that and recreating all the project may be the answer to my problem. The sprites are no longer flickering in the mobile.

Thanks man.

25
Support / Parallax scrolling
« on: May 21, 2013, 10:18:06 pm »
I've found some results on the search page, but none of them explains how to do this effect on 2d toolkit.

I've done the following. Created 2 tk2dsprite with the same sprite in it. I moved the second to the right side of the first and I keep moving the two of them at a constant speed to the left. When the first move off the left bounds, I move it to the right side of the second sprite. When the second one moves away from the left bounds, it moves to the right of the first sprite. And there you go. Theoretically, it works, but I keep getting a thin, perceptible, ugly line between the two sprites.

Is there a more "right" way to do it? Or another way that has proven to work? Thanks.


26
Oh hell, I tried today all day long to install older versions of Unity, but when I import TKD2ROOT folder into the project, Unity crashes. Tried with 3.5.7, 3.5.6 and 3.5.5.

I don't know... maybe is my cellphone. I'm going to test with another device and I post here the results. Maybe Unity 4.2 is released before I release my game, and I hope it doesn't appear the same bug.

Also, I think it's strange the problem be in Unity, because it works FINE the first time it runs. The problems only appear the second time forward.

Well.... I'll test in another device soon. Cheers.

27
I'm doing my first professional game for Android, and I think your product was the best one for this situation.

I did some basic tests for Android. And I've got something VERY strange. When I first "build and run" with my device connected, the game ran JUST FINE. But when I quit it, and reopened, the sprites starts flashing forever (just the static-ones, not the animated ones). I thought it must be some caching problem. But even when I restarted my DEVICE, the sprites are STILL flashing. So, I uninstalled the app, installed again AND - first time running, perfect. Exit, open again, sprites flashing forever. What the hell? My game only works in the first time!

So I continued my tests, this time, messing with the "player settings". And I got something curious. When I turn OFF the "Dynamic batching", the game runs just fine. In the first time, second, third, well... the way it always should have worked. So I thought "well... let's just keep this box unchecked". But... It would be very good that this option stays checked, 'cos I know it increases the game performance. So, you guys could explain to me what these flashing are? And why do they happen? And how can I fix this?



So, the problem is that. I'm going to explain what my tests are - I have 2 prefabs, the first is a "Walls" prefab, and the 2nd is a "Powerups" prefab. These two prefabs are associated with two variables of a Scenario.cs script, which belongs to a GameObject in the scene.

The Scenario.cs script has...
public GameObject wallsPrefab;
public GameObject powerupsPrefab;


The scenario is responsible for creating the GameObjects of the prefabs and moving them along the x-axis. From the right boundarie of the screen to the left. When the sprites get all the way left, they are destroyed.

And that's it. Objects generated from two distinct prefabs that moves from the right side of the screen to the left. These sprites flash all over the scene when the game is run after the first time. And this does not happen when Dynamic Batching is OFF.

Oh yeah, my device is a Motorola Defy (kind of old, but still).

Waiting for an answer. Thanks.

Pages: 1 [2]