Minecraft mapping with Python, Pygame and OpenGL
When playing Minecraft, I love doing stuff underground: mining, spelunking and digging great big tunnels. I really wanted to map out the mines I have dug and the caverns I have explored. There are a...
View ArticleMinecraft mapping – 2D rendering strategy
This is the first in a series of articles about writing a Minecraft mapping tool in Python. I'm aiming for somewhere between a tutorial and a general discussion of the things that I think are cool or...
View ArticleMinecraft mapping – Diagnostic texture
As we will soon see, terrain.png isn't great for diagnosing problems if something goes wrong. For one thing, it has lots of gaps, so if we accidentally get the wrong textures there's a good chance...
View ArticleMinecraft mapping – Rendering with PyOpenGL
Last time we made ourselves a simple texture using Pygame. Today we're going to render it as-is on the screen using PyOpenGL. Simple, right? This will probably be a little steep if you don't know any...
View ArticleMinecraft mapping - Tiled rendering
This is the fourth in a series of articles about my attempts to write a Minecraft mapping program using Python. Last week, we made a simple texture and rendered it with OpenGL. For the amount of work...
View ArticleMinecraft mapping - Zooming and panning
Last time we did some tiled rendering. However, it was pretty awkward to look at the results because we needed to edit the code and re-run it if we wanted to move around. Today we add zooming and...
View ArticleMinecraft mapping - Reading Minecraft files
For storage, the current version of Minecraft breaks the world up into 512×512 cell regions and breaks regions up into 16×16 cell chunks. (These are the X×Z dimensions, regions and chunks are both a...
View ArticleMinecraft mapping - Applying Minecraft textures
Last time we loaded a Minecraft file and rendered a big grid of numbers indicating the block ID of cells in the map. Those block IDs don't directly tell us which item in the texture atlas to use....
View ArticleMinecraft mapping - Using NumPy to flatten the map
Previously, we put together some code to render a 2D array of tiles. But rendering a horizontal 2D slice of the 3D Minecraft world is not particularly helpful. Today we will use numpy to flatten the 3D...
View ArticleMinecraft mapping - Ambient occlusion
Today I'm going to talk about the approach to ambient occlusion used in the Minecraft mapper. First of all, we assume that light falls uniformly from the sky, like on an overcast day. The amount of...
View ArticleMinecraft mapping - Ambient occlusion 2
Last time I described in principle how the ambient occlusion shader works, but didn't really go into the details. Today I'll go into a bit more detail. Something that I think may not have been clear...
View ArticleMinecraft mapping - Rotation and flipping
Last time, I discussed ambient occlusion for adding depth to the map. Today I'm going to explain how the fragment shader rotates and flips oriented blocks like minecart tracks. As you may have noticed,...
View ArticleAs if by magic, some maths appeared
I've not really done any programming lately, so this week there's no Minecraft. Instead there's some maths. Hurrah! Hey, where are you— I was reading Richard Wiseman's Friday puzzle. It's very short...
View ArticleObjects in Javascript and Python
I've been doing some Javascript recently (well, Coffeescript actually, but this applies equally to either, so I'll stick to Javascript for the examples) and found its approach to objects rather...
View ArticleKey usage coding challenge
Last week, Cedric Beust posted a new coding challenge: We want to make multiple calls to a site that only allows to use a key 500 times every 10mn. You are given a collection of keys (strings), a max...
View ArticleUse of 'this' in constructors
this in constructorsSome quick C++ advice today, but I think it generalizes to C# and Java too. If you do anything with the this pointer in your constructor – apart from dereference it – your design is...
View ArticleSome programming annoyances
I write and maintain mostly C# these days. I've been accumulating a list of annoyances. Whenever I come across a piece of code that makes me groan, fills me with fear or just bothers me, I add it to...
View ArticleA dissection of Steve Jackson's Creature of Havoc
I recently found some old Fighting Fantasy gamebooks I remembered from my childhood. One in particular stood out as having seemed next to impossible. I never finished it. I had vague recollections of...
View Article
More Pages to Explore .....