Core S2 Software Solutions

SpaceCore – Java LWJGL Flight Simulator

I wrote a little space-flight over this past weekend. I wanted to learn more about Java, LWJGL (an OpenGL java bindings library), and most importantly: how a slow processor-side run-time affect graphical performance.

I’ve mentioned in a previous post that Java, and other byte-code languages, actually use a JIT (Just-in-Time) compilation technique to really speed up execution. Still, even with such technologies, the run-times are not as fast as native-languages (i.e. compiled into native code, like C or C++), yet what I learned was that it doesn’t (or shouldn’t, if you know what you’re doing) matter!

Game development is complex, and really requires a big effort to distinguish between processor-side computing and graphics-side computing. In the end, even if Java wasn’t JIT-based, a simple video game shouldn’t require heavy processor-side computing, as much of your work really should be pushed onto the graphics card. Though my game is tiny and requires little processing, I can see why people would used managed languages & environments for programming games: the tools and easier, you can develop faster, and all of the built-in libraries really help enormously!

Above is the video game I worked on. There is no story or premise: again, the whole point was to see if I could prototype a game very quickly. Not mentioned in the video was that I had to re-learn quaternions and use that to help with ship control and rotations, rather than directly use Euler-based pitch/yaw.

Interested in reading the source, or executing the game yourself? Grab it here! Be warned: I butchered the source code for the sake of experimentation, and this is very far from any professional code I would write on a real-world project.

Update: The project is now up on GitHub. This was done to allow easier forking and experimentation by the fantastic Reddit community.

This entry was posted in News & Updates. Bookmark the permalink.

8 Responses to SpaceCore – Java LWJGL Flight Simulator

  1. Brendan ☼ says:

    Loving the rustic aesthetic! A great illustration of how effective simplicity can be. And the shadow technique is nice too – will have to file that one away in the brain. :)

    • jbridon says:

      Thanks! Your website has some really impressive art-style similar to what I was aiming for.

      • Brendan ☼ says:

        Yeah, I think the aesthetic has tons of potential – it’s just really hard for me to make any progress. I’m pretty impressed at what you managed to do in a weekend – I guess it’s all experience. :)

  2. owen says:

    I love OBJ files! hate java :( good luck.

  3. keven says:

    can i use java to simulate a flight like this plus some more features like with a destination/origin/coordinates?

  4. Koko1 says:

    Hey thanks for the spacecore example its really good. I downloaded the source code and tried to run the java code but it wouldn’t run, could you please help me with it. thanks!

  5. Sebastian says:

    Hi, nice simulator! I have one problem though: I tried your code and the camera is not behind the plane as in the video, but stays in the middle of the world box. How can I fix this?

  6. Sebastian says:

    Never mind, I just found the boolean responsible for that :)

Leave a Reply

Your email address will not be published. Required fields are marked *


*

Sites map