playMaker

Author Topic: Stuttering lag?  (Read 1705 times)

Avascar

  • Playmaker Newbie
  • *
  • Posts: 45
    • View Profile
Stuttering lag?
« on: June 19, 2014, 03: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.

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2484
  • Yup.
    • View Profile
    • Cleverous
Re: Stuttering lag?
« Reply #1 on: June 20, 2014, 03: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.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3202
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: Stuttering lag?
« Reply #2 on: June 20, 2014, 06: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...)

jess84

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
Re: Stuttering lag?
« Reply #3 on: June 20, 2014, 10:06:01 AM »
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)

Avascar

  • Playmaker Newbie
  • *
  • Posts: 45
    • View Profile
Re: Stuttering lag?
« Reply #4 on: June 22, 2014, 02: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.

jess84

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
Re: Stuttering lag?
« Reply #5 on: June 22, 2014, 03: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/