Hi !
Featured games (85)
games approved by the League of Dukes
Games in Showcase (636)
Games in Android Showcase (178)
games submitted by our members
Games in WIP (687)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Libgdx + Box2d = ~8 fps on android?  (Read 1648 times)
0 Members and 1 Guest are viewing this topic.
Offline Nesopharus

Senior Newbie

« Posted 2013-09-03 13:11:39 »

Heyho folks ^^

I was wondering about my performance on an android.
Just to test i made a very simple "Game" where i just make a world (box2d) + renderer and cam.
I have added 1 Body with this code:

BodyDef circleDef = new BodyDef();
      circleDef.type = BodyType.DynamicBody;
      circleDef.position.set(80, 120);
      Body circleBody = world.createBody(circleDef);
      CircleShape cs = new CircleShape();
      FixtureDef fd = new FixtureDef();
      fd.shape = cs;
      fd.density = 1;
      fd.friction = 0.2f;
      fd.restitution = 0.8f;
      return circleBody;

here is my rendering method :

public void update(float delta)
      renderer.render(world, cam.combined);
      world.step(1/60f, 6, 2);

now on my comp i have got like 60 fps   thats okay  but after launching on android it drops to ~8 fps o.O and this is not suitable for me =(

its the first time im working with android and my second time working with libgdx.

My question is:
can i somehow get this running on android or should i just forget it?   (btw. i cant connect a real android atm so i use the AVD for Nexus One  made out of the given Device Definitions)

Hi! Cheesy
Offline EgonOlsen
« Reply #1 - Posted 2013-09-03 15:23:59 »

The emulator is crap, even if you enable hardware support for the graphics. Real world performance is usually much better. If you have an APK of your app, just upload it and i can give it a try on some real devices if that helps.

Offline Nesopharus

Senior Newbie

« Reply #2 - Posted 2013-09-03 21:58:23 »

hey  thanks =) then ill test it out on desktop version until i got a phone Tongue

Hi! Cheesy
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline netikan

Senior Newbie

Medals: 1


« Reply #3 - Posted 2013-09-03 22:20:33 »

I can completely agree with the above comment about the emulator performance.
I'm honestly surprised you managed to get around 8FPS out of it!

My Advice
Buy a cheap Chinese Android tablet/phone from Amazon. I'd highly recommend that, because then you get used to developing on lower-end hardware. So you can focus more on optimizing your code.

Why a cheap one?
I got so used to coding on quad core phones and tablets, that my players where complaining about performance on their lower end devices. So I had to completely re-think my development cycle; and do what I said above.

Check out my project Land of Zom - Multiplatform Zombie MMO/RPG!
Soon to be at Eurogamer 2013.
Offline namrog84

JGO Ninja

Medals: 46
Projects: 4

Keep programming!

« Reply #4 - Posted 2013-09-04 00:41:01 »

If you share your APK, I can test it for you, to make sure its just the emulator issue. If you want, that is

Though this is more of a 1 time test, to see if thats in.  Not really a long term development solution

"Experience is what you get when you did not get what you wanted"
Offline matheus23

JGO Kernel

Medals: 123
Projects: 3

You think about my Avatar right now!

« Reply #5 - Posted 2013-09-05 11:08:18 »

Just a side-note: The Box2DRenderer is also much slower than rendering sprites as Bodies.

See my:
    My development Blog:     | Or look at my RPG | Or simply my coding
http://matheusdev.tumblr.comRuins of Revenge  |      On Github
Offline Nesopharus

Senior Newbie

« Reply #6 - Posted 2013-09-06 06:24:01 »

thanks for the advices ^^  at the moment it is not necessary to check the code    it was just a test if i could work with box2d
but atm i am working on my first game maybe ill get it to WIP soon ^^

Hi! Cheesy
Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

Dwinin (71 views)
2015-11-07 13:29:08

Rems19 (80 views)
2015-10-31 01:36:56

Rems19 (74 views)
2015-10-31 01:32:37

williamwoles (106 views)
2015-10-23 10:42:59

williamwoles (92 views)
2015-10-23 10:42:45

Jervac_ (106 views)
2015-10-18 23:29:12

DarkCart (134 views)
2015-10-16 00:58:11

KaiHH (116 views)
2015-10-11 14:10:14

KaiHH (156 views)
2015-10-11 13:26:18

BurntPizza (171 views)
2015-10-08 03:11:46
Rendering resources
by Roquen
2015-11-13 14:37:59

Rendering resources
by Roquen
2015-11-13 14:36:58

Math: Resources
by Roquen
2015-10-22 07:46:10

Networking Resources
by Roquen
2015-10-16 07:12:30

Rendering resources
by Roquen
2015-10-15 07:40:48

Math: Inequality properties
by Roquen
2015-10-01 13:30:46

Math: Inequality properties
by Roquen
2015-09-30 16:06:05

HotSpot Options
by Roquen
2015-08-29 11:33:11 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!