<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>thecoshman</title>
    <description>Technically A Game - A series of posts charting my stumblings back into the word of games programing</description>
    <language>en-uk</language>
    <link>http://thecoshman.com</link>
    <atom:link href="http://thecoshman.com/rss-tag.xml" rel="self" type="application/rss+xml" />
    <pubDate>Wed, 24 Mar 2021 22:19:23 +0000</pubDate>
    <lastBuildDate>Wed, 24 Mar 2021 22:19:23 +0000</lastBuildDate>

    
    <item>
      <title>TheEnd</title>
      <description>&lt;h2 id=&quot;the-end&quot;&gt;The End!&lt;/h2&gt;

&lt;p&gt;Yeah, I did it, it’s a click bait title.
But let’s not get ahead of ourselves;
am I perhaps teasing too much?
Any way, V7 really doesn’t offer much from a player’s point of view besides, perhaps, a slightly better FPS.
There’s two main things I’ve managed to implement this time, funnily enough, the two mains things I planned.
We now have a texture atlas and meshes per chunk, for efficient rendering!
Combined, this seems to have restored a reasonable frame rate for me.
Contrary to my usual, I’m not going to bother uploading a copy - is it really worth it?&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/tag/v7/sample.png&quot; alt=&quot;Sample of V7&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;texture-atlas&quot;&gt;Texture Atlas&lt;/h2&gt;

&lt;p&gt;A texture atlas is a method/technique where you combine multiple smaller textures into a single larger one, thus helping reduce the amount of times you need to swap it.
Commonly these would be pre-built along with some sort of configuration data saying what parts of the atlas are what.
I know that I want to make it easy to ‘just add’ new textures, or to possibly swap the textures that are used, I therefore wanted a way to dynamically build the atlas.&lt;/p&gt;

&lt;p&gt;Whilst I’m sure there are better solutions out there, I went with putting each texture into a grid cell in the atlas.
Down the line I’m sure there’s better ways to build this, but still, here’s roughly the steps I take to build the texture atlas:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Load each individual texture into memory (not to the GPU though)&lt;/li&gt;
  &lt;li&gt;Determine the size of the largest texture, as a ‘smallest power of two’, this will be how big each cell needs to be
    &lt;ul&gt;
      &lt;li&gt;This is done dynamically, even though my textures are all 16x16&lt;/li&gt;
      &lt;li&gt;If I had a texture that was 20px wide, I’d calculate each atlas grid cell would need to be 32px&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Work out how large a grid of textures I would need
    &lt;ul&gt;
      &lt;li&gt;As I have three textures, I would need a grid that is 2x2 cells&lt;/li&gt;
      &lt;li&gt;This again this is done as a ‘smallest power of two’; with five textures, it’d be a 4x4 grid that is used&lt;/li&gt;
    &lt;/ul&gt;

    &lt;p&gt;At this stage, I know the smallest ‘power of two’ sized image that can fit every texture, and how many grid cells my atlas needs to have.
That means I can create an OpenGL texture buffer that is large enough for all my textures and is a power of two size.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;I can now ‘blit’ each individual texture into the larger atlas texture, tracking what cell the texture is being put
    &lt;ul&gt;
      &lt;li&gt;This allows me to return the UV coordinates for a given texture within the atlas later on&lt;/li&gt;
      &lt;li&gt;And this is where the ‘block registry’ fits in too, by they way&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;As you can tell, I’m making a few presumptions here.
Chiefly, that the textures are all the same square size.
As my textures are all 16x16, my solution currently works fine with these presumptions.
However, if I had some textures that were 32x32, I could actually fit four 16x16 textures into one grid cell, but my crude solution would make those four smaller textures consume a larger 32x32 cell each.
Whilst not space efficient, my solution would at least handle this.
Packing the atlas more efficiently is something I will worry about later;
it’s hardly an issue when I only have three textures.
Another presumption I’m making is that ‘power of two’ sized textures are indeed something to aim for - some further research is in order I think here.&lt;/p&gt;

&lt;p&gt;It’s also obvious that doing this atlas build every time the game is run is less than ideal.
Later I could look to add a way to save the atlas so that you don’t have to wait for each time you start the game.
As long as I can determine if the input textures are the same, I should be able to simple load a pre build texture atlas.&lt;/p&gt;

&lt;h2 id=&quot;chunk-meshing&quot;&gt;Chunk Meshing&lt;/h2&gt;

&lt;p&gt;Previously, my chunk rendering was a rather ‘brute force’ afair, drawing each block one by one.
There was a minor optimisation, I would create a ‘display chunk’ that would work out, and cache, for each block in the data chunk, is it something to render (ie, not air), and is it possible to be rendered (not surround on all six sides by blocks that can’t be seen through).
This did help a little bit, but still allows for potentially thousands of individual draw calls, each one needing to swap the texture;
though, during development of this version the atlas was used once made by updating the shader uniforms to use for this block.
A solution here then, is to build a single buffer object for the entire chunk so that it can be drawn in a single draw call.&lt;/p&gt;

&lt;p&gt;As I already had the logic in place that that checks each block to see if it should be drawn, I retained that;
a minor reduction in the amount of data in the mesh perhaps, but why not take that?
For each block then, I determine what the vertex coordinates within the chunk are, what the texture coordinates (from the atlas) this block needs and finally the indexes that would draw this block.
This produces three temporary &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;std::vector&lt;/code&gt;s, which I can combine into three large ones as I build the chunk mesh and then buffer into OpenGL.
And like that, I got nearly significant increase in frame rate.&lt;/p&gt;

&lt;p&gt;Some minor things I could look at improving in the future is further culling faces that could never be seen.
Two blocks that are touching would share a common face that could never be seen, thus never need to be added to the mesh.
With a bit more work, I could allow the display chunk building logic to check blocks in neighbouring chunks to detect even more blocks that never be seen.
A slightly more in-depth thing to investigate is how I shift memory around as this data is built, it’s rather simplistic at the moment.&lt;/p&gt;

&lt;h2 id=&quot;dealing-with-cut-corners&quot;&gt;Dealing with Cut Corners&lt;/h2&gt;

&lt;p&gt;When I first implemented the procedural generation for the world, I had an issue that resulted in chunks going up/down in the y axis being duplicated.
To get around this, I simple generate those as empty chunks (just 16x16x16 air blocks), and ‘hacked’ the physics to stop you falling below y=0.
These two hacks were put in place in the interest of moving forward with what I wanted to focus on at the time, but I felt now was a good time to revisit this.&lt;/p&gt;

&lt;p&gt;Indeed the solution to my world generation issue was fairly simple to fix.
I think that stands as a good example of not getting to hung up on issues you can safely move on from for now.
However, this now meant that world generation was more intensive, you feel a big lag spike every time you move such that new terrain needs to be generated;
not to mention starting the game.&lt;/p&gt;

&lt;p&gt;The problem now, single threaded code.&lt;/p&gt;

&lt;h2 id=&quot;and-so-to-frustration&quot;&gt;And so to Frustration&lt;/h2&gt;

&lt;p&gt;When the game first loads and wants to display that first frame, it needs to generate the world as ‘data chunks’ and from those ‘display chunks’.
Setting the chunk range to even a fairly small number, like two, can result in a large number of chunks being required, in this example 125.
A chunk render distance of five is where you start to get a nice view distance, and that’s now 1331 chunks that need to be made ready.
Even if it only takes about 10ms per chunk, that’s 13 seconds where the game is locked up not responding at all.
As you move around, and cause new chunks to need to be generated, you get noticeable lag spikes whilst the game works on generating new data.
This is so badly handled that when the game loads, you get the OS reporting that the application is not responding to user input and asking if it should be terminated!&lt;/p&gt;

&lt;p&gt;In theory, C++ offers a solution to handle this, in practice… I’m giving up with C++.
The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;std::future&lt;/code&gt;, despite having been around for a few versions of the standard now, still doesn’t have a proper way to test if it is ready (yes, I know there’s solutions).
This, along with much discussion amongst friends was one of many an issue, and the prevailing advice on how to use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;std::future&lt;/code&gt; and other such classes was… “don’t”.&lt;/p&gt;

&lt;p&gt;So, it’s time to get back into Rust;
at least, I’m fairly sure that’s what I’ll use - already started to refresh myself with it anyway.
Many a winter ago, back when Rust was in it’s early days, I did start looking into it, and I did quite enjoy it.
However, skill rot being what it is, I’m coming back at it now fairly fresh faced, not to mention how much more it has improved over the years.&lt;/p&gt;

&lt;h2 id=&quot;the-big-rewrite&quot;&gt;The Big Rewrite&lt;/h2&gt;

&lt;p&gt;So there we have it, after seven versions developed in C++ over a span of five years (five, &lt;em&gt;very&lt;/em&gt; lazy years) I’m going to basically rewrite everything from scratch.
As I said, I believe I’ll take this on now in Rust, but Kotlin &lt;em&gt;is&lt;/em&gt; tempting me;
I’m perhaps more familiar with Kotlin, and the JVM does offer me, potentially, an easy way to brining in dynamic logic (for mods).&lt;/p&gt;

&lt;p&gt;Feature wise, I don’t think I’ll have anything different in the new version - other than having the chunk generation handled asynchronously.
As you move around, whilst you might only have a range of five chunks rendered to you, the engine will attempt to generate chunks up to a range of perhaps ten blocks.
This forces the engine to generate more chunks than you need to render, but it means as you explore the world, they can be generated ready for you to display.
I could perhaps do similar for generating the display chunks, this could help reduce a minor delay of them popping into view.&lt;/p&gt;

&lt;p&gt;Along with this rewrite into version eight, I might (don’t hold me to it) look to start towards a client-server model.
Introducing multi-player is something I would want to tackle sooner rather than later, just looking at the substantial tweaks I had to do to start to attempt to get just chunk generation asynchronous was bad enough.
And whilst I’m throwing ideas out there, why not perhaps start looking at some way of having parameters/properties, removing some of the hard coded values.&lt;/p&gt;
</description>
      <link>http://thecoshman.com/tag/2021/03/24/TheEnd/</link>
      <pubDate>Wed, 24 Mar 2021 00:00:00 +0000</pubDate>
      <guid isPermaLink="true">http://thecoshman.com/tag/2021/03/24/TheEnd/</guid>
    </item>
    
    <item>
      <title>SkyBox</title>
      <description>&lt;h2 id=&quot;abandonware&quot;&gt;Abandonware?&lt;/h2&gt;

&lt;p&gt;It’s been quite some time since I last published an updated for this project.
I never fully stopped looking at or thinking about it though, life just got in the way and interest waned a bit.
Version 6 has actually been mostly ready to ‘release’ for quite some time, I just kept putting of writing this article;
in fact, I am fairly sure I did actually write this at least once and then loose track of it.&lt;/p&gt;

&lt;p&gt;Still, it’s here now.
The shiny new version, with gamma correct rendering, a thrilling sky box and less terrible FPS!&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/tag/v6/sample.png&quot; alt=&quot;Sample of V6&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;what-is-frame-rate&quot;&gt;What is Frame Rate?&lt;/h2&gt;

&lt;p&gt;I’m still not satisfied with the FPS I’m getting, but I have found that running the release build helps a huge amount.
Considering the rendering is so simple at the moment, I would have thought this would be much higher.
There are some things that could help, one of the ideas I have is re-work the way the chunks are rendered.
I’m thinking I might look to cache the entire chunk as a single object to render.
One of thing that I think holds this back is the lack of texture atlas - so that’s one thing to add onto the ‘todo list’ for the next version.&lt;/p&gt;

&lt;h2 id=&quot;crude-sky-box&quot;&gt;Crude Sky Box&lt;/h2&gt;

&lt;p&gt;As is the theme with my development for this project, I did a pretty bare minimum for the sky box.
It’s just a basic static cube that invites a certain sense of dread.
Down the line, I will certainly want to come back to make this more interesting looking, especially if I get a day/night cycle going and animated textures.
For now though, I think it suffices;
at the least the unsettling infinite white is gone.&lt;/p&gt;

&lt;h2 id=&quot;gamma-rays-man&quot;&gt;Gamma Rays, Man&lt;/h2&gt;

&lt;p&gt;I am fairly sure I got this implemented correctly.
I’ll probably have to come back at some stage to fix this up, really looking forward to that.
There’s not really much to see with though, but should make things look better for all;
when things get that far.&lt;/p&gt;

&lt;h2 id=&quot;blocks-on-blocks&quot;&gt;Blocks on Blocks&lt;/h2&gt;

&lt;p&gt;I started working on setting up a block registry for this, but then the great silence fell onto this project.
For now, I’ll wrap up where I got with it so that I can push out a new version.
In the next version, I want to also work on establishing a texture atlas and that will work nicely with a block registry.&lt;/p&gt;

&lt;h2 id=&quot;eta-2025&quot;&gt;ETA 2025&lt;/h2&gt;

&lt;p&gt;There’s two key things I want to get done as part of the next version.
Well, three if you want to count ‘publish it before the year is out’.&lt;/p&gt;

&lt;h3 id=&quot;texture-atlas&quot;&gt;Texture Atlas&lt;/h3&gt;

&lt;p&gt;I want to be loading all the textures for the blocks into a single large texture.
The use of a texture atlas should help simplify and speed up the rendering code;
I would not have check on every block if the texture needs to be swap, as it never would (per block).
Not &lt;em&gt;every&lt;/em&gt; texture would be thrown into a single texture atlas though.
For example, the green, red and white block textures I currently have would be thrown into this one atlas whilst the skybox would be stored in it’s own texture object.
This means each frame would only require two calls to set textures, one to set the blocks texture atlas, one to set the sky boxes texture.&lt;/p&gt;

&lt;h3 id=&quot;block-registry&quot;&gt;Block Registry&lt;/h3&gt;

&lt;p&gt;This will allow me to start to store all the properties for blocks in a more ordered fashion.
Obviously one of the main things would be working with the texture atlas to know what texture co-ordinates to use to draw the texture you want.
This can then be used when building the ‘render chunks’, these could become single large models, combining all the visible cube surfaces together.
I expect this too will also help improve the frame rate.&lt;/p&gt;

</description>
      <link>http://thecoshman.com/tag/2020/03/25/SkyBox/</link>
      <pubDate>Wed, 25 Mar 2020 00:00:00 +0000</pubDate>
      <guid isPermaLink="true">http://thecoshman.com/tag/2020/03/25/SkyBox/</guid>
    </item>
    
    <item>
      <title>Word</title>
      <description>&lt;h2 id=&quot;a-thousandth-of-a-picture&quot;&gt;A thousandth of a Picture&lt;/h2&gt;

&lt;p&gt;From a players point of view, all this update brings is obnoxious text on the screen.
There is not much else either to be honest, CI and testing being the only other things of note.
I shall cover these more boring topics first.
On account of their basically being nothing really any different, from last version, no download for this one.&lt;/p&gt;

&lt;p&gt;I’ve set up &lt;a href=&quot;https://travis-ci.org/thecoshman/tag&quot;&gt;Travis CI&lt;/a&gt; for automated builds;
it was fairly simple to set up, the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.travis.yml&lt;/code&gt; file was mostly standard stuff.
Unit testing has also started using Catch.
I need to look to ramp up what I am covering with the tests, but I’m using OpenGL, thus require a context, which could make this awkward; that said, I don’t see why I couldn’t have a window opened up for the purpose of running the tests.
Definitely something to look into, but I’m not that concerned about it right now.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/tag/v5/sample.png&quot; alt=&quot;Sample of V5&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;short-and-sweet-next&quot;&gt;Short and Sweet, NEXT!&lt;/h2&gt;

&lt;p&gt;Really isn’t much else to say about what I’ve done in this version;
I’ve been distracted by other things, so it’s taken me a long time to get not much done (like a week to write this).
The font rendering is handled via a few classes, and most of the actual logic for it was provided by a friend and tweaked to fit my code so far.
When I need to, I will look to expand this font rendering code to give me more control over where exactly text is drawn, and some ‘style’ features, but later.&lt;/p&gt;

&lt;p&gt;On to the next version then.
A small list of things stick out in my mind that I want to focus on next.
Firstly, good lord that FPS is terrible!
Either I am doing something horribly wrong in calculating it, or I my rendering code is disgustingly bad;
I may not be rocking a beastly GPU, but it’s not &lt;em&gt;that&lt;/em&gt; bad!
I know that I can look to optimise the render chunks to have less data in them.
Considering that when I stand still, they are not (should not) be getting re-generated I’m not sure if that will resolve the issues.
I think that it would be of great relief to get a sky box added, it will help to remove the insanity inducing white.
Gamma correct rendering is another thing to address; shouldn’t take too much work I think, but will be nice to have in place.&lt;/p&gt;

&lt;p&gt;Finally, one last thing I want to take a look at, and this might be pushed out to V7, is starting to introduce ‘smarter’ block data.
I’d like to have the list of blocks registered somewhat dynamic, though I might leave it to a later version to come up with some file format to load this data from.
Some sort of ‘block database’ is needed, that can allow a unique id to be assigned to each block type, and each type have properties such as ‘ignore_gravity’, ‘solid_ground’ etc.
Along with that, I want to look at introduce per-block instance data.
For something like ‘ore’, it might want to have it as ‘per block’ how much ore each block has, but it might be better to have distinct types of block, something to play around with.
I also like the idea of being able ‘combine’ blocks, so I can have ‘grey stone’ and ‘iron ore’ dynamically combined, layering the two textures together.&lt;/p&gt;

&lt;h2 id=&quot;onwards-to-version-six&quot;&gt;Onwards to Version Six&lt;/h2&gt;

&lt;p&gt;So a quick short-list of what I want to look to take on in this next version:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Investigate terrible FPS&lt;/li&gt;
  &lt;li&gt;Add a sky box&lt;/li&gt;
  &lt;li&gt;Use gamma correct rendering&lt;/li&gt;
  &lt;li&gt;Block database and/or instance data&lt;/li&gt;
&lt;/ul&gt;
</description>
      <link>http://thecoshman.com/tag/2015/05/20/Word/</link>
      <pubDate>Wed, 20 May 2015 00:00:00 +0000</pubDate>
      <guid isPermaLink="true">http://thecoshman.com/tag/2015/05/20/Word/</guid>
    </item>
    
    <item>
      <title>Infinite!</title>
      <description>&lt;h2 id=&quot;an-infinite-world-of-insanity&quot;&gt;An Infinite World of Insanity&lt;/h2&gt;

&lt;p&gt;Given enough RAM you can now explore the terrain until your sanity runs out.
I really need to sort out some nicer textures though, the three blocks I have ‘designed’ so far just terrible, truly terrible. 
But here we are folks, version four of my wee project. 
As always, I’ll offer a build of the game &lt;a href=&quot;/downloads/tag/TAGDV4&quot;&gt;here&lt;/a&gt;; 
in fine tradition, it is a 64-bit build for linux.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/tag/v4/sample.png&quot; alt=&quot;Sample of V4&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;the-great-chunkification&quot;&gt;The Great Chunkification!&lt;/h2&gt;

&lt;p&gt;I knew I would have to do it eventually, it turned out now was the time, although it was one of the last things done for this update.
For no better reason than Minecraft does, I made the chunk size 16 blocks, though unlike Minecraft, my chunks are only 16 blocks high. 
Previously I stored the entire world in a single std::map&amp;lt;world_coord, cube&amp;gt;, which meant it only stored as many blocks as were actually blocks;
the empty air spaces wouldn’t use any memory.
Now though, I’ve changed to std::map&amp;lt;chunk_coord, chunk&amp;gt;, with each of these having a fixed size 16*16*16 array of cubes.&lt;/p&gt;

&lt;p&gt;At just over 4k blocks per chunk, I might look at doing some sort of basic compression later on, maybe something simple like “run length encoding”, so an ‘empty’ chunk of air is just “air block x 4096”.
As with most things, it would be trade of, more CPU time for using less ram, something to consider later perhaps or not at all even.
On a similar train of thought, brute force rendering this many cubes just kills performance. 
My PC is not &lt;em&gt;terrible&lt;/em&gt;, but once I start trying to render around 16 chunks (a 4 by 4 area around the player) frame rate starts to suffer noticeably; 
that is 65k cubes, each one making lookups and requests to the GPU.
I have started to put in place a solution to this though, display chunks!&lt;/p&gt;

&lt;p&gt;I have one class that manages the entire voxel grid, it abstracts away this notion of chunks (mostly).
The actual world data is stored in instances of ‘data_chunk’, which is used for almost everything. 
The key exception is when it comes to rendering, which due to it’s different requirements, is done using instances of ‘display_chunk’. 
Right now, the main display function will iterate through a collection of these display chunks around the player; 
for each display chunk, the main render function will loop over each cube rendering it one at a time.
All told, far too leaky an abstraction for my liking, also not really that smart.&lt;/p&gt;

&lt;p&gt;In latter versions, smartening up the rendering of terrain should restore reasonable rendering performance. 
When you think about it, a chunk is not updated that often, most of the time you will be rendering the same chunk over and over. 
This means that it is most certainly worth buffering data on the GPU that can render the chunk much more efficiently. 
It will be a lot ‘cleaner’ to just call ‘world.render()’, and let it take care of all this chunk nonsense.&lt;/p&gt;

&lt;h2 id=&quot;advanced-movement&quot;&gt;Advanced Movement&lt;/h2&gt;

&lt;p&gt;One of the other aims of this update was improving movement. 
The most notable change is that you can now &lt;a href=&quot;https://www.youtube.com/watch?v=KZaz7OqyTHQ&quot;&gt;jump around&lt;/a&gt; and fall down by the mystical force that is gravity. 
I want to play around with the mechanics of the jumping though as it feels floaty to me. 
Walking has also been made ‘not sticky’, in earlier versions I crudely stopped any movement if the player touches the walls, this has now been fixed so you can strafe against them.
The movement also has a very slight inertia so the player does not stop instantly if they let go of the keys, it’s a very subtle thing but I like the feel of it. 
Whilst failing you also have some control over movement, I know it’s not realistic, but ‘air walking’ is so natural in games.&lt;/p&gt;

&lt;h2 id=&quot;smarter-algorithms&quot;&gt;Smarter Algorithms&lt;/h2&gt;

&lt;p&gt;There were two main algorithms interacting with the voxel grid, both were pretty dumb. 
One was for the players AABB and the other was for ‘rays’ from the player, detecting what block is being hit. 
The actual AABB-AABB or Ray-AABB algorithm has not changed, what has changed is no longer checking &lt;em&gt;every&lt;/em&gt; cube in the world. 
For the players AABB, I build a small collection of cube co-ordinates that the player might be interacting with.
As the player is only two blocks high, it means that at most, there is only a maximum of 12 possible cubes the player could be interacting with.&lt;/p&gt;

&lt;p&gt;For the ray tracing, I now work out what cube the ray starts in and what direction it is moving. 
From there I move one block at a time, testing if it is hit by the ray. 
This drastically reduces the number of checks that are required.
If a ray starts at (2.5, 2.5, 3.9) and has a direction of (3.2,0.1, -2.3), converted to the grid, it starts in cube (2, 2, 3) and ends in (5, 2, 1), moving in (1,0,-1) direction.
I then loop until my ‘current cube’ (which is initially the ‘start cube’) is the ‘end cube’, each loop I test what would happen if I advanced one cube in certain direction.
As a slight optomisiation, I have a vector of potential advancements ie (1,0,0) and (0,0,-1) to loop through (notice how I never check for cubes at a different y position). 
If I try a cube and find that it is hit by the ray, I add it to my collection of cubes that I know are on the ray, and then make this my current cube.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/tag/v4/raytrace.png&quot; alt=&quot;Diagram of the ray tracing&quot; /&gt;&lt;/p&gt;

&lt;p&gt;So that’s my attempt at a diagram to explain the logic of this ray tracing, reduced to just two dimensions, but it’s the same principle in 3D. 
We start in the green square, and want to trace to the red square. 
Each number shows the order in which the squares are checked, the little arrows are red if the square is found to not be on the line, and green if it is. 
For this example, each time a new square is found on the line, we first check the square below, then to the right. 
A total of eight checks are made, of which three return ‘no hit’, a roughly 40% fail rate, which I believe gets worse as you move through higher dimensions. 
If the order was swapped, attempting to move right then down, we’d have seven checks with only two ‘no hit’ checks, but that would require first working out there was a better order.&lt;/p&gt;

&lt;h2 id=&quot;terrain-generation&quot;&gt;Terrain Generation&lt;/h2&gt;

&lt;p&gt;I put in a simplex noise algorithm that can generate a noise value for a given point on the 2D plane that is the world. 
I then use that noise value to work out how high the ground should be at that point, and then stack cubes to match that. 
Good terrain it most certainly is not, but at least it’s something that I can move on with. 
Due to the limitations in it’s design (ie aka corner cutting), I had to limit the generation to only work for chunks at y 0. 
The terrain is generated made up using only one type of cube, when I start to add more cubes, I can look to do things like ‘top soil’, mineral deposits, caves, all the normal things you would expect really.&lt;/p&gt;

&lt;h2 id=&quot;huds-and-stuff&quot;&gt;HUDs and stuff&lt;/h2&gt;

&lt;p&gt;For the next update I am going to focus on the HUD, primarily getting text rendered to the screen. 
This will allow me to free myself from the console, as I believe that presently, you can’t actually start the game without doing so from the console. 
As I said, I would mostly like to focus on getting text drawn, then I can start to put information on screen such as the sacred FPS value, but also things such as how many chunks (of each type) are loaded, where the player is and so on.&lt;/p&gt;

&lt;p&gt;Some other things that I want to start looking into in general is logging, testing and build automation. 
Logging is low down on that list to be fair, it will be useful later on for sure, when I get to it I’ll have a proper look around, but I’m thinking &lt;a href=&quot;http://sourceforge.net/p/log4cplus/wiki/Home/&quot;&gt;log4cplus&lt;/a&gt;.
Testing is mostly functional testing, for which I will probably use &lt;a href=&quot;https://github.com/philsquared/Catch&quot;&gt;Catch&lt;/a&gt;, but I might also look at using &lt;a href=&quot;https://github.com/rmartinho/nonius&quot;&gt;Nonius&lt;/a&gt; to put put some timing tests. 
Accurate timing will be &lt;em&gt;very&lt;/em&gt; useful later on when I  am trying to improve the performance in trouble areas, though of course just some good old fashioned thinking about stuff can help a lot there too.
In fact, logging will be helpful there too… but yeah, for now logging and timing is not really required. 
Build automation is one of those things that just needs to be done, especially if I want to get build for other platforms. 
I’m going to have to look into this a bit more, but I currently thinking &lt;a href=&quot;https://travis-ci.org/&quot;&gt;Travis&lt;/a&gt;.
Out of all of this, I may find that my current premake build scripts become tiresome to work with, so that might change too.&lt;/p&gt;

&lt;p&gt;So all told, version five will rather dull from a player point of view, but these technical back end things have to be done at some point.&lt;/p&gt;
</description>
      <link>http://thecoshman.com/tag/2015/04/11/Infinite/</link>
      <pubDate>Sat, 11 Apr 2015 00:00:00 +0000</pubDate>
      <guid isPermaLink="true">http://thecoshman.com/tag/2015/04/11/Infinite/</guid>
    </item>
    
    <item>
      <title>Destructible</title>
      <description>&lt;h2 id=&quot;call-a-clone-a-clone&quot;&gt;Call a Clone a Clone&lt;/h2&gt;

&lt;p&gt;Even if it is not a very good one.&lt;/p&gt;

&lt;p&gt;So yeah, it’s hard to deny this is starting to show similarities to a popular game.
Yes I know, Minecraft was not the first of it’s kind, but face it, it’s &lt;em&gt;the&lt;/em&gt; archetype for well… quite a few styles of games I suppose.
Anyway, I’m not there yet.
This version does add one of those core features that I would say makes Minecraft what it is;
You can place and break cubes!
Again, &lt;a href=&quot;/downloads/tag/TAGDV3&quot;&gt;here&lt;/a&gt; is a 64-bit build for linux, one of these days I’ll sort out builds for other platforms, honest!&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/tag/v3/sample.png&quot; alt=&quot;Sample of V3&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;the-latest-features&quot;&gt;The Latest Features&lt;/h3&gt;

&lt;p&gt;A quick summary of the features so far:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;WASD keys to walk around and mouse to look about (If you didn’t notice, this is taking things slowly)&lt;/li&gt;
  &lt;li&gt;Walk into a box to remove it&lt;/li&gt;
  &lt;li&gt;Left click a box will also remove it&lt;/li&gt;
  &lt;li&gt;Right click on the side of a box to place a new one&lt;/li&gt;
  &lt;li&gt;the keys ‘1’, ‘2’ and ‘3’ swap between the three colours you can place&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;technicalities&quot;&gt;Technicalities&lt;/h3&gt;

&lt;p&gt;From a technical point of view, things are still not that great.
There is AABB-AABB collisions as well as Ray-AABB, which I might do another article about, maybe.
I do currently brute force my way through the collision checks;
somewhat excusable when there is only a handful of checks to make, but sure as hell is not going scale.
The rendering is still rather primitive too, again just brute forcing, drawing each cube in the world one after the other.
There is some respite in that by way of being so limited, I always have the correct data buffers bound, but I am swapping out the texture for each cube.
I’m honestly not sure how much &lt;em&gt;precious performance&lt;/em&gt; swapping textures back and forth actually wastes compared to working out all the cubes that would want the same.
The cubes are stored in a map keyed on their position, so I suppose you could argue it’s very efficient for empty spaces!&lt;/p&gt;

&lt;h2 id=&quot;the-end&quot;&gt;The End?&lt;/h2&gt;

&lt;p&gt;When I started working on this little project, the point was to just complete &lt;em&gt;something&lt;/em&gt;.
I did that.
Then I started to work in small steps, adding one or two small things at a time.
The scope was kept &lt;em&gt;very&lt;/em&gt; small, and I think that has helped me keep focused on what I wanted to do each time.
But let’s face it, what I have is not really a game of any merit.
Yes technically it does meet the criteria at a very simplistic level, but it’s not a decent attempt at a game.&lt;/p&gt;

&lt;p&gt;So what now?
Do I try and see this through to a fully realised Minecraft clone?
Maybe I should start over and focus on doing some other game, working on an original idea all of my own!
Does it even matter!?
Have I even ‘finished’ this project?
Argh, decisions!&lt;/p&gt;

&lt;p&gt;I think the hardest part is getting that idea or inspiration.
Once I know what I want to aim towards, all I need to do is enjoy the ride.
I don’t mean to say that it’s easy, if anything, quite the opposite.
Whilst I have done this sort of stuff before, I have left it far too long, I’ve had to remind myself of most of getting this far.
Challenges come up all the time, and it’s far to easy to start over.&lt;/p&gt;

&lt;h3 id=&quot;embrace-the-clone&quot;&gt;Embrace the Clone&lt;/h3&gt;

&lt;p&gt;I honestly do feel a bit cheap making yet another clone of it, but I do really like that damn game.
At least I have a fairly clear end goal for myself, and I’ll say it now, it’s not making something that is indistinguishable from Minecraft.
Creativity is not my strongest area, especially when it comes to making games;
maybe this is one of those things that will become easier the more I do it;
but where I can, I will put my own spin on things.
This will sort of be like making a complete mod for Minecraft, so if I want to have erm… thinking… climbing!
Yeah, if I wanted climbing, where blocks can have ledges that players can jump up to and climb up, I can just make that part of the game.&lt;/p&gt;

&lt;h2 id=&quot;the-feature-list&quot;&gt;The Feature List!&lt;/h2&gt;

&lt;p&gt;I do have some grand ideas of where I would like to take this.
It would be cool to implement my own version of most of the ‘features’ Mincraft has, more for the challenge of it.
So, obviously, the procedural generation thing has to be done but also multiple ‘dimensions’, AI entities, inventory etc.
I am not too concerned about getting the breadth of content though, if I can generate two types of ore, I can generate all the types of ore I can tolerate providing the assets for.
Crafting is something I’m not too sure about… I think I’ll have a go at copying the ‘crafting grid’ approach, but I also like the simple ‘here is what you can craft with what you have’ menu system.&lt;/p&gt;

&lt;p&gt;If you permit me to talk about grand ideas, it would cool if more or less everything was modded into the ‘game’.
Obviously some things are best just being part of the core game it self, but I want to be able to make it so that more or less everything can be done via mods.
This is fairly easy with Minecraft as it’s not &lt;em&gt;that&lt;/em&gt; hard to patch the ‘compiled’ code.
For the level of control I want to be able to expose, a proper mod api would have to be designed, actually exporting control out to an interpreted language, Lua sounds tempting for this.&lt;/p&gt;

&lt;h3 id=&quot;small-steps-though&quot;&gt;Small Steps Though&lt;/h3&gt;

&lt;p&gt;Sticking to these very small and focused updates seems to have worked well for me so far, so here we are.
I want to get some sort of terrain generation implemented, and this will probably be the biggest thing for this update.
There are a lot of ways this could be done, I don’t think I’ll get too hung up on really good generation… probably just something with a distinct ‘unbreakable’ bottom layer, then hills of random heights, probably with a top layer.
So, three block types.
Along with this very basic terrain generation, I want to ensure I have a few things.
Firstly, I need to actually be able to walk over these blocks and have them block the movement, rather than removing them as I currently do.
Then I need to get jumping and falling added so I can get up and over all this glorious terrain.
I also need to ensure that this terrain generation is predictable, for a given ‘seed’ the terrain should always be generated the same way.
There’s also the ‘chunking’ problem… this is something I know will be needed, and I don’t think is going to be &lt;em&gt;that&lt;/em&gt; hard to do… yet I can’t help but feel I should simply ignore this one for now.
Finally, learn how to write a list and not a paragraph.&lt;/p&gt;

&lt;p&gt;Until next time then!&lt;/p&gt;

</description>
      <link>http://thecoshman.com/tag/2015/03/14/Destructible/</link>
      <pubDate>Sat, 14 Mar 2015 00:00:00 +0000</pubDate>
      <guid isPermaLink="true">http://thecoshman.com/tag/2015/03/14/Destructible/</guid>
    </item>
    
    <item>
      <title>Quality Graphics</title>
      <description>&lt;h2 id=&quot;its-all-behind-the-curtains&quot;&gt;It’s all Behind the Curtains&lt;/h2&gt;

&lt;p&gt;It’s still not the prettiest hunk of junk, but textures really do help out, even if they do look like something from an acid trip.
The implementation is most certainly still rough as as all hell, but at least it is starting to take on a more reasonable quality. 
Most of the ‘good code’ is thanks to including GLDR (&lt;a href=&quot;https://github.com/GLDRorg/GLDR&quot;&gt;OpenGL Done Right&lt;/a&gt;). 
I think I might also have revealed that I am most certainly not a graphics artist.
As was planned though, this iteration was mostly about updating the code rather than enhancing the gripping game mechanics or deep graphics.&lt;/p&gt;

&lt;p&gt;As with last time, &lt;a href=&quot;/downloads/tag/TAGDV2&quot;&gt;here&lt;/a&gt; is a pre-built version of the game. 
It is still just a linux 64-bit build.
At some stage I might look into building for other platforms with some service or something.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/tag/v2/sample.png&quot; alt=&quot;Sample of V2&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;gldr&quot;&gt;GLDR&lt;/h2&gt;

&lt;p&gt;GLDR is a library I started working on with a friend, about two years ago now, it sort of got abandoned though. 
The idea is to provide modern, sensible, nice to use C++ classes that can provide an easier way of dealing with OpenGL resources. 
I think in the end we found other libraries offered more or less what we were aiming for and other interests pulled us away form working on it. 
One of the core ideas that we came up with was a type that can manage the lifetime of OpenGL resources that normally you only have a number to track.&lt;/p&gt;

&lt;p&gt;This type was called ‘glid’ and is a template type, meaning that if a ‘texture’ type wants to use this (which it should) it would need to have a ‘glid&amp;lt;texture&amp;gt;’ variable. 
However, glid has a constructor and destructor that will call ‘GLuint T::Create()’ and ‘void T::destroy(GLuint)’ respectively, anything that wants to have a glid has to provide these static functions.
By doing this, anything that uses a glid for managing OpenGL resources now has automatic lifetime; 
if a ‘texture’ ever goes out of scope, it’s resources will automatically be released, and you wouldn’t have to worry about acquiring those resources in the first place! 
The only requirement is that you need to provide the logic to get and release those resources from OpenGL via static functions in the form that glid expects. 
For some reason when we developed this glid we didn’t also require that classes using a glid provide a ‘bind()’ function; 
it seems like a good idea, but with ‘programs’ the function is ‘use’ so that could be a bit jarring, but then, maybe that is just a wrong doing in OpenGL.
Ahh decisions like this is why we didn’t get that far!&lt;/p&gt;

&lt;p&gt;Back when we were working on this, we only got as far as agreeing on the glid type. 
As a way of testing and trying out ideas, we both worked on our own branches developing classes like ‘texture’, ‘shader’ and ‘buffer’. 
We would bounce ideas of each other until we were happy, then look to bring one of those classes over to the main branch once happy with it.
You can probably tell that we didn’t get that far, I think we were on the verge of agreeing on the Vertex Array Object though.
Still, I plan to continue with these classes, trying to ensure all that low level stuff I use is neatly wrapped up.&lt;/p&gt;

&lt;h2 id=&quot;code-smells&quot;&gt;Code Smells&lt;/h2&gt;

&lt;p&gt;One of the main focuses of this iteration was improving the code itself. 
I know full well, there are still some nasty nasty things going on in there! 
I still have a global ‘camera’ object, but apart from that, all objects are created within the main function now. 
This is mostly because I have to ensure that they are not constructed until after the OpenGL context has been created; 
I’d call that a nice little bonus feature of using the gldr types, it forces you to do things better. 
As such, the initialisation and draw functions are now passed the objects they need to work on, rather than accessing globals.&lt;/p&gt;

&lt;p&gt;Speaking of the draw function, it has not improved much. 
The screen is cleared and the OpenGL ‘things’ are bound as before. 
When you think about it, nothing else is ever bound so why re-bind it? 
It’s not a huge deal, and as I work towards fancier things, I will need to be binding like this… well, except better. 
Now I &lt;em&gt;really&lt;/em&gt; got fancy, I pass a vector of positions to a ‘draw box’ function, along with a lambda that can be used to set the ‘model view project matrix’. 
The draw box function works out what the current box’s ‘model matrix’ should be, and needs to be able to set that in the shader, but I wanted to avoid the function having either the shader program object or the uniform location in the shader. 
So the lambda that I pass in will take the model matrix, and combine it the ‘view project’ matrix and then set that in the shader. 
I’ll admit, it was mostly so I could play around with lambda things, there are other, better ways of doing this!&lt;/p&gt;

&lt;p&gt;The update process has not changed a lot either. 
The user input is still done via the keyboard, it works, but I’ll improve that soon. 
I also have yet to move past the terrible “as fast as possible” game loop, but that’s not a concern right now for me. 
The update itself allows the player to move to where ever the keys dictate, then checks for collisions with all the boxes. 
This collision has been improved slightly, as I now use axis aligned bounding boxes (AABB) for both the player and the cubes. 
The main advantage here is the player is no longer treated as a single point, they actually have some volume!&lt;/p&gt;

&lt;p&gt;It took me some time to settle on a way of storing the AABB, thinking too much about how to store the data. 
Either I can store two position vectors, a minimum and maximum, or I can store a ‘centre point’ along with the size (width, height, depth) of the AABB, either way it’s six numbers to store. 
On reflection, I took the wrong option. 
I figured it was easier to create and update where the AABB is if I stored the midpoint and size, as I only have to update one vector as the box moves. 
However, the collision detection uses the min and max value anyway and is going to be using those values a lot more than they need to be updated. 
It makes a lot more sense to store that data directly rather than having to calculate them each time they are required, especially when you consider I cache that value anyway.&lt;/p&gt;

&lt;h2 id=&quot;game-mechanics&quot;&gt;Game Mechanics&lt;/h2&gt;

&lt;p&gt;These really didn’t get improved that much to be honest, as planned. 
The challenge has been really ramped up, as now you have to get to three different boxes! 
Each time you hit one of the boxes, it will pop up into the air meaning you will have to find your way to another box. 
OK… not exactly ground breaking things. 
There really isn’t much more to say about this.&lt;/p&gt;

&lt;h2 id=&quot;version-three&quot;&gt;Version Three&lt;/h2&gt;

&lt;p&gt;So far I’ve been trying to give myself short specifications to keep myself focused, and I think it’s been working well.
For the next iteration then, I’d say it’s about time I got the mouse in on this action, the WASD keys can then take on their typical movement functions. 
For now, I’ll stick to the single plane of movement, so no jumping around quite yet. 
But I do want to play around with being able to interact more with these boxes, so maybe some way of adding and removing them. 
Graphically I think I should attempt actually get other styles of boxes going on, purely cosmetic for now.&lt;/p&gt;

&lt;h2 id=&quot;compulsory-conclusion&quot;&gt;Compulsory Conclusion&lt;/h2&gt;

&lt;p&gt;Another version down, another starting off. 
One thing I am very aware of is that I feel myself working towards a bit of a MineCraft clone. 
Though really, I don’t see what’s wrong with that. 
Either way, I am doing stuff!&lt;/p&gt;
</description>
      <link>http://thecoshman.com/tag/2015/03/01/QualityGraphics/</link>
      <pubDate>Sun, 01 Mar 2015 00:00:00 +0000</pubDate>
      <guid isPermaLink="true">http://thecoshman.com/tag/2015/03/01/QualityGraphics/</guid>
    </item>
    
    <item>
      <title>Version One</title>
      <description>&lt;h2 id=&quot;say-what-you-want-its-still-a-game&quot;&gt;Say what you want, it’s still a game!&lt;/h2&gt;

&lt;p&gt;Well then, there we go; as utterly terrible as it might be, it most certainly is a game! 
I am not looking for reassurance that I’ve not made something utterly sinful; and I am not quite cheeky enough to dare claim this is some bold statement about what makes a game. 
This is something that you can interact with and have a way of ‘winning’, you really can’t argue that it isn’t a game!
I aimed to just get a game completed, and I did it.&lt;/p&gt;

&lt;p&gt;Now, I’m not going to make any promises about weather or not you can run this, but if you want to try it, &lt;a href=&quot;/downloads/tag/TAGDV1&quot;&gt;here&lt;/a&gt; is a pre-built version of the game. 
This is built for 64-bit linux, Ubuntu specifically. 
I don’t think you will need anything specific, other than being able to run at least OpenGL 3.3.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/tag/v1/sample.png&quot; alt=&quot;Sample of V1&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;game-review&quot;&gt;Game Review&lt;/h2&gt;

&lt;p&gt;So, I guess I should get into the self improving mindset and break this game down as a sort of review. 
This game uses &lt;em&gt;just&lt;/em&gt; the keyboard for input, the mouse wasn’t required so wasn’t used. 
The ‘A’ and ‘D’ keys are used to rotate left and right respectively, with ‘W’ and ‘S’ to move forwards and backwards. 
If you find yourself unable to handle the frantic excitement, then you can quit using the ever classic ‘Esc’.
The aim of the game is to move towards the ominous black box, and to do so a few times to then win.&lt;/p&gt;

&lt;p&gt;There is no fail state, you just have to keep going. 
Menus are nowhere to be found, the game starts up and throws you right into the gripping action. 
Not everything is even done ‘in the game’, I cut corners and used the console to print messages for when you get the box and win. 
The astute and avid TAG player might notice that when you get the box, it moves to the same spot each time. 
Again, in the interest of ‘just make &lt;em&gt;any&lt;/em&gt; game’ I didn’t take the time to bother with randomising it’s location.&lt;/p&gt;

&lt;h3 id=&quot;meet-the-spec&quot;&gt;Meet the spec?&lt;/h3&gt;

&lt;p&gt;So, in my previous post I laid out a sort of specification for this game. 
It was primarily a way to help me focus on completing something and not sidetracking trying to do fancy things.
Did I meet that specification? 
No.
Do I care?
No. 
To be fair, I was nearly spot on with it, only two real differences from the spec.
I had the game win with only a few points rather than ten, but come on, that’s nothing really.
I also didn’t bother to add a way to loose the game, but I felt like it was better to finish this and move on then get hung up that.&lt;/p&gt;

&lt;h2 id=&quot;technical-review&quot;&gt;Technical review&lt;/h2&gt;

&lt;p&gt;Man, this reminds me of when you’ve caused some trouble in school and you know the teachers know you did it, but still they insist on waiting for you admit it.
Feel free to take a look at the ‘amazing’ code &lt;a href=&quot;https://github.com/thecoshman/tag/tree/v1&quot;&gt;here&lt;/a&gt; on github. 
Seriously though, please keep in mind what the purpose is here, to complete the project quickly, and as such, I know full well this code is terrible. 
I did a quick hack and slash to get something finished, something I can move on from.
The entire game (well, &lt;em&gt;my&lt;/em&gt; side of it) is in just one file, oh yes it’s that level of bad! 
Most of the code is copied over from an example provided by the main library that I used, &lt;a href=&quot;http://glsdk.sourceforge.net/docs/html/index.html&quot;&gt;glsdk&lt;/a&gt;; 
well ok, it’s set of libraries really.&lt;/p&gt;

&lt;p&gt;The ‘game loop’ for this is about as simplistic as you can get, it just does a render and then updates, each loop as fast as it can. 
There is lots to be said about how a game loop can be done, and most tutorials or discussions will show this approach as the starting point and then quickly move onto better things. 
From the example I have some functions that initialise most of the stuff, though not quite everything is done in there.
The display loop is effectively binding and then unbinding the resources for no reason.
Shader code is baked into the C++ rather than loaded from disk. 
I did put some effort into ‘upgrading’ the example so that it uses an index buffer, rather than just a big long list of (mostly repeated) vertex data.
All in all, probably the worst thing about the use of OpenGL in this is that I am using it directly, rather than making use of some wrappers that I had worked on before with a friend.&lt;/p&gt;

&lt;p&gt;The build system that glsdk comes with is premake4, something I’ve never really used before, but I stuck with it none the less. 
If I wasn’t using an IDE, I got on relatively fine using raw make files. 
In fact, I’ve even messed around with writing my own build system in Perl that I called &lt;a href=&quot;https://github.com/thecoshman/pinkpill&quot;&gt;Pink Pill&lt;/a&gt;, though that was more about getting more familiar with the C++ build system than actually trying to make a viable tool.
Still, I’ve got to say, using premake4 was relatively simple. 
In about an hour I managed to take the examples and work out how to wrangle it into doing what I want to do. 
And whilst cross platform development is something I certainly am not bothering with for now, it is nice to know that (at least in theory) premake will ease going to other platforms.&lt;/p&gt;

&lt;p&gt;I was going to make my code compile for C++14, but when I realised that my compiler needed updating I took the quick (ie almost instant) option and settled for C++11. 
Something that I need to rectify before I press on, starting a project on anything but the latest technology at the time is hard thing to excuse.&lt;/p&gt;

&lt;h2 id=&quot;v2&quot;&gt;V2&lt;/h2&gt;

&lt;p&gt;Sadly, this will not involve rockets; maybe some jazzed up graphics.&lt;/p&gt;

&lt;p&gt;I think my next step will be more of technical update. 
Like I said, I have previously worked on some abstractions of low level things, like buffers, textures and shaders. 
So one of the first things I’ll do is look to pull those in, though it seems since they were written glsdk has subtly changed the way it names things in the ‘gl’ namespace that it provides, nothing major. 
This will also mean that I have to take the time to work out how to organise the project with premake, meaning I have to yet again work out if I want to have just one ‘src’ folder or also have an ‘includes’ folder. 
And then, I should be able to tart up the graphics a bit and have a texture applied to that black box, something more fitting of it’s crate like nature, because what game is complete without crates!&lt;/p&gt;

&lt;p&gt;I guess I should aim to make the game more ‘game’ like as well, so I might look to make those boxes spawn in random locations (rather than moving the player, if you didn’t spot that trick). 
I might also have multiple boxes at once that you have to get to instead of just one box over and over. 
As a final touch, maybe start do some proper collision detection &amp;amp; resolution and so prevent the player moving into the boxes.&lt;/p&gt;
</description>
      <link>http://thecoshman.com/tag/2015/02/21/VersionOne/</link>
      <pubDate>Sat, 21 Feb 2015 00:00:00 +0000</pubDate>
      <guid isPermaLink="true">http://thecoshman.com/tag/2015/02/21/VersionOne/</guid>
    </item>
    
    <item>
      <title>In The Beginning</title>
      <description>&lt;h2 id=&quot;start-at-the-beginning&quot;&gt;Start at the Beginning&lt;/h2&gt;

&lt;p&gt;So, a bit of history about myself. 
By profession I am sadist, I work with Java (Java 7… damn I want lambdas).
It earns the money sure, and Stockholm syndrome really does help cope with it; I rather like reflection and since I started I feel I’ve learnt how to weild the flacid stick of celeraly that is Java.
However, by education, I am C++ games programmer! 
It’s a far cry form the stagnant server side (stop alliterating) stuff I work with to pay the bills, and I most certainly want to get back into games.&lt;/p&gt;

&lt;p&gt;Sure I could have kept at it, but what can I say, laziness sets in. 
Then you start to realise it’s not quite as second nature as you like to pretend it still is.
So, it’s back to basics for me!&lt;/p&gt;

&lt;h2 id=&quot;keep-it-simple-stupid&quot;&gt;Keep It Simple Stupid&lt;/h2&gt;

&lt;p&gt;Back to basics I say. 
What makes a bit of software, a ‘game’… no, I’m not going to get all fussy and debate this; 
as far as I’m concerned, for my purposes, a game is something interactive, that you can win or loose. 
If you just play with it, yeah OK, it might be a game, but it’s more a ‘toy’ really. 
Frankly, not too bothered about these technicalities, what I’m trying to do is define a &lt;em&gt;really&lt;/em&gt; simple specification for a game.&lt;/p&gt;

&lt;p&gt;I am going to make a basic game, it’s going to terrible, both as a game and from an implementation point of view. 
But it will with out a doubt be, at least technically, a game. 
And that’s how you name stuff by the way!&lt;/p&gt;

&lt;h2 id=&quot;technically-a-game&quot;&gt;Technically A Game&lt;/h2&gt;

&lt;p&gt;So, basic game right? 
Not too hard! 
I suppose games a meant to have an elevator pitch, here’s mine; 
“It’s Technically A Game” (shrug shoulders).
It will do the following…&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Keyboard interaction - Doom rocked without a mouse&lt;/li&gt;
  &lt;li&gt;No sound - Just put your own background music on&lt;/li&gt;
  &lt;li&gt;No saving or loading - not that there will be progress worth saving&lt;/li&gt;
  &lt;li&gt;No fancy graphics - like flat coloured cubes&lt;/li&gt;
  &lt;li&gt;Simple to win - get ten points&lt;/li&gt;
  &lt;li&gt;Simple to get points - move to cube&lt;/li&gt;
  &lt;li&gt;Simple to lose - run out of time&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Oh, and yeah, it’s only going to target me. 
If others happen to be able to take the code and compile for them selves to also run, good for them, but I don’t care if they can’t&lt;/p&gt;

&lt;h2 id=&quot;go-go-go&quot;&gt;Go Go Go!&lt;/h2&gt;

&lt;p&gt;So, a sort of clear plan… 
Nothing stopping me really. 
Let’s not dwell too much on the fact that I’ve spent the last hour or so writing this instead of writing this ‘basic’ game.&lt;/p&gt;
</description>
      <link>http://thecoshman.com/tag/2015/02/16/InTheBeginning/</link>
      <pubDate>Mon, 16 Feb 2015 00:00:00 +0000</pubDate>
      <guid isPermaLink="true">http://thecoshman.com/tag/2015/02/16/InTheBeginning/</guid>
    </item>
    
  </channel>
</rss>
