Playmaker Forum

PlayMaker Help & Tips => Android Help => Topic started by: Avascar on June 19, 2014, 06:35:16 PM

Title: Stuttering lag?
Post by: Avascar on June 19, 2014, 06:35:16 PM
Hi,

I'm testing an endless running game on android with randomly spawn obstacles. I'm using Itween to do all the motion (there's quite a handful of moving objects, too)

Whenever I test the game on my computer, it works fine, but when I publish it on android and run it there it has a constant stutter. Basically, it runs fine and then it lags for a split second, every 3 seconds or so, although it's somewhat barely noticeable, this hinders and obstructs the experience of the game.

I have vsync off, I compressed my textures, compressed using ETC1, and various other things to no avail. The total size is about 11 MB, and is about halfway done.

Thanks.
Title: Re: Stuttering lag?
Post by: Lane on June 20, 2014, 06:56:55 AM
Are you able to use the Profiler?

It could be happening when you instantiate new obstacles. Unity is notorious for having slow-downs there and your computer is probably fast enough to deal with then while the phone isn't.
Title: Re: Stuttering lag?
Post by: Alex Chouls on June 20, 2014, 09:28:03 AM
If that's the problem (most likely) search the forums for object pooling. Basically you should avoid creating objects during gameplay. Instead you should create a pool of objects at the start of the level and re-use them as needed (activate/deactivate, reposition...)
Title: Re: Stuttering lag?
Post by: jess84 on June 20, 2014, 01:06:01 PM
Also, from my experience, forget about iTween - its performance on mobile is abysmal. (There are actions available for HOTween, which is a lot of intensive, and there should be actions for LeanTween and DFTween in the future)
Title: Re: Stuttering lag?
Post by: Avascar on June 22, 2014, 05:34:35 PM
Also, from my experience, forget about iTween - its performance on mobile is abysmal. (There are actions available for HOTween, which is a lot of intensive, and there should be actions for LeanTween and DFTween in the future)

Using HOTween, is there an action that moves an object based on speed and not duration/time? My game is built around that mechanic.
Title: Re: Stuttering lag?
Post by: jess84 on June 22, 2014, 06:24:33 PM
HOTween seems to work quite differently - you create a tween, like a vector3 value, and when triggered it creates a HOTween object that handles those changing values - you then set an action to set position on your object every frame.

At least that's my basic understanding.

It's a free and lite add-on, so I'd probably suggest downloading it and having a play around with it and see if it meets your requirements. If it does, ditch that bloated iTween :)

Btw, this is the comparison that Daikon Forge did comparing their new tweening system and iTween and HOTween: http://daikonforge.com/forums/threads/dftween-performance-test-results.1867/