Data Structures – Working with Queues and Games

Queues are really quite a fundamental data structure that all in computing should know. Probably one of the most popular real world examples of a queue in operation is that of a checkout counter in a shop. This is a classical example of First In First Out in operation. The first person to join the queue will be the first to be served at the checkout. All further customers join the back of the queue. Hence is a nice example of enqueue() and dequeue() in operation.

The “Hot Potato” Queue Simulation
Another example that is often used is the “Hot Potato” (online), whereby a person has a “Hot Potato” that gets passed around by “people” in the queue. At each iteration a “person” from will become removed from the queue and placed at the back – therein enqueue(dequeue()). This will occur a certain number of times before the “person” with the “Hot Potato” will be finally removed from the queue. This process continues until just one person remains.

Print Queue
An example more tangibly related to computing is perhaps the “Print Queue”. When a new document is sent for printing it is placed at the end of the queue enqueue(). The process of actually printing off a document will remove it from the queue dequeue(). Under many circumstances this will removed the first print job. However many multi-function printers/photocopiers of today, will present a list of print jobs one screen once you log on, allowing you to select which job or jobs you wish to print. So the example of the “Print Queue” isn’t perhaps the best any more, although even with these multi-function one can often “Select All, Print & Delete” which will print off each job in the “Print Queue” following the standard FIFO ordering.

Waypoints
So what might be a good example of a queue system in operation that would be applicable to students studying Game Development? One nice example is perhaps that of Waypoints, the following (online) link is to an animation that moves an onscreen object towards a location the user has clicked (Waypoint), as the user clicks other locations, these are added to the “Waypoint” queue. When the onscreen object reaches a Waypoint location it is dequeued.

Message Queue
Another nice example is of how to implement a “Message Queue” in a game (online). In this case game avatars can pass messages to one another following a distinct packet/envelope structure, that of: sender, destination, type, data. Therefore instead of having Objects communicating in what could be almost considered as a fully interconnected mesh of messages (just consider what a system sequence diagram for this would be like). All Object / Avatar instances instead communicate with each other through a single queue based messaging system.

Production / Build Queues in Games
One example I considered quite applicable to Game Development students was that of the Production Queue. Many stratagy based games make use of “Production Queues” or “Build Queues” to creating anything from Tanks, and Ships to Aircraft and Experimental Weapons such as the AC1000 from Supreme Commander 2 (online) developed by Gas Powered Games.

The Noah Unit Cannon Experimental (online), is a fixed emplacement that can queue up the production of several types of land units, such as the Rock Head Tank, Titan Assault Bot and the Sharp Shooter Mobile Anti Missile Defense to name but a few.

Simcity Buildit
Simcity Buildit makes very extensive use of Production / Build Queues through the form of Factories that produce basic materials such as Metal, Wood, Plastic, Glass and Electrical Components. These items can take anything from 1 minute for Metal up to 7 hours for Electrical Components to be produced. When fully upgraded these factories have a production queue of 5 units. Materials produced in the Factories can then go on to be used in one or more of the nine Commercial Buildings. The Commercial Buildings take the form of Farmer’s Market, Furniture Store, Hardware Store and Donut Shop to give just a few examples. Details of all the items these factories and buildings can produce can be seen (online) (online). The following videos give some sense of what these building are like.

Given that one can wait almost an entire day to process a full production queue of Beef (11 units) it is very useful to have the opportunity of speeding up the process with “Speedup Tokens” in the form of: Turtle x2, Llama x4 and Cheetah x12. To create “Speedup Tokens” one must either earn them through the “Contest of Mayors” or create them from small pieces by creating “Epic Projects”. These are building that can create a fragment of a “Speedup Token” every 24 hours. The more “Epic Buildings” one has the more fragments are needed to create a “Speedup Token”, however as a starting point one needs 3 fragments for Turtle, 6 for Llama and 9 for Cheetah.

Perhaps tasking Games Development students with creating Production Queues that simulate the creation of Beef, Televisions, Popcorn or Pizza as is the case with Simcity, or Land, Air and Naval units in the case of Supreme Commander is a good way of demonstrating the use and need for queues – particularly in strategy games. Another interesting reason for focusing on Production / Build queues is that especially in the case of Simcity Buildit, many of the items produced are dependent on other items. Therefore quite long chains of production can be formed just to produce the necessary resources to create one “Expensive / Complex” final item.

Parallel Processing / Super-computing
Simcity Buildit provides a really good example of the costs associated with production / processing and relate very well to issues around Parallel Processing / High Performance Computing (HPC) / Super-computing and how jobs can impact one another in the determination of the overall execution time. The classical example of this is the process of making breakfast – many tasks can be done in parallel, though one will be constrained by the cost of the operation that takes the longest. Taking a parallel approach to making “breakfast” can however yield a good deal of cost / time savings over a step by step approach (online).

What other Games use Production Queues?
Do you know of any other games that make heavy use of “Production Queues” / “Build Queues”?

BCU Global Game Jam 20-22 Jan 2017 – Event Summary

Over the weekend of Friday 20th Jan to Sunday 22nd Jan 2017 the Global Game Jam 2017 (online) took place. Tens of thousands took part at locations all around the globe, with Hawaii being the last to kick off. An embargo was in place on the theme until Hawaii had begun, the idea being not to talk about the theme online until Hawaii had joined in the fun. The theme for this year was “waves” which provided quite a deal of scope and direction for idea generation.

One of the locations for the Global Game Jam in the UK was BCU in Birmingham which was organised by Liam Sorta @LiamSorta and Andrew Wilson – Programme Leader for the BSc in Computer Games Technology @BCUGAMESTECH. The event had a great turnout of over 100 people, many from Birmingham, but others from Warwick, Southampton, Newcastle & as far afield as Australia (though had been in the UK since the first semester). It wasn’t just University students either, but also a good few graduates whom work in the games industry. Once the theme for this years jam was announced everybody broke up into teams (a little over 20 in total) and headed to the labs to do a quick brainstorm of ideas and routes to take, before getting down to making those ideas a reality. A large number of the teams made use of the Unity Games Engine, though one or two teams developed their games in Python.

One can see all the games that were uploaded to the Global Game Jam site from Birmingham (online). One of the great things about this is that you can download both the source code and executable, hence can play the game yourself and also learn how it was developed.

The Game that won the BCU “Innovation” prize was produced by a group called “Signal” (online) which was based on one having to navigate around a 3D environment that was pitch dark. One could emit sound waves to help see the outline of the environment & thereby navigate around the environment. This was very much akin to how Daredevil (2003) (IMDB) perceives the world and also similar to how Batman used “sonar” to see his way around a building in the dead of night – The Dark Knight (2008) (IMDB). The winning team for this prize had been selected by myself (online) and Mak Shama (online) having viewed all the presentations on the Sunday afternoon.

Representatives from two companies were also present at the Sunday presentations @VERYGOODFRIEND and @fishinabottle whom also selected teams to win prizes. Zen(x) (online) was particularly creative in developing a unique idea in the form of using a combination of a dozen sine wave calculations to control an onscreen icon, requiring the user to interact when it reached the centre line & therein changing the trajectory of the sine wave. The graphics had very clean lines and very much mirrored the “Zen” concept whereby the user could just relax and enjoy the game. Ooodle Showdown (online) was also another unique game for two players. It featured some very nice graphics and required players to navigate through a sea of characters something akin to a cross between the Marshmallow man from Ghostbusters and the Michelin Man. Each player (blue or red) could send out a sort of sonar wave and would turn the character that colour for a short while. The best thing to probably do is to download and play the game yourself to see how it works.

I had spent a good few hours each day at the game jam. It was really great to see the initial ideas dreamed up on the Friday evening evolve into quite functional games by Saturday and then on to more refined games by the time they needed to be uploaded on the Sunday prior to the afternoons presentations. All in all it was really great to see such a variety of fantastic games grow from an initial idea into a working game in just a matter of 48 hours. The well know phrase “two heads are better than one” certainly holds true whereby the key strengths and talents of teach team member could be harnessed towards one definitive goal and deadline.

Key Web Links
Global Game Jam Site (online)
BCU 2017 Game Uploads (online)
Twitter Hashtag #BCUGGJ17 (online)

Social Media Selection
The following selection of embedded tweets and instagram images from a number of those present during the event should help to give a good sense of what occurred over the 48 hour period.

One of the most gorgeous #platformergames at #bcuggj17 #gamedev #skyfell

A post shared by Jonny Graney (@jonathancharlesgraney) on

#bcuggj17 #afishysituation #gamedev

A post shared by Jonny Graney (@jonathancharlesgraney) on

Great gothic, woodcut imagery and folk feel with #caniborrowalight #bcuggj17

A post shared by Jonny Graney (@jonathancharlesgraney) on

Really impressive visuals, atmosphere and fantastically executed #signal is really interesting #bcuggj17

A post shared by Jonny Graney (@jonathancharlesgraney) on

#ahoythere definitely the most ambitious and exciting game from this years @bcuggj17

A post shared by Jonny Graney (@jonathancharlesgraney) on

#bcuggj17 #seewaves

A post shared by Jonny Graney (@jonathancharlesgraney) on

#bcuggj17 presentations

A post shared by Jonny Graney (@jonathancharlesgraney) on

#bcuggj17 #allhandsondeck

A post shared by Jonny Graney (@jonathancharlesgraney) on

Beautiful minimal sound and art style from #zen at #bcuggj17 bcuggj17 #indiegamedev

A post shared by Jonny Graney (@jonathancharlesgraney) on

#kingbooty #bcuggj17 #gamedev

A post shared by Jonny Graney (@jonathancharlesgraney) on

#bcuggj17 #oodleshowdown #gamedev

A post shared by Jonny Graney (@jonathancharlesgraney) on

#bcuggj17 #teammiodsnowstorm #omni amazing game idea!

A post shared by Jonny Graney (@jonathancharlesgraney) on

#necrodeulists #indiegamedev #gamedev #bcuggj17 #globalgamejam

A post shared by Jonny Graney (@jonathancharlesgraney) on

#wanishingwaves #bcuggj17 #gamedev

A post shared by Jonny Graney (@jonathancharlesgraney) on

Awesome ideas and beautifully executed in the game Spectrum @bcuggj177

A post shared by Jonny Graney (@jonathancharlesgraney) on

#globalgamejam #bcuggj17 #indiegamedev #gamedev

A post shared by Jonny Graney (@jonathancharlesgraney) on

Dawn.

A post shared by Jonny Graney (@jonathancharlesgraney) on

Examples of Graphics, Animation and Fractals in Film

Vol Libre (1980) created by Loren Carpenter is an extremely well know example of early computer animation. It used fractal terrain generation of create a flythrough of a three dimensional landscape. This would in turn lead on to the development of the Genesis Sequence in Star Trek II the Wrath of Khan (1982) (IMDB).

Another good example of computer generated imagery is the Light Cycle battle from Tron (1982) (IMDB).

Tron Legacy (2010) (IMDB) features an updated Light Cycle battle.

Flight of the Navigator (1986) (IMDB) demonstrates the first use of image mapping the surrounding environment on to a surface. In this case it is mapped on to a Trimaxion Drone ship from Phaelon. It also features some nice scenes whereby the Drone ship morphs from “Class 3” mode to “Class 1” – thereby allowing it to efficiently cut through the Earths atmosphere.

Going back to Fractals – its interesting to see how Fractal Graphics seem to crop up in film’s from time to time such as the Mandelbrot Fractal paint job of a car featured in a desert scene from Transformers Revenge of the Fallen. This can be clearly scene at time index (0:35) in the following video clip.

Fractal techniques were again used to generate the lava spewing forth and landing upon a platform, on which Obi-Wan Kenobi and Anakin Skywalker were engaged in a lightsaber battle, located on the volcanic planet Mustafar in Star Wars Episode III Revenge of the Sith (2005) (IMDB).

Another nice example of fractals being mentioned in a film comes from Star Trek First Contact (1996) (IMDB), whereby the Sovereign Class USS Enterprise NCC1701-E is being taken over by the Borg. The Borg are trying to reroute main control to Engineering where they are based. Upon hearing this Captain Picard asks commander Data to “Lockout the main computer”, after some interaction with a console, Data responds by saying that “I have isolated the main computer with a fractal encryption code, it is highly unlikely the Borg will be able to break it”. Hence as you can see even in the 24th century, fractal techniques still prove to be very useful.

Wikipedia has a nice list of computer animation in film and television available (online). Do you know of any other interesting examples of computer graphics / animation featured in films.

The Carbon Journey Event – What does the Future Hold

At the start of the week a day long event was held focusing on what the future holds for the world in which we live. It was organised by Aston University and Birmingham City University and held at the Genting Arena. As you will see from the images below it was quite an amazing and eye opening event, attended by a large number of staff and students from both universities.

The world of tomorrow is likely to be a good deal warmer than it is today. The degree to which the average world temperature will be warmer will have an enormous impact on the lives of billions. The population of the world continues to grow and by the end of the century could very well reach anything from 9 to 11 billion people. A growing population needs ever more resources thereby growing our carbon footprint. However if we are to combat dramatic climate change then exceeding a 2 degree change from per-industrial times will have very serious consequences for the planet, population, plant and animal life.

Many countries have signed up to limit their carbon footprint, but with current commitments, estimates put the average global temperature increase at a good bit over 3.5 degrees. Anything beyond a 2 degree increase will have drastic results, therefore it is clear that far far greater measures will need to be taken by everybody whom call planet Earth their home.

The event was well timed as just a few days before (27th Oct) it was announced that global wildlife populations had fallen by 58% since 1970 (online). What will the global wildlife population be like by 2050 or 2100 if immediate measures are not put in place to curb this dramatic decline?

A good few tweets were generated throughout the day with the hashtag of #carbonjourney (online). Further details about the event and the days programme can be seen (online).

The images below should give you some sense of what the day was like. As can be seen quite a number of speakers were on stage throughout the day. Painting the a picture of what the world of tomorrow may be like from a number of perspectives.

Carbon Journey Genting Arena

The following video – gives some sense of what the news could be like just 30 or so years from now – in the year 2045.

Carbon Journey Genting Arena

Carbon Journey Genting Arena

Carbon Journey Genting Arena

Carbon Journey Genting Arena

Carbon Journey Genting Arena

Carbon Journey Genting Arena

Carbon Journey Genting Arena

Carbon Journey Genting Arena

Carbon Journey Genting Arena

Carbon Journey Genting Arena

Carbon Journey Genting Arena

Carbon Journey Genting Arena

Carbon Journey Genting Arena

Carbon Journey Genting Arena

Carbon Journey Genting Arena

Carbon Journey Genting Arena

Carbon Journey Genting Arena

Carbon Journey Genting Arena

Carbon Journey Genting Arena

Carbon Journey Genting Arena

Carbon Journey Genting Arena

Carbon Journey Genting Arena

Carbon Journey Genting Arena

Carbon Journey Genting Arena

Carbon Journey Genting Arena

Carbon Journey Genting Arena

Carbon Journey Genting Arena

Carbon Journey Genting Arena

Carbon Journey Genting Arena

Carbon Journey Genting Arena

Carbon Journey Genting Arena

Looking Back at George Boole’s 200th Birthday Celebrations

Today 2nd November 2016 is the 201st Birthday of Professor George Boole, the first professor of mathematics at University College Cork, known the world over as the “father of the information age”. On this very day last year I had the opportunity to be on campus to witness some events celebrating his 200th birthday. As you can see from the photos below quite a sizable cake decorated with 0’s and 1’s was on display. A number of talks also took place on the day. One of the talks I attended was given by Professor Anant Agarwal from MIT (online) about working in the realm of Digital Systems. Also in the audience was Professor Donald Knuth (online), well known for the multi-volume book “The Art of Computer Programming”, he had given a talk / Q&A session just prior. Hopefully some of the images below will give a sense of what the campus was like this day last year for the 200th Birthday celebrations.

Some time ago I wrote a post going through all the dates on the calendar listing the Key People and Events in Computer Science (online). Another person whom was also born the very same year as George Boole was Ada Lovelace, well known for her work with Charles Babbage on the Analytical Engine and the creation of the first algorithm intended to work on a machine. Its probably safe to say that without the work undertaken by both of these people born in 1815 none of the digital world that has permeated the very fabric of our lives today would exist.

George Boole 200 Years

George Boole 200 Years

George Boole 200 Years

George Boole 200 Years

George Boole 200 Years

George Boole 200 Years

George Boole 200 Years

George Boole 200 Years

George Boole 200 Years

George Boole 200 Years

George Boole 200 Years

George Boole 200 Years

George Boole 200 Years

George Boole 200 Years

George Boole 200 Years

Visit to Bletchley Park

On Tuesday 20th Sept, five bus loads of students and academics from @BCUComputing went on a 75 mile trip to visit Bletchley Park. A selection of photographs from the trip can be seen below, most being from the mansion, huts, cottages and museum (Block B). Some further images are available on flickr (online).

Visit to Bletchley Park

Around the same last year I attended two lectures organised by the BCS about Enigma (online) which gave some very interesting insight into the work of Bletchley Park. The post contains an embedded video from one of the lectures that is very much worthwhile to take a look at, as it gives a good deal of background to the Enigma, the Battle of the North Atlantic and the work undertaken at Bletchley Park.

Visit to Bletchley Park

We spent around four hours at Bletchley and really only managed a quick glimpse of the facility, which makes a lot of sense considering the many many thousands of people who were working their throughout the war. There is just so much to see, one could easily spend two full days having a quick look around. Will most certainly have to visit again as I didn’t visit all the huts and blocks or The National Museum of Computing.

Upon arrival at Bletchley Park around 11:00 the students had the opportunity to have a look around the estate before heading to the Teleprinter Hall at 12:00 for an hour long series of talks by Academics from BCU Computing. These talks included a general welcome, a talk on placement opportunities (as seen in the tweets below) and some discussion around keys / security.

After this series of talks it was now around lunchtime so many ventured to the Canteen situated in Hut 4 located right next to the Mansion. With lunch sorted it was then time for some further exploration of Bletchley Park, taking in all the various Huts, Cottages, Garages and the Museum located in Block B. All attendees were provided with a very useful Multimedia Guide comprising of map, imagery and audio / video segments to help guide one around the parks and augment ones tour with some very useful information about the various locations and their function. Some staff and students also had the opportunity of getting in a few rounds of table tennis in the scenic grounds before climbing aboard the busses for the journey back to Birmingham.

In summary it was a really great day out, meeting up at 08:30, setting off a bit after 09:00, arriving a bit after 11:00 and eventually returning by 17:30. A huge word of thanks to all involved in organising this fantastic adventure.

One can visit the following websites for further information
https://www.bletchleypark.org.uk/
http://www.tnmoc.org/

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

DSCF0948

DSCF0951

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

DSCF1002

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Visit to Bletchley Park

Essential Viewing – Schwarzenegger Interview: Vision, Goals, Confidence and Time Management

In a previous post (Online) I highlighted many of the key points from Randy Pausch’s lectures on “Time Management” and “Achieving Your Childhood Dreams”. The video below is of an interview with Arnold Schwarzenegger that is very much focused on achieving ones vision, time management and the ineffable fear that most people have of public speaking. Many of his comments can not only be applied to bodybuilding but to all facets of life. The video was published in March 2015 and at the time of writing had 1.86 million views. The interview is divided into two segments, commencing with a focus on bodybuilding, then around the half way mark moving on towards having a Vision.

00:25:54 Have a Deadline, the day of the competition he had to be in the best shape possible. Should focus on the diet, training and to not slack off. If he lost because he didn’t schedule the training in the proper way, didn’t have the right frame of mind, or didn’t give everything he would be so angry, so he never wanted to be in that situation.  It  is therefore essential to set a deadline and work towards it (go to).

00:27:29 Have a Specific Plan, if you don’t have a specific plan then you just wonder around. You could have the best ship or plane in the world, but if you haven’t a specific goal of where you want to go and when you want to get there, you will just drift around and never get anywhere. Creating a sense of urgency is therefore very important (go to).

00:28:04 Have a Vision, The most important thing is to have a Vision, have a Goal, because without such one is just drifting around and never end up getting anywhere. People don’t become successful by accident. One has to have a Goal, it can be anything, having a goal motivates. Put pictures of your goal all over your bedroom wall so every day when you go to sleep or wake up one can see the end goal , which acts as a form of motivation. You therefore know exactly what you are after. He looked forward to working-out as every Set and every Rep that he did, because it brought him one step closer to transforming his  Vision/Goal into reality. Have a clear Vision /Goal of what you wish to accomplish (go to).

00:33:50 Have a Training Partner, Have somebody to train with, if you are feeling down then it’s the responsibility of the training partner encourage you (go to).

00:35:01 Lack of Confidence, Confidence builds by making small achievements that build on one another. When you have one little Victory it leads to the next, little Victories add up, which ultimately leads to confidence (go to).

00:37:50 Public Speaking, little Victories again help to build confidence. Speaking in public is the biggest fear factor for people than anything else (go to).

00:40:20 Time Management, Everybody has a problem with time. The day has 24 hours, and one can sleep 6 hours, therefore you have 18 hours remaining to do your work, family, hobbies and to do/learn something new. Therefore out of the 24 hours in the day, don’t waste one single hour, it’s too precious. Don’t say that you don’t have the time to do something, you make the time (go to).

To Conclude
These are all very good points, especially if you are working on something like an Honours / MSc or PhD Research Project. Having a mentor / supervisor that will push you is key towards achieving success. Certainly in academia – time in the most precious commodity, therefore one must carve out the time to do what’s important. Setting clear goals / plans / deadlines and building on little victories is one very good way to build confidence and to ultimately see ones vision transform into reality.