Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (777)
Games in Android Showcase (231)
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] 2 3 ... 5
  ignore  |  Print  
  SJGL (Now on GitHub!)  (Read 50196 times)
0 Members and 1 Guest are viewing this topic.
Offline DarkCart

JGO Kernel


Medals: 124
Projects: 9
Exp: 50 years


It's all in the mind, y'know.


« Posted 2014-10-31 21:53:07 »

Hello JGO,

Today I will show you my small WIP-library, SJGL, which is an acronym for "Simple Java Game Library". To make games, you can either use the more basic, user-friendly "Draw" class, or you can use SimpleGL, with, as the name suggests, a OpenGL-like syntax. A piece of source code demonstrating the new Image feature can be found here. A placeholder logo (as well as a thumbnail for the thread) is below:

(Hmm.. tiny.)

GitHub: https://github.com/DarkCart/SJGL

If you want to try it out, the latest download is here.

Hm, that just about sums it up, if you have any questions or comments, you know where to find me (hint: browsing the forums), so have a nice day.

The darkest of carts.
Offline BurntPizza

« JGO Bitwise Duke »


Medals: 486
Exp: 7 years



« Reply #1 - Posted 2014-10-31 21:58:08 »

If you're planning on continuing with it, I'd recommend hosting it on github: makes it more accessible, can have wiki docs and issue tracker right in with your code, code can be browsed right in the browser (ha!), doubles as online backup, git as version control so you can track every single change made and revert things if necessary, tag release versions, etc.
Offline DarkCart

JGO Kernel


Medals: 124
Projects: 9
Exp: 50 years


It's all in the mind, y'know.


« Reply #2 - Posted 2014-10-31 22:00:21 »

If you're planning on continuing with it, I'd recommend hosting it on github: makes it more accessible, can have wiki docs and issue tracker right in with your code, code can be browsed right in the browser (ha!), doubles as online backup, git as version control so you can track every single change made and revert things if necessary, tag release versions, etc.

Thanks, once I'm sure people like it and I'm sure people will actually pay attention to it (strange but true persecutioncomplex), I'll do that.

The darkest of carts.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline gouessej
« Reply #3 - Posted 2014-11-01 11:49:26 »

Hi

It seems to be bound to AWT  Sad

Julien Gouesse | Personal blog | Website | Jogamp
Offline DarkCart

JGO Kernel


Medals: 124
Projects: 9
Exp: 50 years


It's all in the mind, y'know.


« Reply #4 - Posted 2014-11-01 11:50:26 »

Hi

It seems to be bound to AWT  Sad

Sorry, is there a problem with that?

The darkest of carts.
Offline DarkCart

JGO Kernel


Medals: 124
Projects: 9
Exp: 50 years


It's all in the mind, y'know.


« Reply #5 - Posted 2014-11-01 14:55:08 »

Been working on the library for most of last night and this morning, so here's SJGL 0.5.

Added:

General:
+"App" is now called "Window", sorry for any code changes nessicary.

+Images can now be displayed using the GLImage class

+You can now get more infromation about the Window you made by using getWidth(), or
getHeight().

+Your Window can now go fullscreen using the setFullscreen(boolean fullscreen) command.

+ImportExport is a new class that can be used to import and export files, as the name
suggests.

SimpleGL:

+New commands, such as glDispose(), glDraw(), and glImage().

+Added general-purpose glDraw(int glMode, int x, int y, int width, int height, boolean fill)
with 3 "glMode" commands, GL_RECT, GL_LINE, and GL_CIRCLE.

+New class: GLImage.

Audio:

+Added stopMp3() command


Removed:

-Package com.darkcart.lib.sjgl.entity has been removed

- Class Entity.java has been removed

Download is in the OP

The darkest of carts.
Offline gzuzboey
« Reply #6 - Posted 2014-11-01 15:47:59 »

Maybe you should make a demo to show what this library is capable of.  Grin

YA BOI
Offline DarkCart

JGO Kernel


Medals: 124
Projects: 9
Exp: 50 years


It's all in the mind, y'know.


« Reply #7 - Posted 2014-11-01 15:48:38 »

Works for me. Give me 5 mins.

EDIT: Here you go

Disclaimer: I did create the assets in the game, however, they are derivative works of assets originally created by Markus Persson and/or Junkboy.

The darkest of carts.
Offline Opiop
« Reply #8 - Posted 2014-11-01 16:12:40 »

Show example code, don't make people download files. Most people will not download your demo, they just want to see how easy it is to code with it and what you can do with it.
Offline DarkCart

JGO Kernel


Medals: 124
Projects: 9
Exp: 50 years


It's all in the mind, y'know.


« Reply #9 - Posted 2014-11-01 16:14:15 »

Show example code, don't make people download files. Most people will not download your demo, they just want to see how easy it is to code with it and what you can do with it.

Alright, here: http://pastebin.java-gaming.org/2e18d4f2e1f10

The darkest of carts.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Opiop
« Reply #10 - Posted 2014-11-01 16:24:15 »

A couple of criticisms

1. Is your library based off Java2D or OpenGL? It seems to me you are using Java2D, but for some reason you are using the "gl-" prefix for a lot of your functions, which is confusing.

2. You are initializing WAY too many objects in your `paint` method. You should not be loading that image over and over before you draw it.

3. Drawing shouldn't be handled by the individual graphics classes (Image for example). This is what I'm talking about:
1  
img.glDrawImage(gl, 250, 140, 64, 64);

You are passing in the graphics object. Why is that silly? Because you will only ever have one graphics object, so what is the point in passing it in every time? You should put all these draw methods into the graphics class so you have something like this:
1  
gl.glDrawImage(250, 140, 64, 64);


3. How do you specify what image to draw? It seems like your idea is to load an image and then immediately draw it. That's a terrible design, quite honestly. Loading an image from file is expensive, you need a way to store the image and then be able to draw it whenever you want, not immediately after you load it.

4.
1  
ColorValue
is a bad name for a color class, no offense. Rename it to
1  
Color
, that's what most people would expect it to be named.

5. Is this all your library can do? Draw images and text? What about input? Or drawing primitives? Or asset handling?

6.
1  
2  
GL gl = new GL();
      gl.glInit(g);

These two lines make me cringe. They are in your `paint` method, which means you are doing it EVERY frame.

I would suggest researching how other libraries are built, and their design patterns.
Offline DarkCart

JGO Kernel


Medals: 124
Projects: 9
Exp: 50 years


It's all in the mind, y'know.


« Reply #11 - Posted 2014-11-01 16:43:49 »

A couple of criticisms

1. Is your library based off Java2D or OpenGL? It seems to me you are using Java2D, but for some reason you are using the "gl-" prefix for a lot of your functions, which is confusing.

2. You are initializing WAY too many objects in your `paint` method. You should not be loading that image over and over before you draw it.

3. Drawing shouldn't be handled by the individual graphics classes (Image for example). This is what I'm talking about:
1  
img.glDrawImage(gl, 250, 140, 64, 64);

You are passing in the graphics object. Why is that silly? Because you will only ever have one graphics object, so what is the point in passing it in every time? You should put all these draw methods into the graphics class so you have something like this:
1  
gl.glDrawImage(250, 140, 64, 64);


3. How do you specify what image to draw? It seems like your idea is to load an image and then immediately draw it. That's a terrible design, quite honestly. Loading an image from file is expensive, you need a way to store the image and then be able to draw it whenever you want, not immediately after you load it.

4.
1  
ColorValue
is a bad name for a color class, no offense. Rename it to
1  
Color
, that's what most people would expect it to be named.

5. Is this all your library can do? Draw images and text? What about input? Or drawing primitives? Or asset handling?

6.
1  
2  
GL gl = new GL();
      gl.glInit(g);

These two lines make me cringe. They are in your `paint` method, which means you are doing it EVERY frame.

I would suggest researching how other libraries are built, and their design patterns.

1. GL means Graphics Library, which is a very broad term, so I called my small, OpenGL-like class SimpleGL, or Simple Graphics Library. Technically however, it uses Java2D.

2. Please elaborate.

3. Okay, I'll do so.

3 (Part 2?). Just asking, but how would YOU do that?

4. It'll break too much existing code.

5. Yep, at the moment.

6. Not sure what you want me to do here.

The darkest of carts.
Offline Longarmx
« Reply #12 - Posted 2014-11-01 16:57:42 »

3 (Part 2?). Just asking, but how would YOU do that?

4. It'll break too much existing code.

3. You bind a texture, then every subsequent draw call will use that texture, until another texture is bound. You should load your textures once at initialization, then just reference them throughout your program.

4. That's why you right click > refactor > rename.

How much have you used OpenGL? It appears like you don't understand any of it's design patterns at all, which is making your library very confusing and hard to use (not to mention inefficient).

Offline saucymeatman
« Reply #13 - Posted 2014-11-01 17:49:19 »

You should get the library on github Smiley
You're missing out on alot of constructive critisism from people who dont have time to download stuff
Offline gouessej
« Reply #14 - Posted 2014-11-01 18:37:01 »

Yes, there is. It means that your library has no chance to work under Android. Moreover, I agree with Longarmx's last sentence. If he's right, just use LibGDX and don't make another library.

Julien Gouesse | Personal blog | Website | Jogamp
Offline DarkCart

JGO Kernel


Medals: 124
Projects: 9
Exp: 50 years


It's all in the mind, y'know.


« Reply #15 - Posted 2014-11-01 18:41:25 »

I'm tired of all this negative feedback. It's really frustrating to make game/game engines when no one will take you seriously and all they do is point out the flaws. For the record, this is supposed to be a small, basic, desktop library, that I did for fun.

The darkest of carts.
Offline Jimmt
« League of Dukes »

JGO Kernel


Medals: 167
Projects: 5
Exp: 6 years



« Reply #16 - Posted 2014-11-01 18:48:20 »

I'm tired of all this negative feedback. It's really frustrating to make game/game engines when no one will take you seriously and all they do is point out the flaws. For the record, this is supposed to be a small, basic, desktop library, that I did for fun.
You'll never learn anything if all you get is positive feedback...what happens if no one points out the flaws? Uh, they stay there. So if you want to ignore the help people are trying to give you, then you will stay with your flawed library, instead of improving it.
Offline DarkCart

JGO Kernel


Medals: 124
Projects: 9
Exp: 50 years


It's all in the mind, y'know.


« Reply #17 - Posted 2014-11-01 18:49:29 »

I'm tired of all this negative feedback. It's really frustrating to make game/game engines when no one will take you seriously and all they do is point out the flaws. For the record, this is supposed to be a small, basic, desktop library, that I did for fun.
You'll never learn anything if all you get is positive feedback...

I know that, except that all negative feedback demotivates most people.

The darkest of carts.
Offline CopyableCougar4
« Reply #18 - Posted 2014-11-01 18:50:17 »

I'm tired of all this negative feedback. It's really frustrating to make game/game engines when no one will take you seriously and all they do is point out the flaws. For the record, this is supposed to be a small, basic, desktop library, that I did for fun.

You were the one who asked for feedback. Taking criticism can make or break people. When people need a library, they want one that does a lot and does it in the fastest, most compatible way possible. For example: people use LibGDX often because it is fast and compatible. Java AWT is also the least used (from what I have seen) for games. If you want to make a game library that people will use, use OpenGL and make it do a lot.

Just my thoughts.

CopyableCougar4

Either wandering the forum or programming. Most likely the latter Smiley

Github: http://github.com/CopyableCougar4
Offline Longarmx
« Reply #19 - Posted 2014-11-01 18:50:49 »

The world is a rough place, and the internet is even rougher.

All we're trying to do is help you improve your project, and that criticism may not always come smothered in nice words.

What you need to do is to continue improving your project, and you will see positive feedback come back more and more often.

Offline gouessej
« Reply #20 - Posted 2014-11-01 18:54:55 »

DarkCart, I don't want to demotivate you but in my humble opinion, writing a library based on OpenGL whereas you're a beginner while expecting others to use it is a bad idea. If it's just for fun or for learning purpose, then don't expect other developers to use it (and I agree with CopyableCougar4's comment). I don't discourage you to make games, even with poor graphics like most of mine.

Julien Gouesse | Personal blog | Website | Jogamp
Offline Opiop
« Reply #21 - Posted 2014-11-01 20:04:25 »

Don't look at it as negative feedback. Look at it as a list of things to do. No offense, you're still quite new at this stuff and a lot of us have more experience than you. We know more about designing these things, what is successfull/what's not, the features that are needed to make or break a good game library etc... If this feedback puts you off then you need to develop a thicker skin for yourself because none of us are being rude or mean, we are trying to help because your library has some bizzare designs and WILL be slow. Taking our advice would only result in a faster, better library.
Offline matanui159

JGO Coder


Medals: 11
Projects: 1
Exp: 10-12 months


Aww... So cute...


« Reply #22 - Posted 2014-11-01 21:40:44 »

I'm tired of all this negative feedback. It's really frustrating to make game/game engines when no one will take you seriously and all they do is point out the flaws. For the record, this is supposed to be a small, basic, desktop library, that I did for fun.
Don't worry, I kind of got the same for my game engine although I thought it was pretty good...
Sometimes I just have the bad habit of thinking of the best...

Is it sad that I still get a fright when the computer beeps at me...
Offline CopyableCougar4
« Reply #23 - Posted 2014-11-01 21:47:08 »

I'm tired of all this negative feedback. It's really frustrating to make game/game engines when no one will take you seriously and all they do is point out the flaws. For the record, this is supposed to be a small, basic, desktop library, that I did for fun.
Don't worry, I kind of got the same for my game engine although I thought it was pretty good...
Sometimes I just have the bad habit of thinking of the best...

I think everybody likes to think that their stuff is the best. However, let's be realistic. Much of the software that is all around considered good is created by people with 15+ years of experience in the industry that know what makes software good. Even I have fallen into the trap of thinking my software is good and watching it crumble into scattered class files.

My thoughts: just enjoy making software for the learning, and when you have industry experience, then make those great products. Also, game libraries are usually infinitely harder to make than games, because they have to be flexible. By no means stop doing what you're doing, just don't expect everybody to love your first try.

Spreading realistic thoughts one post at a time Smiley,
CopyableCougar4

Either wandering the forum or programming. Most likely the latter Smiley

Github: http://github.com/CopyableCougar4
Offline HeroesGraveDev

JGO Kernel


Medals: 382
Projects: 11
Exp: 4 years


┬─┬ノ(ಠ_ಠノ)(╯°□°)╯︵ ┻━┻


« Reply #24 - Posted 2014-11-01 23:00:46 »

Writing code that gets stuff done is easy.
Writing code that other people can use to get stuff done is hard.

If you're trying to make a library before you've had decent experience actually making games isn't going to get you anywhere.
I don't like the "reinventing the wheel" analogy, but it kinda fits here. If you try to invent a new wheel without knowing that a wheel is meant to roll, you're probably going to make a square.

Whether you use Java2D or OpenGL is up to you, but anyone doing serious gamedev will need the performance of OpenGL.

Also, don't prefix things with gl. It's widely accepted as referring to OpenGL functions. Making it mean otherwise is not a good idea.

Edit: I agree with opiop. If you're going to write code and expect others to use it, expect them to complain about things that are wrong.

Offline DarkCart

JGO Kernel


Medals: 124
Projects: 9
Exp: 50 years


It's all in the mind, y'know.


« Reply #25 - Posted 2014-11-02 00:14:46 »

I'm not sure what to relplace gl[Blahblahblah] with. Seemed natural to put gl in front of it, as I've been using OpenGL lately. Now I think it may not have been the best choice (Thanks, HeroesGraveDev). Do you guys have any better suggestions, as I can think of one right off the top of my head.

The darkest of carts.
Offline Longarmx
« Reply #26 - Posted 2014-11-02 00:51:43 »

How about
sjgl[Something]
?

Offline DarkCart

JGO Kernel


Medals: 124
Projects: 9
Exp: 50 years


It's all in the mind, y'know.


« Reply #27 - Posted 2014-11-02 00:52:27 »

How about
sjgl[Something]
?

Nice, I love it. Thanks.

The darkest of carts.
Offline gzuzboey
« Reply #28 - Posted 2014-11-02 00:58:24 »

Btw, when I run the demo, I can't see any images. All i can see is the minicraft text Cry

YA BOI
Offline DarkCart

JGO Kernel


Medals: 124
Projects: 9
Exp: 50 years


It's all in the mind, y'know.


« Reply #29 - Posted 2014-11-02 01:07:32 »

Btw, when I run the demo, I can't see any images. All i can see is the minicraft text Cry

Pretty sure I packed the image files with the .zip file, if not, tell me.

The darkest of carts.
Pages: [1] 2 3 ... 5
  ignore  |  Print  
 
 

 
hadezbladez (331 views)
2018-11-16 13:46:03

hadezbladez (171 views)
2018-11-16 13:41:33

hadezbladez (329 views)
2018-11-16 13:35:35

hadezbladez (80 views)
2018-11-16 13:32:03

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

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

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

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

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

nelsongames (2294 views)
2018-04-24 18:14:32
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
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!