{"id":2094,"date":"2016-11-02T19:29:17","date_gmt":"2016-11-02T23:29:17","guid":{"rendered":"http:\/\/wizardwalk.com\/newblather\/?p=2094"},"modified":"2016-11-02T19:31:20","modified_gmt":"2016-11-02T23:31:20","slug":"game-programming","status":"publish","type":"post","link":"http:\/\/wizardwalk.com\/newblather\/?p=2094","title":{"rendered":"Game programming&#8230;"},"content":{"rendered":"<p>Last year I learned the basics of <a href=\"http:\/\/jmonkeyengine.org\/\">jMonkeyEngine<\/a>, and though I intended to create a 2D game with it, I only ended up creating the MIDI animator mentioned in my last post. But for a tile-based 2D game, it&#8217;s really not ideal. It&#8217;s certainly <em>capable<\/em> of producing such a game, but as an engine, it&#8217;s not really designed for it, and I realized I&#8217;d have to spend a considerable amount of time just programming a custom framework for such a project.<\/p>\n<p>So last month I began learning <a href=\"https:\/\/libgdx.badlogicgames.com\/\">LibGDX<\/a>, which is certainly better suited for the sort of tile-based 2D adventure game I&#8217;d like to create.<\/p>\n<p>So here&#8217;s what I&#8217;ve got so far (the art is temporary, simply a free tile set I found out there, though I think I&#8217;ll be aiming for tiles that are 16&#215;16 pixels as well, so this represents the size I&#8217;m hoping for):<\/p>\n<p><img loading=\"lazy\" style=\"display: block; float: none; margin-left: auto; margin-right: auto; box-shadow: 3px 3px 7px #000; border-width: 0px;\" src=\"http:\/\/wizardwalk.com\/newblather\/wp-content\/uploads\/2016\/11\/Game-1.png\" alt=\"screenshot\" width=\"500\" height=\"291\" \/><\/p>\n<p>Doesn&#8217;t look like much, but I&#8217;m still learning and programming the basics I&#8217;ll need before I actually start programming the actual game play. What I&#8217;ve learned and\/or programmed so far includes:<\/p>\n<ul>\n<li>loading and displaying a tilemap (a .tmx file from <a href=\"http:\/\/www.mapeditor.org\/\">Tiled<\/a>)<\/li>\n<li>dynamic window resizing (or resolution changing) without completely screwing up the aspect ratio (trickier than it may sound)\n<ul>\n<li>basically it will always render with a resolution of 1280&#215;720, which is then rendered as a texture to whatever resolution the user sets; handy for Android devices which may feature differing resolutions which cannot be changed<\/li>\n<\/ul>\n<\/li>\n<li>using <a href=\"https:\/\/github.com\/libgdx\/ashley\">Ashley<\/a> as an entity framework<\/li>\n<li>using <a href=\"https:\/\/github.com\/erincatto\/Box2D\">Box2D<\/a> for character movement and collision detection<\/li>\n<li>animating the character as he walks (much easier with LibGDX; I had to program a custom shader with jMonkeyEngine)<\/li>\n<li>real-time A* pathfinding (hope to use it with NPCs)<\/li>\n<li>text (as you can see at the bottom there) to be used with menus, dialog, etc. (nice little font called <a href=\"http:\/\/tenbytwenty.com\/?xxxx_posts=munro\">Munro<\/a>) (this is also much easier with LibGDX)<\/li>\n<li>custom shader to make object tiles &#8220;light up&#8221;<\/li>\n<\/ul>\n<p>Still lots to program, but I reckon that&#8217;s an OK start. The to-do list before I can actually begin programming the actual game-play logic includes:<\/p>\n<ul>\n<li>have interactable objects &#8220;light up&#8221; as the player nears them, along with a small pop up menu with available actions (pick up, talk, examine, activate, etc.)<\/li>\n<li>design and implement a menu panel \/ status bar (along the black panel along the bottom)\n<ul>\n<li>this menu will switch to a &#8220;dialog mode&#8221; when the character is talking with someone (as in <em>The Secret of\u00a0<\/em><em>Monkey Island<\/em>, for example)<\/li>\n<\/ul>\n<\/li>\n<li>pause menu with save, load, quit, settings, etc.<\/li>\n<li>camera movement for when the player walks off the screen<\/li>\n<li>loading another tilemap for when the character leaves a village or enters a house, for example<\/li>\n<li>I need to try sticking an NPC in there and having it play through some scripted material, utilizing the aforementioned A* algorithm as necessary<\/li>\n<li>real-time combat system\n<ul>\n<li>cast a spell or swing a sword to injure attacking enemies (the combat will be simple in this game, nothing fancy)<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>That&#8217;s all I can think of at the moment, but that&#8217;s plenty, isn&#8217;t it?<\/p>\n<p>The game itself will be pretty short; I&#8217;ve tried to keep it short on purpose since even a short game is a lot of work, especially when you&#8217;ve never done it before and don&#8217;t have a pre-existing framework your familiar with to use. If I manage to actually succeed in this endeavor, I hope it will be easier to create new adventure games and\/or RPGs in a similar style without having to reprogram these basics again, at least not from scratch.<\/p>\n<p>The tentative title for the game is\u00a0<em>Memory of a Thousand Kings<\/em>, which began as a half-plotted fantasy novel, but I think it will work better as an adventure game.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Last year I learned the basics of jMonkeyEngine, and though I intended to create a 2D game with it, I only ended up creating the MIDI animator mentioned in my last post. But for a tile-based 2D game, it&#8217;s really not ideal. It&#8217;s certainly capable of producing such a game, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[19],"tags":[743],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p7gI4B-xM","_links":{"self":[{"href":"http:\/\/wizardwalk.com\/newblather\/index.php?rest_route=\/wp\/v2\/posts\/2094"}],"collection":[{"href":"http:\/\/wizardwalk.com\/newblather\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/wizardwalk.com\/newblather\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/wizardwalk.com\/newblather\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/wizardwalk.com\/newblather\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2094"}],"version-history":[{"count":4,"href":"http:\/\/wizardwalk.com\/newblather\/index.php?rest_route=\/wp\/v2\/posts\/2094\/revisions"}],"predecessor-version":[{"id":2099,"href":"http:\/\/wizardwalk.com\/newblather\/index.php?rest_route=\/wp\/v2\/posts\/2094\/revisions\/2099"}],"wp:attachment":[{"href":"http:\/\/wizardwalk.com\/newblather\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2094"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/wizardwalk.com\/newblather\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2094"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/wizardwalk.com\/newblather\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2094"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}