The binary-bitmap conversion portion of the BBC has already been discussed and is in development. But there are many other aspects of this part of the program that need to be considered, including a physics engine and the motion of the letters. One thing that’s been bugging me is how the letters will react when they run into one another.
Let’s assume that two letters, an ‘A’ and a ‘B’ are floating around in their predetermined environment. They run into each other–what happens?
First of all, we need to clearly define what consitutes a character. There are 256 pixels in the 16×16 square, yes, but most of the border consists of ‘0’s–white space. Is it going to be considered a collision when the outer white pixels of the bitmap collide, or are we going to go with a more literal description of the letters running into each other, i.e. the black pixels (‘1’s)?
I think the second idea makes more sense, even though in computer logic the bitmap touches the other bitmap when the 16×16 squares meet, which causes a kind of predicament for us. The crazy thing about going with option 2 is that it will cause a morphing in the bitmap of at least one of the letters, even before the actual collision takes place. In other words, the ‘A’ bitmap will already change before the genetic code is activated.
Purple shows changed pixels:
0000000000000000
0000000000000000
0001111111000000
0001111111100000
0001000000110000
0001000000010000
0001000000010000
0001000000110000
0001111111100000
0001111111110000
0001000000010000 ‘A’ bitmap becomes:
00000000000001000000010000 0000000000000100
00000001000001000000110000 0000000100000100
00000011100001111111100000 0000001110000111
00000010100001111111000000 0000001010000111
00000110110000000000000000 0000011011000000
0000010001000000 0000010001000000
0000110001100000 0000110001100000
0000100000100000 0000100000100000
0000100000100000 0000100000100000
0001111111110000 0001111111110000
0001111111110000 0001111111110000
0001000000010000 0001000000010000
0011000000011000 0011000000011000
0010000000001000 0010000000001000
0110000000001100 0110000000001100
0000000000000000 0000000000000000
One way around this is to make the border ‘0’s (white pixels) invisible, or transparent to the other letters. Also, we could somehow use them so that when the outer pixels of two letters collide, they activate some sort of “signal” (probably a specific function in the code) that a collision is imminent and that the decision-making procedure needs to occur. Maybe this could even change the white pixels to a different color as an extra visual aid to show that a collision is about to take place somewhere within the soup–a way to highlight the action. Just a thought.
Before: Collision Imminent!
0000000000000000 0000000000000100
0000000100000000 0000000100000100
0000001110000000 0000001110000111
0000001010000000 0000001010000111
0000011011000000 0000011011000000
0000010001000000 0000010001000000
0000110001100000 0000110001100000
0000100000100000 0000100000100000
0000100000100000 0000100000100000
0001111111110000 0001111111110000
0001111111110000 0001111111110000
0001000000010000 0001000000010000
0011000000011000 0011000000011000
0010000000001000 0010000000001000
0110000000001100 0110000000001100
0000000000000000 0000000000000000
The fight-or-flight function, another good chance for GP to help with decision-making, will then determine: Do I, as an ‘A’…
1. continue toward the ‘B’ (attack),
2. change direction to avoid ‘B’ (retreat),
3. breed with ‘B’ (perform GA/GP)?
The thing is, both letters will be running this function to determine the best course of action. It would be interesting in this scenario to see what would happen if ‘A’ tried attacking while ‘B’ decided to activate the genetic algorithm. What would happen? Who would win? Maybe the program would crash and we’d need to tweak it, but whatever–this is just a brainstorming session.
All this can be figured out. I think the main problem with the white borders in a bitmap will be aesthetics: the collision wouldn’t really look like a collision if just the outer empty sections of the letter boxes are running into each other. We can go with the highlighting/color-changing idea, or maybe we can implement some sort of overlap in the outer white pixels on the bitmaps to show more precise-looking collisions. The speed of the letter movement could also be enough to distract the user’s eye from the extra white space. Then again, as small as a 16×16 bitmap is, the difference is probably subtle enough that it won’t even be noticeable.