Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (757)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (843)
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 3566 times)
0 Members and 1 Guest are viewing this topic.
Offline actual

JGO Coder

Medals: 25

« 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:

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: 25

« 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

« JGO Bitwise Duke »

Medals: 82
Projects: 2

« Reply #3 - Posted 2013-07-15 19:15:32 »

Let us implement everything from scratch for you Smiley - 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  

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

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

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

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

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

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

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

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

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

Solater (139 views)
2018-03-17 05:04:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 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!