0

I'm making a simple game with my friends in Android using libgdx game engine.

We use "conelight" object of box2dlights extension in the game. Our problem is that after putting "conelight" in a game, our app starts to consume too much battery.

Is there a way too prevent this ?

Any help will be appreciated

Thank you

Sebastian
  • 5,721
  • 3
  • 43
  • 69

1 Answers1

0

Calculating lights is computational intensive and thus increases energy consumption.

There are a few things you can check to try to minimize that:

  1. Check if you only create those lights once (for example not in your render method)
  2. Reduce the distance, cone degree and number of rays.
  3. Do you use box2d or do you cast shadows? If not you can get an equal effect with light textures.

And then it might depend on the android version or how old the phone is.

Pinkie Swirl
  • 2,375
  • 1
  • 20
  • 25
  • Thank you very much for your nice answer. After decreasing the distance and number of rays, our app gets more battery friendly. However, we also have another problem. In some phones, other than Samsung series, there is a reflection occurs due to light source. Do you know something about it ? –  Oct 26 '15 at 20:26
  • I didn't use box2d lights yet myself, so no. I guess you can ask a new question for that. Be sure to give an example on what you mean with reflection. You can ask/check in the libgdx forum, too. – Pinkie Swirl Oct 26 '15 at 20:58