Computer Science

Shuttle Crash – NASA International Space Apps Challenge Responce

Last weekend (20th-21st) was the NASA International Space Apps Challenge – the galaxy’s largest Hackathon.  Over 9000 people took part in the event from all across the globe, including myself.

The night before the event, Andrei Zisu and I were looking through the challenges (of which there were very many) trying to decide which one to do.  Eventually we decided on a response to ‘Reach For The Stars’ in the form of a Space Shuttle Flight Simulator game.  My preferred programming language for something like this would be Objetive-C (to make an iPhone app) but Andrei insisted on JavaScript so it could be completely cross platform compatible, resulting in me taking a crash course in JavaScript that night.

The idea of the Space Shuttle Flight Simulator (ironically dubbed Shuttle Crash) was to get the younger generation more interested in NASA and Physics.  They would be given a distance that the space shuttle had to travel from the International Space Station back to Earth, and would initially be able to change a parameter of the Space Shuttle to allow them to travel this distance.  As the game progressed, more and more parameters would become available until the game structure looked something like below (which used a lovely user interface – pairs of keys on the top alphabetic line of your keyboard adjusted individual variables – e.g. ‘q’ decreases Ship Length, ‘w’ increased it, and ‘e’ and ‘r’ did the same for Wing Span etc.

Shuttle Crash - Game Play Photo - Shows shuttle at IIS about to launch to Earth with parameters along the top.
Shuttle Crash – Nasa App Challenge

Having arrived at the department building (it was been held in our Computer Science building) and having picked up our awesome T-Shirts, we got to work choosing a JavaScript game engine that would allow us to make a canvas to work on.  We finally selected JSGameSoup because it had everything we needed (event management, entity management, sprites, collision detection, a state machine and of course canvas functionality), or so we thought, since we realised near the end of the challenge that we were going to have to program parallax effect ourselves!

Once we’d selected JSGameSoup, we worked through until about half-past midnight (albeit with numerous breaks for pizza, sandwiches, tea/coffee, nerf gun fights and for sending amusing messages via the live video feeds to other locations), by which time we had most of the basic functionality up.  During the evening we also had a Google Hangout with Tallahassee (organised via messages on sheets of paper held up to the live video cameras) which was awesome.

On Sunday Morning, we had only fractionally over 6 hours to finish the project (having started quite early).  Various problems (such as finding appropriate images of the IIS, flipping the writing on our shuttle, introducing a state machine and adding more fire to the Shuttle’s exhaust) sucked up way more time than we thought.  We also found out we had to give a presentation on our project, which we used as an opportunity to show how more fire and explosions would, when implemented, make our game much more fun, with a 5 second clip of a rather fiery video!

We did get a demonstrable game for the presentation, which we are going to keep on working on, probably after exams or at next years event.  All the code is open source on GitHub, and you can view the original project page here on the Space Apps Challenge website.  You can also play the game here.

Unfortunately, we didn’t come in the top 3 at the event, partially because our project wasn’t all that ‘eye-catching’ because we concentrated more on the back end rather than the front end.  Perhaps that’s something we should do differently next time.  Anyway – some of the other projects were pretty good and equally deserving – one group made an incredible cross-platforms app to help you spot the IIS.  Whether it was the social aspect, nerf-gun aspect or the creative aspect that I most enjoyed, I can’t wait for next year!

Computer Science CPU Project

Mum, I’m Building a CPU – 8-Bit Full Adder

The latest episode of the Unicputeam project has been published, so I’ve included it below. In this episode, Andrei talks about how the 8bit ripple adder works, which we will build on next time with a discussion of how the subtractor works.

Computer Science

WordPress Image Editor Disabled? Thumbnails Not Been Made? You Need GD Library!

Whilst trying to create my photo galleries, I was running into problem after problem – WordPress wasn’t automatically generating the thumbnails (so the images on the gallery page was 5000px long!)

After searching around, and reading some ridiculous things (such as having to make sure the functions.php had no blank lines) I found I needed GD Library installed for WordPress to be able to manipulate images.  Luckily I wasn’t going to have to navigate the endless maze of hosting company ‘technical support’ because I manage my own server, which runs CentOS 5.6 with WHM/cPanel.

GD Library is natively a C application however wrappers have been written for PHP, so you can dynamically create and edit images in a variety of formats.  Most server OS’s have it pre-installed, and if its’s not you should easily be able to get it from a repository.

There are two install methods I found worked on my servers.

If you want to use the terminal, run this to check if GD Library is already installed:

php -m

 you can then install GD Library using YUM by running:

yum install php-gd
service httpd restart

Or, if you have WHM/cPanel and would like to use it’s interface, you can!

  • Open WHM and go to Software > Easy Apache
  • Carry on through and don’t change any of the settings until you get to “Exhaustive Options” (Step 5)
  • You’ll find the option for GD Library under PHP.  Check the box, and carry on to build.
  • Go get a coffee – don’t interupt the process unless you want to risk messing your server up!
  • Restart Apache (using ‘service https restart’)
  • Finished!

Now when you go back to WordPress you should find thumbnails are automatically generated on upload and the image editor is available.