Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (494)
Games in Android Showcase (114)
games submitted by our members
Games in WIP (563)
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  
  Slick2d advantages?  (Read 1966 times)
0 Members and 1 Guest are viewing this topic.
Offline P0jahn

Senior Member


Projects: 3



« Posted 2012-12-18 01:33:31 »

Do Slick2D have advantages over Swing? Example, do it interfere with the native system better than Swing do? Why is it better than Swing?
Isint Slick2D just a modified Swing window?
Offline cheatsguy

Junior Member


Medals: 3


Gamer turned Pixel Artist turned Programmer


« Reply #1 - Posted 2012-12-18 01:57:01 »

Slick2D is better than Swing for a number of reasons, chief among them is its simplicity. It is very easy to jump in with just the documentation behind it. It also runs somewhat faster since it is layered over LWJGL, which uses OpenGL, to speed up the process. I would recommend using it for a beginning project, then moving on to other libraries or using straight-up LWJGL.

Busy between school, work, life, games, programming and general screwing around.
If you'd like some pixel art for your game, send me a PM, i'll see what I can do.
Current project: http://elementalwarblog.wordpress.com/
Offline ReBirth
« Reply #2 - Posted 2012-12-18 02:39:55 »

Slick2D's API is also good for newbie who never used anything but Java2D.

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

JGO Kernel


Medals: 202



« Reply #3 - Posted 2012-12-18 02:54:28 »

Slick2D is not modified Swing, it's a 2d graphics library that uses OpenGL for rendering.  Java2D (an extension of Swing) has an OpenGL-accelerated path, but it's very finicky, drops to software rendering easily, and doesn't let you use any extra OpenGL features.  Slick2D on the other hand strictly uses OpenGL, which makes it much much faster.

Where Slick is somewhat like Swing is in the API, specifically that the API is familiar to Java2D users.  It's not an exact copy, but it's close enough that porting code is not extremely difficult.

For integrating with the native window system, Swing does much better (as good as Swing does anyway).  Slick2D doesn't even have a concept of a button built in, you need third party widget sets like TWL or NiftyGUI to make those.

Personally, I tend to recommend LibGDX these days as a 2D library, but I won't hijack a Slick thread evangelizing it.
Offline ReBirth
« Reply #4 - Posted 2012-12-18 07:25:06 »

Personally, I tend to recommend LibGDX these days as a 2D library, but I won't hijack a Slick thread evangelizing it.
Actually you have done it.

Like I said Slick2D is easier for first step of migration. IMHO Libgdx's architecture is harder.

Offline davedes
« Reply #5 - Posted 2012-12-18 07:55:29 »

IMHO somebody should write a minimal Java2D-like wrapper on top of LibGDX, i.e. to replace Slick and feed the newbies a library that doesn't include words like "matrix", "blending" or what have you.

The only advantage to Slick is that it hides GL concepts (whereas LibGDX makes them visible), so if you are afraid to learn what actual graphic programming entails, and would rather be spoon fed, then you may prefer Slick.

Offline Mads

JGO Ninja


Medals: 26
Projects: 3
Exp: 6 years


One for all!


« Reply #6 - Posted 2012-12-18 09:37:47 »

Don't forget that Slick2D has a ton of features that Java2D does not. It's not just two different ways to display graphics - Slick2D has tools that makes game development easier.

I'll just leave a list of things Slick2D has, that Java2D does not.
  • Pathfinding
  • Resource loading
  • Support for TiLED
  • Animation framework
  • Particle systems
  • Audio
  • Transitions between screens
  • Spritesheet support

Offline ReBirth
« Reply #7 - Posted 2012-12-18 11:26:07 »

IMHO somebody should write a minimal Java2D-like wrapper on top of LibGDX, i.e. to replace Slick and feed the newbies a library that doesn't include words like "matrix", "blending" or what have you.
I'm doing that in this last 3 weeks Pointing but not to become Slick, just simple wrapper (higher than Game and Screen classes).

Offline P0jahn

Senior Member


Projects: 3



« Reply #8 - Posted 2012-12-18 19:22:40 »

Well, I am not that convinced to use Slick2D. I am not creating a high performance game anyway. However, my game looks laggy on my laptop for some odd reson(it is not really laggy as the fps is locked at 66. Its more like an graphical glitch), which is why I am considering switching to Slick2D.
Offline LordChandar

Junior Member


Projects: 1



« Reply #9 - Posted 2012-12-18 19:26:31 »

This is a curious thread for me.

I started converting my 2D game over from AWT over to Slick last night for several reasons.

The input handler on AWT was missing mouse events
The input handler on AWT was slow on keyboard event
I finally maxed out the Java2D canvas painter, and 90% of of my CPU time was sitting on the call to Graphics.drawImage() which I could not do anything to optimize.
Using Slick2D I am able to not have to fake the shading and other effects to keep performance.  I used to keep 4 versions of my tiles in different shades to quickly achieve the desired shading effect.  With Slick2D, I am able to pull the shading off on the fly using the same logic.

However, Slick2D is over-simplified for my tastes.  If you use BasicGame you don't have direct control over which GL "canvas" you are writing to it seems.  The draw logic for an sprite/image seems to be in the Image() class and not in the rendering method.  You call a whole bunch of methods to draw the images individually.  This seems counter intuitive to me.  There is probably some reason for it that is beyond my limited knowledge.

What I do know is I went from 20 fps in my game to 160fps.  The memory footprint also went down because my images are now stored in VRAM, and the CPU went down a whole helluva lot (now it runs at 20% instead of 100%
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline LordChandar

Junior Member


Projects: 1



« Reply #10 - Posted 2012-12-18 19:27:54 »

I also had the same laggy problem with Java2D as well.  I had locked it at 20-30fps, but my sprites never refreshed more than once-twice a second.  I could never figure it out.

Not having that problem with Slick.
Offline davedes
« Reply #11 - Posted 2012-12-18 19:30:02 »

However, Slick2D is over-simplified for my tastes.  If you use BasicGame you don't have direct control over which GL "canvas" you are writing to it seems.  The draw logic for an sprite/image seems to be in the Image() class and not in the rendering method.  You call a whole bunch of methods to draw the images individually.  This seems counter intuitive to me.  There is probably some reason for it that is beyond my limited knowledge.
There is only one "GL canvas" -- it's the Display that you see. Unless you use an AWT container, which you generally shouldn't need.

Slick has some horrible design errors, like Image rendering logic inside of the Image class. For a cleaner API and stronger control over GL, shaders, vertex buffers, etc. you should use LibGDX.

Offline LordChandar

Junior Member


Projects: 1



« Reply #12 - Posted 2012-12-18 19:33:40 »

That is the thing, for this game, for a first effort, I don't need or want stronger control over OpenGL.  When I get to be a Knight on here, I will probably want that then.  Tongue  I have a ways to go.  This game, an old school RPG does just fine under Slick2D.

Maybe Game #2 can be libGDX.

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.

Dwinin (19 views)
2014-09-12 09:08:26

Norakomi (54 views)
2014-09-10 13:57:51

TehJavaDev (63 views)
2014-09-10 06:39:09

Tekkerue (31 views)
2014-09-09 02:24:56

mitcheeb (53 views)
2014-09-08 06:06:29

BurntPizza (37 views)
2014-09-07 01:13:42

Longarmx (23 views)
2014-09-07 01:12:14

Longarmx (27 views)
2014-09-07 01:11:22

Longarmx (27 views)
2014-09-07 01:10:19

mitcheeb (35 views)
2014-09-04 23:08:59
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

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!