Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (773)
Games in Android Showcase (230)
games submitted by our members
Games in WIP (856)
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 3784 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: 138
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  

EgonOlsen (1855 views)
2018-06-10 19:43:48

EgonOlsen (1882 views)
2018-06-10 19:43:44

EgonOlsen (1250 views)
2018-06-10 19:43:20

DesertCoockie (1682 views)
2018-05-13 18:23:11

nelsongames (1348 views)
2018-04-24 18:15:36

nelsongames (1967 views)
2018-04-24 18:14:32

ivj94 (2737 views)
2018-03-24 14:47:39

ivj94 (1940 views)
2018-03-24 14:46:31

ivj94 (3030 views)
2018-03-24 14:43:53

Solater (1081 views)
2018-03-17 05:04:08
Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08

Deployment and Packaging
by gouessej
2018-08-22 08:03:45

Deployment and Packaging
by philfrei
2018-08-20 02:33:38

Deployment and Packaging
by philfrei
2018-08-20 02:29:55

Deployment and Packaging
by philfrei
2018-08-19 23:56:20

Deployment and Packaging
by philfrei
2018-08-19 23:54:46 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!