Friday, September 11, 2009

Mirco controls (avr atmel) o yea

So I have been doing a lot of reading up on micro-controllers lately. I got avropendous that supports usb. The avropendous package has been nice, and I would tell anyone they should start with something like that. It is cool because you can flash the controller over usb with a couple of command from linux

sudo dfu-programmer atmega32u4 erase
sudo dfu-programmer atmega32u4 flash --debug 1 program.hex

I made a simple example of some code I found:


#define F_CPU 10000000UL
#include <avr/io.h>
#include <util/delay.h>

void delayms(uint16_t millis) {
while ( millis )
{
_delay_ms(1);
millis--;
}
}

int main(void)
{
uint8_t i;
while(1)
{
for(i=0; i<256; ++i)
{
PORTB = i; /* LED on */
delayms(10);
}
}
return 0;
}


Anyway it looks like

Sunday, July 5, 2009

Progress

So here is what Shayne got us to (no thanks to me).


Here you see one well is of a much different size.


We also are now trying SCons after a while of using pure make (wonder how long this build system will last ;)

Tuesday, June 9, 2009

Callbacks in C++

Paul pointed me to a Rich Hickey article called Callbacks in C++ Using Template Functors. It is a great paper because it pointed out many of the flaws in my earlier implementations. One implementation, in which I mostly copied the Observer pattern right out of the GoF Design Patterns book, had the big hang-up that I could only have one kind of attachment per Subject. A bigger problem with the Observer pattern as outlined in the book, though, is that any class wanting to listen to a Subject would need to inherit an Observer interface to do it. Using the callbacks implementation created in the Rich Hickey article instead, I was able to remove the Observer class altogether, and just have some function called instead. It's a great setup.

It took me a little bit just to code the callback.h file, and only implementing the one-parameter functor at that. That's when I found out I could've just gone to koders.com and picked up Joel Vennin's callback.h implementation. On the other hand I do have my own callback.h that isn't tied to any license, so I'll probably just stick with mine for now.

Some other references that I used throughout learning about callbacks were Bert Peers Callbacks in C++ which is a different perspective on the original paper, and C++ FAQ Lite on pointers-to-member-functions.

In conclusion, thanks to callbacks, I've found yet another way to unnecessarily complicate the pure simplicity of Tetris. Yep, the shear number of classes we have are going through the roof, and we haven't even begun to code, really. I can see this getting much worse than it currently is. In the end it will be worth it, because all those other simple Tetris projects were mostly for programming practice, rather than making a quality game. Yes indeed, my hope for getting this game out isn't crushed just yet. Although my hope for getting a date is certainly ground into a fine powder. Their eyes seem to glaze over when I start talking about callbacks...

Saturday, June 6, 2009

25 years of Tetris

Today Google changed there image to be made of Tetris blocks as Tetris turns 25 years old. All I have to say is the 26th year of Tetris will be the year of Tezad (at least I hope). Believe it or not we are still working the Tezad project. We have just been running into a lot of low level issues that need to be worked out. If we do it right it should provide a nice framework as we move forward.

Thursday, May 7, 2009

Eclipse Ganymede does not start on Ubuntu 9.04

So I installed ubuntu 9.04 x86-64 and downloaded eclipse and at startup I got this error:

An error has occurred. See the log file
/home/gibbs/Flex/workspace/.metadata/.log.

I googled around and finally got to this link http://forums.aptana.com/viewtopic.php?f=37&t=7147

The bottom line is you need to install xulrunner-1.8.1.3 or some older version and then set your MOZILLA_FIVE_HOME environment variable.

export MOZILLA_FIVE_HOME=/usr/lib/xulrunner-1.8.1.3/

I hope this helps someone if google leads you here and you are trying to get eclipse to work

code on

Saturday, March 28, 2009

Let it begin


So at long last the Tezad project has started to gear up. We hope to have a final release in five months or so (we work slow). The finally release should include things like online playing and will be released Window, Linux, and perhaps Mac if we are lucky.

Thursday, January 22, 2009

Tic-Tac-Toe: Released

You can get Tic-Tac-Toe by visiting the google-code stake of pezad!

It might have taken longer than expected to get Tic-Tac-Toe out the door, but when you start out with a completely clean slate, I suppose the beginnings would be a bit humble.

Yep, project Tic-Tac-Toe started out as but a glint in the eye on Oct 16, 2008. Here we are, 98 days later with a finished product. I must say the end result is much better than the hello world code that it started out as. Still, I can't help but feel a little disappointed with my efforts, considering it should take less than a day to program start to finish. In any case, we've finally got a game under our belt, and we can continue on to our next project! And hopefully it's a game that people will want to play more that a couple of minutes.

We got some great things out of this game though. We figured out how to use OpenGL, SDL, and FreeType without the help of some external framework. The graphics, while amature, fit the motif of Tic-Tac-Toe nicely. Check out the two levels of AI difficulty too, most implementations offer only one.

The most amazing thing about Tic-Tac-Toe was that, somehow, not one, not two, but THREE professional musicians agreed to do music for the game. Chad Nigh was on drums and did the mixing/producing, Kyle Moreland played the funkodyne (er, the acoustic guitar), and Blake Kresge on bass guitar. Check out Kyle's Build Yourself A Boat CD. And then buy it.

I'm not sure why I spaced out on the music credits in the game (I only gave production credit of Chad) but I can't give enough thanks to the group for the aural bliss they provided.

In conclusion: We've got game #1 out the door, let's keep it going!

Monday, January 12, 2009

You know you're a programmer when...

... you go to a Larry the Cable Guy show expecting him to talk about Linus' DVCS.

Think about it.

... you've had to explain to people why 256 is a nice round number.

... you've attempted anything other than a selection sort when playing any game involving a deck of cards.

... you view laziness as a virtue.



Enough of that. In other news, I think I've almost done everything I can for the Windows port of Tic-Tac-Toe, and soon you'll be able to download it from pezad.com and pezad-games on Google Code.