Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (120)
games submitted by our members
Games in WIP (577)
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 utils package - general quality and impressions  (Read 1219 times)
0 Members and 1 Guest are viewing this topic.
Offline actual

JGO Coder


Medals: 23



« Posted 2013-07-15 13:29:43 »

Not sure why I did not see it before, but I finally noticed all of the utility classes packed into com.badlogic.gdx.utils as well as the math and physics packages. I was curious if people have used these classes and what their impressions were, specifically around the collection classes.

I could see myself switching over to the libgdx collections, specifically for maps and sets. I know it's good to avoid premature optimization, but if there are ready-made classes in a library I am already using, then why not use them?

I know the answer to my question is (1) if what you're doing works well enough stick with that and (2) try it for yourself and see; but I was curious what other people's experience has been.
Offline davedes
« Reply #1 - Posted 2013-07-15 13:58:26 »

They can provide some significant (i.e. measurable) performance improvements on low-end devices, where things like allocations (e.g. for-each loop) or auto-boxing can be very detrimental.

For example, LibGDX's StringBuilder.append(int) doesn't lead to any allocations, which makes it especially attractive for displaying integer text on Android (i.e. FPS, player score).

If you are building a 3rd party API, it would be poor practice to use, say, LibGDX's collections instead of the standard collections. But if you are building a game, or a LibGDX-specific extension, or working on internal code that needs to be highly optimized, then it makes much more sense to use LibGDX's collections.

Even the Android docs recommend against getters and setters, which makes the LibGDX utilities desirable:
http://developer.android.com/training/articles/perf-tips.html

Aside from the collections, the vector/matrix and math utilities are really excellent. The vecmath is in many areas accelerated with native code. And the MathUtils sin/cos/etc are usually a little faster than java.lang.Math, at the expense of precision.

And then there is a whole slew of other utilities, like reflection (that works correctly with GWT), Pools for re-using temporary objects, fast and lightweight JSON and XML parsing, etc.

TL;DR - the GDX utils are the best thing since sliced bread, so definitely use them in your games.

Offline actual

JGO Coder


Medals: 23



« Reply #2 - Posted 2013-07-15 19:03:03 »

Thanks, I am using it for my game rather than a third party library so i will give them a look. i think i have finally gotten past the 'i will implement everything form scratch as a learning experience" and actually focus on making a stinkin' game.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline badlogicgames
« Reply #3 - Posted 2013-07-15 19:15:32 »

Let us implement everything from scratch for you Smiley

http://www.badlogicgames.com - musings on Android and Java game development
Offline relminator
« Reply #4 - Posted 2013-07-16 02:18:52 »

Let us implement everything from scratch for you Smiley


Yar!  That would be a nice libGdx slogan.
Offline ReBirth
« Reply #5 - Posted 2013-07-16 02:34:20 »

Ew that sounds less OSS and more like expensive enterprise $$$ service Grin

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

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Longarmx (52 views)
2014-10-17 03:59:02

Norakomi (43 views)
2014-10-16 15:22:06

Norakomi (33 views)
2014-10-16 15:20:20

lcass (37 views)
2014-10-15 16:18:58

TehJavaDev (68 views)
2014-10-14 00:39:48

TehJavaDev (67 views)
2014-10-14 00:35:47

TehJavaDev (60 views)
2014-10-14 00:32:37

BurntPizza (73 views)
2014-10-11 23:24:42

BurntPizza (45 views)
2014-10-11 23:10:45

BurntPizza (86 views)
2014-10-11 22:30:10
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org 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‑gaming.org
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!