Latest AS3 state engine on new area in Google Code
I’ve been plugging away on my AS3 state engine, and with a side-trip through repo-learning land, I think I finally am at a point I can return to the work that I get paid for
!.
In any event, I messed up a Google Code project in my Git experiment, so the new home for the AS3 state engine is http://code.google.com/p/flash-state-engine. I created a simple example to demonstrate it, a digital watch. I will add more examples as time goes on. Thanks to Zjnue Brzavi for his help in combing through the code to reveal bugs that demonstrate I shouldn’t be coding/developing too late at night. He is developing a haXe port, though as I re-implemented the engine in AS3, I also have been mucking around with the API–sorry, Zjnue!
Moving back into Subversion
Over the past few days, I’ve been struggling to get a simple process for converting my Git repo into an SVN repo for upload/changes to Google Code. In spite of the artices I mentioned, it was a real struggle and I’m just not ready to spend the time to figure it all out — I give up, Google Code, I am going back to Subversion / Tortoise. Of course the latter is a very nice tool/environment, but it just works so well with Google Code that I can’t justify more time in trying to finagle Git and Google Code to cooperate. Also, my repo is pretty small, so maybe in a few months when I’ve forgotten the pain over the last few days, I’ll take another shot.
A few nice resources that helped me get started with Git and Google Code
I thought I would be pretty trendy and use Git for my Google Code project, though reading a bit through the Google Code docs tells me that SVN still reigns (some docs are old, though).
I originally had installed Cygwin on my Windows machine to use with Git, but I saw that msysgit makes the process easier, and of course I prefer easier. I am a bit concerned that when setting up Git, I chose the Windows options, and I don’t know how that will affect my downloads on non-Windows machines. A challenge for a later day.
I muddled through my first commit using the GUI provided with msysgit — very nice, lots of buttons to muck about with. It seems like I got it after one or two tries. I had created a new folder for my code and documentation, then git init to create the repository. A few minutes later, with the code in the folders, I made my first commit. Yay!
After I installed Git, I started watching Scott Chacon’s video tutorials. They gave me a whole new set of commands to play with, which I did through the Git Bash (shell), but comparing those commands with what I could see in the Git GUI, I got a better idea of what I was doing.
Emboldened by the appearance of success (though I still have my doubts), I decided to put my code on GitHub, so everyone who is waiting on the edge of their seat for my code can get access immediately. The GitHub documentation was pretty gentle, and helped me to commit my code there, only after a few tries. Through the Git Bash, I tried to create a remote origin and then push my stuff, but I kept getting GitHub to hang up on my process. Then I saw I had to give GitHub my public RSA key, which is probably why it kept hanging up on me. I could generate the key through Git Bash, then set it to the account. I’m not sure if I have to make a new key for each repository, but again, not my problem right now. A few more minutes later and the sweet smell of success!
Now I’m off to see how to synchronize GitHub with Google Code, or at least my local Git reposity with my Google Code repository. I found an article from last year about this, “Develop with Git on a Google Code Project“. Stay tuned…
[Update, 4PM]
Trying to follow the article above (Develop with Git on a…), I got frustrated for two reasons. First, because of the ambiguity I thought in the line:
First we perform the equivalent of a svn checkout. In an empty subdirectory, run:
$ git svn clone --username your-name -s https://your-project.googlecode.com/svn
Which username, the one for Google Code or the one for Git? It was pretty obviously the Google Code username, no problem. But “in an empty subdirectory”? Subdirectory of my Git repository? Any folder? Again, trying to remain calm, I figured a subdirectory of my repository. So I created one, then I changed into it. Finally, I was ready:
git svn clone --username myname https://flashsim-state-engine.googlecode.com/svn
Argh! Unexpected errors after it created the clone. I spent the next 45 minutes clearing things out (couldn’t find a Git command for removing a clone, so the ol’ rm seemed to work in the end). Nothing doing, I was almost ready to give up. Once it looked like it was working, it would ask for my password. Which password? I found the password on Google Code, Profile, Settings. Great! But I was still getting problems.
Time to search for more help on Google. I came across this article, by digitaleagle, regarding trying to get Git and Google Code to work together. I was very grateful the blogger had put a transcript of commands, so I could verify I was creating the right subdirectory.
Second issue I had–it then dawned on me that my code project is at “flashsim-state-engines”, not “flashsim-state-engine”. When I repeated the steps, voila!
So apparently I have my code now on Google Code and on GitHub. I see in Git GUI there is a place for a remote push — I wonder if I can hook it up right through the GUI (that would be nice). I’m not betting on it because it doesn’t seem to ask for all the info that was explained.
[Update, 4:45]
Seemed like it was uploading stuff, but on my Google Code page there is nothing. Bummer. I also saw this follow-up article to one of the previous articles, and it got the uploads started, but I don’t see anything in my Google Code page.
[Update, 5:30]
In a true Homer Simpson moment, I realized what the problem was. I had set my Google Code to use Mercurial versioning, since the comment there said it was for systems like Git. All this time making a subversion-compatible upload, I didn’t think I would have to set the versioning to Subversion. Needless to say, when I switched the option over to Subversion (in the Administer tab), I saw my code in all its glory. Yay!
Packaging my Hierarchical State Machine implementation for AS 3.0
It has been a long time in coming, but I am finally getting ready to release our alpha version of our hierarchical state machine for Flash ActionScript 3.0!
I will be writing blog entries over the next few weeks as I document my path to release. It hasn’t been hard to organize things, but I’ve certainly benefitted from finding blog posts about installing or doing this or that.
To begin the process, I created a Google Code project here. I had to choose a version control system for the code, so I chose Git. I was using Tortoise SVN for other projects, but I have heard good things about Git, and the idea of allowing others to fork projects without creating a whole new project was really intriguing to me. I have only had mild encounters with Flex, but I certainly believe that one of the great values in making a state machine implementation is going to be integrating the engine into Flex. However, I’m not the guy to do it well. Therefore, I’m trying to appeal to others who are more familiar to create a Flex fork, perhaps, or maybe haXe, and allow these other projects to influence where I might go with the AS3 implementation. The wonderful thing about not understanding all of this is that I am not limited to what the things actually do, only what I believe they should do
!
I have been developing the AS3 code in FlashDevelop, which is wonderful (needless to say). While of course I have Flash CS4, on my kick-ass iCore 7 Vista machine, the ActionScript editor inside Flash becomes painfully slow with only 1 or 2 pages of code, especially when I start typing things inside quotation marks. I’m now cleaning up the comments and generating the documentation via ASDoc. FlashDevelop has a command to initiate ASDoc, you just have to provide a few key pieces of information. For example, for AS 3, FlashDevelop requires you to specify where asdoc.exe resides. I have Flex Builder and the Flex SDK, so it was simple to navigate over to the sdk/ folder, find the latest version (3.3), and point to it inside the bin/ folder.
The Adobe Flex docs are pretty good for helping to understand the tags for ASDoc.
