Rhodri Hewitson Games Programmer
Welcome to my blog
Hello and welcome to my blog. Here I will be writing about my experiences while I am enrolled on my MSc in Computer Game Engineering. I will be blogging about what I'm learning, what games I'm playing and other game's related comments.
Tuesday, 26 October 2010
Success
For the last day and a half I've been working on creating a 2d array on the heap. This 2d array is used as a matrix to perform matrix manipulation eg transpose, turn an MxN matrix to an MxM matrix etc.
I decided to create this using classes (which then turned to a template as practise). I had a problem of whenever I use a function outside the main it caused an error when returning the matrix. It took me a while to work out that this was the problem and I wasn't sure how to fix it once I had. But after speaking with my coursemates and my lecture I learnt that I needed a copy constructor since my destructor was deleting the Matrix.
This has now being done...onward so operator overloading.
I decided to create this using classes (which then turned to a template as practise). I had a problem of whenever I use a function outside the main it caused an error when returning the matrix. It took me a while to work out that this was the problem and I wasn't sure how to fix it once I had. But after speaking with my coursemates and my lecture I learnt that I needed a copy constructor since my destructor was deleting the Matrix.
This has now being done...onward so operator overloading.
Monday, 25 October 2010
Trials and Jubilations
I've now been learning to code for 2 weeks, while it been difficult I've been enjoying it. In particular I've been enjoying the tutorials, where we've been given a task to program and we must work out how to go about it. I've been enjoying thinking about how the program will work, then going about to create the said program. Along the way problems occur but I get a great satisfaction in solving them.
Monday, 11 October 2010
First Lab Session
Are first lab session was am extension of "Hello World". We worked with the source code to improve are understanding of C++. What struck me was it was harder to know if you had done what was required. Unlike in mathematics where everyone end up with the same answer even if we've used a different method (unless of course you did a mistake). Here we all had different codes that while we believed we did it to the specification all did slightly different things. So maybe there isn't one right way of doing C++, but some are more effective than others (quicker, less CPU usage etc).
What I had personal difficulty in doing was getting information from a text file ans saving it into another text file. I hadn't realised that streaming operators (<< & >>) are used to output and input not just cout and cin but to files as well. Once I had grasped that fact I found that writing the code a lot easier.
Sunday, 10 October 2010
Metro 2033 (spoilers)
I finished Metro 2033 which is a FPS atmospheric action stealth game. I really enjoyed it it was a really well thought out game. Some of the game mechanics where very immersive- instead of the normal hub and menu for you direction and objectives you got a clipboard with a compass on top which you had to press right trigger view and left trigger to click on the lighter in the dark tunnels, now that original.
The story is played through the perspective of Artyom a young man who's silent throughout the game apart from when he's monologuing the story as it going on during the loading screen. The setting is in a post apocalyptic Moscow where people have to live in the metro to avoid the radioactive atmosphere. It's a coming of age story where Artyom (who at first is seen as a child who likes to sleep in) is trying to save his home from being destroyed by the Darkones ( evolved humans from the radioactivity of the earth who instil such fear into anyone who come across them they are left insane). So we follow his journey through the metro trying to get help, meeting different characters along the way.
The game was very atmospheric and a number of times I jumped in my seat when I was attacked. The ape's in the library where particularity frighting- they kept making a noises to indicate there presence but you couldn't tell where they where until where already attacking you.
Some criticism of the game where the characters I didn't know who half of them where- it took me a good half hour with one guy to realise he was the "funny one". So when some characters died (sorry spoilers) I didn't feel particularly emotional about it since I hadn't been engaged by them. The story was also weak at times, I happened to meet a man I was looking for by falling into him when being chased by the guards (and enemy's called Darkones - seriously?). The game was also pretty buggy: in cutscenes people would reply to a character before he had finished talking, and at one point I floated in mid air when I missed my jump and was stuck there until I floated back to where I started.
But these criticisms aside it was a really good game that gave me a feeling of regret at the end after I had caused genocide on the darkones (another spoiler)- who I felt where not as evil as people thought just misunderstood. I found out later that I could have had an alternative ending where I spared the darkones and created peace, which I feel would have been a more fitting finale.
Hello World
We had are first lecture on coding. We of course did a code displaying Hello World. Since I learnt a bit of C++ over the summer what we did was families, but it was interesting for example to learn why you had to write a # at the beginning of your code (it to communicate with the compiler). The interesting thing about C++ is that it uses symbols as words ( eg { start of function } end of function). Which at first might get confusing, but like the use of symbols in mathematics it will make writing code a lot quicker as my understanding of the language increases.
Thursday, 7 October 2010
Cache
We started off today talking about cache - which is basically a buffer where data can be accessed quickly, much quicker than if you had to access the data from the original source. A cache miss (when the data isn't in the cache) is something to be avoided, since it must then be retrieved from the original source (which take more time), it also flushes data already in the cache (so you lose important data you had already) - which could cause more cache misses.
Level 1 and level 2 caches where also mentioned. Level 1 is the fastest memory on a pc it built directly into the processor itself, there are to separate caches in level 1 one is for instruction the other is for data. Level 2 is bigger in size compared to level 1 but it's not so quick to access.
There is a careful balanced when managing cache - if you manage it to much then you slow the program more than you would have if you hadn't managed the cache at all.
Cache associativity is when level 1 and level 2 share the same data. There are a number of ways you can map these:
(for simplicity I will say Level 1 has 10 bytes of space and Level 2 has 100 bytes)
Direct mapped cache: For each 1 byte of L1 there's an associated 10 bytes block of L2 that go to that specific byte on L1.
Fully associated cache: Any of the 100 bytes from L2 can go anywhere onto the 10 bytes of L1. There is no specific location for each group of bytes.
N-Way Set Association cache: N is an integer normal 2,4,8... Instead of one single block of 10, the L1 cache is split up into 10/N sets sized N (say we have X sets), each of these sets have an associated 100/X block of L2.
Level 1 and level 2 caches where also mentioned. Level 1 is the fastest memory on a pc it built directly into the processor itself, there are to separate caches in level 1 one is for instruction the other is for data. Level 2 is bigger in size compared to level 1 but it's not so quick to access.
There is a careful balanced when managing cache - if you manage it to much then you slow the program more than you would have if you hadn't managed the cache at all.
Cache associativity is when level 1 and level 2 share the same data. There are a number of ways you can map these:
(for simplicity I will say Level 1 has 10 bytes of space and Level 2 has 100 bytes)
Direct mapped cache: For each 1 byte of L1 there's an associated 10 bytes block of L2 that go to that specific byte on L1.
Fully associated cache: Any of the 100 bytes from L2 can go anywhere onto the 10 bytes of L1. There is no specific location for each group of bytes.
N-Way Set Association cache: N is an integer normal 2,4,8... Instead of one single block of 10, the L1 cache is split up into 10/N sets sized N (say we have X sets), each of these sets have an associated 100/X block of L2.
Wednesday, 6 October 2010
What I learnt today
Today we started off talking about polling and interrupting and the advantages and disadvatages of both. One of the main disadvantage of an interruption is that it stops what's going on before - which normally isn't good for games since it creates non deterministic problems.
We also talked about virtual memory and how when programming games we don't want to have to use it, since it's bad programming and it creates slow games. However DMA (Direct Memory Access) can be useful, even though its an interrupting process. If everything is ready for it before it interrupts it no longer stops what was going on, so no longer creates non deterministic problems.
We also talked about virtual memory and how when programming games we don't want to have to use it, since it's bad programming and it creates slow games. However DMA (Direct Memory Access) can be useful, even though its an interrupting process. If everything is ready for it before it interrupts it no longer stops what was going on, so no longer creates non deterministic problems.
Tuesday, 5 October 2010
Halo Reach
Yesterday I completed Halo Reach Campaign on Heroic :P . I thought it was a fitting finale for Bungie's last Halo title. The story was as always not it strong point, but the action was fantastic and it strong AI meant I had to think about a plan rather than go all guns blazing at the nearest enemy.....
So I'm looking forward to Bungie's next game and also wondering where the Halo title is going from here.
What I learnt today
Today we talked about the Turing Machine and how it can give us an basic idea of how the CPU works. We also talked about deterministic and non deterministic problems - and how we should be careful with the programmes we write, sometimes non deterministic programs are quicker at solving specific problem rather than deterministic programs (namely NP-complete problems eg travelling salesman, knapsack problems). But normally deterministic problems are better for game programming since we know when the problem finishes- which is always a good thing when programming games. Interestingly I've covered these type of NP-complete problems in my undergraduate Mathematics course in Cardiff University, which hopefully gives me a taste of how both courses will combine.
An introduction
My name's Rhodri Hewitson and I'm currently enrolled in Newcastle University studying an MSc in Computer Game Engineering. I did my undergraduate in Mathematics at Cardiff University. Good at Maths, I never felt really satisfied with my course: it was all too theoretical for my taste. Now I'm looking forward to applying what I learnt to program great games.
In this blog I’ll be talking about the games I play, offering my thoughts and opinions about them, and writing about what I learn about programming and games design throughout the year. The course is about games programming, but I’m also interested in games that stretch our minds and experience, so I’ll share my thoughts about this as I go along.
In this blog I’ll be talking about the games I play, offering my thoughts and opinions about them, and writing about what I learn about programming and games design throughout the year. The course is about games programming, but I’m also interested in games that stretch our minds and experience, so I’ll share my thoughts about this as I go along.
Subscribe to:
Posts (Atom)