<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2204332218642508435</id><updated>2026-09-11T03:36:56.276-04:00</updated><category term="Java"/><category term="Games"/><category term="Game Development"/><category term="2D tile map"/><category term="Graphics"/><category term="Game Programming"/><category term="Rendering"/><category term="Snippet"/><category term="green algae"/><category term="updates"/><category term="Design"/><category term="Image Loading"/><category term="OpenGL"/><category term="game design"/><category term="lwjgl"/><category term="2D Level"/><category term="Display"/><category term="Image"/><category term="Map Generation"/><category term="Programming"/><category term="Tiles"/><category term="XNA"/><category term="character movement"/><category term="game mechanics"/><category term="jogl"/><category term="lwjgl 3"/><category term="movement"/><category term="update"/><category term="DirectX"/><category term="Double Buffering"/><category term="Eclipse"/><category term="Game Maker"/><category term="JFrame"/><category term="Silverlight"/><category term="Silverlight Games"/><category term="Timed Rendering"/><category term="collision detection"/><category term="development journal"/><category term="frontiersman"/><category term="game"/><category term="game movement"/><category term="game update"/><category term="github"/><category term="java image loading"/><category term="java rendering performance"/><category term="java2D"/><category term="jogl textures"/><category term="layering"/><category term="progress"/><category term="projects"/><category term="voxel game"/><category term=".x"/><category term="3D programming"/><category term="Animation"/><category term="CSharp"/><category term="Design Patterns"/><category term="Expression"/><category term="Expression Blend"/><category term="Fullscreen"/><category term="Game Engine"/><category term="Game Engine Design"/><category term="Image Manager"/><category term="Images"/><category term="Jitter"/><category term="Maps"/><category term="Minecraft"/><category term="Minecraft Like"/><category term="Ruby"/><category term="SDL"/><category term="State"/><category term="State Machine"/><category term="Tutorials"/><category term="Visual Studios"/><category term="Window"/><category term="applet"/><category term="bufferedimage"/><category term="character"/><category term="colliders"/><category term="collision"/><category term="collision results"/><category term="debugging"/><category term="faster rendering"/><category term="game development process"/><category term="game making"/><category term="gamedev"/><category term="grid indexing"/><category term="jME"/><category term="lwjgl 3 textures"/><category term="math"/><category term="mechanics"/><category term="multiple layers multi-layers"/><category term="poll"/><category term="pup8bit"/><category term="ramblings"/><category term="sprites"/><category term="status"/><category term="transparency"/><category term="1000 games"/><category term="2d shooter"/><category term="360 degree movement"/><category term="3D engines"/><category term="3D games"/><category term="3d"/><category term="3d modeler"/><category term="3dsmax"/><category term="Angular movement"/><category term="Animations"/><category term="Anti-Aliasing"/><category term="Audio"/><category term="AudioClip"/><category term="Blender"/><category term="BufferStrategy"/><category term="BufferUtils"/><category term="C++"/><category term="Canvas"/><category term="Centering"/><category term="Code Completition"/><category term="Code Structure"/><category term="ConcurrentLinkedQueue"/><category term="Construct"/><category term="Dialog"/><category term="Display Modes"/><category term="Download"/><category term="Drawing"/><category term="Dwarf Fortress"/><category term="Effects"/><category term="Flickering"/><category term="Frames"/><category term="GL_BLEND"/><category term="GL_ONE_MINUS_SRC_ALPHA"/><category term="Game Context"/><category term="Game Creator"/><category term="Games Industry"/><category term="General"/><category term="Graphics2D"/><category term="HTML"/><category term="Heightmap"/><category term="Ideas"/><category term="Independent"/><category term="Indie"/><category term="Infinite world"/><category term="Input"/><category term="Intellisense"/><category term="JEditorPane"/><category term="Java Monkey Engine"/><category term="Keyboard"/><category term="Level Editor"/><category term="Levels"/><category term="MOGRE"/><category term="Microsoft"/><category term="Miscellaneous"/><category term="Music"/><category term="New Design"/><category term="News"/><category term="Notes"/><category term="Ogre3D"/><category term="Ogre4j"/><category term="Ogrerb"/><category term="Opinion"/><category term="Perlin Noise"/><category term="Primitives"/><category term="Python"/><category term="Python Ogre"/><category term="RenderingHints"/><category term="Resource Manager"/><category term="Room Escape"/><category term="Room Escape Example"/><category term="Screen"/><category term="ScreenModes"/><category term="Scrolling"/><category term="Side Projects"/><category term="Silverlight Example"/><category term="Singleton"/><category term="Sound"/><category term="Source Browsing"/><category term="SwingUtilities"/><category term="Tearing"/><category term="TextureManager"/><category term="Thoughts"/><category term="Tips and Tricks"/><category term="Using Singletons"/><category term="XNA content pipeline"/><category term="acceleration"/><category term="acheivements"/><category term="adsense"/><category term="adsense revenue"/><category term="advice"/><category term="algorithms"/><category term="alpha blending"/><category term="alpha function"/><category term="android"/><category term="auto format"/><category term="auto-generating"/><category term="behavior tree"/><category term="behaviortree"/><category term="behaviortrees"/><category term="chopping"/><category term="chopping down trees"/><category term="code"/><category term="coffee"/><category term="coffeescript"/><category term="color filtering"/><category term="comments"/><category term="cubes"/><category term="decisions"/><category term="demo"/><category term="dev log"/><category term="directional movement"/><category term="disruptor"/><category term="document navigation"/><category term="dungeon"/><category term="dungeon crawler"/><category term="dwarves"/><category term="enhance gameplay"/><category term="exporters"/><category term="fbx"/><category term="file formats"/><category term="first android app"/><category term="free game"/><category term="free game download"/><category term="fun programming"/><category term="fx"/><category term="gamasutra"/><category term="game building"/><category term="game development concepts"/><category term="game ideas"/><category term="game logic"/><category term="game math"/><category term="game release"/><category term="game reward systems"/><category term="gameplay"/><category term="generate dungeon"/><category term="gist"/><category term="git"/><category term="haxe flixel"/><category term="high CPU usage"/><category term="hints"/><category term="how to"/><category term="how to make games"/><category term="image editor"/><category term="image manipulation"/><category term="importers"/><category term="interoperability"/><category term="introspective"/><category term="jar"/><category term="jar file"/><category term="java images"/><category term="java transparency"/><category term="jmonkeyengine"/><category term="jogl texture transparency"/><category term="jruby"/><category term="jump mechanic"/><category term="jumping"/><category term="language"/><category term="lmax disruptor"/><category term="loading from a jar"/><category term="loading textures"/><category term="lwjgl 3 project"/><category term="making games"/><category term="map"/><category term="maven"/><category term="maven lwjgl"/><category term="maven lwjgl eclipse"/><category term="max"/><category term="models"/><category term="mouse movement"/><category term="musings"/><category term="nashorn"/><category term="neat features"/><category term="opengl-es"/><category term="organize imports"/><category term="orge3d"/><category term="particles"/><category term="pathfinding"/><category term="performance"/><category term="personal"/><category term="platform"/><category term="platformer"/><category term="play"/><category term="plugins"/><category term="png"/><category term="prototypes"/><category term="pyOgre"/><category term="resources"/><category term="responses"/><category term="scaling"/><category term="screenshot"/><category term="ship builder"/><category term="shooter"/><category term="skeletal animation system"/><category term="snippets"/><category term="space partitioning"/><category term="sprite"/><category term="sprite system"/><category term="static functions"/><category term="summoning"/><category term="swing"/><category term="test"/><category term="test cube"/><category term="texture"/><category term="texture binding"/><category term="texture mapping"/><category term="thanksgiving"/><category term="threading"/><category term="tile map editor"/><category term="tile sheets"/><category term="tile transitioning"/><category term="timestep"/><category term="timing"/><category term="traffic report"/><category term="troubles"/><category term="troubleshooting"/><category term="turkey"/><category term="unity"/><category term="unreal engine"/><category term="updating"/><category term="vector"/><category term="work in progress"/><category term="z-ordering"/><title type='text'>Game Programming Snippets</title><subtitle type='html'>Place to find helpful snippets of code to use in making your own games.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://gpsnippets.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2204332218642508435/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://gpsnippets.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/2204332218642508435/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Nick</name><uri>http://www.blogger.com/profile/00969811931456041499</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>105</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2204332218642508435.post-7100091409805200937</id><published>2023-05-15T18:48:00.001-04:00</published><updated>2023-05-15T18:48:32.707-04:00</updated><title type='text'>Actions Must Have Consequences </title><content type='html'>I&#39;ve tried a number of different Android games recently. And i noticed a disturbing trend all of them simply give you actions to take that have zero consequences. All the micro transactions gatewayed games are all the same.&amp;nbsp;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;They were actually a type of online game that way pretty easy to make they involved lots of players all competing in a ranked challenge. The biggest problem of course for winning these games was to either gang up in large groups to trounce your enemies or pay a little or a lot to win. These style of games have transitioned into the mobile space for a long time now.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;I&#39;m talking about games like &amp;lt;insert-game-here&amp;gt;. Not only these games but also games like idle apocalypse, marvel snap, and others. It could be described as soulless. Because the big problem is that when you take an action in the game you don&#39;t have any consequences. It&#39;s impossible to take a bad action almost. Since the design is to keep you playing every day. And when you do loose something I&#39;m these games it usually comes as a waste of money if you&#39;ve sunken anything into them.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;They are being very aptly compared to gambling games. Or casino games where by your only actual action is pressing a button. And any kind of &#39;fun&#39; is simply watching an animation. And your only goal is to find all the animations in the game. They are very devoid of meaning. And a huge part of this is driven by the similarity of mechanics that all these types of mobile games or Farmville style games have.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;They are devoid of consequences which removes all meaning. For sure these games are ones without a loose condition making them as safe for players as possible. However this is just lazy designing, it&#39;s safe for the designer. if you actually put in consequences for the player and give them one chance with new game or start over then how can there be any meaning.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;By the way I am fine with games that do not have a loose condition so it&#39;s&amp;nbsp;&lt;/div&gt;</content><link rel='replies' type='text/html' href='http://gpsnippets.blogspot.com/2023/05/actions-must-have-consequences.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2204332218642508435/posts/default/7100091409805200937'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2204332218642508435/posts/default/7100091409805200937'/><link rel='alternate' type='text/html' href='http://gpsnippets.blogspot.com/2023/05/actions-must-have-consequences.html' title='Actions Must Have Consequences '/><author><name>Nick</name><uri>http://www.blogger.com/profile/00969811931456041499</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2204332218642508435.post-460619219071670114</id><published>2019-05-16T09:21:00.001-04:00</published><updated>2019-05-16T09:24:58.550-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="free game"/><category scheme="http://www.blogger.com/atom/ns#" term="free game download"/><category scheme="http://www.blogger.com/atom/ns#" term="game release"/><category scheme="http://www.blogger.com/atom/ns#" term="gamedev"/><title type='text'>Amber Sol game release 0.5.1</title><content type='html'>&lt;p dir=&quot;ltr&quot;&gt;https://youtu.be/&lt;u&gt;jfu0TT3bCx8&lt;/u&gt;&lt;/p&gt;
&lt;p dir=&quot;ltr&quot;&gt;Here is a gameplay video of the 0.5.1 release which you can download and play for free on itch.io https://addiekinstudio.itch.io/amber-game-project&lt;/p&gt;
&lt;p dir=&quot;ltr&quot;&gt;Any feedback is appreciated even if it&#39;s negative.&lt;/p&gt;
&lt;p dir=&quot;ltr&quot;&gt;I hope you enjoy!&lt;/p&gt;
</content><link rel='replies' type='text/html' href='http://gpsnippets.blogspot.com/2019/05/amber-sol-game-release-051.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2204332218642508435/posts/default/460619219071670114'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2204332218642508435/posts/default/460619219071670114'/><link rel='alternate' type='text/html' href='http://gpsnippets.blogspot.com/2019/05/amber-sol-game-release-051.html' title='Amber Sol game release 0.5.1'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2204332218642508435.post-5203568679730254443</id><published>2019-05-07T13:58:00.001-04:00</published><updated>2019-05-07T14:42:07.649-04:00</updated><title type='text'>Why you should write your own tools!</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
Tools, Tools, Tools&lt;/h3&gt;
&lt;div&gt;
I am all about the tools. When I think about what a tool does for me its really about doing the heavy lifting. It&#39;s about moving mountains not simply hammering in nails. I think that helps me focus on the right features when writing the tools I need.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
When making games everything about the game code is very much unique. And you really want it to be that way. You want to be able to control the whole experience. None of it should feel out of place or break the experience with the game for the player. Even the menus and screens you interact with should be fun and enjoyable. You want there to be constant feedback and everything to be themed to match your game art, setting, etc.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Aside from just the UI and menus games must have content. Plenty of content! Creating this much content is hard work and time consuming. You want the maps to be large enough, the world to feel as big as you can. You want to make the game feel new and fresh every time the player jumps into the game. The player needs to feel like there is something left to discover and that means more and more content.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
Building all that content can take up a lot of time so most game developers will build tools to take the tedium or error prone pieces out of building it. As a developer you want to be able to tweak things easily everything from player stats to animation timing. Making it super easy to make these changes without compromising quality.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Having good content building and editing tools&amp;nbsp;can help you take your game to new heights quickly. Tools come in all shapes sizes and for all purposes. If it&#39;s just a little tool to help tweak multiple constant values using set formulas to tools for building foliage with a custom displacement shader. They are all valuable to you and will make your game more consistent better looking and ultimately more enjoyable for your players.&lt;br /&gt;
&lt;br /&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
Engines don&#39;t replace tools&lt;/h3&gt;
&lt;/div&gt;
&lt;div&gt;
In general engines try to be blank canvases there are some like RPG maker that are more specialized but I do not think the idea of single purpose specialized engines really has taken off. Games that offer modding support are good examples of what those types of specialized engines would be like. And either the games come with good tools to make modding much easier or the community of modders will create tools to do the job. The key thing to notice is that either way tools are needed to build/modify the content.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
There are also lots of Unity &#39;tools&#39; in the asset store. More so every day! They are there to help you build all kinds of different games. Some of the most popular tools are ones that take the tedious, difficult, or most time consuming tasks during game development with Unity and make them easier.&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
Tools are fun to make&lt;/h3&gt;
&lt;/div&gt;
&lt;div&gt;
Aside from being extremely useful for developing content. Once you&#39;ve gone from tweaking text files to make new levels to editing them in a gui based map editor you made you begin to see the places you can now take your game. Instead of it taking days to design and tweak a level you can now build a level a day.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
As you build the features in your game your tools also evolve, they can help balance the level details, keeping things feeling consistent and avoiding annoying bugs and time consuming tweaking of settings. Having things like random map generation tools and help give you a head start when staring at a blank canvas and you can&#39;t seem to decide on what type of level would fit next in the games progression.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Adding that next capability to a tool can help propel your game to new heights. For instance a templating tool in a map editor would help you reuse parts of other levels making it simple for you to build much more content. Creating specialized brushes that automatically apply edge smoothing or texture splatting on maps to make them feel less grid like will help you move faster.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
Do not be afraid&lt;/h3&gt;
&lt;div&gt;
I have seen a lot of engineers and teams shy away from building tools or combine commands they do over and over again into simple scripts. When trying to get a game done those are the things that can keep progress from being made or being so slow that development eventually gets extremely difficult as you add more things to your list that need to be done.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Even if your tool only takes a two step process and makes it one step. Every time you use it you get exponentially increasing returns and time savings. If you continue to invest in adding more commands to the single command running script the savings increase each time you run it. Same goes for editing tools, if I needed to do 500 clicks to adjust this object to get it to align properly thats time for each click. But if I had an auto-align feature even if it still required a couple of clicks like 2-3 clicks. That&#39;s still huge savings.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
So it&#39;s generally very much worth it to write scripts to simplify multi-step processes when doing game development. Or really any type of software development. I like a saying that one guy I worked with liked to say, &quot;Make the machine do the work!&quot;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
So build those tools and reap the awesome rewards, make them part of your process and they will benefit you greatly.&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='text/html' href='http://gpsnippets.blogspot.com/2019/05/why-you-should-write-your-own-tools.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2204332218642508435/posts/default/5203568679730254443'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2204332218642508435/posts/default/5203568679730254443'/><link rel='alternate' type='text/html' href='http://gpsnippets.blogspot.com/2019/05/why-you-should-write-your-own-tools.html' title='Why you should write your own tools!'/><author><name>Nick</name><uri>http://www.blogger.com/profile/00969811931456041499</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2204332218642508435.post-1271632717432401187</id><published>2019-04-05T10:39:00.000-04:00</published><updated>2019-04-05T10:42:10.275-04:00</updated><title type='text'>[Announcement] AmberSol version 0.5 released</title><content type='html'>&lt;h2&gt;
Announcing&lt;/h2&gt;
&lt;div&gt;
A coupe of weeks ago I released a new version of my game Amber Sol you can &lt;a href=&quot;https://addiekinstudio.itch.io/amber-game-project&quot; target=&quot;_blank&quot;&gt;download it for free at itch&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
It has taken a long time to get this update out. A lot of things changed in game and I am proud of the changes. The game is still not complete though. There&#39;s a lot of work still to be done.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBn1hUCwFEpdvUZa57wtnWmmPpQcYDgksxENhFA0tY8Pk4Z46GjM-F1sIFwy383itYVZZlgddKE4774ztsAKlopHmaombz7UWOXicBatvC13yp9QM2JHe5QjpZ_ExNvh6zU5wDBuqcVEwq/s1600/1553379023.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;600&quot; data-original-width=&quot;800&quot; height=&quot;300&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBn1hUCwFEpdvUZa57wtnWmmPpQcYDgksxENhFA0tY8Pk4Z46GjM-F1sIFwy383itYVZZlgddKE4774ztsAKlopHmaombz7UWOXicBatvC13yp9QM2JHe5QjpZ_ExNvh6zU5wDBuqcVEwq/s400/1553379023.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Its getting closer to my vision but there are some interesting decisions to make. Progress has been slow, I don&#39;t think I really ever appreciated all the effort that goes into the small details in game development.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Sometimes the smallest thing can be very difficult or time consuming to get right. But I keep moving forward and have fun adding each and every part of the game.&lt;/div&gt;
</content><link rel='replies' type='text/html' href='http://gpsnippets.blogspot.com/2019/04/announcement-ambersol-version-05.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2204332218642508435/posts/default/1271632717432401187'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2204332218642508435/posts/default/1271632717432401187'/><link rel='alternate' type='text/html' href='http://gpsnippets.blogspot.com/2019/04/announcement-ambersol-version-05.html' title='[Announcement] AmberSol version 0.5 released'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBn1hUCwFEpdvUZa57wtnWmmPpQcYDgksxENhFA0tY8Pk4Z46GjM-F1sIFwy383itYVZZlgddKE4774ztsAKlopHmaombz7UWOXicBatvC13yp9QM2JHe5QjpZ_ExNvh6zU5wDBuqcVEwq/s72-c/1553379023.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2204332218642508435.post-5053486508770526013</id><published>2018-08-03T17:07:00.001-04:00</published><updated>2018-09-05T13:26:20.922-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="2d shooter"/><category scheme="http://www.blogger.com/atom/ns#" term="ship builder"/><category scheme="http://www.blogger.com/atom/ns#" term="shooter"/><title type='text'>AmberSol Development Video 08 03 2018</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;iframe allowfullscreen=&quot;&quot; frameborder=&quot;0&quot; height=&quot;270&quot; src=&quot;https://www.youtube.com/embed/CwuNOOhsoO4&quot; width=&quot;480&quot;&gt;&lt;/iframe&gt;&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
The next release will include loads of fixes for various parts of the game. Just smoothing out the gameplay and interface a bit. The update will also include working shields that can be turned on or off. This update includes ship designs being saved between game plays.&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;You can download and play the latest version for free on itch.io&amp;nbsp;https://addiekinstudio.itch.io/amber-game-project&lt;/div&gt;
</content><link rel='replies' type='text/html' href='http://gpsnippets.blogspot.com/2018/08/ambersol-development-video-09-03-2018.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2204332218642508435/posts/default/5053486508770526013'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2204332218642508435/posts/default/5053486508770526013'/><link rel='alternate' type='text/html' href='http://gpsnippets.blogspot.com/2018/08/ambersol-development-video-09-03-2018.html' title='AmberSol Development Video 08 03 2018'/><author><name>Nick</name><uri>http://www.blogger.com/profile/00969811931456041499</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/CwuNOOhsoO4/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2204332218642508435.post-8507987951565876402</id><published>2018-07-11T14:42:00.001-04:00</published><updated>2018-07-11T14:42:33.744-04:00</updated><title type='text'>AmberSol Dev Vid 07 11 2018</title><content type='html'>&lt;iframe allowfullscreen=&quot;&quot; frameborder=&quot;0&quot; height=&quot;270&quot; src=&quot;https://www.youtube.com/embed/I7qiXHICins&quot; width=&quot;480&quot;&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
And development keeps pushing along. In this new demo release you can customize your own ships while wiping out all the alien squads on the orbiting planet.&lt;br /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
Pleased to say progress is good, but there is a lot more to do for sure.</content><link rel='replies' type='text/html' href='http://gpsnippets.blogspot.com/2018/07/ambersol-dev-vid-07-11-2018.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2204332218642508435/posts/default/8507987951565876402'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2204332218642508435/posts/default/8507987951565876402'/><link rel='alternate' type='text/html' href='http://gpsnippets.blogspot.com/2018/07/ambersol-dev-vid-07-11-2018.html' title='AmberSol Dev Vid 07 11 2018'/><author><name>Nick</name><uri>http://www.blogger.com/profile/00969811931456041499</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/I7qiXHICins/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2204332218642508435.post-1608120736462498629</id><published>2018-06-09T18:56:00.001-04:00</published><updated>2018-06-09T21:24:42.159-04:00</updated><title type='text'>Starting a studio and making games...</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
Anor Studios is started&lt;/h2&gt;
&lt;div&gt;
You can see my games and play them on the &lt;a href=&quot;https://anorstudios.itch.io/&quot;&gt;Anor Studios Itch Page&lt;/a&gt;. Currently have been working on a small 2D arcade style shooter called &lt;a href=&quot;https://anorstudios.itch.io/amber-game-project&quot;&gt;Amber Sol&lt;/a&gt;&amp;nbsp;you can play the demo with the &lt;a href=&quot;https://itch.io/app&quot;&gt;itch client&lt;/a&gt;. Here the latest dev video.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;iframe allowfullscreen=&quot;&quot; class=&quot;YOUTUBE-iframe-video&quot; data-thumbnail-src=&quot;https://i.ytimg.com/vi/ELHbyOtndNY/0.jpg&quot; frameborder=&quot;0&quot; height=&quot;266&quot; src=&quot;https://www.youtube.com/embed/ELHbyOtndNY?feature=player_embedded&quot; width=&quot;320&quot;&gt;&lt;/iframe&gt;&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
Keep it simple...&lt;/h3&gt;
&lt;div&gt;
I am trying to keep it as simple as possible and focus on polishing the design. Keeping it fun is a definite challenge.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
After years of practicing and making so many different variations of game framework codes I have finally been able to put my fingers on what makes a game feel good.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
I was not able to do it alone. Here were a couple of videos that really solidified things in my mind on what makes a game feel good. It also happens to be the kinds of things that really really enjoyed about game programming.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;iframe allowfullscreen=&quot;&quot; class=&quot;YOUTUBE-iframe-video&quot; data-thumbnail-src=&quot;https://i.ytimg.com/vi/Fy0aCDmgnxg/0.jpg&quot; frameborder=&quot;0&quot; height=&quot;266&quot; src=&quot;https://www.youtube.com/embed/Fy0aCDmgnxg?feature=player_embedded&quot; width=&quot;320&quot;&gt;&lt;/iframe&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
You definitely need the juice.&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Here is another that I thought presented some good techniques.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;iframe allowfullscreen=&quot;&quot; class=&quot;YOUTUBE-iframe-video&quot; data-thumbnail-src=&quot;https://i.ytimg.com/vi/AJdEqssNZ-U/0.jpg&quot; frameborder=&quot;0&quot; height=&quot;266&quot; src=&quot;https://www.youtube.com/embed/AJdEqssNZ-U?feature=player_embedded&quot; width=&quot;320&quot;&gt;&lt;/iframe&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Two videos worth watching. I was so excited after watching those two that I stayed up almost all night doing things I completely ignored to my then simple 2D space game.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
It was incredibly satisfying, fun, and the biggest thing was it was easy. After all these years I missed something so obvious, the fun. It&#39;s of course in the explosions and the things going on on the screen.&lt;/div&gt;
&lt;h3 style=&quot;clear: both; text-align: left;&quot;&gt;
So come along for the ride...&lt;/h3&gt;
&lt;div&gt;
I don&#39;t plan on stopping any time soon so if you have followed me at all please keep doing so. I know I don&#39;t get the highest points for engagement. That really has never been my thing, mostly code has been it. But with itch I am really trying hard to get into marketing, building a community and being involved.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
Call for help!&lt;/h3&gt;
&lt;div&gt;
So if you can appreciate someone who really just takes a long time to &quot;get with it&quot; and want to help them out, please give me a shout out!&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
There is nothing like the motivation of knowing that what you do has an impact!&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Thanks for reading and understanding!&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;iframe frameborder=&quot;0&quot; height=&quot;167&quot; src=&quot;https://itch.io/embed/223512&quot; width=&quot;552&quot;&gt;&lt;/iframe&gt;
&lt;/div&gt;
</content><link rel='replies' type='text/html' href='http://gpsnippets.blogspot.com/2018/06/starting-studio-and-making-games.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2204332218642508435/posts/default/1608120736462498629'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2204332218642508435/posts/default/1608120736462498629'/><link rel='alternate' type='text/html' href='http://gpsnippets.blogspot.com/2018/06/starting-studio-and-making-games.html' title='Starting a studio and making games...'/><author><name>Nick</name><uri>http://www.blogger.com/profile/00969811931456041499</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/ELHbyOtndNY/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2204332218642508435.post-8483007685070176661</id><published>2018-06-04T14:21:00.001-04:00</published><updated>2018-06-04T14:21:09.746-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="gamedev"/><category scheme="http://www.blogger.com/atom/ns#" term="introspective"/><category scheme="http://www.blogger.com/atom/ns#" term="musings"/><category scheme="http://www.blogger.com/atom/ns#" term="troubles"/><title type='text'>Too many projects syndrome</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
The syndrome&lt;/h2&gt;
&lt;div&gt;
As I sat down to write this I was trying to figure out what I should work on today. I started by going to my latest game project. An Android game using &lt;a href=&quot;https://love2d.org/&quot;&gt;Love2D&lt;/a&gt;&amp;nbsp;which are Lua bindings for one of my favorite libraries &lt;a href=&quot;https://www.libsdl.org/index.php&quot;&gt;SDL&lt;/a&gt;. I had always enjoyed development using SDL in C/C++ and so found development&amp;nbsp; in Lua to be similarly enjoyable. Alas my current projects graphics are all pixel art. For which I use a tool I had built for myself. Writing your own tools during game development is not unheard of at all. I believe its kind of a necessity. Creating your own tools in game development gives you a lot of advantages and huge time savers. If your favorite image editor doesn&#39;t give you the fine grain control your looking for or convert to specific formats or provide a way to, um say bake in additional information into your images well you need to write a script or code something to do it for you. And even though I initially created the editor many years ago it&#39;s still missing lots of features and something of the things about it are limiting.&amp;nbsp; &amp;nbsp;I have been meaning to open source it but I just haven&#39;t cleaned up the project enough yet. And there in lies the rub.&lt;/div&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
So whats &#39;the problem&#39;...&lt;/h2&gt;
&lt;div&gt;
Well I started thinking about all the other projects I have that I have ideas to enhance. I need to port a UI library I created in lua to java so that I can use it in my image editor, and java based games. I have a jogl based game that I want to convert to lwjgl. I have 3 old 2D map editors written in Java that could use some tlc. I have a code editor project, an os project, a programming language project. And of course not to mention the 12+ shelved game projects that got started worked to a point and abandoned.&lt;br /&gt;
&lt;br /&gt;
For about a decade I have suffered from not having either the expertise, focus, time, or resolve to finish any game project. I have a treasure trove of projects that stemmed from what in my mind could be great games and fun projects. I would set them up and start to work on them. Ultimately getting stuck somewhere in the creative process which usually was not far into game development.&amp;nbsp; So I would drop that project for another idea entirely and repeat the same.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
I have created more than a few tools along the way, from an image editor that I use often to build graphics for my frantic game project building project to full game building applications. All these half baked projects has taught me a tremendous amount about myself. What it really amounts to is that all this time I have really been simply practicing and practicing. But practicing like this does not produce many useful or playable games. Nor does it help in my goal to quit my day job. It does serve a very important purpose however. And that is that I can use each of these projects as a way to avoid the feelings that lead to wanting to drop a project because I have a ton of experiences that can help me identify when I am in the practicing mindset and when I am in the productivity mindset.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;In addition to learning how my personal process leads to failed projects. I have also vetted to various degrees a large number of game ideas. These ideas can be extremely useful. I still look back at some of the game ideas for projects in my collection. When I look at those projects I had a vision of the game I was trying to make. A lot of those games do not exist in the set of games available for me to play, leaving me with the same desire to bring those games to life.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='text/html' href='http://gpsnippets.blogspot.com/2018/06/too-many-projects-syndrome.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2204332218642508435/posts/default/8483007685070176661'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2204332218642508435/posts/default/8483007685070176661'/><link rel='alternate' type='text/html' href='http://gpsnippets.blogspot.com/2018/06/too-many-projects-syndrome.html' title='Too many projects syndrome'/><author><name>Nick</name><uri>http://www.blogger.com/profile/00969811931456041499</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2204332218642508435.post-8170222818258279529</id><published>2017-09-27T22:29:00.000-04:00</published><updated>2017-09-28T18:39:12.680-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="fun programming"/><category scheme="http://www.blogger.com/atom/ns#" term="game building"/><category scheme="http://www.blogger.com/atom/ns#" term="game update"/><category scheme="http://www.blogger.com/atom/ns#" term="lwjgl 3 project"/><category scheme="http://www.blogger.com/atom/ns#" term="voxel game"/><title type='text'>LWJGL 3: Voxel Game Update (Adding blocks)</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Well just a small update to report. I was able to get block placement working it works quiet well. It is obvious that there needs to be a small type of delay between each block being placed. Because they are placed really really fast.&lt;br /&gt;
&lt;br /&gt;
The rebuilding of the vertex and texture buffers is also very quick which I am extremely happily surprised by the rebuilding happens in only a couple hundred milliseconds. Its enough for perhaps a slight jitter if done too much to fast but I will not be creating vertex and texture buffers to do animated effects. So for my purposes it does not appear that I will need to do any background jobs for rebuilding and swapping the rendering.&lt;br /&gt;
&lt;br /&gt;
Although that is something that I would like to experiment with cause I&#39;m a sucker for making things run as-fast-a-possible.&lt;br /&gt;
&lt;br /&gt;
Now on to jumping and some world collisions stuff...and may be some moss growing :-D I&#39;m excited (you should be scared)&lt;/div&gt;
</content><link rel='replies' type='text/html' href='http://gpsnippets.blogspot.com/2017/09/voxel-game-update.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2204332218642508435/posts/default/8170222818258279529'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2204332218642508435/posts/default/8170222818258279529'/><link rel='alternate' type='text/html' href='http://gpsnippets.blogspot.com/2017/09/voxel-game-update.html' title='LWJGL 3: Voxel Game Update (Adding blocks)'/><author><name>Nick</name><uri>http://www.blogger.com/profile/00969811931456041499</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2204332218642508435.post-2422080487168495683</id><published>2017-09-15T21:36:00.005-04:00</published><updated>2017-09-28T18:38:59.416-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="development journal"/><category scheme="http://www.blogger.com/atom/ns#" term="game update"/><category scheme="http://www.blogger.com/atom/ns#" term="lwjgl 3"/><category scheme="http://www.blogger.com/atom/ns#" term="Minecraft Like"/><category scheme="http://www.blogger.com/atom/ns#" term="voxel game"/><title type='text'>LWJGL 3: Voxel Game Update (Removing blocks)</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Building a game is tough work. There are so many things that need to be put in-place. Each time I work on a game project, I always get a little closer to having something more closely resembling a game. So I feel like I&#39;m on the right track. Got a good idea for something I want to play. I&#39;ve been building many of the pieces of this game throughout the years.&lt;br /&gt;
&lt;br /&gt;
So the way the project started most of the code was like in a single class and as that approached a point of tough to manage I split it up, modularizing it and picking some of the best design I could. Only time will tell if that pays off or not.&lt;br /&gt;
&lt;br /&gt;
I also spent some time cleaning up a ton of clutter left around from various points of experimentation and rework. As well as demo and other types of codes that had been used to debug the opengl learning I was redoing over the years. It&#39;s been a literal on and off with OpenGL and OpenGLES. I used to do a lot of DirectX work many years ago did some XNA stuff for a little while too back when I was using Windows. These days are pretty much spent with Linux and not really any thought of turning back.&lt;br /&gt;
&lt;br /&gt;
So, I added sounds and light levels to the combined block texture. I separated out the PlayerController class, built up a World class that is handling all the blocks. Currently working on a Parcel (i.e. chunk, partition) system to allow for a larger number of sections of the world to be generated on the fly. Things are working out well so far. Their building up nicely, got a couple of bugs to fix as is normal. Currently focusing on some movement code, adding gravity and stuff with simple collisions, jumping etc.&lt;br /&gt;
&lt;br /&gt;
Oh I also added ray picking and removing of blocks. It happens instantaneously and since there isn&#39;t an inventory or item system yet, there are no tool requirements. I will have to blog about the picking at some point. It works quiet well and is exceptional at using all the GPU memory available since I have not added code to clean up old vertex and texture buffers that are left behind. Just add that to the list of things I need to do.&lt;br /&gt;
&lt;br /&gt;
This time around I am trying to work off of a list of items, a todo list/backlog. I just keep it in a simple document and X off things when their finished no dates or targets yet but maybe I&#39;ll add something like that. I mean I would probably just want a number of days since it&#39;s been modified with the goal being to keep that number low. I think I&#39;ll add a simple one item inventory with a tool requirement for breaking blocks.&lt;br /&gt;
&lt;br /&gt;
Some current screenshots with a few missing blocks, the sides are not really well defined because another backlog item is being able to change the light level for each side. The textures need a lot of work their just placeholders for now until it becomes a playable game and then they will need to change.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiIkoStQe1y5ZE1y6lFPcbCyVyvAz1f7v0prlD05PBcYsB4NXaAFlOpIE_R1pcVs-7qLpAiqKxFoyfeyhmRxRl40m09fVicSwk0tu-Us6Ag6S4bK5_hAjIQ2jWDx2nknCcrBY8SG3WsFX4/s1600/Screenshot+from+2017-09-15+21-31-37.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;741&quot; data-original-width=&quot;1026&quot; height=&quot;231&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiIkoStQe1y5ZE1y6lFPcbCyVyvAz1f7v0prlD05PBcYsB4NXaAFlOpIE_R1pcVs-7qLpAiqKxFoyfeyhmRxRl40m09fVicSwk0tu-Us6Ag6S4bK5_hAjIQ2jWDx2nknCcrBY8SG3WsFX4/s320/Screenshot+from+2017-09-15+21-31-37.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBb0AwrxmN4IrlAizyrVd0ji0Ywfki6trqoMDkhTlwbwj7hIwa-AgoTXpC3t8flVx9iOCT25i-BA7gcBzNp1pUHc-ZzmzOtVaYUHyyTIDq-MAIgTiATj9u2uoLhqX3XvEA1JBMd5El11E/s1600/Screenshot+from+2017-09-15+21-30-56.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;741&quot; data-original-width=&quot;1026&quot; height=&quot;231&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBb0AwrxmN4IrlAizyrVd0ji0Ywfki6trqoMDkhTlwbwj7hIwa-AgoTXpC3t8flVx9iOCT25i-BA7gcBzNp1pUHc-ZzmzOtVaYUHyyTIDq-MAIgTiATj9u2uoLhqX3XvEA1JBMd5El11E/s320/Screenshot+from+2017-09-15+21-30-56.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ttfn...&lt;/div&gt;
</content><link rel='replies' type='text/html' href='http://gpsnippets.blogspot.com/2017/09/flip-coin.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2204332218642508435/posts/default/2422080487168495683'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2204332218642508435/posts/default/2422080487168495683'/><link rel='alternate' type='text/html' href='http://gpsnippets.blogspot.com/2017/09/flip-coin.html' title='LWJGL 3: Voxel Game Update (Removing blocks)'/><author><name>Nick</name><uri>http://www.blogger.com/profile/00969811931456041499</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiIkoStQe1y5ZE1y6lFPcbCyVyvAz1f7v0prlD05PBcYsB4NXaAFlOpIE_R1pcVs-7qLpAiqKxFoyfeyhmRxRl40m09fVicSwk0tu-Us6Ag6S4bK5_hAjIQ2jWDx2nknCcrBY8SG3WsFX4/s72-c/Screenshot+from+2017-09-15+21-31-37.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2204332218642508435.post-2632774022212941754</id><published>2017-08-21T22:21:00.001-04:00</published><updated>2017-08-21T22:21:28.621-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="bufferedimage"/><category scheme="http://www.blogger.com/atom/ns#" term="lwjgl"/><category scheme="http://www.blogger.com/atom/ns#" term="lwjgl 3"/><category scheme="http://www.blogger.com/atom/ns#" term="lwjgl 3 textures"/><category scheme="http://www.blogger.com/atom/ns#" term="Minecraft"/><category scheme="http://www.blogger.com/atom/ns#" term="Minecraft Like"/><category scheme="http://www.blogger.com/atom/ns#" term="test cube"/><title type='text'>LWJGL 3: Texture Coords and Picking</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
So instead of catching up on facebook and looking for nice videos and photographs of the 2017 solar eclipse, I decided to do an update on what I have been working on.&lt;br /&gt;
&lt;br /&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
Ray Cube Intersection...Picking&lt;/h2&gt;
&lt;div&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiy-sD1hwtdpN1khyphenhyphenGcLFsfGoX-EbZ5rRCm62zXlFgAiU-yww8GruEQTfvN-zt6zKnCb_MrdMWy1RA3hlPxDhOVAEk-AC_gnpK_ECAbyWbqw7uP0ra8s4CwWhThwpzTV9L6HtNBAfUPxnY/s1600/screen-2017-08-21-lwjgl3.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;729&quot; data-original-width=&quot;679&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiy-sD1hwtdpN1khyphenhyphenGcLFsfGoX-EbZ5rRCm62zXlFgAiU-yww8GruEQTfvN-zt6zKnCb_MrdMWy1RA3hlPxDhOVAEk-AC_gnpK_ECAbyWbqw7uP0ra8s4CwWhThwpzTV9L6HtNBAfUPxnY/s320/screen-2017-08-21-lwjgl3.png&quot; width=&quot;298&quot; /&gt;&lt;/a&gt;It works but it needs a bit of debugging. It doesn&#39;t always work when I think it should, may be it has something to do with the direction of the ray or the way the ray is used in the algorithm.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
But as you can see I checkered test cubes with left, right, top, bottom, front, back images which are generated on the fly as test BufferedImage&#39;s and then added to a single final texture which is generated for all blocktypes and their respective side images that are specified in a single json file and referenced by name in the code.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
There are lots of optimizations to made later down the road that will improve performance dramatically but already a good number of blocks can be displayed on pretty old hardware so it shouldn&#39;t be a problem to begin building the gameplay out and experimenting with different mechanics.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Also notice I added the cross-hairs. That is coming from a font texture that is procedurally generated using the Graphics2D object into a BufferedImage and then converted to a Texture. So atm just building some very basic capabilities into the code that will help to build the overall pieces of the game. There is a lot of stuff to get done though and its no small task.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
The Glorious Test Cube&lt;/h3&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;float: left; text-align: left;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4HysG-Yf7wwlh2nY315D-emlIJC2UMyKgxtjZBqIsiPPjKY3cIivYzTqwz2FyJVy7BOjjdFo3OcZfsO6oR6zvtzoWhfIqXJv7zwtIm1OXH0LiamCo4Piz9QGD5ePbE2lTgqZ15Eht7-I/s1600/screen-2017-08-21-lwjgl3-3.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;729&quot; data-original-width=&quot;679&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4HysG-Yf7wwlh2nY315D-emlIJC2UMyKgxtjZBqIsiPPjKY3cIivYzTqwz2FyJVy7BOjjdFo3OcZfsO6oR6zvtzoWhfIqXJv7zwtIm1OXH0LiamCo4Piz9QGD5ePbE2lTgqZ15Eht7-I/s320/screen-2017-08-21-lwjgl3-3.png&quot; width=&quot;298&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Inside the test cube atm...no lighting of textures yet.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div&gt;
It was much easier to tell the issues with the faces and texture coordinates once I had these helpful textures generated.&lt;br /&gt;
&lt;br /&gt;
Also generating them using code was much easier than generating them with an image editing program. I didn&#39;t have to worry about them being misaligned or a little bit off, not that they need to look uniform but it was just easier to create and algorithm that loops through each element of an array of strings a add the Textures to the TextureManager than it would have been to Open -&amp;gt; Edit (drawing drawing drawing) -&amp;gt; Save -&amp;gt; Open -&amp;gt; Edit (...) -&amp;gt; Save and then name the files put them on the class path. Ugh but I guess that is why I am a programmer.&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTyo1sqpH5iZS4HipoIRuetZw6rBHiAB83ApO-EFxH5kqZO6fQTZCgOx7wS6Cq-BUGUwNVb4PPI37apD6orcIdHfgRLE-KUkAemVd7e8krVpoMSqsJ0zXGVJjlVFmsHIoalm2Ii9FDzEo/s1600/screen-2017-08-21-lwjgl3-2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;729&quot; data-original-width=&quot;679&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTyo1sqpH5iZS4HipoIRuetZw6rBHiAB83ApO-EFxH5kqZO6fQTZCgOx7wS6Cq-BUGUwNVb4PPI37apD6orcIdHfgRLE-KUkAemVd7e8krVpoMSqsJ0zXGVJjlVFmsHIoalm2Ii9FDzEo/s400/screen-2017-08-21-lwjgl3-2.png&quot; width=&quot;372&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Ah the simplicity of being a cube, what a life...&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
The other blocks are test grass blocks with different textures for the top, and bottom, and another texture for the left, right, front, back. I do not have a block editor just yet but adding new blocks is simple enough, create the textures and add the new block to the json file. It&#39;s not entirely decided how I will do world generation but it will be epic. Nah amazing, ok it&#39;s going to be really fun if any thing.&lt;br /&gt;
&lt;br /&gt;
So far this has been a lot of fun to create and see the different things come together and hopefully even though it is seeming a bit like Minecraft the end result will be its own unique experience.&lt;br /&gt;
&lt;br /&gt;
I had tried to do these sort of things with a engine like Unity and contemplated doing it in something like Unreal Engine. But both of those engines would have made the procedural texture generation and cube lighting a nightmare. Especially with attempting to control the way those engines utilize buffer objects and other aspects of the GPU. Though having most of these types of things done for you already can save a lot of time obviously. Still I believe the end result ends up suffering from performance and smoothness issues unless you really cater to the types of pipelines those engines were made to do well. But it also means an incredible amount of work for me to do. But like I said I&#39;m having fun so as long as thats happening things are good. This isn&#39;t like my day job or anything so it&#39;s a good off the clock activity to help keep my programming skills sharp and exercise coding I do not get the opportunity to do with my day job.&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='text/html' href='http://gpsnippets.blogspot.com/2017/08/lwjgl-3-texture-coords-and-picking.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2204332218642508435/posts/default/2632774022212941754'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2204332218642508435/posts/default/2632774022212941754'/><link rel='alternate' type='text/html' href='http://gpsnippets.blogspot.com/2017/08/lwjgl-3-texture-coords-and-picking.html' title='LWJGL 3: Texture Coords and Picking'/><author><name>Nick</name><uri>http://www.blogger.com/profile/00969811931456041499</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiy-sD1hwtdpN1khyphenhyphenGcLFsfGoX-EbZ5rRCm62zXlFgAiU-yww8GruEQTfvN-zt6zKnCb_MrdMWy1RA3hlPxDhOVAEk-AC_gnpK_ECAbyWbqw7uP0ra8s4CwWhThwpzTV9L6HtNBAfUPxnY/s72-c/screen-2017-08-21-lwjgl3.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2204332218642508435.post-7609709731184107310</id><published>2017-08-11T22:26:00.000-04:00</published><updated>2017-08-11T22:28:48.190-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="BufferUtils"/><category scheme="http://www.blogger.com/atom/ns#" term="Games"/><category scheme="http://www.blogger.com/atom/ns#" term="github"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="loading textures"/><category scheme="http://www.blogger.com/atom/ns#" term="lwjgl"/><category scheme="http://www.blogger.com/atom/ns#" term="lwjgl 3"/><category scheme="http://www.blogger.com/atom/ns#" term="lwjgl 3 textures"/><category scheme="http://www.blogger.com/atom/ns#" term="snippets"/><category scheme="http://www.blogger.com/atom/ns#" term="TextureManager"/><category scheme="http://www.blogger.com/atom/ns#" term="voxel game"/><title type='text'>LWJGL 3: Texture to GPU and back</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
Time Flies...&lt;/h2&gt;
&lt;div&gt;
It&#39;s supposed to end with &quot;when you&#39;re having fun&quot; but that and a lot of other cliche sayings have all been in question lately. For one thing who ever said that &quot;slept like a baby&quot; was actually supposed to be mean waking up every two hours to feed and then fussing because you do not want to close your eyes. And since I&#39;m a programmer I have fun when I am getting things done and there is time left over in the day. Not when I only get to sit down and do things for five minutes right before bed. And then you look down at the date on your computer and see that more than a month has gone by since your last post. Ridiculous!&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
What was accomplished?&lt;/h2&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
So there is some small bit of progress... The hard part of actually doing things the way I wanted to do them... see I wanted to combine a bunch of textures as texture classes after they had been converted from BufferedImages and their contents transferred to the GPU. But how to do that was not entirely straight forward, or so I thought.&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
See the BufferedImages were being loaded and in order to not be bothered with hashing out different methods of copying the images to the GPU based on different ColorFormats I simply rendered the image to a new BufferedImage whose format is ARGB but in OpenGL the complimentary image format is RGBA so yeah simple one would say just use the rotate assembly instruction and we are all set. ***BUZZER SOUND*** WRONG!!!! you cannot do that in Java. Thanks a bunch Jawa. &amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
So after fiddling and fiddling with it because I wanted to pull out all the pixels into an array instead of accessing them one by one through the BufferedImage object I present you with my silly idea of progress.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;script src=&quot;https://gist.github.com/njd5475/20c2c3179c3b5a996629271eb98d3326.js&quot;&gt;&lt;/script&gt;

&lt;br /&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
And then...&lt;/h2&gt;
So once I got that to work properly and could stop fiddling with bits in Java which is not a fun process. I was able to generate a single texture from multiples and replace those multiples with SubTextures in the TextureManager. That all works now and that enabled me to externalize all my BlockTypes into a single json file which enables an editor that I will work on to add new blocks this is huge because editors can make adding content 10 times faster than editing a growing json file and 100 times faster and less error prone than adding new blocktypes in code.&lt;br /&gt;
&lt;br /&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
Addendum&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
And here just to make this post complete is how the textures are loaded from an image in LWJGL 3.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;script src=&quot;https://gist.github.com/njd5475/04c5459131f94b5b7d2b5f9b6f6f4273.js&quot;&gt;&lt;/script&gt;

&lt;br /&gt;
&lt;div&gt;
And there you have it now on to bigger and better things. Like I also added movement in 4 directions WASD and fixed a bunch of odd things that were incorrect about displaying the textures and generated a Font texture and a number of other things but ya know other topics for another day. TTFN&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='text/html' href='http://gpsnippets.blogspot.com/2017/08/lwjgl-3-texture-to-gpu-and-back.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2204332218642508435/posts/default/7609709731184107310'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2204332218642508435/posts/default/7609709731184107310'/><link rel='alternate' type='text/html' href='http://gpsnippets.blogspot.com/2017/08/lwjgl-3-texture-to-gpu-and-back.html' title='LWJGL 3: Texture to GPU and back'/><author><name>Nick</name><uri>http://www.blogger.com/profile/00969811931456041499</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2204332218642508435.post-1030621031628551881</id><published>2017-07-06T21:28:00.001-04:00</published><updated>2017-07-06T21:28:51.458-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="3d"/><category scheme="http://www.blogger.com/atom/ns#" term="3D programming"/><category scheme="http://www.blogger.com/atom/ns#" term="cubes"/><category scheme="http://www.blogger.com/atom/ns#" term="java rendering performance"/><category scheme="http://www.blogger.com/atom/ns#" term="lwjgl"/><category scheme="http://www.blogger.com/atom/ns#" term="lwjgl 3"/><category scheme="http://www.blogger.com/atom/ns#" term="OpenGL"/><title type='text'>Playing with LWJGL 3</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
Recap &amp;amp; Update&lt;/h3&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
I have been very busy lately. Got a new job, moved, had a kid, ya know the usual life stuff. I must admit blogging has never been something I have been good at. As is evident by my infrequent posting and sporadic change in directions. I have ultimately discovered that my personal projects that I talk about here, work on for a little while and then abandon are my method of learning. I am not sure whether this is indicative of us as human beings or if its just me. I can never stick with any of my &quot;fun&quot; side projects very long. Perhaps I have not put enough effort in or none have reached a good enough point to be released creating a sense of responsibility to continue working on it.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
It is probably one of the reasons some of my more useful programs stay unreleased since I do not want to have to support them and can just use them for the purpose they were created for. For instance I have made at least 3 different tilemap makers, and a small image editor that I use often. Perhaps another reason is that most of them were made with Java Swing and those apps are not particularly fun to modify after a while or pleasing to utilize.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
now on to the goodies...&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
LWJGL 3 and Vertex Arrays&lt;/h2&gt;
&lt;div&gt;
&lt;div class=&quot;&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVVStJlRZRmoFaSuqW4pJR-QCI7F7_GjIvjRVKj5Yi1nELeaISOXILQOFBE-iqq9ZzWB9oj1V2mqNXFbexmKhf9BZh0kjKtE_Mu2bA_FPPbeYl5yLoTnmV7QlinVfJFVXZUXBs_V0Udgs/s1600/Screenshot+from+2017-07-06+17-40-58.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;741&quot; data-original-width=&quot;1026&quot; height=&quot;231&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVVStJlRZRmoFaSuqW4pJR-QCI7F7_GjIvjRVKj5Yi1nELeaISOXILQOFBE-iqq9ZzWB9oj1V2mqNXFbexmKhf9BZh0kjKtE_Mu2bA_FPPbeYl5yLoTnmV7QlinVfJFVXZUXBs_V0Udgs/s320/Screenshot+from+2017-07-06+17-40-58.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
So navigating the options available to different opengl versions is almost nightmareish. So the basics are pretty simple for working with these arrays. You gen the array &lt;b&gt;glGenBuffers &lt;/b&gt;you bind the gen&#39;d buffer &lt;b&gt;glBindBuffer&lt;/b&gt;. Then you fill the buffer with your data, from using JOGL for this and switching to LWJGL I must say having only to send a FloatBuffer object to the &lt;b&gt;glBufferData &lt;/b&gt;call is kind of nice. The included screenshot is rendered from a single vertex array with a single texture array for the 3d geometry. As you can see by the render quads though that is the texture used to render the individual blocks. Yes omg another block game, whatever man its a good way to expirement and learn so sue me if I generated a 100x10x100 block world and culled&amp;nbsp;76832 blocks that are not open to the sky or surrounded by others leaving&amp;nbsp;23168 blocks to generate a buffer of&amp;nbsp;10008576 floats.&amp;nbsp;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
For the geometry I am using 36 vertices per cube (108 floats) and rendering without culling (omg I know, but hey I was debugging). I am using a glsl shader with a simple &lt;b&gt;projection * view * model&lt;/b&gt; matrix multiplication to transform the three dimensional coordinates to the camera 2D plane. Currently I am using the nice &lt;a href=&quot;https://github.com/JOML-CI/JOML&quot;&gt;JOML&lt;/a&gt;&amp;nbsp;library for the projection but quaternions for the camera.&lt;/div&gt;
&lt;div class=&quot;&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h3 style=&quot;clear: both; text-align: left;&quot;&gt;
Triangle Strips&lt;/h3&gt;
&lt;div class=&quot;&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmmnEZxpWeShGt7dUHEPjn0CpysAf8LFRnNwyUkrY5x66SUQHskDX7XJUnBhDERM0YxW9js0s1YYlhOG1fkXhG6QFi94KeUyP_XIjSKVP6omT8t8S7iPMgdITIkJPezK5f7TrbcvMHofs/s1600/Screenshot+from+2017-07-06+17-51-36.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;741&quot; data-original-width=&quot;1026&quot; height=&quot;231&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmmnEZxpWeShGt7dUHEPjn0CpysAf8LFRnNwyUkrY5x66SUQHskDX7XJUnBhDERM0YxW9js0s1YYlhOG1fkXhG6QFi94KeUyP_XIjSKVP6omT8t8S7iPMgdITIkJPezK5f7TrbcvMHofs/s320/Screenshot+from+2017-07-06+17-51-36.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Now as for the 4 quads...ooops the heading gave it away. They are rendered as triangle strips in a single vertex/texture and index buffer. In order to get them to be rendered as triangle strips I used&amp;nbsp;&lt;b&gt;GL_PRIMITIVE_RESTART &lt;/b&gt;setting the restart index&amp;nbsp;&lt;b&gt;glPrimitiveRestartIndex&lt;/b&gt;. I had to use &lt;b&gt;0xFF&lt;/b&gt;&amp;nbsp;to set the short constant in java as well as enable the behavior using &lt;b&gt;glEnable(GL_PRIMITIVE_RESTART)&lt;/b&gt;. There are a lot of optimizations to be made here.&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Next I want to get up a decent &lt;b&gt;FPS&lt;/b&gt;&amp;nbsp;counter to track the effectiveness of the optimizations. Also put in a number of performance tracking logs.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Thats all for now...&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='text/html' href='http://gpsnippets.blogspot.com/2017/07/playing-with-lwjgl-3.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2204332218642508435/posts/default/1030621031628551881'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2204332218642508435/posts/default/1030621031628551881'/><link rel='alternate' type='text/html' href='http://gpsnippets.blogspot.com/2017/07/playing-with-lwjgl-3.html' title='Playing with LWJGL 3'/><author><name>Nick</name><uri>http://www.blogger.com/profile/00969811931456041499</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVVStJlRZRmoFaSuqW4pJR-QCI7F7_GjIvjRVKj5Yi1nELeaISOXILQOFBE-iqq9ZzWB9oj1V2mqNXFbexmKhf9BZh0kjKtE_Mu2bA_FPPbeYl5yLoTnmV7QlinVfJFVXZUXBs_V0Udgs/s72-c/Screenshot+from+2017-07-06+17-40-58.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2204332218642508435.post-7551823145240359900</id><published>2016-09-18T10:39:00.002-04:00</published><updated>2016-09-18T10:39:19.051-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="development journal"/><category scheme="http://www.blogger.com/atom/ns#" term="frontiersman"/><category scheme="http://www.blogger.com/atom/ns#" term="Game Development"/><category scheme="http://www.blogger.com/atom/ns#" term="green algae"/><category scheme="http://www.blogger.com/atom/ns#" term="pathfinding"/><title type='text'>Green Algae: Dev Update pathfinding</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
Finding the way&lt;/h2&gt;
So just implemented a brute-force pathfinding method implementing a basic Flood-Fill (Breadth first search) algorithm. It&#39;s wasteful but effective. I plan to improve the pathfinding method to a more practical implementation for use in other areas. It&#39;s enough to get started integrating it more abstractly into the basic game world for easier use when characters want to move around. It was pretty fun seeing it work.&lt;br /&gt;
&lt;br /&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
Other work&lt;/h2&gt;
&lt;div&gt;
On top of the pathfinding, I reworked the map generation which is hopefully more efficient, reliable, and is making more evenly distributed islands. If you noticed from previous screenshots the islands were all generating on an angle moving to the top-left while generating. Was due to the infamous off by one error, though I was kind of digging the realistic nature of some of the island strips. Perhaps that could be a useful generation permutation in the future.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBaY1OfEF5Nsec30b199v2Dv0lb8kvrxgQd0K-90wlrLQ1-WfNNqWmlQuFiVAZGirvTCUCIPvHU7pe1RvL2q0WJfjbJIfiZoqSeuIhqZXbxaUlYX9JBt_F2bUdGQ7DOvtBo_FSgly6urU/s1600/Screenshot+from+2016-09-18+09%253A54%253A09.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;255&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBaY1OfEF5Nsec30b199v2Dv0lb8kvrxgQd0K-90wlrLQ1-WfNNqWmlQuFiVAZGirvTCUCIPvHU7pe1RvL2q0WJfjbJIfiZoqSeuIhqZXbxaUlYX9JBt_F2bUdGQ7DOvtBo_FSgly6urU/s320/Screenshot+from+2016-09-18+09%253A54%253A09.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
Where&#39;s the build?&lt;/h2&gt;
&lt;div&gt;
I wish I had something playable that you could check out but it&#39;s just too rough right now. And I do not have any process for putting together a public release yet. But things are moving along getting some basic AI and decision making system set up is probably my number one priority. Once I have a solid extendable task based system for controlling units assignments it will open the gates to adding all kinds of content. Right now it&#39;s just reworking and molding the current code into a more effective structure.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
Suggestions welcome&lt;/h2&gt;
&lt;div&gt;
By the way the game concept is very much flexible at this point in time. Not much at all has been solidified. That being said, I am completely open to suggestions or ideas that you may have to help guide some of the gameplay.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Comments to any update post or to the &lt;a href=&quot;http://p/green-algae-frontiersman.html&quot;&gt;Project Page&lt;/a&gt; are strongly encouraged.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
P.S. You can find updates to the Roadmap on the project page. I&#39;ll get a description of the game there too since there is no dev version yet.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
ttfn&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='text/html' href='http://gpsnippets.blogspot.com/2016/09/green-algae-dev-update-pathfinding.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2204332218642508435/posts/default/7551823145240359900'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2204332218642508435/posts/default/7551823145240359900'/><link rel='alternate' type='text/html' href='http://gpsnippets.blogspot.com/2016/09/green-algae-dev-update-pathfinding.html' title='Green Algae: Dev Update pathfinding'/><author><name>Nick</name><uri>http://www.blogger.com/profile/00969811931456041499</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBaY1OfEF5Nsec30b199v2Dv0lb8kvrxgQd0K-90wlrLQ1-WfNNqWmlQuFiVAZGirvTCUCIPvHU7pe1RvL2q0WJfjbJIfiZoqSeuIhqZXbxaUlYX9JBt_F2bUdGQ7DOvtBo_FSgly6urU/s72-c/Screenshot+from+2016-09-18+09%253A54%253A09.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2204332218642508435.post-6729947336555521487</id><published>2016-09-14T18:31:00.001-04:00</published><updated>2016-09-18T09:55:37.414-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="2D tile map"/><category scheme="http://www.blogger.com/atom/ns#" term="dev log"/><category scheme="http://www.blogger.com/atom/ns#" term="development journal"/><category scheme="http://www.blogger.com/atom/ns#" term="frontiersman"/><category scheme="http://www.blogger.com/atom/ns#" term="Game Development"/><category scheme="http://www.blogger.com/atom/ns#" term="game update"/><category scheme="http://www.blogger.com/atom/ns#" term="green algae"/><title type='text'>Green Algae: Frontiersman Development Update</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Yay! We struck tree!&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-lZE53q4RCRW003odWRcJSsk3n8xdNOCFHOpFyT25PnZf1mefn9zK9wr4tih82icGf1ldS70RE935SU8EBylrhSG0UfzAKDdFQ06UCtOnHoaZ8lG7lKBcIrvW_1jqCzt93Q36DKWyT0VG/s1600/Screenshot+from+2016-09-14+18%253A19%253A27.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;255&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-lZE53q4RCRW003odWRcJSsk3n8xdNOCFHOpFyT25PnZf1mefn9zK9wr4tih82icGf1ldS70RE935SU8EBylrhSG0UfzAKDdFQ06UCtOnHoaZ8lG7lKBcIrvW_1jqCzt93Q36DKWyT0VG/s320/Screenshot+from+2016-09-14+18%253A19%253A27.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Things are moving a little bit after fixing up a number of things. Rearranging stuff implementing some additional stuff as well. Like being able to select objects on the map and get details about them.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsGoU2gcQKlVA8FYwovzFBheBVa0myWfIaWso3zBug1AJiU5Gs0fIqtaBt3jPNjQhuLfroxiUThSbOdoh8kX1xd0JvwPd3N9eQbvMIAYz3-si1JyTRqqtqWTfOvom6OL_RcSx6prvhbaJR/s1600/Screenshot+from+2016-09-14+18%253A23%253A13.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;255&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsGoU2gcQKlVA8FYwovzFBheBVa0myWfIaWso3zBug1AJiU5Gs0fIqtaBt3jPNjQhuLfroxiUThSbOdoh8kX1xd0JvwPd3N9eQbvMIAYz3-si1JyTRqqtqWTfOvom6OL_RcSx6prvhbaJR/s320/Screenshot+from+2016-09-14+18%253A23%253A13.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
Trees can be selected and designated to be chopped down. Currently only a single object selection is available. I&#39;ll put drag and drop selection on the roadmap of course.&lt;br /&gt;
&lt;br /&gt;
So here&#39;s where things stand.&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Terrain&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strike&gt;finish tile-type transitions&lt;/strike&gt;&lt;/li&gt;
&lt;li&gt;add dirt (with transitions)&lt;/li&gt;
&lt;li&gt;add gravel (with transitions)&lt;/li&gt;
&lt;li&gt;add random stones&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Player controls&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strike&gt;map movement controls&lt;/strike&gt;&lt;/li&gt;
&lt;li&gt;&lt;strike&gt;object-selection and displayed details&lt;/strike&gt;&amp;nbsp;&lt;span style=&quot;color: #e69138; font-size: x-small;&quot;&gt;new&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;designating actions for map items&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strike&gt;chop/down tree&lt;/strike&gt;&lt;/li&gt;
&lt;li&gt;stockpile area designation&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;li&gt;AI Simulated Character&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strike&gt;add gender and age&amp;nbsp;&lt;/strike&gt;&lt;span style=&quot;color: #e69138; font-size: x-small;&quot;&gt;new&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;add basic decision-based model&lt;/li&gt;
&lt;li&gt;add crappy path-finding method&lt;/li&gt;
&lt;li&gt;add hunger, starvation, and death&lt;/li&gt;
&lt;li&gt;add actions and event, thoughts and memory&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Save/Load&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Test, test, test&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Build Scripts and release checklist&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
</content><link rel='replies' type='text/html' href='http://gpsnippets.blogspot.com/2016/09/frontiersman-development-update.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2204332218642508435/posts/default/6729947336555521487'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2204332218642508435/posts/default/6729947336555521487'/><link rel='alternate' type='text/html' href='http://gpsnippets.blogspot.com/2016/09/frontiersman-development-update.html' title='Green Algae: Frontiersman Development Update'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-lZE53q4RCRW003odWRcJSsk3n8xdNOCFHOpFyT25PnZf1mefn9zK9wr4tih82icGf1ldS70RE935SU8EBylrhSG0UfzAKDdFQ06UCtOnHoaZ8lG7lKBcIrvW_1jqCzt93Q36DKWyT0VG/s72-c/Screenshot+from+2016-09-14+18%253A19%253A27.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2204332218642508435.post-3576715309991993824</id><published>2016-09-11T23:12:00.000-04:00</published><updated>2016-09-11T23:12:05.063-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="frontiersman"/><category scheme="http://www.blogger.com/atom/ns#" term="game"/><category scheme="http://www.blogger.com/atom/ns#" term="Game Development"/><category scheme="http://www.blogger.com/atom/ns#" term="green algae"/><category scheme="http://www.blogger.com/atom/ns#" term="tile transitioning"/><category scheme="http://www.blogger.com/atom/ns#" term="updates"/><title type='text'>Green Algae: Game Development Update</title><content type='html'>&lt;h2&gt;
Update: Tile transitions&lt;/h2&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnhoTcfyH0-A8PtIpmcZ8djrxC-ZBMFlMTY4udDX4VpAaORJC6klkTH7eJQpsimDerHPEwaYlv_zyuJ5s3cGIQxMFbDXDaNEnwDwgwTr5n_NluBh5Cxyc3WElZjmhgB1AlAWdp0lS0PDiz/s1600/Screenshot+from+2016-09-11+21%253A32%253A01.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;255&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnhoTcfyH0-A8PtIpmcZ8djrxC-ZBMFlMTY4udDX4VpAaORJC6klkTH7eJQpsimDerHPEwaYlv_zyuJ5s3cGIQxMFbDXDaNEnwDwgwTr5n_NluBh5Cxyc3WElZjmhgB1AlAWdp0lS0PDiz/s320/Screenshot+from+2016-09-11+21%253A32%253A01.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Finally got transitions built between grass sand and water. I still think there are a few edge cases that need to be handled like one water tile surrounded by sand and other combinations of the same.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
My first approach which quickly became a painstakingly brutal experience reloading map after map. &lt;i&gt;Note to self create a small map test area. &lt;/i&gt;Was to have different tile types for each transition tile for instance a &lt;b&gt;SAND_WATER_TOP_LEFT &lt;/b&gt;this became problematic when working with a testing tile types in the game logic. For instance player collision with water, and placing bridges. Not to mention that determining which transition to place was also difficult things kept breaking as more and more tile types were added. So I decided to use a slightly more subtle approach.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
While rendering each tile the adjacent tiles are tested to determine which transition is to be used. This method short-circuits only testing each north, south, east, west, northeast, southeast, northwest, southwest, position in turn if any fail the test exits. These are mapped to the corresponding image for the transition changing which image is rendered.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h3&gt;
Focus on gameplay&lt;/h3&gt;
&lt;div&gt;
For the moment I think I need to focus on getting as many gameplay elements working as possible to actually have something that can be played like a game. Currently there isn&#39;t any real objective or goal so there really isn&#39;t a whole lot to do. Of course removing the movement controls from the player kind of eliminated an entire aspect of the game. Things are kind of slow going as I do not spend an incredible amount of time working on this project. I probably have too many at the moment which is why I do not have more updates. But if I can kind of get some semblance of a game going we might be talking more frequent updates.&amp;nbsp;&lt;/div&gt;
&lt;h3&gt;
Other mentions&lt;/h3&gt;
&lt;div&gt;
Its subtle but noticed I have changed the title too. The gameplay is starting to develop a little more clearly in my head. Time will tell where it goes. But the name of the game is now &#39;&lt;b&gt;Frontiersman&lt;/b&gt;&#39; the game idea might be a bit obvious. You are controlling a family starting out in a new world trying to survive and discovering the dangers that lurk in your new world. &amp;nbsp;&lt;/div&gt;
&lt;h3&gt;
Roadmap updates&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Terrain&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strike&gt;finish tile-type transitions&lt;/strike&gt;&lt;/li&gt;
&lt;li&gt;add dirt (with transitions)&lt;/li&gt;
&lt;li&gt;add gravel (with transitions)&lt;/li&gt;
&lt;li&gt;add random stones&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Player controls &lt;span style=&quot;color: #e69138; font-size: x-small;&quot;&gt;new&lt;/span&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;map movement controls &lt;span style=&quot;color: #e69138; font-size: x-small;&quot;&gt;new&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;designating actions for map items &lt;span style=&quot;color: #e69138; font-size: x-small;&quot;&gt;new&lt;/span&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;chop/down tree &lt;span style=&quot;color: #e69138; font-size: x-small;&quot;&gt;new&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;li&gt;AI Simulated Character&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;add basic decision-based model&lt;/li&gt;
&lt;li&gt;add crappy path-finding method&lt;/li&gt;
&lt;li&gt;add hunger, starvation, and death&lt;/li&gt;
&lt;li&gt;add actions and event, thoughts and memory&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Save/Load&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Test, test, test&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Build Scripts and release checklist&lt;/li&gt;
&lt;/ul&gt;
</content><link rel='replies' type='text/html' href='http://gpsnippets.blogspot.com/2016/09/green-algae-game-development-update.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2204332218642508435/posts/default/3576715309991993824'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2204332218642508435/posts/default/3576715309991993824'/><link rel='alternate' type='text/html' href='http://gpsnippets.blogspot.com/2016/09/green-algae-game-development-update.html' title='Green Algae: Game Development Update'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnhoTcfyH0-A8PtIpmcZ8djrxC-ZBMFlMTY4udDX4VpAaORJC6klkTH7eJQpsimDerHPEwaYlv_zyuJ5s3cGIQxMFbDXDaNEnwDwgwTr5n_NluBh5Cxyc3WElZjmhgB1AlAWdp0lS0PDiz/s72-c/Screenshot+from+2016-09-11+21%253A32%253A01.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2204332218642508435.post-4617601932920376666</id><published>2016-08-29T14:32:00.001-04:00</published><updated>2016-08-29T14:51:56.885-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="2D tile map"/><category scheme="http://www.blogger.com/atom/ns#" term="Game Development"/><category scheme="http://www.blogger.com/atom/ns#" term="Games"/><category scheme="http://www.blogger.com/atom/ns#" term="green algae"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="java2D"/><title type='text'>Green Algae: Game Development Update</title><content type='html'>&lt;h2&gt;
Greetings&lt;/h2&gt;
It&#39;s been a while since I have posted updates on one of my old game projects. It has been slow going. I was particularly blocked on building a save file format. Finally decided to implement saving and loading via the remarkably light &lt;a href=&quot;https://github.com/ralfstx/minimal-json&quot; target=&quot;_blank&quot;&gt;minimal-json&lt;/a&gt; library. I also had to take the time to convert the project to gradle so it was easy to pull in the libraries auto-magically. Also realigned the trees into the each particular tile and adjusted the number of logs spawned after chopping one down although the math is not working very well. I get either 2 logs or no logs for smaller trees. That needs some tweaking.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBKVD7-3LqWuHsrqn4ZaELNqGvOMR3yrcgRIGy0XHVrzyZf4tHOo6oqzsbqjl-Yag4sgGaB75Vt3VkPJbw-8IukqHeWNR-RsodneAWCSxA3Tcon5ArabOWmtAjdZ08Q3_5BSgjHLfekHBr/s1600/Screenshot+from+2016-08-29+13%253A57%253A45.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;318&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBKVD7-3LqWuHsrqn4ZaELNqGvOMR3yrcgRIGy0XHVrzyZf4tHOo6oqzsbqjl-Yag4sgGaB75Vt3VkPJbw-8IukqHeWNR-RsodneAWCSxA3Tcon5ArabOWmtAjdZ08Q3_5BSgjHLfekHBr/s400/Screenshot+from+2016-08-29+13%253A57%253A45.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h2&gt;
&lt;/h2&gt;
&lt;h3&gt;
Gameplay&lt;/h3&gt;
I still have not decided what style of game It will be. I&#39;ve only been really working on small insignificant details at this point. As you can see an incomplete update of smooth transitions between tile types which should be finished soon enough. I&#39;ve been toying with the idea of moving more towards a &lt;a href=&quot;http://www.bay12games.com/dwarves/&quot; target=&quot;_blank&quot;&gt;Dwarf Fortress&lt;/a&gt; / &lt;a href=&quot;http://rimworldgame.com/&quot; target=&quot;_blank&quot;&gt;RimWorld&lt;/a&gt;&amp;nbsp;type of game. My map generation algorithm will need to become more sophisticated over time. I have been working on a few ideas to create a more versatile and generic system so that different types of terrain are possible. But first getting the terrain transitions to be generic and easily definable is probably necessary.&lt;br /&gt;
&lt;br /&gt;
I have removed a little annoying gameplay element where by chopping down a tree required that you continuously collided with the tree by moving into it. This sort of mechanism was a bit confusing when not knowing you had to collide with it. Adjustments to log pickup will probably benefit from not having to be moving while colliding with the log hit box. Although these types of adjustments are secondary to figuring out which direction the game will take.&lt;br /&gt;
&lt;br /&gt;
I am definitely open to ideas and/or suggestions even cries for a released version for anyone who still reads this blog. I&#39;ve only really been working on the code for years now mostly a bit of a pass-time effort slowly but steadily trying to move it forward to a playable version.&lt;br /&gt;
&lt;br /&gt;
Apparently the bridge building mechanic was broken with a few updates to map and world objects as part of building a save/load feature. But that could probably be fixed, though a quick mechanic test world would be cool since the map generation is not that quick to run, especially on my old laptop since it&#39;s only a dual-core.&lt;br /&gt;
&lt;br /&gt;
But please feel free to leave your comments concerns etc. It&#39;d definitely be nice to know if anyone is interested since it&#39;s really just a personal pet project at this point. Though I feel pet projects are where some of the most in-depth games come from.&lt;br /&gt;
&lt;h2&gt;
Short-Term Roadmap&lt;/h2&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;Terrain&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;finish tile-type transitions&lt;/li&gt;
&lt;li&gt;add dirt&lt;/li&gt;
&lt;li&gt;add gravel&lt;/li&gt;
&lt;li&gt;add random stones&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;AI Simulated Character&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;add basic decision-based model&lt;/li&gt;
&lt;li&gt;add crappy path-finding method&lt;/li&gt;
&lt;li&gt;add hunger, starvation, and death&lt;/li&gt;
&lt;li&gt;add actions and event, thoughts and memory&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Save/Load&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Test, test, test&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Build Scripts and release checklist&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
That should be more than enough to focus on in the short-term. It might take a bit of doing to refactor the code to convert from a character based movement scheme to one of an overview and direction based one. We&#39;ll just take it step by step and see what happens.&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Another idea I&#39;ve been toying with is cutting the size of the tiles in half going from 32x32 pixels to 16x16 still keeping the base image resolution at 32x32 but simply scaling to half the size. Which might significantly break things but would be flexible after fixing.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Anyway that&#39;s it for this update. Just needed to write down some thoughts and try to create some semblance of interest as well as a place to hold myself accountable for plans.&lt;/div&gt;
</content><link rel='replies' type='text/html' href='http://gpsnippets.blogspot.com/2016/08/green-algae-game-development-update.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2204332218642508435/posts/default/4617601932920376666'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2204332218642508435/posts/default/4617601932920376666'/><link rel='alternate' type='text/html' href='http://gpsnippets.blogspot.com/2016/08/green-algae-game-development-update.html' title='Green Algae: Game Development Update'/><author><name>Nick</name><uri>http://www.blogger.com/profile/00969811931456041499</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBKVD7-3LqWuHsrqn4ZaELNqGvOMR3yrcgRIGy0XHVrzyZf4tHOo6oqzsbqjl-Yag4sgGaB75Vt3VkPJbw-8IukqHeWNR-RsodneAWCSxA3Tcon5ArabOWmtAjdZ08Q3_5BSgjHLfekHBr/s72-c/Screenshot+from+2016-08-29+13%253A57%253A45.png" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2204332218642508435.post-6033525784067415536</id><published>2016-05-24T08:00:00.000-04:00</published><updated>2016-05-24T08:00:00.176-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="2D tile map"/><category scheme="http://www.blogger.com/atom/ns#" term="Game Programming"/><category scheme="http://www.blogger.com/atom/ns#" term="github"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="java rendering performance"/><category scheme="http://www.blogger.com/atom/ns#" term="layering"/><category scheme="http://www.blogger.com/atom/ns#" term="pup8bit"/><category scheme="http://www.blogger.com/atom/ns#" term="Rendering"/><category scheme="http://www.blogger.com/atom/ns#" term="scaling"/><category scheme="http://www.blogger.com/atom/ns#" term="Tiles"/><title type='text'>Game optimization by space partitioning: Part II</title><content type='html'>&lt;h2&gt;
Reduce rendering calls&lt;/h2&gt;
&lt;div&gt;
Note that last time we reduced the number of objects returned in collision detection using a bin-ing strategy from 10020 to just around 31 objects. But then after profiling the application we noticed that the most time was now being spent in the rendering loop. Upon examination both loops were largely inefficient they were in fact both performing loops on 10020+ objects each call which was happening at both 33fps and the updates were as often as possible.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Since the strategy existed already it was easy enough to figure out how a bounding box of objects to grab each time we render the screen and only render those objects since they are the only ones that are visible.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
One problem that arose from this was the fact that the way the views work the actual objects on screen were significantly scaled.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h3&gt;
Handle scaling&lt;/h3&gt;
&lt;div&gt;
Screen size was 640x480 but each tile is 8x8 and is scaled. Blown up by a factor of 5. So grabbing a 640x480 section of from the SpacePartitionStrategy resulted in returning over 5000 objects.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
If we take the inverse scale factor for the x and y directions which where 1/5 since each x and y was multiplied by 5. Then we get a grid size of 128x96 so instead of about 80*60 (4800) objects we now are only rendering 16*12 or 192 objects approximately. Of course it comes out to more like 200 or so objects based on bin boundaries and that will fluctuate when we add in smooth scrolling on maps.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
The savings are incredible and give many many more benefits for future development.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h3&gt;
&amp;nbsp;Check out the commits&lt;/h3&gt;
&lt;div&gt;
You can check out the diffs of the four commits created for these two posts.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Abstract partitioning scheme &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;a href=&quot;https://github.com/njd5475/Pup8Bit/commit/32994afbc7d8bf2c34f4e3246473acb9eace8d7f&quot;&gt;32994afbc7d8bf2c34f4e3246473acb9eace8d7f&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
Space partitioning &amp;nbsp;that does not work &amp;nbsp;&amp;nbsp;&lt;a href=&quot;https://github.com/njd5475/Pup8Bit/commit/4e09bed3aff2f03856ff282ec4c6e1d91ca6ed58&quot;&gt;4e09bed3aff2f03856ff282ec4c6e1d91ca6ed58&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
Fix integer bin partition strategy &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;a href=&quot;https://github.com/njd5475/Pup8Bit/commit/e62a1760dd9c59d6d8619b88f03a24f573c23e37&quot;&gt;e62a1760dd9c59d6d8619b88f03a24f573c23e37&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
Reduce Rendering using Partitioning &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;a href=&quot;https://github.com/njd5475/Pup8Bit/commit/fb896ef2098972b6007bb1cb0b03d74e14f93ce6&quot;&gt;fb896ef2098972b6007bb1cb0b03d74e14f93ce6&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='text/html' href='http://gpsnippets.blogspot.com/2016/05/game-optimization-by-space-partitioning.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2204332218642508435/posts/default/6033525784067415536'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2204332218642508435/posts/default/6033525784067415536'/><link rel='alternate' type='text/html' href='http://gpsnippets.blogspot.com/2016/05/game-optimization-by-space-partitioning.html' title='Game optimization by space partitioning: Part II'/><author><name>Nick</name><uri>http://www.blogger.com/profile/00969811931456041499</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2204332218642508435.post-662118262718062315</id><published>2016-05-20T22:37:00.000-04:00</published><updated>2016-05-21T14:41:19.612-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="algorithms"/><category scheme="http://www.blogger.com/atom/ns#" term="coffeescript"/><category scheme="http://www.blogger.com/atom/ns#" term="debugging"/><category scheme="http://www.blogger.com/atom/ns#" term="game"/><category scheme="http://www.blogger.com/atom/ns#" term="Game Engine"/><category scheme="http://www.blogger.com/atom/ns#" term="Games"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="map"/><category scheme="http://www.blogger.com/atom/ns#" term="nashorn"/><category scheme="http://www.blogger.com/atom/ns#" term="pup8bit"/><category scheme="http://www.blogger.com/atom/ns#" term="space partitioning"/><category scheme="http://www.blogger.com/atom/ns#" term="updating"/><title type='text'>Game optimization by space partitioning</title><content type='html'>&lt;h3&gt;
&lt;b&gt;But first, a recap of LD#35&lt;/b&gt;&lt;/h3&gt;
&lt;br /&gt;
I participated in the last &lt;a href=&quot;http://ludumdare.com/compo/&quot;&gt;ludumdare&lt;/a&gt; competition. I love to participate in the competitions, they are an incredible challenge which forces me to focus and learn about how unprepared I am. Also how few public code I&#39;ve actually released. Most of my entries I have started from scratch and each time I get a little bit farther than I did before, but still way behind where I need to be in order to actually make a game during the competition.&lt;br /&gt;
&lt;br /&gt;
I tend to dive into writing a lot of boilerplate code that would already be written for me in an engine though I&#39;ve never really found an engine I like. Though I am contemplating going back to &lt;a href=&quot;https://wiki.libsdl.org/Installation&quot;&gt;SDL&lt;/a&gt;&amp;nbsp;one of the few graphics libraries that actually provided all the necessary drudge work to write a game on top of. Otherwise I will stick with writing a game for ludumdare with the code from my last entry.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;br /&gt;&lt;b&gt;&lt;a href=&quot;https://github.com/njd5475/Pup8Bit&quot;&gt;Pup8Bit an engine&lt;/a&gt;&lt;/b&gt;&lt;/h3&gt;
&lt;br /&gt;
So yeah I did not create a game I only created an engine and not the perfect one at that. It had a couple of bugs. Including no transparent images which was a huge time sync during the competition. Silly Java. Besides needing to make transparent images work, there was a huge issue with collision detection where the character movement code actually was checking it&#39;s current position instead of checking the next position for validity. But now that is working correctly.&lt;br /&gt;
&lt;br /&gt;
Did some refactoring of the main Game object to off load all event handlers, updaters and rendering queues to &lt;a href=&quot;http://gpsnippets.blogspot.com/2007/06/game-state-machine.html&quot;&gt;game state objects&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Oh and this may be a little odd and out there but during the competition I added javascript support for scripting. Then quickly added coffeescript support after that. This uses Javas &quot;&lt;a href=&quot;http://openjdk.java.net/projects/nashorn/&quot;&gt;Nashorn&lt;/a&gt;&quot; javascript engine. &amp;nbsp;And grabbed the javascript distribution from the &lt;a href=&quot;https://github.com/jashkenas/coffeescript&quot;&gt;github repo&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Long story short with that, I intend to use the coffeescript files in a resources/states directory as init scripts for game states so all your objects can be added to the game state via coffeescript. This will allow me to reload the game states and watch the file system for changes to the scripts automatically restarting the state if the script changes. There is already a game initialization script that is loaded right now and does all the keyboard input handling for the current test game.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;br /&gt;&lt;b&gt;Ok, the problem - Performance Profiling&lt;/b&gt;&lt;/h3&gt;
So the project is moving along, I have already resolved a couple of major performance bottlenecks with the code, as in somebody (me) was generating new transformation matricies in GameView everytime an object was rendered. Obviously this caused some major gc issues. But that has been resolved storing the transformations efficiently. But there are still occasional pauses when moving about the screen. Using jvisualvm helped catch the last performance issue so lets see if it helps in this circumstance.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDQmQ_lXBFhGUGUbFswqO5-veqrVmGQkDMJEKxGUuTWuAa_p8AgO63DT4hS0KqEPL9ValZ6NrfEGYtPpQoqSH7MWYAW0HpKagaZZBKK-K-XXSV8JQaHNKq9CxoSGyzmzTSZMXnSw9Nlng/s1600/Screenshot+from+2016-05-17+21%253A45%253A41.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;150&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDQmQ_lXBFhGUGUbFswqO5-veqrVmGQkDMJEKxGUuTWuAa_p8AgO63DT4hS0KqEPL9ValZ6NrfEGYtPpQoqSH7MWYAW0HpKagaZZBKK-K-XXSV8JQaHNKq9CxoSGyzmzTSZMXnSw9Nlng/s400/Screenshot+from+2016-05-17+21%253A45%253A41.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
So most of the time is being spent in the GamePosition.isClose method. Though there really isn&#39;t much to optimize there which is, maybe in getBounds call which does instantiate a new bounding box when there isn&#39;t one already but that should not take up too much time after the first call.&lt;br /&gt;
&lt;br /&gt;
Heres the code for isClose.&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;br /&gt;
&amp;nbsp; public boolean isClose(Renderable r) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; return distSq(r.getPosition()) &amp;lt; (r.getBounds().getRadiusSq() * 10d);&lt;br /&gt;
&amp;nbsp; }&lt;br /&gt;
&amp;nbsp; public double distSq(GamePosition update) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; double dx = (getX() - update.getX());&lt;br /&gt;
&amp;nbsp; &amp;nbsp; double dy = (getY() - update.getY());&lt;br /&gt;
&amp;nbsp; &amp;nbsp; return dx * dx + dy * dy;&lt;br /&gt;
&amp;nbsp; }&lt;/blockquote&gt;
&lt;br /&gt;
Really not much we can do about optimizing the calculations like my &lt;a href=&quot;http://gpsnippets.blogspot.com/2016/05/quick-distance-checking.html&quot;&gt;previous post&lt;/a&gt; indicated through experimentation. So really we need to go a step above that to the either the GameState.isClose or the GameState.neighbors method.&lt;br /&gt;
&lt;br /&gt;
isClose just purely asks an individual position if a renderable object is close to it&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private boolean isClose(Renderable r, GamePosition update) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;return update.isClose(r);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/blockquote&gt;
&lt;br /&gt;
So nothing we can do to optimize that except eliminate the function call. Definitely not our concerning code.&lt;br /&gt;
&lt;br /&gt;
And then here we have it. Where all of our time is being spent.&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public Renderable[] neighbors(GenericGameObject go, GamePosition update) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Set&lt;renderable&gt; nearbys = new HashSet&lt;renderable&gt;();&lt;/renderable&gt;&lt;/renderable&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;for (Set&lt;renderable&gt; rSet : byLayer.values()) {&lt;/renderable&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;for (Renderable r : rSet) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;if (isClose(r, go.getPosition()) &amp;amp;&amp;amp; r != go) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;nearbys.add(r);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;return nearbys.toArray(new Renderable[nearbys.size()]);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/blockquote&gt;
&lt;br /&gt;
So pretty ugly here we are going through each layer and checking every renderable object to see if its close to the position we care about. Oh and all the while doing a bunch of memory allocations in to boot.&lt;br /&gt;
&lt;br /&gt;
What we need is to reduce the overall number of checks. Yes we could pass back a reference to the hashset or store a field for the hashset and reuse that clearing it every update cycle etc. Or some such non-sense but as long as the number of items that we are iterating over is small there isn&#39;t really anything wrong with this code. So we shouldn&#39;t try to do crazy abnormal optimizations in order to eliminate the memory allocation. I think our biggest way to identify why this is a problem set of code is to output how many renderables get iterated over in this check.&lt;br /&gt;
&lt;br /&gt;
So I added in some code to found how many Renderables in the inner loop were called.&lt;br /&gt;
&lt;br /&gt;
And got a whole bunch of the following&lt;br /&gt;
&lt;br /&gt;
Iterating over 10020&lt;br /&gt;
Iterating over 10020&lt;br /&gt;
Iterating over 10020&lt;br /&gt;
Iterating over 10020&lt;br /&gt;
&lt;br /&gt;
This is for a small map from Tiled. So the app then performs fairly well for doing all those iterations every update on top of rendering at 33fps. But we are kind of wasting vast amounts of cycles here.&lt;br /&gt;
&lt;br /&gt;
We need those extra cycles for doing input handling, AI logic, handling particle movement, etc, etc. So lets get them back shall we.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;br /&gt;&lt;b&gt;Ideas...anyone...anyone...Bueller!!!!&lt;/b&gt;&lt;/h3&gt;
Ok so how about we drop the byLayers and just have a separate collection for all 10020 objects. Then what if instead of just one collection how about we use small collections of objects that are close together position wise. I mean this is mostly a filtering out unlikely candidates to get to a small number of objects that significantly reduces the impact of the loops.&lt;br /&gt;
&lt;br /&gt;
A lot of people like to suggest quad trees or other data structures. I on the other hand like to use a grid based partitioning scheme where lookup time is constant time and aggregation is O(&lt;b&gt;n&lt;/b&gt;) where &lt;b&gt;n&lt;/b&gt; is the number of objects in the area of space we are grabbing. Though on the flip side a quad tree would give you O(&lt;b&gt;log n&lt;/b&gt;) lookup time where &lt;b&gt;n&lt;/b&gt; is the number nodes in the quad tree you have to traverse but then there is no aggregation time if each node has a list of objects in that section of the tree. Otherwise you have to continue traversing and still build a collection. I might eventually implement a combined method using bins of a certain size but each bin is a quad tree and the quad tree has nodes that contain the entire list of objects in that space. Removal time might be a problem though so might need to keep non-static objects out of it.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
Defining the space partitions&lt;/h3&gt;
We will say out space partitions are 4 tiles wide by 4 tiles high. Can go in any direction and the spacial grid starts at 0,0 and goes to &lt;b&gt;MAX_INTEGER/2, MAX_INTEGER/2&lt;/b&gt; only positive values. We want to be able to add renderable objects to the partition strategy. And get all objects within any bounds, regardless of layer. We want to allow for negative positioned renderable objects so we&#39;ll put renderables centered at &lt;b&gt;MAX_INTEGER/4, MAX_INTEGER/4&lt;/b&gt; in our grid system. We will also want our code to handle any bin size. So we can optimize for our bins. Obviously with a quad tree system our bins would only be allowed to contain a maximum number of elements thereby helping make iterations and performance more constant. With bins though the bins can have any number of objects in them so it would be based solely on how many objects occupy that space. Good for top-down rpgs where the maps are pretty static and there are not going to get very busy in one section of the maps. RTS&#39; might benefit from quad tree with an implementation that reduces insertion time an keep back-references to the node an objects in for updating purposes.&lt;br /&gt;
&lt;h4&gt;
Game types to use with bins&lt;/h4&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;Turn-based Strategy&lt;/li&gt;
&lt;li&gt;Top-down RPG&lt;/li&gt;
&lt;li&gt;Simulation Games&lt;/li&gt;
&lt;li&gt;2D Shooters are ok&lt;/li&gt;
&lt;li&gt;Platformer&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
I think all of the above should perform fine with binning as a space partition strategy.&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Ok now it&#39;s time for....&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h3&gt;
Math&lt;/h3&gt;
&lt;div&gt;
This ends up being our bin calculation.&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private int getBin(int x, int y) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;return BIN_OFFSET + (y * BIN_COLUMNS + x);&lt;/div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
We calculate the bin by taking a base number &lt;b&gt;BIN_OFFSET&lt;/b&gt; adding the number of elements for the beginning of the row in the grid we are currently in so &lt;b&gt;y * BIN_COLUMNS&lt;/b&gt;&amp;nbsp;where columns are the number of columns in our grid. I actually made the size of the bin grid just the square root of the &lt;b&gt;BIN_OFFSET&lt;/b&gt;&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
// just make the number of possible bins really large&lt;br /&gt;
private static final int&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;BIN_OFFSET&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;= Integer.MAX_VALUE / 4;&lt;br /&gt;
private static final int&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;BIN_COLUMNS&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;= (int) Math.sqrt(BIN_OFFSET);&lt;/blockquote&gt;
This is still pretty large for game maps. It&#39;s&amp;nbsp;&lt;b&gt;23170&lt;/b&gt; elements.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
Benefits of Space Partitioning&lt;/h3&gt;
&lt;div&gt;
So here we go now what are the benefits of this strategy. Before we were iterating over &quot;Iterating over 10020&quot; each update loop&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Now we are&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
Iterating over 31&lt;/div&gt;
&lt;div&gt;
Iterating over 31&lt;/div&gt;
&lt;div&gt;
Iterating over 31&lt;/div&gt;
&lt;div&gt;
Iterating over 31&lt;/div&gt;
&lt;div&gt;
Iterating over 31&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
So wow we dropped 9989 iterations.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h3&gt;
Check Profiling&lt;/h3&gt;
Now lets check the profiling to see if there is anything else we can optimize.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWscXHZxNzGd8o0FKvWDBuwzZhuNbXOEuGbzKEUz4zVSTYUJ9etbePHrJUdlMe4jq3CyuNeLKZ3ydf9Sw-QkKn3jE1otaR_n_2ijk48bGGRpckrD9UveL3jeA-8ctcbxzWJTGJXPUfJZc/s1600/Screenshot+from+2016-05-20+09%253A07%253A17.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;131&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWscXHZxNzGd8o0FKvWDBuwzZhuNbXOEuGbzKEUz4zVSTYUJ9etbePHrJUdlMe4jq3CyuNeLKZ3ydf9Sw-QkKn3jE1otaR_n_2ijk48bGGRpckrD9UveL3jeA-8ctcbxzWJTGJXPUfJZc/s400/Screenshot+from+2016-05-20+09%253A07%253A17.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Looks like a lot of time is now spent in rendering. And that reminds me that we were looking at only the collision detection code and not the rendering code due to the most significant time user.&lt;br /&gt;
&lt;br /&gt;
We could easily now use the abstract &lt;a href=&quot;http://pup8bit/src/com/zealouscoder/ld35/partitioning/SpacePartitionStrategy.java&quot;&gt;SpacePartitionStrategy&lt;/a&gt; and the methods on it to reduce the number of rendering calls the application is making every render which is now the most significant path.&lt;br /&gt;
&lt;br /&gt;
I will let you know those benefits next time.</content><link rel='replies' type='text/html' href='http://gpsnippets.blogspot.com/2016/05/optimizing-rendering-by-space.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2204332218642508435/posts/default/662118262718062315'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2204332218642508435/posts/default/662118262718062315'/><link rel='alternate' type='text/html' href='http://gpsnippets.blogspot.com/2016/05/optimizing-rendering-by-space.html' title='Game optimization by space partitioning'/><author><name>Nick</name><uri>http://www.blogger.com/profile/00969811931456041499</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDQmQ_lXBFhGUGUbFswqO5-veqrVmGQkDMJEKxGUuTWuAa_p8AgO63DT4hS0KqEPL9ValZ6NrfEGYtPpQoqSH7MWYAW0HpKagaZZBKK-K-XXSV8JQaHNKq9CxoSGyzmzTSZMXnSw9Nlng/s72-c/Screenshot+from+2016-05-17+21%253A45%253A41.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2204332218642508435.post-563071207737177675</id><published>2016-05-15T22:08:00.000-04:00</published><updated>2016-05-20T22:24:14.973-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="colliders"/><category scheme="http://www.blogger.com/atom/ns#" term="collision detection"/><category scheme="http://www.blogger.com/atom/ns#" term="collision results"/><category scheme="http://www.blogger.com/atom/ns#" term="game math"/><category scheme="http://www.blogger.com/atom/ns#" term="github"/><category scheme="http://www.blogger.com/atom/ns#" term="math"/><title type='text'>Quick distance checking!</title><content type='html'>&lt;h2&gt;
Recap&lt;/h2&gt;
A while ago (ah hem 8 years ago) I made a post about how to implement &lt;a href=&quot;http://gpsnippets.blogspot.com/2008/10/bounding-box-collision-detection.html&quot;&gt;basic bounding box coliision detection&lt;/a&gt;. I thought I would make a post about how to use a little short-cut method to determine if two objects are nearby each other.&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
The Problem&lt;/h2&gt;
If we have a world full of objects, which are anything from the trees, and grass to the little particles racing around the screen we do not want to needlessly check every object with every other object if we do not have to. For instance, an object on the left side of the screen could not possibly collide with an object on the right side of the screen.&lt;br /&gt;
&lt;br /&gt;
You want to eliminate as many of these expensive mathematical calculations as possible. Or perhaps you just want to see if two objects will affect each other anytime soon. There are a couple things we need to know about the objects in order to quickly make the determination if we want to check them. We might be currently checking collisions on objects that will never touch each other. Each time we can eliminate a future check it is can save us from wasting a check. Although not as big of a problem with modern day graphics if you use the GPU for rendering. Still it will help update cycles which that we run on the CPU and anything that is still prone to bottlenecks.&lt;br /&gt;
&lt;br /&gt;
There may also be other areas where you want to quickly find all objects close or nearby each other. I plan to cover some partitioning strategies in the future that will help eliminate massive amounts of loops from being necessary.&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
The Math&lt;/h2&gt;
We want to determine if two objects are close to each other. We need to at least have a radius around the objects in order to calculate whether or not they are within another objects radius. So we use the distance between the two objects which is calculated as&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
// SquareRootCalculator&lt;br /&gt;double d = Math.sqrt( Math.pow(object1.x - object2.x, 2) + Math.pow(object1.y - object2.y,2));&lt;/blockquote&gt;
&lt;br /&gt;
We can improve the speed of this a little bit by short-cutting the math and applying some variables.&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
// SingleDiffCalculator&lt;br /&gt;double diffX = object1.x - object2.x;&lt;br /&gt;double diffY = object1.y - object2.y;&lt;br /&gt;double distSquared = diffX * diffX + diffY * diffY;&lt;/blockquote&gt;
&lt;br /&gt;
No Math routine calls and eliminate the need to calculate difference twice. Although the compiler and JIT may not use a register for diffX and diffY they may instead decide to use the stack which is less optimal but probably negligent difference in performance. You can expand it out to be a long equation.&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
// DirectFromObjectsCalculator&lt;br /&gt;double distSquared = (object1.x - object2.x) * (object1.x - object2.x) + (object1.y - object2.y) * (object1.y - object2.y);&lt;/blockquote&gt;
&lt;br /&gt;
And because I like to take things farther than they need to be here accessing the x and y variables may not be efficient enough since the objects were probably allocated on the heap and may not be in cpu cache lets force them to be put on the stack which is probably in cache still.&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
// DirectFromStackCalculator&lt;br /&gt;double ox1 = object1.x;&lt;br /&gt;double oy1 = object1.y;&lt;br /&gt;double ox2 = object2.x;&lt;br /&gt;double oy2 = object2.y;&lt;br /&gt;double distSquared = (ox1-ox2) * (ox1-ox2) + (oy1-oy2) * (oy1-oy2);&lt;/blockquote&gt;
&lt;br /&gt;
Because I like to be thorough lets see if that matters at all lets put them into a utility class and use a Unit Test and get some output. And lets do it in an object oriented way.&lt;br /&gt;
&lt;br /&gt;
Ok so there was not much of a difference or enough to be noticable between methods.&lt;br /&gt;
&lt;br /&gt;
283 ms for 10000000 using DirectFromObjectsCalculator&lt;br /&gt;
263 ms for 10000000 using DirectFromStackCalculator&lt;br /&gt;
283 ms for 10000000 using SingleDiffCalculator&lt;br /&gt;
268 ms for 10000000 using MathCalculator&lt;br /&gt;
304 ms for 10000000 using SquareRootCalculator&lt;br /&gt;
&lt;br /&gt;
Another run:&lt;br /&gt;
&lt;br /&gt;
336 ms for 12000000 using DirectFromObjectsCalculator&lt;br /&gt;
347 ms for 12000000 using DirectFromStackCalculator&lt;br /&gt;
391 ms for 12000000 using SingleDiffCalculator&lt;br /&gt;
394 ms for 12000000 using MathCalculator&lt;br /&gt;
409 ms for 12000000 using SquareRootCalculator&lt;br /&gt;
&lt;br /&gt;
These results did not change much on repeated runs and varied a bit between winners the only obvious looser was the SquareRootCalculator obviously.&lt;br /&gt;
&lt;br /&gt;
So no need to go drastically changing your coding style use variables if you want to clean things up. Doing temporary calculations like the SingleDiffCalculator.&lt;br /&gt;
&lt;br /&gt;
If you would like to fiddle with the code then you can find it &lt;a href=&quot;https://github.com/njd5475/gpsnippets&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;
&lt;h2&gt;
&lt;br /&gt;The Check&lt;/h2&gt;
So the final piece which I should have mentioned before going into all that testing above, is the comparison of against the radius.&lt;br /&gt;
&lt;br /&gt;
The calculation returns the squared distance so we need to see if the square of the distance from the objects centers is less than the square of the sum of the radii.&lt;br /&gt;
&lt;br /&gt;
Something like&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
double radiusSquared = Math.pow(object1.radius + object2.radius, 2);&lt;br /&gt;if(distSquared &amp;lt; radiusSquared) {&lt;br /&gt;&amp;nbsp; // objects could be colliding&lt;br /&gt;}else{&lt;br /&gt;&amp;nbsp; // objects not colliding&lt;br /&gt;}&lt;/blockquote&gt;
&lt;br /&gt;
That should be about it. Hopefully I will get some time to back fill that repo with examples from earlier snippets I posted.</content><link rel='replies' type='text/html' href='http://gpsnippets.blogspot.com/2016/05/quick-distance-checking.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2204332218642508435/posts/default/563071207737177675'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2204332218642508435/posts/default/563071207737177675'/><link rel='alternate' type='text/html' href='http://gpsnippets.blogspot.com/2016/05/quick-distance-checking.html' title='Quick distance checking!'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2204332218642508435.post-6630353923637734202</id><published>2016-03-26T00:15:00.001-04:00</published><updated>2016-03-26T00:15:16.075-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="auto-generating"/><category scheme="http://www.blogger.com/atom/ns#" term="behavior tree"/><category scheme="http://www.blogger.com/atom/ns#" term="behaviortree"/><category scheme="http://www.blogger.com/atom/ns#" term="behaviortrees"/><category scheme="http://www.blogger.com/atom/ns#" term="code"/><category scheme="http://www.blogger.com/atom/ns#" term="dungeon"/><category scheme="http://www.blogger.com/atom/ns#" term="dungeon crawler"/><category scheme="http://www.blogger.com/atom/ns#" term="dwarves"/><category scheme="http://www.blogger.com/atom/ns#" term="Eclipse"/><category scheme="http://www.blogger.com/atom/ns#" term="game"/><category scheme="http://www.blogger.com/atom/ns#" term="generate dungeon"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="Snippet"/><category scheme="http://www.blogger.com/atom/ns#" term="work in progress"/><title type='text'>Dungeon Crawler in Java</title><content type='html'>I have begun building a dungeon crawler game. The premise of the game that I came up with is a little odd for a dungeon crawler but hopefully it will be interesting and you&#39;ll like it.&lt;br /&gt;
&lt;br /&gt;
So the world is going to be made up of dungeons, yeah obviously. The dungeons will have been created from a simulation of AI dwarves starting from just two in a random area. I plan on creating some unique monsters that spawn in order to slow or stop the dwarves quest to build meaningful dungeons. Build in some magical items and of course hopefully some humorous history generated for NPCs, books, spells, and items in the dungeon crawl.&lt;br /&gt;
&lt;br /&gt;
The world currently is all dirt except for a 5x5 area of grass where the dwarves will start out, need to add in minerals and rare metals etc. Also little hazards ;)&lt;br /&gt;
&lt;br /&gt;
Tools I&#39;m using:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Java 8&lt;/li&gt;
&lt;li&gt;Eclipse&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/njd5475/behaviortree&quot;&gt;BehaviorTree&lt;/a&gt;&amp;nbsp;&lt;a href=&quot;https://www.blogger.com/&quot;&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;All current art done with &lt;a href=&quot;https://play.google.com/store/apps/details?id=com.meltinglogic.pixly&amp;amp;hl=en&quot;&gt;Pixly&lt;/a&gt;&amp;nbsp;for android&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
Heres a snippet from the Dwarves current behaviortree&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;







&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;s1&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;static&lt;/span&gt; AICreature createMaleDwarf(&lt;span class=&quot;s1&quot;&gt;final&lt;/span&gt; World &lt;span class=&quot;s2&quot;&gt;world&lt;/span&gt;) {&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; InOrderSequence&lt;aicreature&gt; &lt;span class=&quot;s2&quot;&gt;root&lt;/span&gt; = &lt;span class=&quot;s1&quot;&gt;new&lt;/span&gt; InOrderSequence&amp;lt;&amp;gt;();&lt;/aicreature&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SelectorNode&lt;aicreature&gt; &lt;span class=&quot;s2&quot;&gt;isHealthy&lt;/span&gt; = &lt;span class=&quot;s1&quot;&gt;new&lt;/span&gt; SelectorNode&amp;lt;&amp;gt;();&lt;/aicreature&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SelectorNode&lt;aicreature&gt; &lt;span class=&quot;s2&quot;&gt;isDanger&lt;/span&gt; = &lt;span class=&quot;s1&quot;&gt;new&lt;/span&gt; SelectorNode&amp;lt;&amp;gt;();&lt;/aicreature&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;s2&quot;&gt;isDanger&lt;/span&gt;.addChild(&lt;span class=&quot;s2&quot;&gt;context&lt;/span&gt; -&amp;gt; {&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;s1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;world&lt;/span&gt;.findHostiles(&lt;span class=&quot;s2&quot;&gt;context&lt;/span&gt;, &lt;span class=&quot;s2&quot;&gt;context&lt;/span&gt;.getAwarenessDistance()).&lt;span class=&quot;s3&quot;&gt;length&lt;/span&gt; &amp;gt; 0;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }, &lt;span class=&quot;s2&quot;&gt;isHealthy&lt;/span&gt;);&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Action&lt;aicreature&gt; &lt;span class=&quot;s2&quot;&gt;attack&lt;/span&gt; = &lt;span class=&quot;s2&quot;&gt;context&lt;/span&gt; -&amp;gt; {&lt;/aicreature&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;s1&quot;&gt;return&lt;/span&gt; NodeStatus.&lt;span class=&quot;s3&quot;&gt;FAILURE&lt;/span&gt;;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; };&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;s2&quot;&gt;isHealthy&lt;/span&gt;.addChild(&lt;span class=&quot;s2&quot;&gt;context&lt;/span&gt; -&amp;gt; {&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;s1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;context&lt;/span&gt;.getHealth() &amp;gt; 80;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }, &lt;span class=&quot;s1&quot;&gt;new&lt;/span&gt; LeafNode&lt;aicreature&gt;(&lt;span class=&quot;s2&quot;&gt;attack&lt;/span&gt;));&lt;/aicreature&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; LeafNode&lt;aicreature&gt; &lt;span class=&quot;s2&quot;&gt;isBored&lt;/span&gt; = &lt;span class=&quot;s1&quot;&gt;new&lt;/span&gt; LeafNode&amp;lt;&amp;gt;(&lt;span class=&quot;s2&quot;&gt;context&lt;/span&gt; -&amp;gt; {&lt;/aicreature&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;s1&quot;&gt;if&lt;/span&gt; (&lt;span class=&quot;s2&quot;&gt;world&lt;/span&gt;.every(&lt;span class=&quot;s2&quot;&gt;context&lt;/span&gt;, 0.3)) {&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;s2&quot;&gt;world&lt;/span&gt;.moveToRandomAdjacent(&lt;span class=&quot;s2&quot;&gt;context&lt;/span&gt;);&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;s1&quot;&gt;return&lt;/span&gt; NodeStatus.&lt;span class=&quot;s3&quot;&gt;RUNNING&lt;/span&gt;;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; });&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;s2&quot;&gt;root&lt;/span&gt;.addChild(&lt;span class=&quot;s2&quot;&gt;isBored&lt;/span&gt;);&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;s2&quot;&gt;root&lt;/span&gt;.addChild(&lt;span class=&quot;s2&quot;&gt;isDanger&lt;/span&gt;);&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;s1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;new&lt;/span&gt; Dwarf(&lt;span class=&quot;s2&quot;&gt;root&lt;/span&gt;, &lt;span class=&quot;s2&quot;&gt;world&lt;/span&gt;.zero());&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;/blockquote&gt;
&lt;br /&gt;
Teaser&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgc1GweJDviCP8Q7kewrK5sEOB5GARfD0vMrFV8NR1RLR1aURZra_CXY40sfsKk_Wb5mBSxZnK6YAn4ytre_ZhIPXbmS4WkSdlbGNofioiI4ritKqsPWsq9jXdiuRVJiZqOt1Xv0j-D4nc9/s1600/Screen+Shot+2016-03-25+at+11.57.51+PM.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgc1GweJDviCP8Q7kewrK5sEOB5GARfD0vMrFV8NR1RLR1aURZra_CXY40sfsKk_Wb5mBSxZnK6YAn4ytre_ZhIPXbmS4WkSdlbGNofioiI4ritKqsPWsq9jXdiuRVJiZqOt1Xv0j-D4nc9/s400/Screen+Shot+2016-03-25+at+11.57.51+PM.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;</content><link rel='replies' type='text/html' href='http://gpsnippets.blogspot.com/2016/03/dungeon-crawler-in-java.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2204332218642508435/posts/default/6630353923637734202'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2204332218642508435/posts/default/6630353923637734202'/><link rel='alternate' type='text/html' href='http://gpsnippets.blogspot.com/2016/03/dungeon-crawler-in-java.html' title='Dungeon Crawler in Java'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgc1GweJDviCP8Q7kewrK5sEOB5GARfD0vMrFV8NR1RLR1aURZra_CXY40sfsKk_Wb5mBSxZnK6YAn4ytre_ZhIPXbmS4WkSdlbGNofioiI4ritKqsPWsq9jXdiuRVJiZqOt1Xv0j-D4nc9/s72-c/Screen+Shot+2016-03-25+at+11.57.51+PM.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2204332218642508435.post-5904467733395938130</id><published>2016-03-10T21:38:00.003-05:00</published><updated>2016-03-10T21:40:01.914-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="interoperability"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="java2D"/><category scheme="http://www.blogger.com/atom/ns#" term="jruby"/><category scheme="http://www.blogger.com/atom/ns#" term="language"/><category scheme="http://www.blogger.com/atom/ns#" term="Ruby"/><category scheme="http://www.blogger.com/atom/ns#" term="swing"/><title type='text'>JRuby for game development</title><content type='html'>So I have been pretty active in using Ruby for the past several years. I have found it a great resource for writing less code and producing more results. So why not use it for game development. Build some DSLs or better syntax for writing game logic code. So in this post I am going to run through a couple of ways to accomplish writing a game in ruby by using java for graphics and additional functionality.&lt;br /&gt;
&lt;br /&gt;
So first we start off by needing to package everything up nicely in a single jar file so it appears as though we&#39;re just using java. Unfortunately this comes with a bit of a space cost. And that space is that of jruby the complete jar is ~20mb you can find them at &lt;a href=&quot;http://jruby.org/downloads&quot;&gt;http://jruby.org/downloads&lt;/a&gt;&amp;nbsp;so no way to avoid this although you can do something like write an install script that downloads it and then puts your source into it afterwards.&lt;br /&gt;
&lt;br /&gt;
Ok once you have the jar file you will add your code to it and it will become your executable from java.&lt;br /&gt;
&lt;br /&gt;
Make a copy of the complete jar.&lt;br /&gt;
&lt;br /&gt;
$ cp jruby-complete-9.0.5.0.jar mygame.jar&lt;br /&gt;
&lt;br /&gt;
Create a file that jruby will launch called &lt;b&gt;jar-bootstrap.rb&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
#!/usr/bin/env ruby&lt;br /&gt;
puts &quot;Hello, I am jar-bootstrap.rb from inside the jar file&quot;&lt;br /&gt;
&lt;br /&gt;
Update the jar (&lt;b&gt;-u&lt;/b&gt;)&amp;nbsp;by first modifying the manifest to run a specific java class using option &lt;b&gt;-e&lt;/b&gt;&amp;nbsp;to override the Main-Class entry in the manifest already inside the jar.&lt;br /&gt;
&lt;br /&gt;
$ jar ufe mygame.jar org.jruby.JarBootstrapMain&lt;br /&gt;
&lt;br /&gt;
Then you can use the &lt;b&gt;-u &lt;/b&gt;option to add files to the jar file or update existing ones.&lt;br /&gt;
&lt;br /&gt;
$ jar uf mygame.jar&amp;nbsp;jar-bootstrap.rb&lt;br /&gt;
&lt;br /&gt;
Then viola:&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;$ java -jar mygame.jar&lt;br /&gt;
Hello, I am jar-bootstrap.rb from inside the jar file.&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Ok we&#39;ve entered the ruby~java land woot woot.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Now for lets rubify java to do our game-logics bidding!!!&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Lets switch the &lt;b&gt;jar-bootstrap.rb &lt;/b&gt;to load our game which we will start in a game.rb file:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;jar-boostrap.rb&lt;/b&gt;&amp;nbsp;becomes&lt;/div&gt;
&lt;div&gt;
#!/usr/bin/env ruby&lt;/div&gt;
&lt;div&gt;
require &#39;./game.rb&#39;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Then we make our game.rb file with a simple example of loading a java swing window and rendering loop&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;game.rb&lt;/b&gt;&amp;nbsp;is&lt;/div&gt;
&lt;div&gt;
#!/usr/bin/env ruby&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
include Java&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
import javax.swing.JFrame&lt;/div&gt;
&lt;div&gt;
import javax.swing.JPanel&lt;/div&gt;
&lt;div&gt;
import java.awt.BorderLayout&lt;/div&gt;
&lt;div&gt;
import java.awt.Dimension&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
class MyDrawPane &amp;lt; JPanel&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; def initialize&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; super&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; setDoubleBuffered true&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; setPreferredSize Dimension.new(800,600)&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; end&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; def paintComponent(g)&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; g = g.create&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; g.drawString &#39;Hello from ruby&#39;, 0, self.height / 2&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; g.dispose&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; end&lt;/div&gt;
&lt;div&gt;
end&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
class MyGame &amp;lt; JFrame&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; def initialize&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; super &quot;My Game Window Title&quot;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; self.setLayout BorderLayout.new&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; self.add ::MyDrawPane.new&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; self.setDefaultCloseOperation JFrame::EXIT_ON_CLOSE&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; self.pack&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; self.setLocationRelativeTo nil&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; self.setVisible true&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; end&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
end&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
MyGame.new&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
And with all this we have a simple window to start from but now we can use the power of ruby to rule the world. Uh I mean we&#39;ll use the power of ruby to make games...&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;...to rule the world...&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
So this is all great but maybe we want easier iterations with our game development because updating the jar all the time isn&#39;t that fast. So for development just execute your game.rb file from jruby directly. You can use the original one you downloaded.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
$ java -jar ../jruby-complete-9.0.5.0.jar game.rb&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Or if you use rvm or rbenv then just execute the game script. And Q.E.D.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='text/html' href='http://gpsnippets.blogspot.com/2016/03/jruby-for-game-development.html#comment-form' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2204332218642508435/posts/default/5904467733395938130'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2204332218642508435/posts/default/5904467733395938130'/><link rel='alternate' type='text/html' href='http://gpsnippets.blogspot.com/2016/03/jruby-for-game-development.html' title='JRuby for game development'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2204332218642508435.post-7272767455322236063</id><published>2015-09-13T22:30:00.001-04:00</published><updated>2016-05-29T18:39:32.617-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Construct"/><category scheme="http://www.blogger.com/atom/ns#" term="decisions"/><category scheme="http://www.blogger.com/atom/ns#" term="game design"/><category scheme="http://www.blogger.com/atom/ns#" term="game development process"/><category scheme="http://www.blogger.com/atom/ns#" term="Game Maker"/><category scheme="http://www.blogger.com/atom/ns#" term="haxe flixel"/><category scheme="http://www.blogger.com/atom/ns#" term="orge3d"/><category scheme="http://www.blogger.com/atom/ns#" term="SDL"/><category scheme="http://www.blogger.com/atom/ns#" term="unity"/><category scheme="http://www.blogger.com/atom/ns#" term="unreal engine"/><title type='text'>So many options, whats a game programmer to do</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot;&gt;
This has been a difficult question lately with for all kinds of programming tasks. Its sometimes feels like the toss of a coin.&amp;nbsp;&lt;/div&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
Delusional thoughts...&lt;/h2&gt;
&lt;div dir=&quot;ltr&quot;&gt;
Do I go with Java and deal with the steep cost of over engineering. Or do I use unreal engine cause every professional game is made with it. Or perhaps &lt;a href=&quot;http://www.ogre3d.org/&quot; target=&quot;_blank&quot;&gt;Ogre3d&lt;/a&gt; to just take up so much time reimplementing or integrating c++ packages. Perhaps I should just stick with &lt;a href=&quot;https://unity3d.com/&quot; target=&quot;_blank&quot;&gt;Unity&lt;/a&gt; its popular these days.&amp;nbsp;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot;&gt;
Anh! but the workflow for &lt;a href=&quot;https://unity3d.com/&quot; target=&quot;_blank&quot;&gt;Unity&lt;/a&gt; involves nothing but hacking around and repositioning everything which i should probably just get used to, since that seems to be how all levels are made. I could try &lt;a href=&quot;http://haxeflixel.com/&quot; target=&quot;_blank&quot;&gt;HaxeFlixel&lt;/a&gt; again that actually showed promise and was something different. It had my game state pattern built in which was cool.&amp;nbsp;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot;&gt;
I could go back to &lt;a href=&quot;https://www.libsdl.org/download-1.2.php&quot; target=&quot;_blank&quot;&gt;SDL&lt;/a&gt; with &lt;a href=&quot;https://www.libsdl.org/download-2.0.php&quot; target=&quot;_blank&quot;&gt;SDL2&lt;/a&gt; but the setup was nightmarish to include all the necessary SDL pieces and kind of a bad fragmented experience. Or I could just use &lt;a href=&quot;http://www.yoyogames.com/gamemaker&quot; target=&quot;_blank&quot;&gt;GameMaker&lt;/a&gt; its still around, of course &lt;a href=&quot;https://www.scirra.com/&quot; target=&quot;_blank&quot;&gt;Construct&lt;/a&gt; worked though they are in a monetizing phase and &lt;a href=&quot;https://www.scirra.com/&quot; target=&quot;_blank&quot;&gt;Construct2&lt;/a&gt; didn&#39;t seem performant in the browser and the interface is not conducive to game design but gives me the feel of the old school drag and drop GUI editors.&lt;/div&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
...from fantasy island&lt;/h2&gt;
&lt;div dir=&quot;ltr&quot;&gt;
Retrospectively I have failed repeatedly to make games with any of these. Usually its because i start and then reach some part of the process where I have to make a decision about what I do next and I cannot decide how to choose either the implementation detail or a game design choice. But in order to move forward I must choose.&lt;/div&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
desire for motivation&lt;/h2&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot;&gt;
So it would probably help for me to state the problem and then come up with a solution. I have been trying to find the best way to motivate continuous change within software to push development forward and to not get stagnated. If successful I will be able to put aside my uncertainty and anxiety and move forward. It should help propel my projects forward. &lt;/div&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot;&gt;
The key to overcoming these adversities and focus on the task at hand and propel things forward is first to a release them and increase my public code presence. Which will help with my career and help get users who may need new features so as to add additional incentive.&lt;/div&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot;&gt;
Next is to know where each project is in its development, and roadmap the near and far future. The better the roadmap the easier it is to just pick up the project months down the road and get it to that next step. &lt;/div&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot;&gt;
What is truly need by ever programmer is to clearly identify what the next coding objective is whether it be to write an abstract game saving mechanism or to write a high throughput light calculation algorithm it remains the same, what do I work on next. Regardless of language or package we must remain objective in order to develop games.&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='text/html' href='http://gpsnippets.blogspot.com/2015/09/so-many-options-whats-game-programmer.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2204332218642508435/posts/default/7272767455322236063'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2204332218642508435/posts/default/7272767455322236063'/><link rel='alternate' type='text/html' href='http://gpsnippets.blogspot.com/2015/09/so-many-options-whats-game-programmer.html' title='So many options, whats a game programmer to do'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2204332218642508435.post-206350988436178118</id><published>2015-02-03T23:28:00.003-05:00</published><updated>2015-02-03T23:28:40.324-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Eclipse"/><category scheme="http://www.blogger.com/atom/ns#" term="gist"/><category scheme="http://www.blogger.com/atom/ns#" term="git"/><category scheme="http://www.blogger.com/atom/ns#" term="jogl"/><category scheme="http://www.blogger.com/atom/ns#" term="lwjgl"/><category scheme="http://www.blogger.com/atom/ns#" term="maven"/><category scheme="http://www.blogger.com/atom/ns#" term="maven lwjgl"/><category scheme="http://www.blogger.com/atom/ns#" term="maven lwjgl eclipse"/><category scheme="http://www.blogger.com/atom/ns#" term="ramblings"/><title type='text'>Ok so not quite...back yet</title><content type='html'>Been playing around with lwjgl and jogl a little bit lately. Ran into a slit issue as while attempting to get a project setup and running. First was that I wanted to use maven to grab the latest jars and ultimately natives. Each project does things in substantially different ways. I have to say that jogl is much simpler on the setup end for maven support.&lt;br /&gt;
&lt;br /&gt;
Hey here is the pom.xml file:&lt;br /&gt;
&lt;a href=&quot;https://gist.github.com/njd5475/4dc980d0a0ed8775bb20&quot;&gt;https://gist.github.com/njd5475/4dc980d0a0ed8775bb20&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
And of course the lwjgl which was not so simple. Instructing maven to do the jar extraction for the natives was pain enough to find. There was also a necessity to put them in the root project directory in order to run in eclipse out of the box.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://gist.github.com/njd5475/1109a01cec0afbd64b68&quot;&gt;https://gist.github.com/njd5475/1109a01cec0afbd64b68&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
It was an interesting exercise along with updating an old JOGL 1.x project for JOGL 2 there were some basic differences that caused quite a few compile errors.&lt;br /&gt;
&lt;br /&gt;
P.S. Yes I am on github here&amp;nbsp;&lt;a href=&quot;https://github.com/njd5475&quot;&gt;https://github.com/njd5475&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='text/html' href='http://gpsnippets.blogspot.com/2015/02/ok-so-not-quiteback-yet.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2204332218642508435/posts/default/206350988436178118'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2204332218642508435/posts/default/206350988436178118'/><link rel='alternate' type='text/html' href='http://gpsnippets.blogspot.com/2015/02/ok-so-not-quiteback-yet.html' title='Ok so not quite...back yet'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2204332218642508435.post-6803440601999718073</id><published>2014-12-01T07:10:00.001-05:00</published><updated>2015-02-03T22:49:10.669-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ramblings"/><title type='text'>Back and better than ever</title><content type='html'>&lt;div dir=&quot;ltr&quot;&gt;
Its been far too long. So lets see whats happened.&amp;nbsp; Well got let go of a job got another job, got sucked in to a mountain of work and just couldn&#39;t get out of it. Been working on some android game engine code for a while. A little on green algae here and there but thats like the pet project at this point.&lt;/div&gt;
&lt;div dir=&quot;ltr&quot;&gt;
You always have two projects, first is always your masterpiece and the monolith.&amp;nbsp; The second project is usually your playground and the one you dont care about.&amp;nbsp; Its always the one you don&#39;t care about that ends up succeeding where you fail at the other one. Its also the one you keep coming back to to work on after you learn new things.&lt;/div&gt;
</content><link rel='replies' type='text/html' href='http://gpsnippets.blogspot.com/2014/12/back-and-better-than-ever.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2204332218642508435/posts/default/6803440601999718073'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2204332218642508435/posts/default/6803440601999718073'/><link rel='alternate' type='text/html' href='http://gpsnippets.blogspot.com/2014/12/back-and-better-than-ever.html' title='Back and better than ever'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>