naive implementation II i've been posting about it enough. i've been thinking it constantly over the past month. free space. boxes of free space. boxes of used space. unused space. placement algorithms. window-manager-like. boundary. grid. free space grid. 128 x 128.
block placement algorithm. bin-packing like algorithm. real-time context. bit manipulation, bit shifting, bit-masks, data types. speed. so i make a video for you all to see. i post it also to a non-arts related list, but linux related. and then i decide after writing so much and posting it here, why do i not just write it in my website's journal. so i do. i write it up and then watch the video trying to assess what people who are not me might see. all this time i always think there's a chance people won't see anything interesting here. but after writing the journal entry for my website i watch the video again and suddenly i look at it and it's dull and quite boring. like something they were doing in the sixties. like a screen saver from the nineties. all the work i put into it evaporates. all the effort i put into it so it would make efficient usage of memory while performing fast - meaning i had to use bit-twiddling-hacks (a google search term for you if ever you needed one). so why do i let it out into the world knowing it looks so dated? if they could have done that in the sixties... put another way, if me being me, could i have done it in the sixties? no, there were no such thing as home computers. and so why don't i make all the boxes pretty and different colours using OpenGL or SDL or some other graphics library more suitable for impression people? because it's prototyping, it's research, it's under development. i don't need boxes rendered in pretty colours to test the algorithms i've coded. the simplest method is enough to see if it's working or not, and in fact, any other more fanciful rendering would be a major distraction for my easily distract-able brain. so is it a naive implementation? for every box that appears, depending on where it appears and the placement strategy used to discover where it could be placed, anywhere from a tiny portion of the grid, to the entire grid, was scanned by the algorithm. well, the bit-twiddling stuff means that a one element in the array can represent up to 64 elements in the grid. so if we create a 64bit binary mask, and we have an offset of N 0s and then a width of N 1s followed by more 0s, we can test with a single condition if that width will fit where we think it might. so that does improve things. But what about implementations of Conway's Game of Life? The grids they use are... very big, much bigger... I don't think that's a fair comparison. But I don't know for sure. One day it will be pretty, and each box that appears will send forth MIDI note-on messages to synthesizers, sequencing, and each box that disappears will send MIDI note-off messages to those same synthesizers, and keyboards or other sequencers will play into the grid, blocking the boxes and adding to them. and it will all still be good in my eyes at least. but that's sure a long way off. _______________________________________________ NetBehaviour mailing list [email protected] http://www.netbehaviour.org/mailman/listinfo/netbehaviour
