{"id":190,"date":"2012-04-17T17:35:09","date_gmt":"2012-04-17T17:35:09","guid":{"rendered":"https:\/\/www.cores2.com\/blog\/?p=190"},"modified":"2012-04-19T18:04:02","modified_gmt":"2012-04-19T18:04:02","slug":"spacecore-java-lwjgl-flight-simulator","status":"publish","type":"post","link":"https:\/\/www.cores2.com\/blog\/?p=190","title":{"rendered":"SpaceCore &#8211; Java LWJGL Flight Simulator"},"content":{"rendered":"<p>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.<\/p>\n<p>I&#8217;ve <a href=\"https:\/\/www.cores2.com\/blog\/?p=107\">mentioned in a previous post<\/a> 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&#8217;t (or shouldn&#8217;t, if you know what you&#8217;re doing) matter!<\/p>\n<p>Game development is complex, and really requires a big effort to\u00c2\u00a0distinguish\u00c2\u00a0between processor-side computing and graphics-side computing. In the end, even if Java wasn&#8217;t JIT-based, a simple video game shouldn&#8217;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 &amp; environments for programming games: the tools and easier, you can develop faster, and all of the built-in libraries really help\u00c2\u00a0enormously!<\/p>\n<p style=\"text-align: center;\"><iframe loading=\"lazy\" src=\"http:\/\/www.youtube.com\/embed\/XhFcmbo4abw\" frameborder=\"0\" width=\"420\" height=\"315\"><\/iframe><\/p>\n<p>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.<\/p>\n<p>Interested in reading the source, or executing the game yourself? <a href=\"https:\/\/www.cores2.com\/files\/SpaceCore.zip\">Grab it here<\/a>! <strong>Be warned<\/strong>: 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.<\/p>\n<p><strong>Update:<\/strong>\u00c2\u00a0The project is now <a href=\"https:\/\/github.com\/nint22\/SpaceCore\">up on GitHub<\/a>. This was done to allow easier forking and experimentation by the fantastic Reddit community.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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&#8217;ve mentioned in a previous post that &hellip; <a href=\"https:\/\/www.cores2.com\/blog\/?p=190\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-190","post","type-post","status-publish","format-standard","hentry","category-news_updates"],"_links":{"self":[{"href":"https:\/\/www.cores2.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/190","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cores2.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cores2.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cores2.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cores2.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=190"}],"version-history":[{"count":0,"href":"https:\/\/www.cores2.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/190\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.cores2.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=190"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cores2.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=190"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cores2.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=190"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}