Space

It doesnt have a name yet, suggestions are welcome :slight_smile:

My goal is to render realistic (random generated) planets, stars and other objects.
Currently, the planets and stars are generated using perlin noise and sphere mapping, so everything looks unique (to bad i only have implemented one pattern for the planets yet).

Features:

  • All planets / stars are generated realtime without lag.
  • Ups always stays at 59/60 UPS (rounding errors), while fps is capped at 60.
  • Implemented some particle systems.

New:

  • Optimized planet generation, should not lag at all.
  • Toggle FPS cap with F1 (dont, its bugged).
  • Memory usage is shown on screen.
  • Increased gravitational pull (2x)
  • Shaders!
    • Sun glow is created using a shader, now there is no limit of the width of the glow, its faster and it looks much smoother.
    • Sunbeams are calculated and projected on planets (visible in the image of the planet above).
    • Sun is more alive (color multiplier shifts from 0.9 - 1.5)
    • Antialiastering for the sun, planet and atmosphere.
  • Shooting
  • Added random moon

Download Url (sorry i need to figure out how to pack the natives / lib yet).
Download

You can fly around a bit and check the generated content, have fun (maybe a minute of 2) :slight_smile:

Wow, this is really great! Very smooth game, also the gravitational pull towards the sun was very nicely put in there.
Can’t wait to see where this goes.

Oh man!.. Procedural content! I’m dying… I can’t play this :frowning:

$ java -jar SpaceGame.jar Full-screen exclusive mode not supported Exception in thread "Thread-0" java.lang.NullPointerException at Game.Presenter.a.b(Unknown Source) at Game.Presenter.c.run(Unknown Source)

java version:

$ java -version java version "1.7.0_07" OpenJDK Runtime Environment (IcedTea7 2.3.2) (ArchLinux build 7.u7_2.3.2-2-x86_64) OpenJDK 64-Bit Server VM (build 23.2-b09, mixed mode)

You should better include line-numbers…

Also, why lib/lwjgl, if you try to set “fullscreen exclusive mode”? FEM is only for AWT, isn’t it?

Works fine for me. Gave a “file not found” exception, saying it wanted D:\Screen.vert
Exited successfully, though :smiley:
Very nice! Keep it up

Really cool, but same error as Ultroman. Specifically:


java.io.FileNotFoundException: D:\screen.vert (The device is not ready)
        at java.io.FileInputStream.open(Native Method)
        at java.io.FileInputStream.<init>(Unknown Source)
        at java.io.FileInputStream.<init>(Unknown Source)
        at g.b.a.a(Unknown Source)
        at g.b.a.a(Unknown Source)
        at g.b.a.<init>(Unknown Source)
        at j.a.a.<init>(Unknown Source)
        at j.g.<init>(Unknown Source)
        at Game.a.<init>(Unknown Source)
        at Game.d.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

Same error here, except it said “The system cannot find the file specified” in parenthesis instead of “The device is not ready”. The game worked completely fine though. I was kinda lost as to what I was doing, but I did smash my spaceship right into a planet :smiley:

I did notice that it looks like the escape button closes the game. I think it should just open up a pause menu or something, but I assume you will add that when it comes time. This game looks really cool so far.

Thanks for all the replies :).
The exception is some leftover from my try with shaders (hardcoded path), i want the sun to cast light on the planets and blurring objects when the player moves.
Ill upload a new version without this problem.

doesnt work on mac :cranky:

Possibly, i dont have any mac near, so hard to test.
It would come in handy if you explained a little more, what happens when you execute the jar, are there any errors?

I can help you with a little more info. :slight_smile:

Regenuluz@Medusa ~/Downloads/game $ java -jar SpaceGame.jar 
Exception in thread "main" java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1860)
	at java.lang.Runtime.loadLibrary0(Runtime.java:845)
	at java.lang.System.loadLibrary(System.java:1084)
	at org.lwjgl.Sys$1.run(Sys.java:73)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.lwjgl.Sys.doLoadLibrary(Sys.java:66)
	at org.lwjgl.Sys.loadLibrary(Sys.java:95)
	at org.lwjgl.Sys.<clinit>(Sys.java:112)
	at org.lwjgl.opengl.Display.<clinit>(Display.java:132)
	at Game.Presenter.a.<init>(Unknown Source)
	at Game.Presenter.Start.main(Unknown Source)
Exception in thread "Thread-1" java.lang.NullPointerException
	at Game.Presenter.a.b(Unknown Source)
	at Game.Presenter.c.run(Unknown Source)

Is the error when trying to run it on a Mac, and I think I recall seeing that before and that being something with the current version of lwjgl not working correctly on os x ^^ (Someone correct me if I’m way off here… :P)

you probably should not obfuscate your code to get better feedback

+1

How will not obfuscating your code get you better feedback? Any exceptions etc. is printed in the terminal, unless they’re caught, whether or not the code is obfuscated.

If the code is not obfuscated, you can see which file it was and even which line threw the Exception, else you can’t.
I don’t know how you would want to know where the exception happened, if you’ve got a big project, which is even obfuscated.

Yeah, but i want to keep some code for myself, so that wouldnt work well.
Most of the stuff is basic, but im kinda proud of my terrain generation, so i want to protect it a little.
Im sorry for this guys.

The error is “no lwjgl in java.library.path”, so a command line error.
LWJGL is not added to the command e.g. “java -Djava.library.path=“lib\macosx” -jar SpaceGame.jar”
(slash could be the other way, im not so familiar with mac)
When the library path is added to the command it should work.

I actually used “java -Xmx512m -Xms256m -Djava.library.path=“lib\macosx” -jar SpaceGame.jar” at first. But well, guess I should’ve used slashes instead. :stuck_out_tongue:

Now I get this error:

Regenuluz@Medusa ~/Downloads/game $ java -Xmx512m -Xms256m -Djava.library.path="lib/macosx/" -jar SpaceGame.jar
JavaVM WARNING: JAWT_GetAWT must be called after loading a JVM
org.lwjgl.LWJGLException: Could not get the JAWT interface
	at org.lwjgl.opengl.AWTSurfaceLock.lockAndInitHandle(Native Method)
	at org.lwjgl.opengl.AWTSurfaceLock.access$100(AWTSurfaceLock.java:51)
	at org.lwjgl.opengl.AWTSurfaceLock$1.run(AWTSurfaceLock.java:94)
	at org.lwjgl.opengl.AWTSurfaceLock$1.run(AWTSurfaceLock.java:92)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.lwjgl.opengl.AWTSurfaceLock.privilegedLockAndInitHandle(AWTSurfaceLock.java:92)
	at org.lwjgl.opengl.AWTSurfaceLock.lockAndGetHandle(AWTSurfaceLock.java:66)
	at org.lwjgl.opengl.MacOSXCanvasPeerInfo.initHandle(MacOSXCanvasPeerInfo.java:57)
	at org.lwjgl.opengl.MacOSXDisplayPeerInfo.doLockAndInitHandle(MacOSXDisplayPeerInfo.java:56)
	at org.lwjgl.opengl.PeerInfo.lockAndGetHandle(PeerInfo.java:85)
	at org.lwjgl.opengl.MacOSXContextImplementation.create(MacOSXContextImplementation.java:47)
	at org.lwjgl.opengl.ContextGL.<init>(ContextGL.java:132)
	at org.lwjgl.opengl.Display.create(Display.java:847)
	at org.lwjgl.opengl.Display.create(Display.java:754)
	at org.lwjgl.opengl.Display.create(Display.java:736)
	at Game.d.run(Unknown Source)
	at java.lang.Thread.run(Thread.java:722)
java.lang.NullPointerException
	at org.lwjgl.opengl.GL11.glGenTextures(GL11.java:1372)
	at g.d.b(Unknown Source)
	at g.d.a(Unknown Source)
	at g.d.a(Unknown Source)
	at g.b.<init>(Unknown Source)
	at g.a.a.a(Unknown Source)
	at Game.a.<init>(Unknown Source)
	at Game.d.run(Unknown Source)
	at java.lang.Thread.run(Thread.java:722)
java.lang.NullPointerException
	at org.lwjgl.opengl.ARBShaderObjects.glDeleteObjectARB(ARBShaderObjects.java:66)
	at g.b.a.a(Unknown Source)
	at g.b.a.<init>(Unknown Source)
	at j.a.a.<init>(Unknown Source)
	at j.g.<init>(Unknown Source)
	at Game.a.<init>(Unknown Source)
	at Game.d.run(Unknown Source)
	at java.lang.Thread.run(Thread.java:722)
java.lang.NullPointerException
	at org.lwjgl.opengl.GL11.glGenTextures(GL11.java:1372)
	at g.d.b(Unknown Source)
	at g.d.a(Unknown Source)
	at g.d.a(Unknown Source)
	at g.a.<init>(Unknown Source)
	at j.a.a.<init>(Unknown Source)
	at j.g.<init>(Unknown Source)
	at Game.a.<init>(Unknown Source)
	at Game.d.run(Unknown Source)
	at java.lang.Thread.run(Thread.java:722)
java.lang.NullPointerException
	at org.lwjgl.opengl.GL11.glGenTextures(GL11.java:1372)
	at g.d.b(Unknown Source)
	at g.d.a(Unknown Source)
	at g.d.a(Unknown Source)
	at g.a.<init>(Unknown Source)
	at j.a.<init>(Unknown Source)
	at j.g.<init>(Unknown Source)
	at Game.a.<init>(Unknown Source)
	at Game.d.run(Unknown Source)
	at java.lang.Thread.run(Thread.java:722)
java.lang.NullPointerException
	at org.lwjgl.opengl.GL11.glGenTextures(GL11.java:1372)
	at g.d.b(Unknown Source)
	at g.d.a(Unknown Source)
	at g.d.a(Unknown Source)
	at d.d.e(Unknown Source)
	at d.a.b.<init>(Unknown Source)
	at d.d.<init>(Unknown Source)
	at j.a.<init>(Unknown Source)
	at j.g.<init>(Unknown Source)
	at Game.a.<init>(Unknown Source)
	at Game.d.run(Unknown Source)
	at java.lang.Thread.run(Thread.java:722)
java.lang.NullPointerException
	at org.lwjgl.opengl.GL11.glGenTextures(GL11.java:1372)
	at g.d.b(Unknown Source)
	at g.d.a(Unknown Source)
	at g.d.a(Unknown Source)
	at g.a.<init>(Unknown Source)
	at h.d.<init>(Unknown Source)
	at f.d.<init>(Unknown Source)
	at Game.a.<init>(Unknown Source)
	at Game.d.run(Unknown Source)
	at java.lang.Thread.run(Thread.java:722)
java.lang.NullPointerException
	at org.lwjgl.opengl.GL11.glGenTextures(GL11.java:1372)
	at g.d.b(Unknown Source)
	at g.d.a(Unknown Source)
	at g.d.a(Unknown Source)
	at d.a.e(Unknown Source)
	at d.a.b.<init>(Unknown Source)
	at d.a.<init>(Unknown Source)
	at h.a.<init>(Unknown Source)
	at h.d.k(Unknown Source)
	at h.d.<init>(Unknown Source)
	at f.d.<init>(Unknown Source)
	at Game.a.<init>(Unknown Source)
	at Game.d.run(Unknown Source)
	at java.lang.Thread.run(Thread.java:722)
java.lang.NullPointerException
	at org.lwjgl.opengl.GL11.glGenTextures(GL11.java:1372)
	at g.d.b(Unknown Source)
	at g.d.a(Unknown Source)
	at g.d.a(Unknown Source)
	at d.b.e(Unknown Source)
	at d.a.b.<init>(Unknown Source)
	at d.b.<init>(Unknown Source)
	at h.a.<init>(Unknown Source)
	at h.d.k(Unknown Source)
	at h.d.<init>(Unknown Source)
	at f.d.<init>(Unknown Source)
	at Game.a.<init>(Unknown Source)
	at Game.d.run(Unknown Source)
	at java.lang.Thread.run(Thread.java:722)
java.lang.NullPointerException
	at org.lwjgl.opengl.GL11.glGenTextures(GL11.java:1372)
	at g.d.b(Unknown Source)
	at g.d.a(Unknown Source)
	at g.d.a(Unknown Source)
	at g.b.<init>(Unknown Source)
	at c.a.b.<init>(Unknown Source)
	at Game.a.<init>(Unknown Source)
	at Game.d.run(Unknown Source)
	at java.lang.Thread.run(Thread.java:722)
java.lang.NullPointerException
	at org.lwjgl.opengl.GL11.glGenTextures(GL11.java:1372)
	at g.d.b(Unknown Source)
	at g.d.a(Unknown Source)
	at g.d.a(Unknown Source)
	at d.c.e(Unknown Source)
	at d.a.b.<init>(Unknown Source)
	at d.c.<init>(Unknown Source)
	at c.a.b.<init>(Unknown Source)
	at Game.a.<init>(Unknown Source)
	at Game.d.run(Unknown Source)
	at java.lang.Thread.run(Thread.java:722)
java.lang.NullPointerException
	at org.lwjgl.opengl.GL11.glGenTextures(GL11.java:1372)
	at g.d.b(Unknown Source)
	at g.d.a(Unknown Source)
	at g.d.a(Unknown Source)
	at d.c.e(Unknown Source)
	at d.a.b.<init>(Unknown Source)
	at d.c.<init>(Unknown Source)
	at c.a.b.<init>(Unknown Source)
	at Game.a.<init>(Unknown Source)
	at Game.d.run(Unknown Source)
	at java.lang.Thread.run(Thread.java:722)
java.lang.NullPointerException
	at org.lwjgl.opengl.GL11.glGenTextures(GL11.java:1372)
	at g.d.b(Unknown Source)
	at g.d.a(Unknown Source)
	at g.d.a(Unknown Source)
	at g.a.<init>(Unknown Source)
	at c.a.b.<init>(Unknown Source)
	at Game.a.<init>(Unknown Source)
	at Game.d.run(Unknown Source)
	at java.lang.Thread.run(Thread.java:722)
Exception in thread "Thread-3" java.lang.NullPointerException
	at org.lwjgl.opengl.GL11.glGenLists(GL11.java:1391)
	at c.a.b.<init>(Unknown Source)
	at Game.a.<init>(Unknown Source)
	at Game.d.run(Unknown Source)
	at java.lang.Thread.run(Thread.java:722)
Exited succesfull

Mother of errors…
Well it seems i need some more exception handling to stop those extra errors.
Im going to try to fix this.

Thanks for trying.

*It seems this bug happen rarely on random games under osx, are you running java 1.7?

New version with less bugs (i hope): http://www.mediafire.com/?fbd3ymsshhuo2m5

Yeah, I’m running Java 7.

Regenuluz@Medusa ~ $ java -version
java version "1.7.0_04"
Java(TM) SE Runtime Environment (build 1.7.0_04-b21)
Java HotSpot(TM) 64-Bit Server VM (build 23.0-b21, mixed mode)

I’m getting the same error from the new build. ^^

Ehmm… i dont know it.
All threads i can find about it just tell to rollback to java 6.
Do other java games (using lwjgl) work well for you?