<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>evilpaul.org</title>
	<atom:link href="http://www.evilpaul.org/wp/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.evilpaul.org/wp</link>
	<description></description>
	<lastBuildDate>Sat, 18 May 2013 20:29:21 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Layers and layers and more layers..</title>
		<link>http://www.evilpaul.org/wp/2013/03/22/layers-and-layers-and-more-layers/</link>
		<comments>http://www.evilpaul.org/wp/2013/03/22/layers-and-layers-and-more-layers/#comments</comments>
		<pubDate>Fri, 22 Mar 2013 13:31:13 +0000</pubDate>
		<dc:creator>evilpaul</dc:creator>
				<category><![CDATA[atebit]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://www.evilpaul.org/wp/?p=622</guid>
		<description><![CDATA[<p>I recently posted a new video of AteBitVJ up onto Vimeo. It&#8217;s an interesting one because it shows how a single, pretty basic effect can be made into something much more by applying a few layers of effects. I&#8217;m a &#8230; <a href="http://www.evilpaul.org/wp/2013/03/22/layers-and-layers-and-more-layers/">Continue reading <span class="meta-nav">&#8594;</span></a></p><p>The post <a href="http://www.evilpaul.org/wp/2013/03/22/layers-and-layers-and-more-layers/">Layers and layers and more layers..</a> appeared first on <a href="http://www.evilpaul.org/wp">evilpaul.org</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>I recently posted a new video of AteBitVJ up onto Vimeo. It&#8217;s an interesting one because it shows how a single, pretty basic effect can be made into something much more by applying a few layers of effects. I&#8217;m a big believer that you can really easily improve your real-time visual effects by applying some simple post-processing, and I thought it might be nice to delve behind the scenes into how I go about doing that.</p>
<p>So, first off, here&#8217;s the video:<br />
<iframe src="http://player.vimeo.com/video/61884238?color=ababab" width="425" height="239" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe><br />
It&#8217;s recorded live from AteBitVJ with <a href="http://www.fraps.com/">FRAPS</a> in a single take &#8211; no external post-processing or editing involved. Unfortunately the video compression hasn&#8217;t been particularly kind here and you can see some ugly compression artifacts. Luckily, the screen shots in this post will be lossless! The audio is provided by <a href="http://4mat.bandcamp.com/">4mat</a> and is called <a href="http://4mat.bandcamp.com/track/spun-gold">&#8220;Spun Gold&#8221;</a>. It&#8217;s one of my favourite tracks from his 2012 album, <a href="http://4mat.bandcamp.com/album/origins">Origins</a>.</p>
<p>The base layer for this video is a pretty simple effect &#8211; audio FFT data from the track represented as an infinitely scrolling 3D landscape. By itself this effect can look quite nice, but I wanted to get some more out of it. I started out by zooming in and cropping so that it fills most of the frame:<br />
<a href="http://www.evilpaul.org/wp/wp-content/uploads/2013/03/1-FFT-Landscape.png"><img src="http://www.evilpaul.org/wp/wp-content/uploads/2013/03/1-FFT-Landscape.png" alt="1-FFT Landscape" width="425" height="238" class="alignnone size-full wp-image-631" /></a><br />
<span id="more-622"></span><br />
Next I apply the first effect: a radial blur. This takes the image and blurs it away from the centre point. There&#8217;s an extra little trick here in that I blur the red, green and blue elements by slightly different amounts. This gives a quick and dirty <a href="http://en.wikipedia.org/wiki/Chromatic_aberration">chromatic aberration</a> effect. All the cool kids are doing it:<br />
<a href="http://www.evilpaul.org/wp/wp-content/uploads/2013/03/2-Add-Radial-blur.png"><img src="http://www.evilpaul.org/wp/wp-content/uploads/2013/03/2-Add-Radial-blur.png" alt="2-Add Radial blur" width="425" height="238" class="alignnone size-full wp-image-634" /></a></p>
<p>Now comes a very light layer of noise. It&#8217;s pretty hard to see here but you can notice it’s effect all the way down to the subtle grain that&#8217;s visible in the final image.  Noise is probably one of the most underrated effects &#8211; adding small doses of it in the right places can really help break up sharp edges and gradients and that can make computer generated images look less synthetic:<br />
<a href="http://www.evilpaul.org/wp/wp-content/uploads/2013/03/3-Add-noise.png"><img src="http://www.evilpaul.org/wp/wp-content/uploads/2013/03/3-Add-noise.png" alt="3-Add noise" width="425" height="238" class="alignnone size-full wp-image-636" /></a></p>
<p>Then comes a standard bloom effect. After this is applied we pretty much have the basics of the final look done:<br />
<a href="http://www.evilpaul.org/wp/wp-content/uploads/2013/03/4-Bloom.png"><img src="http://www.evilpaul.org/wp/wp-content/uploads/2013/03/4-Bloom.png" alt="4-Bloom" width="425" height="238" class="alignnone size-full wp-image-644" /></a></p>
<p>Bloom is followed by overlaying a vertical colour gradient. This makes the image a bit more interesting by varying the colours from the top to bottom. From here on in it’s just a case of tweaking the colours to get the final result:<br />
<a href="http://www.evilpaul.org/wp/wp-content/uploads/2013/03/5b-Add-gradient.png"><img src="http://www.evilpaul.org/wp/wp-content/uploads/2013/03/5b-Add-gradient.png" alt="5b-Add gradient" width="425" height="238" class="alignnone size-full wp-image-645" /></a><br />
(for reference, the gradient is <a href="http://www.evilpaul.org/wp/wp-content/uploads/2013/03/5a-Gradient.png">here</a>)</p>
<p>After the gradient I add some colour correction. This is the biggest contributor to the overall colour palette of the image. It works by sampling the colours of the source image and using these as an index into a pre-computed 1D look up table to get the destination colour. The look up texture was made in Photoshop where I loaded up a suitable test image and then played with the levels until I get the look that I wanted. In this case that means a soft, retro looking colour with strong blue tones at the darker end of the scale and creamy whites towards the top. Once I’d got that look I applied it to a linear black to white gradient and saved it as my 256×1 look up texture. This is a really simple, really lightweight but really powerful technique to give your images a stunning colour palette and it&#8217;s somewhat akin to colour grading in the film and cg industries. There&#8217;s a good discussion of this technique (and the more advanced 3D look up texture version) in <a href="http://http.developer.nvidia.com/GPUGems2/gpugems2_chapter24.html">GPU Gems 2</a>. The result:<br />
<a href="http://www.evilpaul.org/wp/wp-content/uploads/2013/03/6-Colour-correction.png"><img src="http://www.evilpaul.org/wp/wp-content/uploads/2013/03/6-Colour-correction.png" alt="6-Colour correction" width="425" height="238" class="alignnone size-full wp-image-650" /></a><br />
(the look up texture is <a href="http://www.evilpaul.org/wp/wp-content/uploads/2013/03/gradienttexture_recolour_retro.png">here</a>)</p>
<p>That all looks good so far, but we&#8217;ve lost a bit of definition in the process so I put that back in with some brightness and contrast adjustments:<br />
<a href="http://www.evilpaul.org/wp/wp-content/uploads/2013/03/7-Brightness-and-contrast.png"><img src="http://www.evilpaul.org/wp/wp-content/uploads/2013/03/7-Brightness-and-contrast.png" alt="7-Brightness and contrast" width="425" height="238" class="alignnone size-full wp-image-653" /></a></p>
<p>And last, but by no means least, I add a vignette effect over the top. It&#8217;s simple and fairly subtle, but it frames the image nicely:<br />
<a href="http://www.evilpaul.org/wp/wp-content/uploads/2013/03/8-Add-vignette.png"><img src="http://www.evilpaul.org/wp/wp-content/uploads/2013/03/8-Add-vignette.png" alt="8-Add vignette" width="425" height="238" class="alignnone size-full wp-image-654" /></a></p>
<p>Finally, here’s a composite image of how all the different layers add up to give the end result:<br />
<a href="http://www.evilpaul.org/wp/wp-content/uploads/2013/03/all-layers.png"><img src="http://www.evilpaul.org/wp/wp-content/uploads/2013/03/all-layers.png" alt="all layers" width="425" height="238" class="alignnone size-full wp-image-623" /></a></p>
<p>So there you go – one simple base effect and then a bunch of small, generic adjustment layers to push and pull it into something more interesting. And with AteBitVJ this is all happening real-time at 60fps. In fact, one of the nicest parts of the whole process was that I was able to create, preview and tweak the whole effect completely live. If you&#8217;re writing your own real-time visual framework then not only would I strongly encourage you to add the ability to layer up effects like this, but you should also make everything editable in real-time. Immediate feedback when editing is definitely a very important thing and, once you’re used to it, you won’t want to give it up.</p>
<p>The post <a href="http://www.evilpaul.org/wp/2013/03/22/layers-and-layers-and-more-layers/">Layers and layers and more layers..</a> appeared first on <a href="http://www.evilpaul.org/wp">evilpaul.org</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.evilpaul.org/wp/2013/03/22/layers-and-layers-and-more-layers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A bit more textmode fun</title>
		<link>http://www.evilpaul.org/wp/2013/02/21/a-bit-more-textmode-fun/</link>
		<comments>http://www.evilpaul.org/wp/2013/02/21/a-bit-more-textmode-fun/#comments</comments>
		<pubDate>Thu, 21 Feb 2013 20:26:07 +0000</pubDate>
		<dc:creator>evilpaul</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://www.evilpaul.org/wp/?p=570</guid>
		<description><![CDATA[<p>One of the reasons I wanted to use a canvas (rather than tables of characters) for my textmode library is that is allows you to easily mix in normal 2D graphics and use effects like transparency. This post is a &#8230; <a href="http://www.evilpaul.org/wp/2013/02/21/a-bit-more-textmode-fun/">Continue reading <span class="meta-nav">&#8594;</span></a></p><p>The post <a href="http://www.evilpaul.org/wp/2013/02/21/a-bit-more-textmode-fun/">A bit more textmode fun</a> appeared first on <a href="http://www.evilpaul.org/wp">evilpaul.org</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>One of the reasons I wanted to use a canvas (rather than tables of characters) for my textmode library is that is allows you to easily mix in normal 2D graphics and use effects like transparency. This post is a quick example to show how this sort of thing can work. Click on the image below to see what it looks like and then I&#8217;ll delve into the method behind it:</p>
<p><a href="http://evilpaul.org/content/textmode/example3/"><img class="alignnone size-full wp-image-582" alt="example3thumb" src="http://www.evilpaul.org/wp/wp-content/uploads/2013/02/example3thumb.png" width="425" height="125" /></a><br />
<span id="more-570"></span><br />
There are obviously a couple of extra things going on here, but it all boils down to using multiple layers on the canvas. Instead of just one textmode layer I&#8217;ve added an overlay and a background, giving me three layers in total:</p>
<p>Layer 1: Background<br />
<a href="http://www.evilpaul.org/wp/wp-content/uploads/2013/02/background.png"><img class="alignnone size-full wp-image-573" alt="Layer 1" src="http://www.evilpaul.org/wp/wp-content/uploads/2013/02/backgroundthumb.png" width="425" height="150" /></a><br />
This is just a static image, nothing special here.</p>
<p>Layer 2: Textmode<br />
<a href="http://www.evilpaul.org/wp/wp-content/uploads/2013/02/mid.png"><img class="alignnone size-full wp-image-573" alt="Layer 2" src="http://www.evilpaul.org/wp/wp-content/uploads/2013/02/midthumb.png" width="425" height="150" /></a><br />
This is where our action is, and this is also where a small addition is needed to the textmode library. I&#8217;ll go into detail on this later, but the addition basically allows us to have some part of the textmode layer appear transparent so that the background layer can be seen.</p>
<p>Layer 3: Overlay<br />
<a href="http://www.evilpaul.org/wp/wp-content/uploads/2013/02/overlay.png"><img class="alignnone size-full wp-image-573" alt="Layer 3" src="http://www.evilpaul.org/wp/wp-content/uploads/2013/02/overlaythumb.png" width="425" height="150" /></a><br />
Again, this is just a static image. Note that every second line of this image is a feint black line. I basically added a layer in Photoshop with solid black 1px high lines every other line, and then set the whole thing to about 20% opacity. When this is overlaid on top of everything else it gives a retro scanline effect. This kind of &#8220;post-processing&#8221; effect, when applied over all other layers, can really help to tie everything together.</p>
<p>So how does all of this work in practice? Let&#8217;s look through the new stuff in main.js and textmode.js. I&#8217;m only going to highlight the important parts, so if you haven&#8217;t already read <a href="http://www.evilpaul.org/wp/?p=504">my first post on textmode</a> then head on over and do that now.</p>
<p>The first change is to load in a couple of images:</p>
<pre>// Background and overlay images. These are the same size as the canvas so that they don't get 
// stretched or shrunk
var background = new Image();
background.src = "background.png";
var overlay = new Image();
overlay.src = "overlay.png";</pre>
<p>Next we draw the effect and the text box. I&#8217;ll skip over this as it&#8217;s similar to the previous examples (you can examine the code yourself) apart from one important part. In the rendering loop for the effect you&#8217;ll see that we conditionally set the background colour to &#8217;0&#215;00&#8242;, or black ink on black paper. This is a special colour code that I&#8217;ve designated to mean that the textmode cell is transparent. When we come to render the textmode layer to the canvas with presentToScreen() it&#8217;ll skip over all of these specially coloured cells, allowing the underlying image to show through.</p>
<p>Finally, we draw the three layers. Remember that the first and last layers are just images, so we use drawImage() to copy these to the canvas. The middle layer is our textmode layer, so we&#8217;ll use the old presentToScreen() method. This time, though, we&#8217;ll add an extra argument of &#8217;0&#215;00&#8242;. This tells the function to treat our special colour as transparent.</p>
<pre>    // Render the background, then the textmode buffer, then put the overlay on top
    screenManager.context2d.drawImage(background, 0, 0);
    screenManager.presentToScreen(0x00);
    screenManager.context2d.drawImage(overlay, 0, 0);</pre>
<p>The next change is in the textmode library itself. I&#8217;ve altered the presentToScreen() function to take an optional argument &#8211; a mask colour. The function now has two control paths: one with a mask colour and one without. If you don&#8217;t pass a mask colour in then it renders exactly as it did before. If you do then it&#8217;ll skip rendering of any cells that have that mask colour. The code looks like this:</p>
<pre>TextModeScreen.prototype.presentToScreen = function(maskColour) {
    if (typeof maskColour === "undefined") {
        // Copy straight to the screen with no masking
        var readPos = 0;
        var sy = 0;
        for (y = 0; y &lt; this.charsHigh; y++) {
            var sx = 0;
            for (x = 0; x &lt; this.charsWide; x++) {
                var charId = this.charBuffer[readPos];
                var colourId = this.colourBuffer[readPos];
                readPos++;

                var cx = (charId &amp; 0x0f) * 16;
                var cy = (charId &gt;&gt; 4) * 24;
                this.context2d.fillStyle = colourTable[colourId &gt;&gt; 4];
                this.context2d.fillRect(sx, sy, 16, 24);
                this.context2d.drawImage(this.colouredFonts[colourId &amp; 15], cx, cy, 16, 24, sx, sy, 16, 24);

                sx += 16;
            }
            sy += 24;
        }
    } else {
        // Copy to the screen unless the colour is the same as the mask colour
        var readPos = 0;
        var sy = 0;
        for (y = 0; y &lt; this.charsHigh; y++) {
            var sx = 0;
            for (x = 0; x &lt; this.charsWide; x++) {
                var charId = this.charBuffer[readPos];
                var colourId = this.colourBuffer[readPos];
                readPos++;
                if (colourId != maskColour) {
                    var cx = (charId &amp; 0x0f) * 16;
                    var cy = (charId &gt;&gt; 4) * 24;
                    this.context2d.fillStyle = colourTable[colourId &gt;&gt; 4];
                    this.context2d.fillRect(sx, sy, 16, 24);
                    this.context2d.drawImage(this.colouredFonts[colourId &amp; 15], cx, cy, 16, 24, sx, sy, 16, 24);
                }
                sx += 16;
            }
            sy += 24;
        }
    }
}</pre>
<p>You should clearly be able to see the two control paths there &#8211; one for masked rendering and one for non-masked.</p>
<p>So that&#8217;s that &#8211; a nice extension to my textmode library and an example of how to use it. I&#8217;ve updated the textmode library zip file to include the code for all three examples. You can grab it from here: <a href="http://evilpaul.org/content/textmode/textmode.zip">Javascript textmode library and examples</a></p>
<p>Now, what next? Well, there are plenty of possibilities. How about a textmode puzzle game where your progress reveals an image underneath? But what should <em>I</em> do next? I&#8217;d love to hear your thoughts on what else I should add to this library ;)</p>
<p>The post <a href="http://www.evilpaul.org/wp/2013/02/21/a-bit-more-textmode-fun/">A bit more textmode fun</a> appeared first on <a href="http://www.evilpaul.org/wp">evilpaul.org</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.evilpaul.org/wp/2013/02/21/a-bit-more-textmode-fun/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Textmode in your browser with HTML and Javascript</title>
		<link>http://www.evilpaul.org/wp/2013/01/30/textmode-in-your-browser-with-html-and-javascript/</link>
		<comments>http://www.evilpaul.org/wp/2013/01/30/textmode-in-your-browser-with-html-and-javascript/#comments</comments>
		<pubDate>Wed, 30 Jan 2013 21:30:19 +0000</pubDate>
		<dc:creator>evilpaul</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://www.evilpaul.org/wp/?p=504</guid>
		<description><![CDATA[<p>Recently I&#8217;ve been thinking about making a textmode demo. If I&#8217;m honest this happens about once a year, usually when the results of the annual Text Mode Demo Contest come out. I love that TMDC is helping to keep textmode &#8230; <a href="http://www.evilpaul.org/wp/2013/01/30/textmode-in-your-browser-with-html-and-javascript/">Continue reading <span class="meta-nav">&#8594;</span></a></p><p>The post <a href="http://www.evilpaul.org/wp/2013/01/30/textmode-in-your-browser-with-html-and-javascript/">Textmode in your browser with HTML and Javascript</a> appeared first on <a href="http://www.evilpaul.org/wp">evilpaul.org</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>Recently I&#8217;ve been thinking about making a textmode demo. If I&#8217;m honest this happens about once a year, usually when the results of the annual <a href="http://tmdc.scene.org/">Text Mode Demo Contest</a> come out. I love that TMDC is helping to keep textmode alive, but I always feel that the demos they attract are, often, just standard 2D or 3D renderers passed through an image to ASCII filter like the impressive <a href="http://sol.gfxile.net/textfx/">TextFX</a>. Now, don&#8217;t get me wrong, I love the look of some of these demos. But I do feel like they are missing the point somewhat and I&#8217;d love to see some hand painted ASCII art in amongst the filtered stuff. Hopefully I&#8217;ll actually be doing something about it this time, but you&#8217;ll have to wait and see..</p>
<p>So, I like textmode art. A lot. I also like realtime. A lot. Realtime textmode demos that end up rendered out to a video and shared around as a YouTube linke? Not so much. It&#8217;s 2013. We should be able to watch textmode demos in their crisp, &#8220;full high-res&#8221; glory. And that&#8217;s where this article comes in. I&#8217;ve been taking a look at getting textmode effects running in a browser. Turns out it&#8217;s surprisingly easy even if, like me, you haven&#8217;t ever done any serious browser coding. Here.. I&#8217;ll show you..</p>
<p><a href="http://evilpaul.org/content/textmode/example1/"><img class="alignnone size-full wp-image-509" alt="textmode1" src="http://www.evilpaul.org/wp/wp-content/uploads/2013/01/textmode1.png" width="425" height="150" /></a><br />
<span id="more-504"></span><br />
I&#8217;m going to jump straight in and show you a proof of concept example. Then I&#8217;ll break down the code and explain it a bit. So go ahead and click on the image above to take you to the first example:</p>
<p>The code for this breaks down into three stages: the HTML file, the main program logic and the textmode library. Let&#8217;s start off with the simplest: the HTML file.</p>
<pre>&lt;html&gt;
    &lt;head&gt;
    	&lt;script type="text/javascript" src="main.js"&gt;&lt;/script&gt;
    	&lt;script type="text/javascript" src="textmode.js"&gt;&lt;/script&gt;
        &lt;style type="text/css"&gt;
            canvas { border: 40px solid #000000; }
        &lt;/style&gt;
    &lt;/head&gt;
    &lt;body onload="init();"&gt;
        &lt;canvas id="mainCanvas" width="0" height="0"&gt;&lt;/canvas&gt;
    &lt;/body&gt;
&lt;/html&gt;</pre>
<p>Nothing complex there then. Just a simple page that loads in a couple of js scripts, hooks in an onload function to run our code and sets up a canvas with a bit of css to give it a border.</p>
<p>Now we&#8217;ll take a look at the main program logic bit by bit. This will give us an idea about how to use the textmode library.</p>
<pre>// This is our global textmode manager
var screenManager;

// The font that we will use
var sourceFont = new Image();
sourceFont.src = "font.png";

function init() {
    // Initialise the textmode library
    screenManager = new TextModeScreen(40, 25, "mainCanvas", sourceFont);

    // Call our main loop at 25fps
    setInterval(mainLoop, 1000 / 25);
}</pre>
<p>First we have some globals. There&#8217;s a screenManager which we set up in init() and use in mainLoop() and there&#8217;s a font. The init() function initialise textmode screen to 40 characters wide, 25 characters high, using <a href="http://www.evilpaul.org/wp/wp-content/uploads/2013/01/font.png">this MS-DOS bitmap console font</a> and we&#8217;ve told it to appear in the canvas we defined earlier. The first interesting bit of code is the mainLoop() function:</p>
<pre>function mainLoop() {
    // Fill the screen with random characters and colours
    for (i = 0; i &lt; screenManager.charsWide * screenManager.charsHigh; i++) {
        screenManager.charBuffer[i] = Math.random() * 255;
        screenManager.colourBuffer[i] = Math.random() * 255;
    }

    // Render the textmode screen to our canvas
    screenManager.presentToScreen();
}</pre>
<p>The textmode screen contains two buffers: one for characters and one for colours. Each buffer is made out of bytes, giving us 256 possible characters and 256 possible colours. The colours are split further using a 16 colour palette and giving us 16 forgeround and 16 background colours per character. What we are doing in this loop is filling both of these buffers with random values and then calling presentToScreen() to copy that to our canvas. You&#8217;ve already seen the result.</p>
<p>Now we need to delve into the textmode library itself. This is contained in the textmode.js file. It&#8217;s not a huge library, but I&#8217;ll break it down into functions. Firstly we have the colour table.</p>
<pre>var colourTable = ['#000000', '#0000AA', '#00AA00', '#00AAAA',
                   '#AA0000', '#AA00AA', '#AA5500', '#AAAAAA',
                   '#555555', '#5555FF', '#55FF55', '#55FFFF', 
                   '#FF5555', '#FF55FF', '#FFFF55', '#FFFFFF'];</pre>
<p>This defines the 16 colour palette. Remember how I said we have 16 foreground and 16 background colours? This is what they look like (click to see the full thing):<br />
<a href="http://www.evilpaul.org/wp/wp-content/uploads/2013/01/palette.png"><img class="alignnone size-full wp-image-531" alt="paletterthumb" src="http://www.evilpaul.org/wp/wp-content/uploads/2013/01/paletterthumb.png" width="425" height="150" /></a><br />
There you see all 256 colours expressed as hex bytes. You&#8217;ll notice that you set the foreground using the lower nibble and the background with the upper.</p>
<p>Now comes the biggest piece of code, the set up function for the library:</p>
<pre>function TextModeScreen(charsWide, charsHigh, canvasName, sourceFont) {
    var canvas = document.getElementById(canvasName);
    if (!canvas) {
        alert("Failed to find canvas");
        return;
    }
    this.context2d = canvas.getContext("2d");
    if (!this.context2d) {
        alert("Couldn't get 2d context on canvas");
        return;
    }

    // Setup canvas size and buffers
    canvas.width = charsWide * 16;
    canvas.height = charsHigh * 24;
    this.charsWide = charsWide;
    this.charsHigh = charsHigh;
    this.charBuffer = new Uint8Array(charsWide * charsHigh)
    this.colourBuffer = new Uint8Array(charsWide * charsHigh)

    // Create foreground font colours
    this.colouredFonts = new Array(16);
    for (i = 0; i &lt; 16; i++) {
        this.colouredFonts[i] = document.createElement('canvas');
        this.colouredFonts[i].width = sourceFont.width;
        this.colouredFonts[i].height = sourceFont.height;
        var bufferContext = this.colouredFonts[i].getContext('2d');
        bufferContext.fillStyle = colourTable[i];
        bufferContext.fillRect(0, 0, sourceFont.width, sourceFont.height);
        bufferContext.globalCompositeOperation = "destination-atop";
        bufferContext.drawImage(sourceFont, 0, 0);
    }
}</pre>
<p>We already know that you pass in the size and name of the canvas and the font. In this demo the font is hardwired to be 16 pixels wide by 24 high but that&#8217;s easy to change. The init() function first gets hold of a 2D context for the canvas. Next it calculates and sets the canvas size and create a couple of byte sized arrays for the character and colour buffers that we talked about earlier. Finally we make 16 copies of the font, each in a different colour. The source font is white on a transparent background so we can easily create tinted version of it using &#8220;destination-atop&#8221; image blending. The reason for creating these copies will become clear when we look at the next function, presentToScreen():</p>
<pre>TextModeScreen.prototype.presentToScreen = function() {
    var readPos = 0;
    var sy = 0;
    for (y = 0; y &lt; this.charsHigh; y++) {
        var sx = 0;
        for (x = 0; x &lt; this.charsWide; x++) {
            var charId = this.charBuffer[readPos];
            var colourId = this.colourBuffer[readPos];
            readPos++;

            var cx = (charId &amp; 0x0f) * 16;
            var cy = (charId &gt;&gt; 4) * 24;
            this.context2d.fillStyle = colourTable[colourId &gt;&gt; 4];
            this.context2d.fillRect(sx, sy, 16, 24);
            this.context2d.drawImage(this.colouredFonts[colourId &amp; 15], cx, cy, 16, 24, sx, sy, 16, 24);

            sx += 16;
        }
        sy += 24;
    }
}</pre>
<p>What we do here is go through the character and colour buffers and render them to the canvas. This has to be done in two steps for every character. First we render the background colour. This is easily drawn with a fillRect() of the appropriate colour. Then we render the font on top in the foreground colour. However, we can&#8217;t tint this character to make it the colour we need. Luckily we created a different copy of the font for each of the 16 colours, so we can simple overlay the appropriate character from the correctly coloured font. Repeat for all characters in the buffer and we&#8217;re done.</p>
<p>That&#8217;s the main part of the library dealt with, but there are a couple of additional utility functions: print(), printBox() and processBox(). The first two are fairly obvious and quite trivial so take a look at the code yourself and see if you can follow it. The third one however:</p>
<pre>TextModeScreen.prototype.processBox = function(x, y, w, h, func) {
    for (sy = y; sy &lt; y + h; sy++) {
        if (sy &gt;= 0 &amp;&amp; sy &lt;= this.charsHigh) {
            var readWritePos = x + sy * this.charsWide;
            for (sx = x; sx &lt; x + w; sx++) {
                if (sx &gt;= 0 &amp;&amp; sx &lt;= this.charsWide) {
                    var charId = this.charBuffer[readWritePos];
                    var colourId = this.colourBuffer[readWritePos];
                    var results = func(charId, colourId);
                    this.charBuffer[readWritePos] = results[0];
                    this.colourBuffer[readWritePos] = results[1];
                }
                readWritePos++;
            }
        }
    }
}</pre>
<p>This is an interesting function. You pass in a box (defined by x, y, width and height) and a function. The function is then called for every character inside the box, with the character and colour as arguments. The function should return an array containing a new character and colour pair. You can use these to do neat character or palette changing effects like greyscale, shadow or upper/lower case conversion. Think of it as a simple shader for textmode. Feel free to expand upon it..</p>
<p>Putting this all together I&#8217;ve created a (very slightly) more complex example. You&#8217;ll find examples of print(), printBox() and processBox() (used to create a drop shadow) in here:<br />
<a href="http://evilpaul.org/content/textmode/example2/"><img class="alignnone size-full wp-image-506" alt="helloworld" src="http://www.evilpaul.org/wp/wp-content/uploads/2013/01/helloworld.png" width="425" height="150" /></a></p>
<p>That last example is bundled up with the textmode library and supporting files and can be grabbed from here: <a href="http://evilpaul.org/content/textmode/textmode.zip">Javascript textmode library</a></p>
<p>Now all you need to do is make something cool with it. And that&#8217;s what I&#8217;ll be doing too ;)</p>
<p>Disclaimer: You should consider this as sample code to be built upon. It&#8217;s meant to be clear rather than optimal. You should use requestAnimationFrame() instead setInterval(). It won&#8217;t work in all browsers as it stands. Also, I&#8217;m no Javascript expert.</p>
<p>The post <a href="http://www.evilpaul.org/wp/2013/01/30/textmode-in-your-browser-with-html-and-javascript/">Textmode in your browser with HTML and Javascript</a> appeared first on <a href="http://www.evilpaul.org/wp">evilpaul.org</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.evilpaul.org/wp/2013/01/30/textmode-in-your-browser-with-html-and-javascript/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>VJing with Python?</title>
		<link>http://www.evilpaul.org/wp/2012/11/24/vjing-with-python/</link>
		<comments>http://www.evilpaul.org/wp/2012/11/24/vjing-with-python/#comments</comments>
		<pubDate>Sat, 24 Nov 2012 22:50:09 +0000</pubDate>
		<dc:creator>evilpaul</dc:creator>
				<category><![CDATA[atebit]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Music]]></category>

		<guid isPermaLink="false">http://www.evilpaul.org/wp/?p=472</guid>
		<description><![CDATA[<p>Time for another update on AteBitVJ. The latest addition to it&#8217;s arsenal is the ability to create your own effect modules from scratch. Anyone who knows me or has read this blog will know that I am a big fan &#8230; <a href="http://www.evilpaul.org/wp/2012/11/24/vjing-with-python/">Continue reading <span class="meta-nav">&#8594;</span></a></p><p>The post <a href="http://www.evilpaul.org/wp/2012/11/24/vjing-with-python/">VJing with Python?</a> appeared first on <a href="http://www.evilpaul.org/wp">evilpaul.org</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>Time for another update on AteBitVJ. The latest addition to it&#8217;s arsenal is the ability to create your own effect modules from scratch. Anyone who knows me or has read this blog will know that I am a big fan of Processing. I love it&#8217;s immediacy &#8211; that I can very quickly prototype and test out ideas. Several of the effects modules in AteBitVJ started out as Processing sketches before being re-written in C++ and HLSL. In fact, it was partly due to me wanting to take my audio visual Processing experiments further that led to me creating AteBitVJ in the first place. So it&#8217;s fitting that I&#8217;ve added a Processing-like scripting library to the app. The cool thing is that these scripted modules are immediately fully integrated into AteBitVJ, giving you access to a wide range of filters, modules and synchronisation options.</p>
<p>The scripting language I chose to use is Python, but it was a close call between Python and Lua. I&#8217;ve embedded Lua a lot in the past, mostly in various commercial games like <a href="http://www.metacritic.com/game/xbox-360/crackdown">Crackdown</a>, and have always liked it. I find that it&#8217;s very easy to embed and is pretty safe and simple for non-technical people (like game artists and designers) to pick up. Python is a newer discovery for me and I&#8217;ve only been using it in anger for a few months. I&#8217;ve been using it a lot in my day job, so it&#8217;s advantageous for me to take a more in-depth interest in it, but I&#8217;m also aware that a lot of artists are getting into it through scripting in packages like Maya, Max and C4D.</p>
<p>So here&#8217;s a quick video of the latest version of AteBitVJ. It not only shows off the immediacy of the UI (the whole video is shot in one take) but also the Python scripting &#8211; the main visual effect you see is Python scripted.</p>
<p><iframe src="http://player.vimeo.com/video/53679356?title=0&amp;byline=0&amp;portrait=0&amp;badge=0&amp;color=ff3333" height="239" width="425" allowfullscreen="" frameborder="0"></iframe></p>
<p>And here&#8217;s the script itself:<br />
<span id="more-472"></span><code></code></p>
<pre>from atebitvj import *

colBackground = color(0)
colCircleStroke = color(255,255,0)
colCircelFill = color(255)
colLinesLow = color(255,0,0)
colLinesHi = color(255,255,0)

def setup():
	addParamFloat("offset", 0, 0, 1)
	addParamFloat("length", 1, 0, 1)
	ellipseMode(CENTER)

def draw():
	background(colBackground)
	translate(screenWidth()/2, screenHeight()/2)

	# draw the central ball
	ellipseScale = 0
	for i in range(64, 128):
		ellipseScale = max(ellipseScale, getFFT(i))
	strokeScale = 1-(elapsedBeats() % 1)
	strokeWeight(strokeScale * 20)
	stroke(lerpColor(colLinesLow, colLinesHi, strokeScale))
	fill(colCircelFill)
	ellipseSize = ellipseScale * 300
	ellipse(0, 0, ellipseSize, ellipseSize)

	# draw the lines coming out to show the energy at different frequencies
	strokeWeight(5)
	rotate(-HALF_PI)
	rotationStep = TWO_PI / 128
	offset = 250 + getParamFloat("offset") * 50
	lengthScale = getParamFloat("length") * 200;
	for i in range(128):
		band = i / 2 if i &lt; 64 else 64 - i / 2
		audioScale = getFFT(band * 256 / 64)
		stroke(lerpColor(colLinesLow, colLinesHi, audioScale))
		line(offset, 0, offset + lengthScale * audioScale, 0)
		rotate(rotationStep)</pre>
<p>&nbsp;</p>
<p><code></code><br />
If you&#8217;ve seen Processing before then this should pretty much make sense, even if you&#8217;re completely new to Python. There are a couple of AteBitVJ functions that deserve some further explanation though:</p>
<pre>addParamFloat("name", 0, 0, 1)
getParamFloat("name")</pre>
<p>&nbsp;</p>
<p><code></code>You can add named parameters (with initial and min/max values) to the module which are then exposed to the same UI and automation facilities as everything else. Of course, they&#8217;re also saved along with the rest of project. Not shown here are the other parameter types that are available, like colour.</p>
<pre>elapsedTime()
elapsedBeats()
elapsedBeatsInBar()
elapsedBars()
beatsPerBar()</pre>
<p>&nbsp;</p>
<p><code></code>Read various times values, allowing you to sync your script to the audio.</p>
<pre>getFFT(band)</pre>
<p>&nbsp;</p>
<p><code></code>Read the current value of the audio FFT. This lets you sync your script to the audio volume.. to some extent.</p>
<p>So that&#8217;s it for now. The scripting only allows you to produce 2D content at the moment, but 3D will be added over the next couple of weeks &#8211; I&#8217;m still adding new functionality to this app on an almost daily basis.</p>
<p>The post <a href="http://www.evilpaul.org/wp/2012/11/24/vjing-with-python/">VJing with Python?</a> appeared first on <a href="http://www.evilpaul.org/wp">evilpaul.org</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.evilpaul.org/wp/2012/11/24/vjing-with-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Just cleaning up the garage..</title>
		<link>http://www.evilpaul.org/wp/2012/07/30/just-cleaning-up-the-garage/</link>
		<comments>http://www.evilpaul.org/wp/2012/07/30/just-cleaning-up-the-garage/#comments</comments>
		<pubDate>Mon, 30 Jul 2012 20:57:04 +0000</pubDate>
		<dc:creator>evilpaul</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[Misc]]></category>
		<category><![CDATA[Music]]></category>

		<guid isPermaLink="false">http://www.evilpaul.org/wp/?p=410</guid>
		<description><![CDATA[<p>Did some cleaning in the garage this weekend in preperation for a house move. Here are some of the random things that I found. First off, a Dreamcast dev kit. This one doesn&#8217;t work &#8211; I think the graphics cards &#8230; <a href="http://www.evilpaul.org/wp/2012/07/30/just-cleaning-up-the-garage/">Continue reading <span class="meta-nav">&#8594;</span></a></p><p>The post <a href="http://www.evilpaul.org/wp/2012/07/30/just-cleaning-up-the-garage/">Just cleaning up the garage..</a> appeared first on <a href="http://www.evilpaul.org/wp">evilpaul.org</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>Did some cleaning in the garage this weekend in preperation for a house move. Here are some of the random things that I found.</p>
<p><a href="http://www.evilpaul.org/wp/wp-content/uploads/2012/07/dreamcast.jpg"><img src="http://www.evilpaul.org/wp/wp-content/uploads/2012/07/dreamcast_thumb.jpg" alt="" title="dreamcast" width="425" height="150" class="alignnone size-full wp-image-445" /></a><br />
First off, a Dreamcast dev kit. This one doesn&#8217;t work &#8211; I think the graphics cards is fried. Still a lovely looking unit though.</p>
<p><a href="http://www.evilpaul.org/wp/wp-content/uploads/2012/07/gus.jpg"><img src="http://www.evilpaul.org/wp/wp-content/uploads/2012/07/gus_thumb.jpg" alt="" title="gus" width="425" height="150" class="alignnone size-full wp-image-445" /></a><br />
A large, red <a href="http://en.wikipedia.org/wiki/Gravis_Ultrasound">Gravis Ultrasound</a>. This was a mighty soundcard back in the 90s. It had on-board sampe RAM and got a lot of love from the demoscene as a result.</p>
<p><a href="http://www.evilpaul.org/wp/wp-content/uploads/2012/07/storage.jpg"><img src="http://www.evilpaul.org/wp/wp-content/uploads/2012/07/storage_thumb.jpg" alt="" title="storage" width="425" height="150" class="alignnone size-full wp-image-445" /></a><br />
Three different types of storage: a 3.5&#8243; disc, a 5.25&#8243; inch disc and a monster 15.1&#8243; disc cartridge. The <a href="http://www.pdp-11.nl/peripherals/disk/rl-info.html">RL01K-DC</a> holds a whopping 5.2MB and was used in the venerable <a href="http://en.wikipedia.org/wiki/PDP-11">PDP-11</a>.</p>
<p><span id="more-410"></span><br />
<a href="http://www.evilpaul.org/wp/wp-content/uploads/2012/07/stsoftware.jpg"><img src="http://www.evilpaul.org/wp/wp-content/uploads/2012/07/stsoftware_thumb.jpg" alt="" title="stsoftware" width="425" height="150" class="alignnone size-full wp-image-445" /></a><br />
Some more storage: a collection of Atari ST software. Some great <a href="http://en.wikipedia.org/wiki/Bitmap_Brothers">Bitmap Brothers</a> games here, along with the almost-never-out-of-my-drive <a href="http://www.atarimania.com/utility-atari-st-advanced-ocp-art-studio-_21473.html">OCP Art Studio</a>. Many a non-released game was designed in this..</p>
<p><a href="http://www.evilpaul.org/wp/wp-content/uploads/2012/07/zxsoftware.jpg"><img src="http://www.evilpaul.org/wp/wp-content/uploads/2012/07/zxsoftware_thumb.jpg" alt="" title="zxsoftware_thumb" width="425" height="150" class="alignnone size-full wp-image-445" /></a><br />
And now onto ZX Spectrum software. I&#8217;ve already shifted a load of this stuff, I think this is the last lot. Greats in here include the expertly coded but slightly dull <a href="http://www.worldofspectrum.org/infoseekid.cgi?id=0000996">Cobra</a>, an early word processor called <a href="http://en.wikipedia.org/wiki/Tasword">Tasword Two</a>, David Jones&#8217; brilliant <a href="http://en.wikipedia.org/wiki/Finders_Keepers_%28video_game%29">Finders Keepers</a> and an epic old EA RPG called <a href="http://en.wikipedia.org/wiki/The_Bard%27s_Tale_%281985_video_game%29">The Bards Tale</a>. You can also see <a href="http://en.wikipedia.org/wiki/HiSoft_Systems">HiSoft&#8217;s</a> <a href="http://www.worldofspectrum.org/infoseekid.cgi?id=0008091">Devpac</a>, which is probaby where I really started my journey into programming. Oh, and there&#8217;s a Cheetah <a href="http://en.wikipedia.org/wiki/SpecDrum">SpecDrum</a> in there too, which started me on the road to hacking around with digital audio.</p>
<p><a href="http://www.evilpaul.org/wp/wp-content/uploads/2012/07/zx.jpg"><img src="http://www.evilpaul.org/wp/wp-content/uploads/2012/07/zx_thumb.jpg" alt="" title="zx" width="425" height="150" class="alignnone size-full wp-image-445" /></a><br />
Here&#8217;s what those Spectrum games ran on: <a href="http://en.wikipedia.org/wiki/Zx_spectrum">Spectrums</a>. You can see a standard 48k, a +2 and a +3 here. In the corner is a <a href="http://baze.au.com/divide/">divIDE</a> with a 2GB flash card, allowing thousands of games to be loaded in mere seconds rather than the minutes you&#8217;d have to wait for with tapes. If you&#8217;d seen one of those back in the 80s you&#8217;d have thought it was voodoo.</p>
<p><a href="http://www.evilpaul.org/wp/wp-content/uploads/2012/07/zxluc.jpg"><img src="http://www.evilpaul.org/wp/wp-content/uploads/2012/07/zxluc_thumb.jpg" alt="" title="zxluc" width="425" height="150" class="alignnone size-full wp-image-445" /></a><br />
And this is what modern kids think of 30 year old computers. Luc is pushing play money into the tape drive of the +2. He coudn&#8217;t provide a satisfactory explanation as to why.</p>
<p><a href="http://www.evilpaul.org/wp/wp-content/uploads/2012/07/pc.jpg"><img src="http://www.evilpaul.org/wp/wp-content/uploads/2012/07/pc_thumb.jpg" alt="" title="pc" width="425" height="150" class="alignnone size-full wp-image-445" /></a><br />
Here we have a vintage 2000-era PC. This one I built myself from parts. You&#8217;ll notice it isn&#8217;t a standard, off-the-shelf PC because the manufacturers bag is a picture of <a href="http://en.wikipedia.org/wiki/Bagpuss">Bagpuss</a>. Bagpuss lasted me quite a few years, finally ending his life as an experimental OpenBSD server.</p>
<p><a href="http://www.evilpaul.org/wp/wp-content/uploads/2012/07/pcinside.jpg"><img src="http://www.evilpaul.org/wp/wp-content/uploads/2012/07/pcinside_thumb.jpg" alt="" title="pcinside" width="425" height="150" class="alignnone size-full wp-image-445" /></a><br />
The inside of the old furry catpuss.</p>
<p><a href="http://www.evilpaul.org/wp/wp-content/uploads/2012/07/pccards.jpg"><img src="http://www.evilpaul.org/wp/wp-content/uploads/2012/07/pccards_thumb.jpg" alt="" title="pccards" width="425" height="150" class="alignnone size-full wp-image-445" /></a><br />
A classic 3COM 3C509 ethernet card. A <a href="http://www.sharkyextreme.com/hardware/articles/geforce_indepth/">3D Blaster Geforce</a>, the first ever consumer level graphics card with hardware transform and lighting &#8211; a real game changer this one. Also an Adaptec SCSI card and a Sound Blaster 16.</p>
<p><a href="http://www.evilpaul.org/wp/wp-content/uploads/2012/07/pccontents.jpg"><img src="http://www.evilpaul.org/wp/wp-content/uploads/2012/07/pccontents_thumb.jpg" alt="" title="pccontents" width="425" height="150" class="alignnone size-full wp-image-445" /></a><br />
The other interesting parts of Bagpuss are the <a href="http://en.wikipedia.org/wiki/Pentium_III">Pentium 3</a>, the (probably tiny amounts of) RAM and a pair of (probably also very tiny) Quantam Fireball HDs.</p>
<p><a href="http://www.evilpaul.org/wp/wp-content/uploads/2012/07/stomp.jpg"><img src="http://www.evilpaul.org/wp/wp-content/uploads/2012/07/stomp_thumb.jpg" alt="" title="stomp" width="425" height="150" class="alignnone size-full wp-image-445" /></a><br />
Finally we reach the audio bits &#8211; a tuner, a wah peddle, a distorsion stomp box and a lovely little &#8220;legendary&#8221; <a href="http://en.wikipedia.org/wiki/Pignose">Pignose</a> buskers amplifier. The Strat wasn&#8217;t in with the rest of junk, before you ask.</p>
<p><a href="http://www.evilpaul.org/wp/wp-content/uploads/2012/07/picks.jpg"><img src="http://www.evilpaul.org/wp/wp-content/uploads/2012/07/picks_thumb.jpg" alt="" title="picks" width="425" height="150" class="alignnone size-full wp-image-445" /></a><br />
Some wicked picks-in-a-business-card from <a href"http://www.denki.co.uk/">Denki</a>, where I used to work. No doubt these were <a href="https://twitter.com/denkicolin/">Colin&#8217;s</a> idea, the little guitar fan that he is.</p>
<p><a href="http://www.evilpaul.org/wp/wp-content/uploads/2012/07/mp550.jpg"><img src="http://www.evilpaul.org/wp/wp-content/uploads/2012/07/mp550_thumb.jpg" alt="" title="mp550" width="425" height="150" class="alignnone size-full wp-image-445" /></a><br />
Bow down before the gorgeous sounds of the <a href="http://www.lexiconpro.com/en-US">Lexicon</a> <a href="http://www.soundonsound.com/sos/jan03/articles/lexiconmpx550.asp">MPX550</a>.</p>
<p><a href="http://www.evilpaul.org/wp/wp-content/uploads/2012/07/cables.jpg"><img src="http://www.evilpaul.org/wp/wp-content/uploads/2012/07/cables_thumb.jpg" alt="" title="cables" width="425" height="150" class="alignnone size-full wp-image-445" /></a><br />
And, finally, what no self respecting musician should be without: a bag full of random cables.</p>
<p>All of this stuff is <a href="http://www.youtube.com/watch?v=uU5trjpFus0">destined to go</a>. Probably via eBay but possibly via the tip. If you&#8217;re interested in anything here then give me a shout. Quick!</p>
<p>The post <a href="http://www.evilpaul.org/wp/2012/07/30/just-cleaning-up-the-garage/">Just cleaning up the garage..</a> appeared first on <a href="http://www.evilpaul.org/wp">evilpaul.org</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.evilpaul.org/wp/2012/07/30/just-cleaning-up-the-garage/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Shall we play a game?</title>
		<link>http://www.evilpaul.org/wp/2012/07/12/shall-we-play-a-game/</link>
		<comments>http://www.evilpaul.org/wp/2012/07/12/shall-we-play-a-game/#comments</comments>
		<pubDate>Thu, 12 Jul 2012 12:30:02 +0000</pubDate>
		<dc:creator>evilpaul</dc:creator>
				<category><![CDATA[atebit]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[Demoscene]]></category>

		<guid isPermaLink="false">http://www.evilpaul.org/wp/?p=396</guid>
		<description><![CDATA[<p>Way back in December of last year I was honoured to be asked by Abyss, one of the main organisers behind the massive Assembly demoparty, if I would be interested in creating an invitation demo for them this year. Of &#8230; <a href="http://www.evilpaul.org/wp/2012/07/12/shall-we-play-a-game/">Continue reading <span class="meta-nav">&#8594;</span></a></p><p>The post <a href="http://www.evilpaul.org/wp/2012/07/12/shall-we-play-a-game/">Shall we play a game?</a> appeared first on <a href="http://www.evilpaul.org/wp">evilpaul.org</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>Way back in December of last year I was honoured to be asked by Abyss, one of the main organisers behind the massive <a href="http://www.assembly.org/summer12/">Assembly</a> <a href="http://en.wikipedia.org/wiki/Assembly_%28demo_party%29">demoparty</a>, if I would be interested in creating an invitation demo for them this year. Of course I jumped at the chance. It&#8217;s taken a while (curse you real life and your endless demands!) but here&#8217;s the result:</p>
<p><iframe src="http://player.vimeo.com/video/45538243" width="500" height="375" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></p>
<p>The demo is written in C++ and GLSL using <a href="http://www.openframeworks.cc/">OpenFrameworks</a> 007 as a base. That&#8217;s a bit of a departure from my usual DirectX + custom engine approach, but I needed to familiarise myself with OF for my job and this seemed like a good way to go about doing that. So this is actually my first ever (and possibly only ever) OF release.</p>
<p>The wonderful soundtrack for this demo was created by <a href="http://echolevel.co.uk/">Brendan Ratliff, aka Syphus, aka Echolevel</a>. This isn&#8217;t the first time we&#8217;ve worked together &#8211; back in 2008 we made the matter-of-factly named <a href="http://pouet.net/prod.php?which=51668">Ribbons, Tunnels &#038; Techno</a>, a demo that I&#8217;ve always had a bit of a soft spot for.</p>
<p>Shortly I&#8217;ll be packaging up the code for a full source release and I&#8217;ll blog a bit more about the creation of the demo at the same time. Until then you can download the windows executable from <a href="http://atebit.org/#asm2012invitro">the Ate Bit site</a> and, if you&#8217;re feeling generous, you could always leave a nice comment on <a href="http://www.pouet.net/prod.php?which=59454">Pouet</a>.</p>
<p>The post <a href="http://www.evilpaul.org/wp/2012/07/12/shall-we-play-a-game/">Shall we play a game?</a> appeared first on <a href="http://www.evilpaul.org/wp">evilpaul.org</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.evilpaul.org/wp/2012/07/12/shall-we-play-a-game/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AteBitVJ</title>
		<link>http://www.evilpaul.org/wp/2012/03/02/atebitvj/</link>
		<comments>http://www.evilpaul.org/wp/2012/03/02/atebitvj/#comments</comments>
		<pubDate>Fri, 02 Mar 2012 21:15:42 +0000</pubDate>
		<dc:creator>evilpaul</dc:creator>
				<category><![CDATA[atebit]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Music]]></category>

		<guid isPermaLink="false">http://www.evilpaul.org/wp/?p=378</guid>
		<description><![CDATA[<p>It&#8217;s still fairly secretive and hasn&#8217;t been seen in public yet but my latest project, AteBitVJ, is coming along nicely. The aim of AteBitVJ is to take the best bits of some of my previous works (my demoscene output, my &#8230; <a href="http://www.evilpaul.org/wp/2012/03/02/atebitvj/">Continue reading <span class="meta-nav">&#8594;</span></a></p><p>The post <a href="http://www.evilpaul.org/wp/2012/03/02/atebitvj/">AteBitVJ</a> appeared first on <a href="http://www.evilpaul.org/wp">evilpaul.org</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>It&#8217;s still fairly secretive and hasn&#8217;t been seen in public yet but my latest project, AteBitVJ, is coming along nicely. The aim of AteBitVJ is to take the best bits of some of my previous works (my demoscene output, my Processing experiments and music visualistations and a bunch of my other, non-public, experiments) and wrap them up into a real-time VJ app. The unofficial tag line for the project is &#8220;no loops allowed&#8221;, meaning that it&#8217;s not a VJ program for playing video loops &#8211; pretty much everything is generated (and tweakable) in realtime.</p>
<p><iframe src="http://player.vimeo.com/video/31509522" width="425" height="239" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe><br />
<span id="more-378"></span><br />
The whole project aims to be highly customisable and highly controllable. The interface is a little like a cross between Photoshop, After Effects and Resolume. Visuals are created by blending multiple layers of modules (video input, particle effects, images, 3D scenes, etc) on top of each other, and those layers can have multiple effects (bloom, noise, threshold, glitch, etc) applied to them. You can drive any of the visual parameters directly using the UI, or from audio input, LFOs, OSC or MIDI. I&#8217;ve been using my trusty <a href="http://bitethis.org/2010/05/10/nanokontrol-korg/">Korg Nano</a> most of the time, but I also had some fun hooking up a Wii controller via <a href="http://glovepie.org/glovepie.php">GlovePie</a>. Recently I&#8217;ve been eyeing up the Launchpad that&#8217;s sat on the shelf in the office..</p>
<p><iframe src="http://player.vimeo.com/video/31855245" width="425" height="239" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></p>
<p>Right now the project is unfinished but in a pretty good state &#8211; the vidoes are captures of the app being played live. I&#8217;m actively looking for either a musician or an event to partner with so that I can take this to the next level &#8211; using it to create live visuals. If you&#8217;d like to get involved, give me a shout! I&#8217;m based around London UK if that help ;)</p>
<p>The post <a href="http://www.evilpaul.org/wp/2012/03/02/atebitvj/">AteBitVJ</a> appeared first on <a href="http://www.evilpaul.org/wp">evilpaul.org</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.evilpaul.org/wp/2012/03/02/atebitvj/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>OpenProcessing.org and Ray Marching</title>
		<link>http://www.evilpaul.org/wp/2011/03/22/openprocessing-org-and-ray-marching/</link>
		<comments>http://www.evilpaul.org/wp/2011/03/22/openprocessing-org-and-ray-marching/#comments</comments>
		<pubDate>Tue, 22 Mar 2011 21:54:12 +0000</pubDate>
		<dc:creator>evilpaul</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://www.evilpaul.org/wp/?p=318</guid>
		<description><![CDATA[<p>I&#8217;ve taken a little break from Flash and gone off to play with ray marching &#8211; an optimised form of ray tracing. I started off using the GPU, then ended up with a nice little Processing sketch that I&#8217;ve uploaded &#8230; <a href="http://www.evilpaul.org/wp/2011/03/22/openprocessing-org-and-ray-marching/">Continue reading <span class="meta-nav">&#8594;</span></a></p><p>The post <a href="http://www.evilpaul.org/wp/2011/03/22/openprocessing-org-and-ray-marching/">OpenProcessing.org and Ray Marching</a> appeared first on <a href="http://www.evilpaul.org/wp">evilpaul.org</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve taken a little break from Flash and gone off to play with ray marching &#8211; an optimised form of ray tracing. I started off using the GPU, then ended up with a nice little Processing sketch that I&#8217;ve uploaded to <a href="http://www.openprocessing.org/portal/?userID=10654">OpenProcessing.org</a>. Open Processing allows you to share sketches with others and is a great place to pick up inspiration and learn &#8211; every sketch uploaded includes full source code, easily browsable on the site.</p>
<p><a href="http://www.openprocessing.org/visuals/?visualID=25016"><img src="http://www.evilpaul.org/wp/wp-content/uploads/2011/03/rm04_thumb.jpg" alt="" title="rm04_thumb" width="425" height="150" class="alignnone size-full wp-image-322" /></a><br />
(click on the picture to run the sketch)</p>
<p>Be sure to play around with the F and M keys to get a look at what the sketch has to offer.<br />
<span id="more-318"></span><br />
I&#8217;ve put a couple of my older sketches up there too. So why don&#8217;t you head on over to <a href="http://www.openprocessing.org/portal/?userID=10654">browse my portfolio</a> and view, comment, favourite and remix the sketches.. or whatever it is you crazy kids do on that site :)</p>
<p>When I&#8217;ve got some time spare I&#8217;ll add a post here about the sketch, and maybe show some of my GPU work too.</p>
<p>The post <a href="http://www.evilpaul.org/wp/2011/03/22/openprocessing-org-and-ray-marching/">OpenProcessing.org and Ray Marching</a> appeared first on <a href="http://www.evilpaul.org/wp">evilpaul.org</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.evilpaul.org/wp/2011/03/22/openprocessing-org-and-ray-marching/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Make your own Bullet Hell</title>
		<link>http://www.evilpaul.org/wp/2011/02/03/make-your-own-bullet-hell/</link>
		<comments>http://www.evilpaul.org/wp/2011/02/03/make-your-own-bullet-hell/#comments</comments>
		<pubDate>Thu, 03 Feb 2011 22:31:14 +0000</pubDate>
		<dc:creator>evilpaul</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Games]]></category>

		<guid isPermaLink="false">http://www.evilpaul.org/wp/?p=305</guid>
		<description><![CDATA[<p>Work continue apace on my Flash game, Bullet Hell Surive. Actually, no it doesn&#8217;t. What&#8217;s the opposite of apace? Slowly? That will do. With most of my time now taken up by housedad duties, I&#8217;m finding it hard to get &#8230; <a href="http://www.evilpaul.org/wp/2011/02/03/make-your-own-bullet-hell/">Continue reading <span class="meta-nav">&#8594;</span></a></p><p>The post <a href="http://www.evilpaul.org/wp/2011/02/03/make-your-own-bullet-hell/">Make your own Bullet Hell</a> appeared first on <a href="http://www.evilpaul.org/wp">evilpaul.org</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>Work continue apace on my Flash game, Bullet Hell Surive. Actually, no it doesn&#8217;t. What&#8217;s the opposite of apace? Slowly? That will do.</p>
<p>With most of my time now taken up by housedad duties, I&#8217;m finding it hard to get enough time to get things done on the project. Occasionally I get an uninterrupted hour or two and get lots done, but usually it&#8217;s half an hour here or there and once I&#8217;ve got settled in the time is half gone. I get the distinct impression that, were I working on this fulltime, I could have got to this stage in the project in a single week.</p>
<p><a href="http://www.evilpaul.org/wp/wp-content/uploads/2011/02/BulletHellSurvive.swf"><img src="http://www.evilpaul.org/wp/wp-content/uploads/2011/02/bhs2.png" alt="" title="bhs2" width="425" height="150" class="alignnone size-full wp-image-286" /></a><br />
(click on the picture to run the demo)</p>
<p>So what&#8217;s new in this version? First up is the level editor. You can use this to create your own levels, which you can then play.<span id="more-305"></span> All of the levels in the game are built using this editor, so it&#8217;s a complete toolset. I&#8217;m currently in two minds as to whether I should include the editor in the final version of the game or not. On the one hand, it&#8217;s great to allow end users to create and share their own levels. On the other, it requires a fair amount of work to make it solid enough and straight forward enough for them to get to grips with. There&#8217;s also the whole back end code, which isn&#8217;t something that I have much experience with. My current plan is to keep the editor at a level where I will use it to create my own levels but not to worry about it too much. The thinking here is that I can continue to use it to edit and tweak my levels, and then if I do decide to include it in the final release it shouldn&#8217;t be too much work to polish it up.</p>
<p>As well as the level editor, I&#8217;ve also recently improved the placeholder assets a bit. Every sprite, every level and every piece of audio is still placeholder &#8211; it&#8217;s just that they&#8217;re a bit better now. I strongly believe that prototypes can almost always work with just simple placeholders. I&#8217;d even say that adding anything other than really basic assets at an early stage actually detracts from the game mechanics that you are trying to prove. But I do think there comes a time when improving these assets can help to improve the feel of the game. I think of this as staged delivery: You start with simple gameplay and very simple assets, just as in the first build of BHS. But once you improve the gameplay, you also need to improve the tools (ie: the editor) the game wrapper (eg: level select and game ceremonies) and the assets. If you don&#8217;t then you end up with a game that is unbalanced and inconsistent and, as much as we like to believe otherwise, I think we find it difficult to look at such a game objectively. I think that people also have a tendency to work on the areas of hobby projects that they like most, leaving the other areas far behind. This is all fine until you get to the end of the project and remember that you&#8217;ve still got to write all that stuff anyway, but now there&#8217;s not going to be any respite. And maybe that&#8217;s why so many promising looking hobby projects never get finished?</p>
<p>Apart from the level editor then, the two areas in the game that have recently been added are the sound effects (all created by <a href="http://www.drpetter.se/">Dr Petter&#8217;s</a> excellent audio tool, <a href="http://www.drpetter.se/project_sfxr.html">SFXR</a>) and the scrolling background. Both are fairly simple, it took only an hour or so to complete both, but both massively improve the atmosphere of the game. I&#8217;ve also made an effort to put some decent levels together. There are only six in there at the moment, but they follow a simple learning curve that shows you the basics of the game. Again, I think this has made a big difference to the feel of the game without needing much, if any, new code.</p>
<p>Next up I would like to start tweaking the gameplay. I&#8217;ve reduced the time of a level down to 20 seconds from the 30 seconds of the last build. Remember that in the original PC prototype it was 60 seconds. 20 feels much better, but I&#8217;m still not convinced that it shouldn&#8217;t be a little longer. I&#8217;m also going to play around with some new enemy weapon types &#8211; probably some homing weapons and laser beams. I&#8217;d also like to start working on the graphics and the audio, and that&#8217;s where I need to start getting the other team members involved ;)</p>
<p>The post <a href="http://www.evilpaul.org/wp/2011/02/03/make-your-own-bullet-hell/">Make your own Bullet Hell</a> appeared first on <a href="http://www.evilpaul.org/wp">evilpaul.org</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.evilpaul.org/wp/2011/02/03/make-your-own-bullet-hell/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Tweet!</title>
		<link>http://www.evilpaul.org/wp/2011/01/13/tweet/</link>
		<comments>http://www.evilpaul.org/wp/2011/01/13/tweet/#comments</comments>
		<pubDate>Thu, 13 Jan 2011 14:23:32 +0000</pubDate>
		<dc:creator>evilpaul</dc:creator>
				<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://www.evilpaul.org/wp/?p=276</guid>
		<description><![CDATA[<p>Yup.. I&#8217;ve finally joined Twitter. Drop by and follow me, I&#8217;ll be talking about BHS development (and other things) as they happen. Twitter username: evilpaul_atebit</p><p>The post <a href="http://www.evilpaul.org/wp/2011/01/13/tweet/">Tweet!</a> appeared first on <a href="http://www.evilpaul.org/wp">evilpaul.org</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>Yup.. I&#8217;ve finally joined <a href="http://twitter.com/">Twitter</a>. Drop by and follow me, I&#8217;ll be talking about BHS development (and other things) as they happen.</p>
<p>Twitter username: <a href="http://twitter.com/evilpaul_atebit">evilpaul_atebit</a></p>
<p>The post <a href="http://www.evilpaul.org/wp/2011/01/13/tweet/">Tweet!</a> appeared first on <a href="http://www.evilpaul.org/wp">evilpaul.org</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.evilpaul.org/wp/2011/01/13/tweet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
