Sunday, June 24, 2012

Evaluation of the Graphical User Interface


During this project I was tasked with creating an interactive graphical user interface. This user interface would respond to hotkeys, mouse clicks, and various other interface elements to help breath it into life.

During project development, I stuck with my intial plan, which was to develop the UI in C++, using SDL as the graphics library in order to blit my images to the screen. The end product, was close to my original intentions, if not a little lazy in the areas that I wanted to implement, but time constraints, and knowledge of the API meant I didn't have much to work with intially to meet the final deadline.

In the end, the final product was capable of responding to hotkeys and showing the appropriate screen to correspond with that. Furthermore, it changed the internal state of the object to display a glow around the images and remove the screen and the same key was pressed twice, or another screen popped up.

Did your end product match your original intentions?

The end product matched somewhat to my original intentions, and this post will relay all the aspects that I hit while developing this piece.

One key factor was the lack of a mouse over option. Due to the nature of SDL and the blitting of pixels, I found it rather difficult and time consuming to render a RECT around the image and apply a mouse over event to detect. While I could have done it with no doubt in my mind, I intially knew that I had to cut the most time consumin aspects out, in order to develop this by the deadline.

Another factor was the lack of the health bar and the compass. I felt to relay my end prodcut to focus on the main objective was enough, implementing more images (causing more overhead) would have been an intial waste of resources, in itself, there, I decided that  focusing my UI on the main elements was beneficial enough and allowed me to put more work in that area, rather than others.

How did you manage your time?

Time was a key factor in this development process, we had three weeks to plan and produce. That wasn't enough time to get things completed the way I intended, instead, I took alot of time aside to work on the graphical aspects of it, the books, maps, bags. Getting this out of the way first, during the planning stage, allowed me to focus on the coding side of it all, and reduce the stress to allow me to architect a solid system.

My time was planned intially to spend the half term week holiday at my own computer with all my own tools to develop this, which gave me two weeks at college previously to plan, create and work on the graphics aspects of the UI.

How could you manage your time more effectively?  


I honestly can't think of how I could effectively have made better use of my time, I planned from the start how I would use it, and I stuck to it. I could have given myself an extra week, to work on implementing other features into the UI, but the extra work would have taken focus away from my other studies. Intially, I do believe the the time I spent on this was spent correctly and effectively with little impact on the end product, minus the extra week I could have used.

What problems did you face?


One problem I faced was utilising the SDL API. While the API itself is farely easy, it lacks some graphical aspects that I would have really enjoyed, however, I didnt intially attempt to program this in OpenGL, but looking at the time it would take to even render a simple image on screen, I knew I had to look elsewhere.

Another problem I faced was getting the mouse over to work, while I got close, I find the reponse of the event system implemented to lax, and I couldn't grip the correct RECT location to intiate a response. After two days of working I decided that I would abadon this to approach at another time.

What did you find easy?

I found actually implementing the subsystems and working on the correct architecture was the best part and most easiest to control for me. Coupled with the development of graphics in photoshop, I found it easy to implement the UI, the main problem stemmed from various areas that where intially out of my direct control.

Thursday, June 21, 2012

How to Build a PC


Welcome, to a rather unusual blog post. This one all about building a PC. Now, I don't mean taking a PC and literally making the Silicon parts, and creating the individual chips, that'd be stupid.. like the time I attempted to do it.. and failed... poorly.

First off, lets begin by talking a little about the components and then how they slot into the system and how they operate. A little history about me however, I have been building computer systems since I was 15 and got my first computer, since then I have upgraded, renewed, rebooted and done a wide range of tasks, so lets begin.

CPU 

The CPU is the main component, it's task is to process information, (Bits) and send data and messages to other components of the computer. Imagine that the CPU is the brain, it has the job of commanding and working with the computer and processing everything to ensure it all works.

GPU

The Graphics Processing Unit, is the component that handles processing Vertex Data, Pixels and Buffers, and then displaying these to the Display Unit (Monitor), while its job can be done by the CPU, it is much more efficient to offload that pressure and place it on the GPU instead. There is even PPUs (Physics Processing Unit), but thats not quite offcial yet.

RAM

Random Access Memory, is a collection of physical memory components that are split into 9 Bits per Byte, the 9th used for storying memory parity errors. RAM is used by programs to store data like variables and levels, as well as other program data. The entire program is loaded into memory and more memory is allocated at Run Time if required.

PSU 

The Power Supply Unit is the part of the computer that generates and distributes electricity to the system, so it can be powered. They come in various watts, 400W, 450W, 500W. For a average systemm a 450W is more than suffcient, however, count up the componentry power units, in order to get an idea on how much power you need. 

Motherboard

The motherboard is probably the most important part of your system. It acts as the main boss of the entire computer, accepting components through slots called BUS and distributing data between componenets along canals and couplings. Without the motherboard, the components would not be able to operate together, and therefore, remain useless.

Disk Drive

Disk Drives come in various sizes and quantities, but the intial concept remains the same, they slot into your computer case, and connect to he motherboard using wires called SATA and a power supply through Molar cables.

Harddrive 

Another very important part, Harddrive come in various capacities and types, IDE, SATA, SSD, they all perform the same function though, and thats to store data in a magnectic disk (or in the case of SSD, store data to a flash drive).

Building the PC - Internals

The first thing you need to know about building the internals of a PC is that everything is of a volatile nature. You should take precautions to remove static from your hands, as this can cause serious damage to the actual internals of a components. Using a static clamp, or simply running your hands across the metal structure of the case is suffice enough to ensure no static conducts your internals.

The next  thing is to get your case, providing you have one. A case is just a metallic box, which comes in various sizes, standard is the ATX Case, which supports a wide range of motherboards and disk drives.  Standard case looks like the following below.


Taking your case, you need to layer it down flat, and remove the side. Usuing this is the left side of the base, when facing forward, but you'll know, its the section that doesn't have the huge metal dinner plate sitting on it.

Working with the motherboard

I hope you have a screwdriver handy, cos the next section requires. Never say that we computer geeks don't know how to work tools. You need to take your motherboard, and carefully place it flat against the backface of the case. This is called, mounting the motherboard.


This is an essential step, so make sure that your motherboard is tightly bolted down, you really don't want this to fall out when you prop your case up, so best to check by slowly lifting your case from the top and see if the motherboard stays still. If your motherboard is too small or too big for your case, then you have clearly got the incorrect size for your system, and its time to go back to the shop.. or use a cardboard case.


Once your motherboard is correctly bolted in, move onto the next section, inserting the CPU. Pay attention to this part, because if you get this wrong, it could go bad for you.

Inserting the CPU

The CPU is the brain of the system and processes everything from the smallest bit to the gigabyte data files. Without a CPU, your computer will not run, will not sing and will not fight. So it's important you get this right. You CPU should have come in the following parts, below is a AMD FX 6100 (Codenamed "Bulldozer" if your interested)

Your CPU should look something similar, underneath with long metal pins. We very careful not to bed these, otherwise you'll have a joyous time trying to insert this into the slot. Now, liste up, because this is very important. They are different types of sockets for inserting CPUS. I'll talk about AMD, because i'm not too familar with Intel. But Before that, you should know that motherboards are optimised (or rather designed) for specific CPU brands. AMD motherboards use the AM2, AM2+ and the AM3 sockets, and support a wide variety of other extra buses, while the Intel have there equalivent that supports there CPU brand.

It's always a good idea to do your research, or use Computer Planet, it has a great PC designer, that is brilliant for building a PC without worrying about compatibility (It handles this for you).

So, you have your AMD CPU (or intel, but i'll reference AMD, you can switch it across easy enough). The slot you are looking for is marked on the diagram below.


You will notice that both the chip and the slot lack a small area of the pins, this defines what way you need to insert the chip, so carefully taking two hands, gently and slowly insert the CPU into the chip slot, if it doesn't seem to want to go in, DO NOT force it, instead, take your time to carefully check why it isn't insertinh, it could be you haven'ts aligned the pins correctly, or that you are trying to insert a incompatible CPU for your motherboard.

But once you have it in, then its time to move onto the next part of this section, applying the thermal paste.

Thermal paste is used to help keep the CPU cool. A CPU can generate enough heat to burn the skin off your hand in a few miliseconds, so its vital we do our best to keep it cool and from setting on fire. The idea of the thermal paste is to act as conductor of heat, for the heatsink to help pass that away. A digram below will show what I mean. (TIM means Thermal Interface Materials, generally just Thermal Paste).


The main role of the heatsink is to take the heat generated by the CPU and dissipate that into the surrounding air. The reason we need Thermal Paste is to conduct heat, the problem is, the little air pockets that might arrise between the CPU and the heatsink is very bad, and a build up of air (which is not conductive of heat by the way), can cause more overheat and therefore blow the CPU its self. (Which is bad). The Thermal paste acts as that filler, rather to help conduct the heat, so its vital this is done correctly.

There are three types of Thermal Pastes, your have you Metal Based Pastes, which are probably the most expensive but more effcient. The grease contains lots of little metal particles which conduct heat very well, and therefore allow for a cooler CPU overall.

The second is a Ceramic Paste, this doesn't perform as well as the Metal Based Pastes, however its cheaper, and isn't that much different from the Metal Based pastes, also, the ceramic particles do not conduct electricity, so therefore, in my opnion is also a safer option, and a faster one for your CPU.

The last one is Silicon Based. These are pretty much thermal pads, that you slap onto the top of your CPU, and are easily removed afterwards, but don't provide near enough conduction as the previous two, and if you have a powerful computer system (6 Cores :D) then your not going to get far with these.

This is a little long winded, so lets begin applying that grease. First thing you should know is something called Lapping. This is a technique to smoothen out the surface of the CPU, to allow for less TIM and more conduction. I won't go to far into this, as its a topic all on its own, however, feel free to check it out in your own time, for now, your CPU should be fine, and unless you plan to stick into another motherboard, there is no reason worrying too much about that.

You only need to put as much thermal paste on as there is to fill the air pockets between the Heatsink and the CPU, so a thin layer is needed only (If you are replacing a CPU then Lap the CPU Surface first, otherwise you'll likely need more Paste to make up for the increased air pockets). Then put a little dab of paste, no larger than a grain of rice, and spread it out, in a thin layer. You don't need a whole lot remember, just a small amount. Once that is done, fix on your heatsink, and then attach your fan. Follown your, manufacturers instructions for installing CPU fans, each one is different.

Inserting the RAM

RAM is used to store volatile data about a program, while running. It is a run time concept, meaning, the memory only stays in memory while the computer is running, once that is switched off, then you lose all the data stored. RAM is generally pretty easy to install.

Located on your motherboard, you should see some BUS slots that look like the following:


Typically, one RAM slot, holds one stick of RAM. For your reference a stick of RAM looks like the image below.

RAM like Harddrives can come in various sizes, 1GB, 2GB, 4GB, 8GB. And can be coupled up with more than one piece of RAM to increase available storage.

As I previously stated, RAM is generally simple to install. With your two forefingers, grab the top coerners of the RAM stick, and please it gently against the slot. Make sure you have it facing the right way and that the small incision in the chip match against the BUS. Then, with a quick push it should slot in pretty nicely. Clamp it down with the white clamps at either side of the slot, and there you go. RAM is installed. Pretty simple right?

Installing the Harddrive

Harddrives are generally one of those "WTH" moments with some people. But fear not, I'll help you figure this out. To install your harddrive, you must first choose a slot in the tower. All Tower cases come with a predefinied number of metal slots, these are for storying harddrives, evidently and also disk drives.

General, the first thing you do is clamp your drive in. This is pretty simple task, you slow it into a spare disk slot, and screw it down.


Once achieved, you need to take your SATA/IDE cable. Now, a little word of advice. Modern day systems use Sata as the method of data transfer, as such IDE Harddrives are pretty much deprecated by todays standard. In fact if you can find anyone who sells an IDE HDD still, then you probably want to look elsewhere. While they are cheaper, the data is transferred at around 3/4 of the speed of a SATA. But the call is yours to make. Also, the cables for IDE is clunkly and gets in the way. The difference between cables, is shown in the image below.


So taking your selected cable and plug it into the back of the harddrive. With IDE harddrives its simple to see where to plug it in, and the small stopper at the top, assures you can only put it in, one way. As for the Sata, look for a slot with a L shape section cut out, and then, match the slot of the cable to that point and you simply just click it in.

Now comes the careful. In order for data to be trasnferred to the motherboard and and data/messages be sent back, you must hook the other end of the cable into the motherboard. They should be a slot nearby, thats matches the same look as on the device. Simply, plug it in, and you're set.

Finally, takign your power cable, and plug that into the back of the harddrive, and boom, your done. Not as hard as you assumed right? Well, the next part once your system is booted up, comes to formatting the harddriveso it can be used to write data too. But i'll leave that as a task for the reader to achieve.