James Sweet's Blog A blog and portfolio to demonstrate my work, focusing on visualisation

13Jan/120

Pong – States

I have continued my work on my pong game and have taken the rough game that was just a single file of code and refactored it to separate some classes out.

I have also now added states (just enums and if statements) for a main menu and a pause state for the game. Now that I have these, I want to refactor them into their own classes and then expand the menus to have options that can be selected with the mouse.

Menu State:

Pause State:

Tagged as: , , No Comments
11Jan/120

And Were Back

There seemed to be some DNS issues with this site during the day. I could get access to it yesterday, but when I tried this morning it wasn't there. Confusingly I could get access to another site that was on the same web server with a different virtual host and all the same DNS settings as this.

This was a problem because a subversion repository that me and some other developers use is also hosted on this domain and the access to that went as well.

All issues seem to be fixed now however.

Filed under: General No Comments
10Jan/120

Moved Domain Registrar

I realised that my domain names were up for renewal at the start of the next month, so I decided that I would do my part and take a stance against SOPA. And so, I now have my domains registered with Namecheap, which, along with being against SOPA, are also cheaper than GoDaddy (my old registrar).

Back to games, I am trying to work on implementing game states into my pong game to allow me to create menus easier. Whilst I am not sure if is the best way to accomplish this task, I am taking inspiration from Managing Game States In C, which provides an example way to create and manage game states.

9Jan/120

Pong – Complete

In my last post I said that I wanted to start actually making games and completing them, well I have a working version of pong with complete gameplay. Last time I attempted pong, I got stuck trying to work out how to make the ball bounce at the proper angle. This time, It clicked in my head that I just need to invert the X acceleration when it hits a paddle and the Y acceleration when it hits the top or bottom boundary.

The next steps that I want to do with this code are:

  • Refactor
  • Menus
  • Opponent AI
  • Online Leader boards
  • Online Opponents

I intend to work on these ideas at the same time as working on the next game, which will be a breakout clone as it is similar to pong but is slightly more complicated. Hopefully, I can start building up a good collection of reused code to make it easier in future to implement these games.

Screenshot:

Tagged as: , , No Comments
8Jan/120

Pong

So, I have realised that I have never actually created a working game that is playable and I intend to make this year a year where I actually make games. To kick it all off I am going to make pong. I have already created a simple version in OpenGL where I can move two paddles and the ball bounces around with the ability to score. The next phase is to have a score counter on the screen and lives so that there is an end to the game.

This is a good step forward, as last time I attempted to write pong I got stuck trying to work out how to make the ball bounce correctly. This time it hit me that it was as simple as just reversing the X acceleration if it hits a paddle, or the Y acceleration if it hits the top and bottom boundary.

The code is at: Pong

Obligatory Screenshot:

Tagged as: , , , No Comments
28Dec/110

Graduate OS

I have now received my results for the last semester and I received a B+ grade for graduate os. This is lower than I was hoping, but I believe that I picked too difficult a project to undertake compared to what was required for the class. There was also some misunderstanding about how to hand in extra credit for this course that ment that I missed demonstrating it, reducing the possible extra marks that I could have received.

This means that in the next semester I intend to retake both Advanced Computer Architecture and Graduate Complexity & Algorithms. As I have done these before I have high hopes that I will be able to meet a high grade in both of these classes.

6Nov/110

Graduate OS & Crypto CL – Project Update

I managed to finally get a TLS connection working correctly, I now want to pull the code out of the project that I was working on and turn it into a library, TLS++, so that other people can use it and so that it is decoupled from any code within the project.

CryptoCL now has a fully functional Advanced Encryption Standard reference and OpenCL implementation. I also have a build server setup that makes sure that changes always build and that the tests are run. The next stage is to try and improve the performance, add more block cipher modes and then potentially add more cryptographic functions.

26Oct/110

Spinoff Projects – CryptoCL and TLS++

With the work that I have done towards my Operating Systems project I have decided that I will branch off the cryptographic code and the TLS socket code into separate libraries.

I did a search for OpenCL cryptographic libraries and there doesn't seem to be any so I will be releasing mine and keep working on it whilst I get some spare time. It currently supports only AES encryption.

The TLS library I want to create as there seems to be no C++ libraries for TLS sockets, when I had problems working on it I either had to delve through the OpenSSL code which is very difficult to follow or I asked questions online and got told to just use OpenSSL. I hope that it will be useful to somebody else.

My cryptographic library can be found here, and my TLS library can be found here.

I intend to keep track of the code using the Jenkins CI server here.

22Oct/110

ClientKey Message

For the last week I have been implementing my own TLS socket in C++ so that I can implement the encryption on the GPU.

I have written an AES implementation using OpenCL and for an average HTTP message length, running it on the GPU is actually faster.

The latest issue that I occurred was that after recieving the Client Key Exchange handshake message I then had to calculate the master secret. This is done using the client and server random values and the issue that I encountered was that the four bytes used for the time variable were in little endian and they needed to be in big endian.

17Sep/110

The Tempest

Today, me, my brother and some friends from university went to a performance of Shakespeare's "The Tempest". It was performed by "Actors From The London Stage" at the University of Notre Dame.

The performance started being difficult to follow but I attribute that to the fact that there were more characters in the play than there was actors to play them leading to the need for actors to play multiple roles. After the first couple of scenes the play became easy enough to follow as I had seen the actors play through their different characters and knew which character was which via clothing and the way they act. The only other barrier to understanding of the play was due to the prevalent use of Old English, this did not detract from the play as you can grasp what is happening through the performing as much as the words.

One of the major features of this specific group of actors is that they shun the use of too many props, this lead to one confusing scene where one of the actors lifted up another actor who was being ridged. This turned out to be a character collecting a log for firewood.

The lack of props did not detract from the play as it allowed the audience to use their imagination to understand what was going on. It also produced a few laughs as at one point there was a summoning of a banquet which turned out to be a bed sheet with the word banquet written on it.

The overall view of the performance was that everyone enjoyed it.