{"id":568,"date":"2016-02-28T14:42:31","date_gmt":"2016-02-28T22:42:31","guid":{"rendered":"https:\/\/jacksontech.net\/?p=568"},"modified":"2016-02-28T14:43:13","modified_gmt":"2016-02-28T22:43:13","slug":"voxel-engine-project-aiblocks","status":"publish","type":"post","link":"https:\/\/jacksontech.net\/index.php\/2016\/02\/voxel-engine-project-aiblocks\/","title":{"rendered":"Voxel Engine Project: AIBlocks"},"content":{"rendered":"<h1>AIBlocks<\/h1>\n<p>This is the first in a series of posts describing my current development project, AIBlocks. It is a voxel game engine (similar to Minecraft) that I am developing to study various techniques for procedural world generation, networked game systems, video game artificial intelligence, and Java optimization. I&#8217;m also brushing up on my OpenGL knowledge and getting some valuable practice using modern software design techniques and patterns.<\/p>\n<p>AIBlocks grew out of a project for an Artificial Intelligence course (CSc 215) at CSU Sacramento. It was initially a study in A* pathfinding, but quickly grew over the course of a week into a small OpenGL-powered game engine that looks (coincidentally, of course) like a certain very popular video game. These blog posts document my progress and interesting problems I&#8217;ve encountered, as well as related research.<\/p>\n<h1>Project Status, February 2016<\/h1>\n<p>Here&#8217;s what the project looks like currently:<\/p>\n<div id=\"attachment_573\" class=\"wp-caption alignleft\" style=\"width: 768px\"><a href=\"https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/02\/progress_2_20_2016.png\" rel=\"attachment wp-att-573\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium_large wp-image-573\" src=\"https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/02\/progress_2_20_2016-768x564.png\" alt=\"Image of textures\" width=\"768\" height=\"564\" srcset=\"https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/02\/progress_2_20_2016-768x564.png 768w, https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/02\/progress_2_20_2016-300x221.png 300w, https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/02\/progress_2_20_2016-1024x753.png 1024w, https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/02\/progress_2_20_2016.png 1600w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><p class=\"wp-caption-text\">Textures courtesy of public-domain SoarTex pack<\/p><\/div>\n<p>&nbsp;<\/p>\n<div id=\"attachment_572\" class=\"wp-caption alignleft\" style=\"width: 768px\"><a href=\"https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/02\/game111.png\" rel=\"attachment wp-att-572\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium_large wp-image-572\" src=\"https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/02\/game111-768x564.png\" alt=\"Screenshot of terrain\" width=\"768\" height=\"564\" srcset=\"https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/02\/game111-768x564.png 768w, https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/02\/game111-300x220.png 300w, https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/02\/game111-1024x751.png 1024w, https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/02\/game111.png 1600w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><p class=\"wp-caption-text\">Procedurally generated terrain using OpenSimplex noise. Fully pathfindable.<\/p><\/div>\n<p>&nbsp;<\/p>\n<div id=\"attachment_569\" class=\"wp-caption alignleft\" style=\"width: 768px\"><a href=\"https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/02\/pathfinding.png\" rel=\"attachment wp-att-569\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium_large wp-image-569\" src=\"https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/02\/pathfinding-768x563.png\" alt=\"Image of a-star pathfinding\" width=\"768\" height=\"563\" srcset=\"https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/02\/pathfinding-768x563.png 768w, https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/02\/pathfinding-300x220.png 300w, https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/02\/pathfinding-1024x751.png 1024w, https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/02\/pathfinding.png 1600w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><p class=\"wp-caption-text\">Pathfinding in a procedurally-generated 3D environment using A*<\/p><\/div>\n<p>&nbsp;<\/p>\n<div id=\"attachment_570\" class=\"wp-caption alignleft\" style=\"width: 768px\"><a href=\"https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/02\/ai6.png\" rel=\"attachment wp-att-570\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-570 size-medium_large\" src=\"https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/02\/ai6-768x445.png\" alt=\"Image of pathfinding\" width=\"768\" height=\"445\" srcset=\"https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/02\/ai6-768x445.png 768w, https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/02\/ai6-300x174.png 300w, https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/02\/ai6-1024x593.png 1024w, https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/02\/ai6.png 1370w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><p class=\"wp-caption-text\">More 3D pathfinding<\/p><\/div>\n<p>&nbsp;<\/p>\n<h1>Current Features<\/h1>\n<ul>\n<li>Infinitely-generated terrain (a-la Minecraft) using OpenSimplex noise.<\/li>\n<li>Brute-force meshing algorithm to remove unseen faces.<\/li>\n<li>AI pathfinding using A*.<\/li>\n<li>Entities that can jump to navigate terrain.<\/li>\n<li>Passable terrain physics for players and entities.<\/li>\n<\/ul>\n<h1>Technical Details<\/h1>\n<p>The engine is implemented using OpenGL 2.1 (plus VAO extension) via the <a href=\"http:\/\/legacy.lwjgl.org\" target=\"_blank\">Lightweight Java Game Library, version 2<\/a>. I targeted OpenGL 2.1 so the engine would run on my laptop, which has a 1st gen Intel HD Graphics integrated GPU. However, after seeing the abysmal performance of that GPU, I will probably drop support for older versions of OpenGL and move up to OpenGL 3.x. The engine is very performant on an Intel Atom + 4th gen Intel HD Graphics tablet, getting 60FPS even on battery, at least until you explore enough terrain to make it bog down.<\/p>\n<p>Terrain is generated using a public-domain <a href=\"https:\/\/gist.github.com\/KdotJPG\/b1270127455a94ac5d19\" target=\"_blank\">OpenSimplex Noise<\/a> implementation that generates a heightmap on the fly from a seed. (No caves yet!)<\/p>\n<h1>Roadmap<\/h1>\n<p>AIBlocks started as a &#8220;what-if&#8221; project, and I didn&#8217;t plan it out very well; my goal was essentially &#8220;see what I can make in a day&#8221;, which grew to two days, then three&#8230;<\/p>\n<p>While this was a great way to impart impetus on an exploration-style project like AIBlocks, random flailing and &#8220;chasing the shiny&#8221; wasn&#8217;t going to see the project through to completion. At the very least, I needed goals that I could break down into smaller tasks to focus on one at a time. Even better would be an end goal so I could declare the project done (or as close to done as possible) at some point in the future. So I sat down and laid out some constraints for the project.<\/p>\n<p><strong>Major &#8220;must-have&#8221; features:<\/strong><\/p>\n<ul>\n<li>Terrain generation: <strong>done<\/strong>!<\/li>\n<li>NPC Pathfinding (A*): <strong>done!<\/strong><\/li>\n<li>NPC behavior (Behavior Trees, Boids)<\/li>\n<li>Block placement\/removal<\/li>\n<li>Very simple combat system<\/li>\n<\/ul>\n<p><strong>&#8220;Nice-to-have&#8221; features:<\/strong><\/p>\n<ul>\n<li>Improved engine architecture (I&#8217;m eying <a href=\"https:\/\/en.wikipedia.org\/wiki\/Entity_component_system\" target=\"_blank\">Entity-Component systems<\/a>)<\/li>\n<li>Biomes<\/li>\n<li>Cave generation<\/li>\n<li>Generated world structures (houses, etc): partially done if you consider trees.<\/li>\n<li>Networked support for multiple players<\/li>\n<li>World saving\/loading<\/li>\n<\/ul>\n<p><strong>&#8220;Definitely not doing unless I get lots of free time&#8221; features:<\/strong><\/p>\n<ul>\n<li>Mining mechanics<\/li>\n<li>Crafting recipes<\/li>\n<li>XP<\/li>\n<li>Enchanting<\/li>\n<li>Basically anything else from Minecraft<\/li>\n<\/ul>\n<p>The project covered a lot of ground (no pun intended) since I started it a few weeks ago. The next few blog posts will be retroactively analyzing various parts of the engine before I move on to new features.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>AIBlocks This is the first in a series of posts describing my current development project, AIBlocks. It is a voxel game engine (similar to Minecraft) that I am developing to study various techniques for procedural world generation, networked game systems, video game artificial intelligence, and Java optimization. I&#8217;m also brushing up on my OpenGL knowledge &#8230; <a class=\"moretag\" href=\"https:\/\/jacksontech.net\/index.php\/2016\/02\/voxel-engine-project-aiblocks\/\">more<\/a><\/p>\n","protected":false},"author":1,"featured_media":573,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[82,28,9],"tags":[87,83,86,85,84,89,60,63,88],"class_list":["post-568","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-aiblocks","category-personal","category-projects","tag-ai","tag-aiblocks","tag-artificial-intelligence","tag-games","tag-java","tag-minecraft","tag-programming","tag-project","tag-video-games"],"_links":{"self":[{"href":"https:\/\/jacksontech.net\/index.php\/wp-json\/wp\/v2\/posts\/568","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jacksontech.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jacksontech.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jacksontech.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jacksontech.net\/index.php\/wp-json\/wp\/v2\/comments?post=568"}],"version-history":[{"count":12,"href":"https:\/\/jacksontech.net\/index.php\/wp-json\/wp\/v2\/posts\/568\/revisions"}],"predecessor-version":[{"id":584,"href":"https:\/\/jacksontech.net\/index.php\/wp-json\/wp\/v2\/posts\/568\/revisions\/584"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/jacksontech.net\/index.php\/wp-json\/wp\/v2\/media\/573"}],"wp:attachment":[{"href":"https:\/\/jacksontech.net\/index.php\/wp-json\/wp\/v2\/media?parent=568"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jacksontech.net\/index.php\/wp-json\/wp\/v2\/categories?post=568"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jacksontech.net\/index.php\/wp-json\/wp\/v2\/tags?post=568"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}