Things in Jars

Simon Madine (thingsinjars)

@thingsinjarsFollow me on Twitter

Hi, I’m Simon Madine and I make digital toys and write guides on web development.

I'm a senior web dev and evangelist for Nokia Maps in Berlin.

  • Twitter
  • Flickr
  • GitHub
  • Forrst
  • Shelvist
  • Last.FM
  • RSS
  • Open Source Ideas

    Written 30 Oct 2009

    Ideas

    All too often, I have ideas which might make a cool website or iPhone app or whatever and I know I just don't have the time to build them. I'm going to post them here in the hope that someone else might find a use for them. These ideas might already be in existence, of course. I'm not claiming they are unique in any way (although some might be).

    You are free to take these ideas and do whatever you like with them. Of course, if they become amazingly successful, I could do with a bigger TV...

    Comments

  • Web Page Screensavers

    Written 3 May 2012

    Ideas,Geek

    I don't find myself using screensavers that much these days. Sure, they made sense when you needed to avoid burning a ghost of the windows start bar into your CRT monitor but with TFTs, LEDs, projectors, OLEDs and whatever else, it's rare you'll find hardware that actually needs protecting like that any more. On top of that, in my case, I'm either at my desk coding or at the coffee machine refilling. There aren't that many opportunities for me to appreciate a warp-speed starfield or some infinite pipes.

    What I'm saying is: I miss screensavers.

    Since I started writing for CreativeJS, I've seen a lot more examples of clever, cool, pretty and downright creative demos and toys written in JS than I ever had before. You can probably figure out where I'm heading with this: these would make cool screensavers.

    A quick bit of googling later and I found a couple of applications that let you set a web-page fullscreen as your screensaver. Of course, you can't just set any old demo as your screensaver, many of them rely on user interaction which kinda defeats the purpose.

    Downloads

    OS X

    WebSaver

    Unfortunately, this uses plain-old standard WebKit so no WebGL demos. Maybe someone can fork Chromium to make it do this.

    Windows

    web-page-screensaver

    This one seems to be based on IE so it probably won't work with the canvas-based demos below. If you can point me to a WebKit-based one, I'll include that instead.

    Old-school screensavers

    Flying Windows

    http://dl.dropbox.com/u/16145652/flying/flying.html

    Starfield by Chiptune

    http://www.chiptune.com/starfield/starfield.html

    Non-canvas

    Insta-Art by me

    http://thelab.thingsinjars.com/insta-art.html

    Newsola by Nick Nicholaou

    http://www.newsola.com/#/uk

    Canvas

    Falling blocks by Lionel Tardy

    http://experiments.lionel.me/blocs

    MMOSteroids by Seb Lee-Delisle

    http://seb.ly/demos/MMOsteroids.html

    Origami by Hakim El Hattab

    http://hakim.se/experiments/html5/origami/

    The Single Lane Superhighway by Aaron Koblin and Mr.doob

    http://www.thesinglelanesuperhighway.com/

    Ablaze by Patrick Gunderson

    http://theorigin.net/ablazejs/

    Visual Random by Dimitrii Pokrovskii

    http://voxelrain.appspot.com/

    Circle Worm by Ilari

    http://style.purkki.ilric.org/projects/js_wave/

    Boids by Jason Sundram

    http://viz.runningwithdata.com/boids/

    3D Globe by Peter Nederlof

    http://peterned.home.xs4all.nl/demooo/

    WebGL Needed

    Just in case someone in the comments finds a WebGL-capable screensaver, here are the demos I liked that require WebGL.

    Clouds by Mr.doob

    http://mrdoob.com/lab/javascript/webgl/clouds/

    WaterStretch by Edouard Coulon

    http://waterstretch.ecoulon.com/

    Further Development

    The ideal screensaver would allow you to enter several different URLs to allow you to easily save them. There should also be a checkbox to mark demos as 'works offline'. That way, when the screensaver starts, it checks for connectivity displays a screensaver that doesn't require a connection.

    Add your suggestions below.

    Comments

  • Sine

    Written 21 Oct 2011

    Development,Geek,Ideas,Toys

    Another game concept prototype – Sine

    Honestly, I have no idea what I was going for with this one. It started off last weekend with a vague idea about matching patterns of numbers and old-school graphics and I don't know what and ended up with this.

    The idea is to make the bottom row match the top row, basically. There are several front-ends to this game so you can choose the style of play you prefer - numbers and letters, waves, colours or a generated sound wave (if you have a shiny new-fangled browser). It uses the nifty little Riffwave library to generate PCM data and push it into an audio element.

    Further development

    If I were to develop this further, I'd try and build it in a modular fashion so that front-ends could be generated really easily and open it to other people to see how many different ways this game could be played. It'd be an interesting social experiment to be able to play what is fundamentally the same game in a dozen different ways. You could find out if visual thinkers processed the information faster than numerical or audio-focused people. Leaderboards could allow different styles of player to compete on the same playing field but with a different ball (hmm, weak sports analogy). The rhythms of the game lend themselves well to generated drum tracks so there's probably something in that area for exploring as well.

    At the moment, the code is written as the programming equivalent of stream-of-consciousness – global variables everywhere, some camel-case, some underscored, vague comments sprinkled around. There's some commented-out code for the wave mode that moves the waves closer together so that there's a time-limit set but I felt it didn't suit the game.

    Warning

    The audio mode is very annoying. Seriously. If I were still a full-time game designer, I would not release this due to public health concerns. As I'm now an enthusiastic amateur, here you go :D

    Comments

  • Multi-user pages

    Written 18 Jul 2011

    Toys,Javascript,Ideas

    Whenever I'm away from home, my usual stream of random ideas tends to become more focused on projects involving sharing. Usually something about creating a connection between people where the interaction point is the Internet. This is what first inspired the now defunct MonkeyTV project back in 2007 or noodler.net in 2008 – both created while I was living in Tokyo as ways to connect to people back in Edinburgh.

    Until the beginning of August, I'm in Berlin finding somewhere to live while Jenni and Oskar are in Edinburgh packing up our flat (although, I'm not entirely sure Oskar is doing much more than drooling over packing boxes). The result of this is that I started to wonder about how to best show Jenni some of the flats I'm looking at remotely. What I figured I wanted was a way for us both to be looking at the same web page and for each of us to be able to point out things to the other. I tidied up my idea and posted it to the Made By Ideas site hoping that someone else would run off and make it so I could focus on apartment hunting.

    The inevitable happened, I couldn't let it lie:

    Multi-user page (installable bookmarklet).

    If you install that bookmarklet by draggin’ it to your bookmarks bar then launch it anywhere, your cursor position and how far you've scrolled the page will be sent to anyone else viewing the same page who has also launched it. If you launch it on this page just by clicking it just now, you'll see cursors from other people reading this post who've also clicked it.

    Technical

    This is built in node.js with socket.io.

    It heavily reuses Jeff Kreeftmeijer's multiple user cursor experiment but updated to use socket.io v0.7. I also used the socket.io 'rooms' feature to contain clients to a given window.location.href so that it could be launched on any page and interactions would only appear to users on that same page. I also removed the 'speak' feature to simplify things. I'm planning on talking via Skype when I'm using it. In theory, mouse events other than cursor coordinates and scroll could be shared – keyboard input, clicks, selects.

    The day after I built this, Christian Heilmann pointed out on twitter a different solution to the same problem. Browser Mirror uses the same technology (node + websockets) but instead of passing cursor positions, it passes the entire DOM of the page from the instigator's computer to their node relay and then out to any invited viewers. This approach gets round a lot of the problems and is probably a more robust solution, all in all. They also have an integrated chat feature.

    Warning

    The server side is running on a borrowed VPS. It's not even been daemonised using Forever so it might fall over and not come back up. Don't rely on this for anything, just think of it as a point of interest.

    The Code

    I'm not really going to do any further development with it but for interest, here's the node.js server, almost entirely Jeff Kreeftmeijer's work but updated for the latest socket.io

    var sys = require('sys'),
        http = require('http'),
        io = require('socket.io').listen(8000),
        log = sys.puts;
    
    io.sockets.on('connection', function (socket) {
    	socket.on('set location', function (name) {
    	    socket.set('location', name, function () { socket.emit('ready'); });
    		socket.join(name);
    	});
    	socket.on('message', function (request) {
    		socket.get('location', function (err, name) {
    			if(request.action != 'close' && request.action != 'move' && request.action != 'scroll') {
    				log('Invalid request:' + "\n" + request);
    				return false;
    			}
    			request.id = socket.id;
    			socket.broadcast.to(name).json.send(request);
    		});
    	});
    	socket.on('disconnect', function () {
    		socket.broadcast.json.send({'id': socket.id, 'action': 'close'});
    	});
    });

    And here's a bit of the client-side JS that I modified to connect via socket.io v0.7 (again, modified from Jeff Kreeftmeijer's):

    
    var socket = io.connect('http://yourserver.com', {port: 8000}),
    socket.on('connect', function() {
    	socket.emit('set location', window.location.href);
    	socket.on('message', function(data){
        if(data['action'] == 'close'){
          $('#mouse_'+data['id']).remove();
        } else if(data['action'] == 'move'){
          move(data);
        } else if(data['action'] == 'scroll'){
    			clearTimeout(noscrolltimeout);
    			disabled = true;
          scroll(data);
    			noscrolltimeout = setTimeout('disabled = false;',2000);
        };
      });
    });

    If you'd like to snoop around the code more, it's all available on the lab: Multi-user pages

    Props to Andrew for letting me use his server, by the way. It was enough hassle having to learn node for this little experiment, he saved me from having to build my own.

    Comments

  • Torch

    Written 11 Jul 2011

    Ideas,Geek,Development,Toys

    Concept

    Another proof-of-concept game design prototype. This is kind of a puzzle game. Ish. It's mostly a simple maze game but one in which you can't see the walls. You can see the goal all the time but you are limited to only being able to see the immediate area and any items lit up by your torch. You control by touching or clicking near the torch. The character will walk towards as long as you hold down. You can move around and it'll follow.

    Torch v0.1

    The first 10 levels are very easy and take practically no time at all. After that, they get progressively harder for a while before reaching a limit (somewhere around level 50, I think). The levels are procedurally generated from a pre-determined seed so it would be possible to share high scores on progression or time taken without having to code hundreds of individual levels.

    Items that could be found around the maze (but aren't included in this prototype) include:

    • Spare torches which can be dropped in an area and left to cast a light
    • Entrance/exit swap so that you can retrace your steps to complete the level
    • Lightning which displays the entire maze for a few seconds (but removes any dropped torches)
    • Maze flips which flip the maze horizontally or vertically to disorient you.

    I worked on this for a few months (off and on) and found it to be particularly entertaining with background sound effects of dripping water, shuffling feet with every step, distant thunder rumbling. It can be very atmospheric and archaeological at times.

    Half-way through a level, two torches dropped
    Torch, the game

    Slightly technical bit

    The game loop and draw controls are lifted almost line-for-line from this Opera Dev article on building a simple ray-casting engine. I discarded the main focus of the article - building a 3D first-person view - and used the top-down mini map bit on its own. The rays of light emanating from the torch are actually the rays cast by the engine to determine visible surfaces. It's the same trick as used in Wolfenstein 3D but with fewer uniforms. It's all rendered on a canvas using basic drawing functionality.

    The audio is an interesting, complicated and confusing thing. If I were starting again, I'd look at integrating an existing sound manager. In fact, I'd probably use an entire game engine (something like impact.js, most likely) but it was handy to remember how I used to do stuff back in the days when I actually made games for a living. Most of all, I'd recommend not looking too closely at the code and instead focusing on the concept.

    Go, make.

    As with Knot from my previous blog post, I'm not going to do anything with this concept as I'm about to start a big, new job in a big, new country and I wanted to empty out my ‘To do’ folder. The code's so scrappy, I'm not going to put it up on GitHub along with my other stuff, I seriously do recommend taking the concept on its own. If you are really keen on seeing the original code, it's all unminified on the site so you can just grab it from there.

    The usual rules apply, if you make something from it that makes you a huge heap of neverending cash, a credit would be nice and, if you felt generous, you could always buy me a larger TV.

    Torch v0.1

    Comments

  • older posts

Browse articles by category:

Toys, Guides, Opinion, Geek, Non-geek, Development, Design, CSS, JS, Open-source Ideas, Cartoons, Photos

Recent side-projects

  • Insta-Art
  • 8-Bit Alpha
  • Shelvi.st
  • The Elementals
  • Harmonious

Toys

Find my digital toys at thelab.thingsinjars.com.

Contact

Send me a message via Twitter.

Adopt-a-Museum

@thingsinjars:

    © 2012 Simon Madine