playMaker

Author Topic: Translate lagging on mobile  (Read 3236 times)

DennisJensen

  • Full Member
  • ***
  • Posts: 104
Translate lagging on mobile
« on: June 02, 2014, 08:40:47 AM »
Hi Playmaker forum.

Short introduction:
We are a small indie team, working on two games. One mobile and one console/PC/MAC. The mobile game is made in playmaker and causing some problems.

Game:
The game is a endless 2d runner, where you collect coins and upgrade your weapons. It has great looking pixel graphics. The game is different because you can challenge your friends and bet real money.

Problem:
The game is very fast phase, and the speed increases. The camera is standing still and the environments move. The game is optimized fairly well, I use pool manager for all props, enemies and coins. I have some physics. But not a lot. And it seams that everything is running smoothly except how the environment translate.

I think the problem is the speed that updates and increases, while the environment moves. If I use every second the environment will increase speed every second (and frame) and make a little "jump", if I use every frame, it's not really working, because the FPS changes accordingly to how many objects are in the scene. it runs around 45-60 FPS on our mobile test device, and around 100 FPS on a PC. I tried playing around with both fixed update and late update.

I have translate on 9 different environment modules, a props group, on all enemies and a spawning object. I have a lot of functions that runs every frame.

Any ideas?

Cheers
Dennis

PS. I'm normally a artist, my knowlegde within programming is limited.
Game Designer, CEO, Artist
http://2ndStudio.com

DennisJensen

  • Full Member
  • ***
  • Posts: 104
Re: Translate lagging on mobile
« Reply #1 on: June 03, 2014, 01:43:10 PM »
So I put all environment in a empty game object and translated that instead of all the objects individualy.

I also looked at everything to find update "Every frame", I found some and tried to get rid of them, using wait instead.

I also looked at textures and shaders. I use transparent vertexlit when using transparent objects, and we have a lot. But otherwise I try not to use transparent things.

It got optimized a bit, but it still lags when it loads in a new piece of ground/environment.

Not sure what to do.
Game Designer, CEO, Artist
http://2ndStudio.com

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: Translate lagging on mobile
« Reply #2 on: June 03, 2014, 07:47:09 PM »
Quote
it still lags when it loads in a new piece of ground/environment.

What do you mean by "loads in"? How are you instantiating new pieces?

Ideally you would create new pieces from an object pool...

DennisJensen

  • Full Member
  • ***
  • Posts: 104
Re: Translate lagging on mobile
« Reply #3 on: June 04, 2014, 05:53:13 AM »
The environment pieces are quite large meaning you run on one piece for like 2 sec. I have 9 in total.

So all pieces are loaded into the scene at the beginning, and then whenever I use a piece i activate them, so only 2 of the 9 pieces are activated at the same time. When I activate a new piece it lags a little, but I also tried having all of the activated all the time, and then moving them off screen when not used. That caused a little lag, but all the time, not it only lags a little bit when I activate them.

So on the environments I don't use pool objects, but I reuse the 9 pieces again and again just by activating them.
Game Designer, CEO, Artist
http://2ndStudio.com