Those moments when you’re angry at your past self

I’m installing Arch Linux on my BeagleBone again. Everything’s going smoothly, and now I want to ditch the Ethernet cable. Unfortunately, when I plug in the adapter, its firmware and driver don’t get automatically loaded. I know I had this problem in the past, and I know that I found the solution. But I didn’t record what that solution was anywhere.

…Damnit, past Clay.

Ponies!

I used to dislike them.  Then I wanted to see exactly what I didn’t like.

…I’m a brony now.

Oh man, I never posted pictures of the finished BeagleBone case!

Damn I’m forgetful.  I was supposed to do that two months ago.  I’ve actually done some cool stuff with my BeagleBone now; it runs an IRC bot and puts messages from a channel onto a 128×64 OLED display from Adafruit.  Two buttons let you scroll up and down through chat history, and if you know the secret command, you can tell the bot to enable and change a chat filter so not all messages appear on the display.  I can’t believe I forgot to write about that stuff, as I rather enjoy writing a few paragraphs about stuff I do.

Terrible Consequences

I drilled the mounting holes for the BeagleBone today.  I also completely forgot that there was felt in the bottom of the box, and drilled right through into the felt.  The consequences were not really what I’d consider terrible, but the felt did come unglued and wrap around the drill bit.  It’s needless to say that the particular hole I was drilling came out somewhat larger than the others after it.

Then I realized I didn’t know how I’d mark where the connector holes would go.  The connectors were right against the front of the box, but in the inside; I’d need to get them in the same position but on the outside.  Using my human ingenuity, I decided to use the BeagleBone as a stamp.  Yes, a stamp.  With an ink pad and everything.  Like a rubber stamp, except metal and plastic.  It worked fairly well, but the client USB connector wasn’t marking anything at all.  Then, at my mom’s suggestion, I tried stamping it with the paper on a mousepad, and that got excellent results.  I stamped it on tissue paper so it could be seen clearly from the other side, and I used that to help mark the locations of the holes on the box itself.

I then drilled center holes for all three connectors, and made the real hole for the power connector.  It being about 11:00 PM by then, I realized I should go to bed before I seriously messed something up.  Besides, I’m going to take the driving test tomorrow, and I want a good night’s sleep first.  After I get back from the test, I’ll get some pictures of the box on here before trying to finish the job.  In case you didn’t figure it out, I’m awfully excited about this little computer.

Back from SC with a BeagleBone case

A wooden box with light sides and a dark lid.I just got back from a one week vacation to North Myrtle Beach, SC visiting my grandmother.  The whole time we were there, I was looking for potential BeagleBone cases everywhere I could.  I finally found one when we stopped at a flea market on the way home.  It’s a very nice wooden box that’s just about a perfect size for the BeagleBone, a cape or two, and some extra room for WiFi modules, etc.

 

A wooden box with light sides, its dark lid removed and sitting next to it.To open the box, you simply press down on one end of the lid.  The other end rocks up, and the lid can be easily lifted off of the box.

 

 

A wooden box with light sides and its lid removed.  There is a BeagleBone computer sitting inside the box.As mentioned before, the BeagleBone fits in quite nicely.  Here you can see the ‘Bone sitting in the box (it’s sitting so high because I’m temporarily holding standoffs onto the board using screws that are way too long).

 

 

A wooden box with light sides and its lid removed.  A BeagleBone computer sits inside.And finally, a better view of how the ‘Bone fits in the box.

 

 

 

The box wasn’t cheap ($23), but it was hand-made by the guy who sold it to me, it seems well-built, and it looks very nice.  I thought it seemed like a fair deal, so I bought it.  I’m not quite sure how I’ll mount the ‘Bone inside, though.  The box’s sides are too thick for most panel-mount connectors I’ve found at reasonable prices, so it might be best to just drill holes carefully for all the connectors on one side, and leave the other side’s connectors internal.  I also might want to remove the felt from the bottom of the box before drilling holes to mount the BeagleBone.  Or maybe I could just drill the holes right through the felt.  That wouldn’t have any terrible consequences, right?

Randomly Dithered Images

At this point, I don’t remember what put this idea in my head. I recently started thinking about what would happen if I displayed an image by generating random numbers and comparing those numbers to the values of the pixels. I figured that it wouldn’t look very good, and with a bit of searching, my suspicions were confirmed. Then I thought that it might look better if it’s drawn repeatedly, as quickly as possible. First I thought of doing this in black and white, but then I realized color would be just as easily possible. So last night, instead of trying to sleep like a normal human, I got hacking. The result is horribly error-prone and horribly inefficient, but it works. You can download the source code from GitHub. Instructions for compiling and usage can be found in a comment above the main function in the code.

I’ll give you a moment to look at your porn in 3 bit glory test it out on some images.

I might try displaying things that way with my Beaglebone, when it arrives. I’m getting a tiny black and white 1″ diagonal OLED screen to connect to it, and I’d like to see how the ‘bone can handle something like that.

Okay, I’d better end this post now. Just after writing that, the Beaglebone arrived. Extreme excitement time!

Entities

Anything that can change in Intelligence will be an entity. The static parts of a map are the quadtree, the changing parts are entities. The quadtree can influence entities (collisions, treadmill floors, etc.), but for the most part it’ll be passive. I have quadtree loading and drawing working fully already, so next I clearly need to work on entities. But they’ll be basically all of the game, so I’m not really sure where to begin on them. They’re…complicated.  They will have one or more functions governing their behavior (I might conceivably want more than one; for instance, one for player controls and one for physics), a position, a texture (which may be animated, and a behavior function will take care of animation), a size, and maybe some more properties I haven’t thought of yet. They’ll need to be able to give messages to the player through text, and run around on predetermined paths. I’ll need the possibility of multiple player characters which can be switched through while playing a level, and perhaps I’ll need to be able to have the level control one of those player characters while he’s not being controlled. It’s some complicated stuff, but I think I can manage it.

Basically, once it’s done, the main loop of the game will be incredibly simple. Just update every entity, draw the quadtree, draw every entity. Do this synced to the screen’s refresh rate, and you’ve got yourself a fully playable game. Obviously, the most important part is the entities, so I need to get started on them. I guess first I need to figure out what all they need in their main structure (which I basically figured out above), and then make that structure and some functions to work with instances of it. Then put one of those in the map structure, start making some simple behavior functions, and see how it goes from there. The ones for AI and such will definitely be the most interesting, and they’ll have to have some variables which can be controlled in the map files on disk. This probably doesn’t make sense to anyone but myself, but getting my thoughts written down definitely helps me organize them.

This has been quite helpful. I’ll try writing about tricky problems to help solve them more in the future.

Follow

Get every new post delivered to your Inbox.