Skip to main content

News

Topic: JavaSphere Redux (Read 5194 times) previous topic - next topic

JavaSphere Redux
So for those of you who remember the original JavaSphere engine attempt, the main reason it failed was because Oracle (for the most part) seems to have driven the concept of Java applets into the ground. Way to go, jerks. That being said, I've been thinking about bringing it back, since Java is very cross platform and runs on almost every OS under the sun, without too many hoops of fire.
I don't know if I still have what little code I had written for it still, but even if I do, I'll probably end up trashing it anyway, since I was a horrible coder, and have at least slightly improved. This  time, I'll focus on having it run directly on the user's computer, making things much easier (think Minecraft)
Another goal for it will be for it to be as compatible as possible with the different versions, from Sphere 1.x to all of the forks and offshoots
Eventually when I figure out how and most of it is stable, I'd like to add Android support as well, since as far as I know, you can write straight Java code for apps.


So what do you guys think? I saw the HTML5 project, but that looks like it's going nowhere fast.

  • Radnen
  • [*][*][*][*][*]
  • Senior Staff
  • Wise Warrior
Re: JavaSphere Redux
Reply #1
If you focus on Android, and make a "Sphere-droid" I'm all for it bud.
If you use code to help you code you can use less code to code. Also, I have approximate knowledge of many things.

Sphere-sfml here
Sphere Studio editor here

Re: JavaSphere Redux
Reply #2
I'll be focusing on desktop mostly at first, since that would be much easier, but when that's all good, I'll focus more on the Android platform.

Re: JavaSphere Redux
Reply #3
So, this would properly be an entire Sphere engine, written in Java? I support this idea!

Re: JavaSphere Redux
Reply #4
Does anyone know how Minecraft works without requiring a Java installation on someone's computer?

  • DaVince
  • [*][*][*][*][*]
  • Administrator
  • Used Sphere for, like, half my life
Re: JavaSphere Redux
Reply #5
It doesn't (as far as I'm aware, anyway... The Linux and Mac versions are literally just a JAR file). The game needs Java to run.

Re: JavaSphere Redux
Reply #6
Well yeah, I know about Linux, and I figured with OS X. If I can figure out how to get Java packaged with it in Windows, that'll be fine, and I don't know about OS X, but Java is way easier to install in Linux than in Windows. Good freaking god, Windows Java default folder setup is completely stupid.
But enough about that nonsense.

Lookie lookie!

Don't worry, the error is a good thing in this case. Although no Sphere specific functions have been worked on yet, the error means the Javascript engine is working perfectly. Not very far, granted, but it's a start. And it's already organized much better than the original JavaSphere.

Re: JavaSphere Redux
Reply #7
Well crap, it looks like I'm going to have to cut out a lot of the Slick2D (OpenGL wrapper/game engine) and replace it with straight OpenGL, because it doesn't have the functionality to generate images, needed for things like fonts, maps, character sprites, etc rendering. Bugger.
There's a good chance I'll be cutting that out, and going with another package which is a much thinner wrapper around OpenGL since that appears to be more powerful, and looks like it has the ability to generate graphics.

  • Radnen
  • [*][*][*][*][*]
  • Senior Staff
  • Wise Warrior
Re: JavaSphere Redux
Reply #8

There's a good chance I'll be cutting that out, and going with another package which is a much thinner wrapper around OpenGL since that appears to be more powerful, and looks like it has the ability to generate graphics.


I found that the best solution is not to rely on an existing sprite or image drawing API. For example, SFML has pre-made Sprite and Shape classes so I could draw sprites and graphic primitives easily to screen. But then I saw it also had the ability to just push raw vertices and a texture pointer to OpenGL and so now I exclusively use that for everything. So if you do use a light-weight OpenGL library, make sure it exposes this kind of feature, because pushing vertices, texture-coords, and textures to your graphics card is where 100% of the graphics functionality really stems from.
If you use code to help you code you can use less code to code. Also, I have approximate knowledge of many things.

Sphere-sfml here
Sphere Studio editor here

Re: JavaSphere Redux
Reply #9
It looks like it's supposed to do that, but I'm trying to figure out exactly where. Slick2D doesn't expose that, so I'm dumping it.

Re: JavaSphere Redux
Reply #10
Good freaking god, Windows Java default folder setup is completely stupid.


...OS X is worse ;_;

Maybe have a look at (I think it's called) LWJOGL?

  • Radnen
  • [*][*][*][*][*]
  • Senior Staff
  • Wise Warrior
Re: JavaSphere Redux
Reply #11

Maybe have a look at (I think it's called) LWJOGL?


That'll be the LWJGL: The Light Weight Java Game Library. I've used it before, it seems decent, I'm unsure of its GL options tho.
If you use code to help you code you can use less code to code. Also, I have approximate knowledge of many things.

Sphere-sfml here
Sphere Studio editor here

Re: JavaSphere Redux
Reply #12
That's the one I'm thinking of. It has OpenGL, OpenAL, and some input library I believe. I compiled it for Solaris once to make Minecraft work.

I would be inclined to either use that, or to poke at the GL and GLX/EGL/CGL/WGL libraries directly using JNI.

Re: JavaSphere Redux
Reply #13
I figured I may as well go with JOGL, straight up Java OpenGL, which seems to just be a very thin OpenGL wrapper, and I want to stay as close to the main stuff as I can

Re: JavaSphere Redux
Reply #14
So I'm working on the most important part of the engine: the icon. This is still sort of a rough idea, but what do you guys think?


I was thinking of putting the Java logo there instead of the J, but that might be a branding issue.