Friday, 20 November 2009

Processing the Flicker API

Digital Animation with Flicker

I've been experimenting with the Flickr Api this week and used it along with a sketch I had written previously for Chunk 16 images. I don't have that much experience of using Flickr, but it was relatively easy to use their API. The main problem I am having is that the URL I use seems to change on a daily basis. This would stop me posting an applet version on the Internet. Even if I got around this by not using my authority code I would still need to sign the applet as it gets its images from a different web site than the one where the applet started.
I used the flickr.interestingness.getList method in my URL to retreive the images. This returns the most viewed photos of the day on Flickr.
They have an excellent resource that can be used to generate the required URL. Processing doesn't need any extra libraries to use Flickr but it does require you to add 'format=json' to extras field when you fill in the details to allow it to use the images.
When you request the images you are sent an xml file with the details of the available photos. I just used Java substrings to get the info needed to build the photo URLs.

pids[i]=getTheString('photo id=');

I had to take down the images because the Flickr photos may not be licenced for derivative works...

Wednesday, 4 November 2009

Snap Happy Wedding Game

Well, after much consideration, I decided that allowing the customer to load any music file they already have on their hard drive was the only way I could see of avoiding copyrighting issues. Instead of displaying Lyrics the game will now display the details of the wedding and the names of the bridal group. This means the order form has grown a little but these things would be futher refined as the game is customised.

The copyright owners would have earned money every time a game was sold, but having to employ copyright lawyers whose fees can be over £100 an hour is not an option I would be willing to pursue right now. There is no way that applying for permission to use a different piece of music for every new order would be feasible. I could be waiting for months for a reply and the costs would be too high!

The Snappy Happenings web site has been updated and everything is now in place to receive orders. Anyone....?

Friday, 30 October 2009

Handling Copyright


After designing and coding the 'Snap Happy Wedding Game', I have ran in to an unforseen problem. I dont think it would be legal to include the lyrics and mp3 file of the couple's favourite song. This is a real disappointment. I was prepared to buy an MP3 to include with each copy of the game but as far as I can make out this would not be legal.
The wedding games I would be producing, would be for one single user, so I really can't see why I cant include a legally purchased MP3 with each game.
I could include a disclaimer that protected me from copyright infringement suits but this would have to be drawn up by a lawyer and would likely be too costly. In this case I would use the music file provided by the customer but I still wouldn't be able to include the lyrics for the song, as these are copyrighted separately.
I could write my own music and lyrics but this would probably not be as personal as the couples own favourite song. I would likely have to include a turn off music button if I chose this option.
At the moment I'm thinking of adding a load music dialog that would allow the customer to add their own choice of music. I would not be able to add any lyrics but at least this would keep it legal. (probably...?)

Saturday, 17 October 2009

Snappy Happenings


I've been working on a Snap Happy Wedding game as a present for my sister. The amount of photos increased to 30, as I didn't want to leave anybody out. I had to edit all the photo's widths so they fitted on the cards. The music plays when ten snaps have been completed.
I changed the theme to the wedding colours and tartan.
I tried to use some freeware packagers for Java to make an easily installable package, but my files are for Processing. Perhaps I should make a main java class which loads the processing code but I'm not sure how to do this and info is a bit scarce.
In the end I found a 30 day trial version of a commercial program that works great with processing applications. Unfortunately, it would cost over 200 pounds to purchase! If the project were a success it would be worth the outlay but I cant justify this cost at the moment.

The installer generates an msi setup program that is great for Windows and there is an option for OS. Shortcuts are added wherever you denote and you can even have a product key that is checked online.
The file must be zipped if it is sent by hotmail or messenger but googlemail accepts it as it is. This is strange when you consider that the msi format is a Microsoft convention...

The photos in the lyrics section have a randomised tint applied.

Tuesday, 13 October 2009

Snappy Game in Processing


I've been working on a new version of the Snappy Game in Processing. It took me only 2 days to write. Most of the time was spent editing the photographs. My neice got married recently so I did a snappy game with pictures from the wedding.
One of the many advantages of Processing is that I can write the same code and have it run as an applet or an application. Applications can be set up to run in presentation mode or in their own sized window. I used the minim library for the sound, as it is really easy to use.
When the player completes the game I have it displaying the lyrics and playing the song that was played at the wedding service. Photos of the wedding are displayed on each page and I added a randomized tint to each one. This makes the photos look different each time it is run.
If I made this service available to users, I would need to decide whether to deliver the game as an applet or an application. I kept the size of the files down by converting the photos to PNGs and making them small but the final size is still over 10MB. If the game was delivered as an applet it might take a few minutes to load and some users experience java problems running the applets. I will likely test the load time this week sometime...
The standalone version loads very quickly and has less Java problems but set up is more complicated. The user would have to extract the folder from a zip file and double click the application icon.
If I set this up as a service I would need to find a way of letting the customer send me the photos. This would need to be done by email or file upload. It takes a while to edit the images and choice of music could cause copyright problems, I'm not sure how payment for a file in a one customer game works.
The game could be set up for any event such as a wedding, party or a baby's first birthday.
I think 25 pounds would be a fair price for the work involved, If anyone would like try out the service please contact me and we could work on it. :)


Friday, 2 October 2009

Ally Boo - Catch the Birdie Game


I uploaded the latest version of the birdie game and I'm really pleased with how easy it was to write in Processing.
If this had been written in Java, I believe it would have taken months longer to write. The sound files use the minim library and there are no embarrassing pauses loading them.
I used the open source audio application Audacity to record the sound clips. My broad Scots accent and squeaky voice is ... different compared to most other kids games...lol.
I used Tune Smithy to write the background music for the game. This is an amazing application that allows you to use maths to write a tune. The pc keyboard can be used to add melodies and you can use every instrument I ever heard of and even some I haven't. This free program allows you to write original royalty free music. I'm really pleased with how the bird tweets echo the melody.
I drew the pictures and animations using Draw Plus X2 from Serif.
There are a few minor niggles to fix but the game works perfectly. Occasionally the birdie almost goes off screen but can always be found. A numerical score for the birdies and leaves may be added later.
Seeing how easy this interactive game was to write I am seriously considering porting Solundria to this format!

Tuesday, 22 September 2009

Birdie Music

I spent a whole day looking for royalty free music for the birdie game. Everything was either copyrighted or unsuitable, so decided to attempt writing some new music for it instead. I had the notion of using the keyboard to write something so I did a search on Google and eventually found an amazing program called the Tune Smithy.
I wrote a piece of music and uploaded it but it was over 6MBs and bits of it had my hubby climbing the walls. Maybe it was the high pitched flute part... anyway it was taking too long to load so I edited it down to an 18 second loop. I think it works better and I like the way the bird tweets take up the melody.
I started on the ending animation (hence the flock of birdies) when my niece, who has a 5 year old, suggested I let the child tidy the leaves up as they like to feel they are doing something. Thinking it over, this made sense, so I implemented it. I would have liked to add a sweeping brush cursor but you can't change the cursor in a Processing applet online. I suppose I could have just added an image next to the cursor...
So now I need to add a dialog and an ending for when the leaves have been picked up.

Monday, 14 September 2009

State, Activity, Bird Class and Minim

I'm recovering from a bout of flu and finding it even harder than usual, to concentrate on the logic needed to control the workflow.
At the moment I'm using booleans to control the states in the Birdie game but its getting very unwieldy and I'm beginning to think I need to factor out the bird animation into a new Bird class.
I will need to add a sound file of a bird going tweet. This should improve feedback when the birdie is clicked. The weather today is awful so I don't rate my chances of recording this today as very high. How on earth do I record this on my laptop? Does it have its own built in mike? Do I even have Audacity installed to edit the sound if I ever succeed in capturing it? Can Minim be used for the sound in the Processing applet without causing Out of Memory errors?
So my task for the week is to make a Bird class and add sound.
As I now use Processing 1.0.6 Minim is one of the standard libraries available so I didn't even need to download and unzip it.
I used the RecordPad Sound Recorder in Windows Vista and said "tweet tweet". Then I used some of the effects available to make the sound not sound like me going "tweet tweet". This produced a very strange tweety sound but lets face it, this is one very strange bird anyway!
I added my sound file to the sketch and edited the code provided by the Minim Quick Start Instructions. It worked first time and needed no more research! Thanks to the Minim team, when I remember the cartwheels I had to perform with threading and preloading to provide the sound in Solundria... this is a very welcome feature!
That Bird class really needs to be created now, as the sound is only playing the first time the birdie is clicked. I think the birdie state needs more work.
...
I added a Birdie class and this made handling the states in the game easier. I used the rewind function, after each play, so the sound now works fine. There's now a kinda score thing for each time the birdie is found.
Next week's tasks will be to add an endgame scene. I will need to find some suitable music too. The Birdie Song or Rockin Robin would've been nice but are likely copyrighted.
Latest version of Catch the Birdie. Use refresh to see latest version or start new game. feedback welcome...

Saturday, 5 September 2009

Catch The Birdie

I've started to write a game applet for Solundria using Processing.
My two year old grandson, Ally came up to visit for a week and so I decided to make a game for him.
He is a cheerful little fellow but sometimes quite fearless. He somehow managed to go diving out the backdoor, giving himself quite a nasty black eye. Then he took the doorstop and dropped it on his foot! My glasses went missing for days and then he heroically picked them up from behind a chair and handed them to me.
He went out to play in the back garden and was shouting at the birds to come down, so he could play with them, and so I thought granny would help with that.
One of the problems with writing an applet is that you don't know the size available to the game in the client's browser. I couldn't find an easy way of implementing this, so I just set the size to a default size of 800. I set the height to be 100 pixels smaller than an actual height of 600 to allow for toolbars etc.

Folder Permissions

One of the annoyances of working in Vista is the stifling user permissions. Although I have tried to set the permissions of the processing folder to be not read only, numerous times, it keeps changing them back. This means that every time I export I have to remember to untick read only both in the project folder and the applet folder. If this isn't done I get errors about the images not being found and not being able to delete the applet folder.

Applet Index Page

Every time the project was exported the index page was being overwritten again. This made the background colour, text, width and height of the applet reset to their default values. This was really annoying as I suspect the jar file had a different id number every time it was exported which caused other errors to occur. I was so peeved about having to edit the file every time that I did a search on the Processing site. There I found some great info that means I dont have to do this anymore. There is a file called applet.html in the lib folder of processing. You just need to copy this to your project's root folder and edit it with your preferred values. Now when I export as an applet the index file has the my preferred values and this has saved me a mountain of time!

GifAnimation Library

I made a stop frame animated gif of a birdie using Draw Plus X2. I also made three leaf images, although I'm not very pleased with them. I added these to the sketch folder using Sketch-Add File. I downloaded the Gif Animation library and unzipped it to Processing's Library folder. To use it you just add import gifAnimation.*; to the top of the sketch. I declared it globally as Gif myAnimation; Then to set it with the animated gif and start it off I used:
myAnimation = new Gif(this, "birdie.gif");
myAnimation.loop();
Now it can be drawn anywhere using:
image(myAnimation, xPos , yPos);

The Leaf Class

Adding the Font and Text Dialogs

Mouse Control and State

To be continued....

Friday, 28 August 2009

Send me the date - Please!

I hate to admit it but at the moment I am totally stuck! I've been working on the snappy birthday game form again.
The form takes the customer's details and sends them to a PHP form handler, that sends an email to me and then, allows the customer to choose to upload images or just pay for their game. A 'send a birthday game product' is not working at optimum capability if it doesn't include a field for the recipient's DOB. This would allow me to make sure the game is sent on the correct date!
I had originally asked the customer to write the date in the special instructions text area on PayPal. I would prefer to get this info, in the email with all the other order details though. With this in mind I researched adding a pop up calendar to the form page and thought that the YUI calendar was my best bet. I followed the simple instructions and lo and behold the calendar widget is working perfectly.
  1. The customer clicks in the birth date box and the pop up calendar displays
  2. They select a date
  3. the calendar closes
  4. The DOB is displayed in a dynamic text field
  5. they submit the form
  6. The form handler parses the data
  7. I receive the email with the appropriate details
  8. I make a Snappy Birthday game according to the details
  9. happy me :) happy customer :)
Unfortunately it only gets as far as 5! I have tried every way I can think of to get the date the customer selects and pass it to the PHP form handler and then by email to me.
The other details on the page are checked and sent when the form is submitted and if I could get at the value in the dynamic div... I'm sure it would work...
Otherwise, the customer will just have to enter the date in an input text field...
which might be easier all round, if not so pretty.
I decided just to let the customer enter the date, I've saved the YUI version in case I ever find out how to implement it.
I'm thinking of attempting to write a game in Processing. This will be an experiment to begin with but if I manage it, I might try some more game applets...

Sunday, 16 August 2009

Good Idea or I'm Dottled

I've been thinking about what sets the Solundria RPG game apart from other RPG games. It seems most successful sites and games possess their own unique brand. Many brands have their own motto or mission statement too. There's even a cool mission statement generator, that can help you write your own.
"The customer can count on me, to enthusiastically create user friendly, "outside the box", content to delight my customers.
This might suit Solundria.
I was thinking of what does Solundria have, that other game producing companies don't have. They usually have a team that can work on different aspects of the web site; but Solundria just has me...
So what can I provide that other games companies cant?
That's when I came up with my next public relations campaign:
Solundria - One of the few games designed by a granny and offering prizes with a difference!
'Escape the hell that is Solundria and win a crocheted Amigurumi figure. You may also choose a Clever Clyde or the Rabbid Wombat exclusive!
cartoon
Lets face it, false modesty aside, at crocheting I kick ass! It will take the other game sites a good 6 months to learn the syntax and even start to compete! Grannies will be hired by the thousand in an effort to keep up with the demand. Name your price grannies and hide your design patterns from prying eyes!
We will hold conferences and give talks on the basics and then provide certifications in Tunisian Crochet and Hairpin Lace.
In the spirit of open source, I would mention that Lion Brand have made all their patterns free and this will give all developers a great source of inspiration! Yes Sega, you will have problems with Sonic's spikes but there is help out there! (for a hefty fee)
You say there's someone at the door with a white lace up jacket?
to be continued.....

Friday, 14 August 2009

Test -Test - and Test Again!

I could kick myself! Solundria had loads of extra traffic this week because I used a facebook voucher. All these visitors ready to try out the hell that is Solundria....and the link was broken!
That could explain why nobody has managed to escape the dungeon yet...
Its really put a downer on my day.
I cant understand why nobody let me know, maybe I need to provide more email links on the pages!

Wednesday, 12 August 2009

Woopra - Facebook - Google Web Optimiser

Woopra is a 'real-time Web tracking and analysis application' and it shows a lot of promise. They are looking for beta testers for their new release, so I applied, of course. There are web and desktop versions of the application and you can watch your visitors in real time.
Some of the capabilities of Woopra are very powerful and a lot of fun. You can see at a glance how many visitors are using which browser and the country they are in. There is even a facility which lets you use Google maps to zone in on where the signal is coming from, but I think this is more likely to be their ISP than their residence.
Live visitors on the site can be tagged so next time they log on you will recognize them.
The developers are working on a chat facility, which apparently lets you talk to your visitors. I really think this is something I will have to stop myself from using too much. I can just imagine someone coming to Solundria and me suddenly asking them why they didn't buy a Snappy Birthday Game! The thought of it is just so comical. There will also be an option to add a chat button to the site, so that visitors can talk to you when you are available. This sounds like a really valuable feature as I have little contact with my visitors. You can set it up to give audible alerts when you set it up to report certain events. I can see it now... Ding Dong "Someone is on the Birthday game page! Quick - get them tagged and then if they leave ask them 'Hey why u not buy a game!'hee hee the mind boggles!"
My ISP provided me with $25 of free Facebook vouchers and it really increased the traffic to the site. I set it up for the homepage but if I were to pay for more I think I would drop my visitors at the Snappy Birthday Pages.
Solundria has been really dead since the voucher ran out and the traffic has virtually stopped. In fact I've never seen a day this slow before. I haven't had one visitor today! This happened yesterday too but the traffic suddenly shot up to 25 later in the day. Something has changed how my hits are recorded and I will have to check this out.
I set up the Google Web Optimiser AB experiment on my home page too. This serves one of 2 different home pages each time a visitor arrives. Then it keeps a record of which page gets the most visitors to play Solundria. Using Google's web optimiser and woopra javascript code blocks on the same page may be slowing my traffic report but I really cant understand how this could be happening.
The optimiser will run until it has enough data but at this rate I'm not holding my breath!
I used slick map to make a site map and add it to my footer on all pages. This really helped me structure the site better and I;ve added more pages like "About Us" and "Principles"
Links to be added....

Monday, 10 August 2009

Redirections

The payment process has been rewritten and now includes captcha. This helps prevent crackers from using the form in some kind of batch attack. I added the facility to upload 3 card images. This was a good step as now its something that is standard and I dont need to get customers to send their images by email. I think the max file size needs adjusting, but we will see how it goes.
After getting everything working, I decided I should do a web site backup, just in case... I used wget, which backed up most of the site. I used Filezilla to get the parts wget couldn't reach.
I set up the Solundrian.com site, because some company was trying to get me to pay hundreds of pounds to get my old domain name Solundria.com. When the domain became available again, for under 10 pounds, I quiuckly bought it. At the moment it has an experimental layout and uses different pages, but its just confusing matters. The SnappyBirthday.co.uk domain is also sitting doing nothing. I need to find out the best way to redirect these domains to solundrian.com
I found the script I needed for the redirect at Sebastion's Pamphlets. This blog looks like it is worth reading as it has a lot of sensible advice on search engines etc. It explains how to implement the redirect so Google will understand you are not trying anything dodgy by using:
meta name="robots" content="noindex,follow"
I uploaded the script and it is working well. Here's hoping google finds it ok and that there are no problems.
Next I changed the snappybirthday.co.uk link to work in much the same way and pointed it to the Snappy Birthday Game page.

Thursday, 6 August 2009

PHP-Whats that again?

The host for Solundria does not support Java so I don't have access to Icefaces etc. I had the payment process set up to use Formail but the script on the host uses a default landing page and I need to have another form for uploading images and using PayPal. I have written the pages for the uploads but I need to change the payment process to PHP only. I'm sure there must be a way to send the images by email too, but I don't know it and I really want to be doing other things.
I have been putting off refining the payment process for so long... by documenting it here I might be forced to actually complete it this time!
Here is the workflow of the process:
1: The user arrives on the snap game page where they may try out the free snap games. If they like the idea of sending a Snappy Birthday Game they click the Place Order link.
2:The order form appears. This allows the customer to enter their details. On my last tinkering attempt I managed to break this page so my number one priority is to fix this first!
I used to have a really good PHP editor called PHP2000 or something but it went commercial and I just cant justify the outlay at the moment.
I used SciTE to edit the php and found a really good online syntax checker which allowed me (eventually), to switch the page to just use PHP to send email.
Everything seems to be working correctly now but I need to check the orders are being sent correctly by email!
The orders are getting through ok but I need to find a way of keeping track of which details belong to which images. Also the customers email address is not being sent so this will also require fixing.
3: When the form details are submitted the upload images page is displayed. This allows a customer to upload up to 3 images which can be included in the birthday game. This is working as intended, but I am using a last name input to match images to details and I don't have a last name field on the details page...
Almost there though!

Wednesday, 17 June 2009

Snappy Birthday Game Launch

It has been a long time since I wrote anything for this Blog on my Java website Solundria. It has been an extremely busy time and I now have a beautiful new baby grand daughter! My other passion apart from programming is crochet and after bringing up 4 sons (who really don't appreciate crocheted articles of clothing) ,I now have a reason to pursue my other hobby! So I am multi tasking at the moment, It is surprising how much I can crochet while waiting for my pc to complete some simple task!
Anyway, back to Solundria and the reason for this blog....
Last year while visiting my granson Juan, I wrote him a very simple snap game as he is only 2. The game was written in Java so I used Java Web Start to make it available to play free to visitors to Solundria. Later I came up with the idea of providing the game as a service, to send an alternative and unusual birthday message by email.
Some months later the game is now available to play free on the site. Its a simple little game and so should be easily playable by young children. There are different versions of the game, the original version has the characters from Solundria on numbered cards including Clever Clyde who Juan really took a shine to.
There is also a version which includes images from some programs I wrote for an Open University Book. There are also a Snappy Xmas and Snappy Easter versions.
Because I am using Webstart as a delivery mechanism it took a while for me to work out a suitable payment process. At one point I even had a Processing payment GUI which took the customers choices and uploaded them by ftp to my site. When an order was submitted it also sent me an email and I could pick up orders from the site. This worked like a charm on my local machine but when I tried to get this to work with webstart there wasnt an easy method of allowing ftp transfers. Finally I designed a PHP form which is a much easier way of receiving orders. I started out with a properties file which could be used to read the properties into each ordered game. Then I discovered that the jnlp file can be used to pass in the parameters, which has made customising the Snappy Birthday Games much easier!
The game can be sent for 10 pounds GBP to any email address. This might sound a bit steep but I have to customise each copy and upload it to a personalised address for each order. There is a lot of free stuff on the site and a girl has got to eat.....T.T
The Snappy Birthday Game is available to send as a personalised birthday game and payment is handled off site by PayPal. There is also an option to get the game free with some very good offers from TrialPay. This is also handled off site so the payment details are kept secure. The offers include flowers, DVDs, books and other items that would provide a nice birthday gift and getting the Snappy game sent free with a personalised birthday message is an added bonus!
After coding all this, I now have to attract some customers to the Snappy Birthday Game, who may want to send a Happy Birthday message to someone special. Search Engine optimization is something I have not considered very carefully up to now...but I will have to find some way of publicising this unusual, unique and original new birthday product (teehee).
Apparently in order to succeed on Google you have to have some relevant links pointing to your page.
All links gratefully received!

Trial Pay


Clever Clyde will show you how to send the Snappy Birthday Game free with a personalised message from you.