Software Engineering II

Software Engineering II really brought together a lot of real world practical skills. Now that the module is over, the idea that I won’t be able to take any more modules taught by Sebastian Coope, with his decades of industry experience and wealth of knowledge of real-world workplace issues and anecdotes, is upsetting.

Seb introduced us to many concepts from pair programming to poker planning, the details of XP and Agile Development, and project management issues, whilst giving out tips on how to ensure that we communicate realistic time and cost estimations, improving our EQF, and general good practice programming and debugging techniques from program slicing to object patterns.

This is possibly one of the most invaluable modules I have studied at University, and has really been made relevant and useful by Seb.

C++ Game Engine

I followed this tutorial to create a Game Engine in C++ and SFML .

I was apprehensive, since creating a Game Engine sounds like a vaguely daunting task.

I am getting the hang of the setup for SFML, and decided that I don’t need to keep practicing  it every time so I exported the template of the properties for this project once I had set it up so that I can reuse them in the future.

[The property changes are fairly simple.

1. Go into the Properties of the project.

2. Under C/C++ -> Additional Include Directories, put the location of the ‘include’ folder which came with your download of SFML.

3. Under Linker -> General -> Additional Library Directories, put the location of the ‘lib’ folder .

4. And under Linker -> Input -> Additional Dependencies, add the graphics, window, and system .lib file names spearated by semi-colons(;).

Press ‘Apply’ and ‘OK’]

5. Also, ensure that the .dll files are held in the Debug folder of your Project.

Once this was all complete for my Game Engine project, I began to follow the tutorial.

There’s no point in me repeating what you can find here, since I did pretty much exactly that. There were points (such as creating three separate  .cpp files for Input, Update, and Draw…?) where I was unsure whether the tutorial was going about it in the right way, but as only my third project in SFML, I didn’t feel that this was the time to be going rogue.

I will, however, summarise the Game Engine.

The Game Engine consists of 6 .cpp (C++) files and 2 .h (Header) files (not including targetver.h, stdafx.h, and stdafx.cpp, which are all there as default).

These files are: Main.cpp, Engine.cpp, and Player.cpp; Input.cpp, Update.cpp and Draw.cpp; and Engine.h and Player.h.

Main.cpp simply calls the constructor for Engine, calls the start method for Engine, and returns 0 when complete. This is the entire functionality of the program, on the highest level (the game engine is made and started, when it is finished, the program finishes).

Engine.cpp and Engine.h work together to provide the overall functionality at a slightly lower level. Engine.cpp sets up the window size and background texture when constructed, and its ‘start’ method initialises a clock and contains a while loop calling input, update (and passing it the current time), and draw methods as long a the window is open. Engine.h just contains all of the variables and methods of Engine, and is included by Engine.cpp to be able to use these.

Player.cpp and Player.h (called ‘Bob’ in the tutorial) provide player setup and functionality. The contructor brings in the texture for the player, and initialises the speed, and x-y position of the player. There are then 6 methods: getSprite(), moveLeft(), moveRight(), stopLeft(), stopRight(), and update(). The only one of any real interest is update(), which takes in a time parameter, to be multiplied by the declared speed to calculate the distance traveled and add it to the x position (right), or subtract it from the x position (left). Again, Player.h simply creates all of the required variables and methods.

Input.cpp just takes user keyboard input and calls the appropriate method- wouldn’t this be better in the Player.cpp and Engine.cpp files?

Update.cpp just calls the update method in player, passing it the time from Engine.cpp. This call could be in Engine.cpp right?

Draw.cpp clears the window, then adds in the background and player sprites and then calls display();.

And that’s it! All of these parts will work together to run a simple game, and more functionality could always be added to these components to create a more complex game using this Game Engine.

Please comment below if you can explain to me why there is a need for separate Update.cpp, Draw.cpp and Input.cpp files.


Distributed Systems

During second semester I studied a module called ‘Distributed Systems’, the partner module to ‘Internet Principles’ from first semester. It doesn’t sound the most interesting but I was keen to study it, especially as I began to realise how frequently the phrase ‘distributed system’ came up in almost every other module. From ‘Database Development’ to ‘Advanced Object-Oriented Programming in Java’, every lecturer seemed to be bringing up this topic. It seemed a good idea to gain a real understanding of it.

Although this module turned out to be far from my favourite, it has given me a solid basis in topics such as leader election algorithms, network communications, fault tolerance, and DNS. None of these are concepts which I would have decided to study of my own accord, which really makes me appreciate the opportunities given to me during my University studies.


In my most recent Java assignment I was asked to submit my files as a .zip. As I was in a hurry (see Panic! At the deadline), I did the first thing I could think of- I emailed all of the files to myself with the subject of the email the zip filename I wished to use. This worked very effectively and tbh I was quite pleased with myself…

Screenshot of window asking whether to open or save a .zip

After the deadline, my lecturer sent around an email reminding us to submit a .zip archive file and telling people to use their preferred internet search engine to find out if they didn’t know how to do this. I feel like my hacky way around it was a bit of a cheat if other people are struggling to work out how to use the official compression systems…

Okay, um, I thought I’d see how to do it and I don’t feel at all bad now: