Dan Kenny Game Design
  • Home
  • Portfolio
    • Game Design
    • 2D & Animation
  • Blog
  • About Me
  • Contact
  • Home
  • Portfolio
    • Game Design
    • 2D & Animation
  • Blog
  • About Me
  • Contact

Introduction to C# in Visual Studio Part 3: Loops

2/1/2019

Comments

 
Hey there, Gamers and Game Makers!

in this week's blog, we're going to continue our introduction to C# in visual studio by looking at loops. Specifically a for loop and a while loop.

Loops are used when we want to repeat a sequence of code several times over as long as a particular condition is met. The first loop we'll be looking at is the for loop. The for loop is used when we know the sequence is to be executed a certain number of times. For example, we might only want it to run as long as an index is below a certain value.

A for loop starts off with the keyword for followed by the condition. With for loops we tend to have an index variable that keeps count of the iterations through the loop along with what's called an exit condition. The exit condition is what the index is compared too. If we did not have an exit condition, the loop would never end. The following for loop iterates through the loop as long as the index is less than the count variable. It writes out the current index step each time. Once we reach the exit condition, the loop ends.
Picture
Picture
A while loop can work in a very similar way. However there are a few very important differences. As you can see, I've initialized my index variable outside the loop and the increment of the index is handled after each execution of the code. Same as before, if we don't have an exit condition, the loop would never end. 
Picture
​Try coming up with your own loops and see what results you get.

Until next time!
Comments

Introduction to C# in Visual Studio Part 2: If Statements

1/1/2019

Comments

 
Hey there, Gamers and game Makers!

In this week's blog post, we will continue our introduction to C# in Visual Studio series by looking at if statements. We use if statements when we want to check if certain conditions have been met before executing a particular body of code. For this example, we're going to create a console app that asks the user to input their age. If they are over 18, we tell them so. If they are under 18, we will tell them something to that effect.

As you can probably guess based on the first tutorial on variables, we are going to need an int variable to store the age. We'll create an int variable called age but we wont assign it any value at this time. We will then use a Console.ReadLine() to assign the users input from the keyboard to be the value of age.

Picture
We can now write our If Statement. An if statement consists simply of writing if followed by the conditional expression you are checking in brackets. This is then followed by the code you wish to execute if the condition is met in curly brackets. In this example we are checking if the age value is greater or equal to 18, we will display to the screen a message saying you are old enough to enter. With if statements we can also have else ifs that will check another condition should the first one fail. You can do as many of these as you wish but one would urge not overdoing it as it can create messy code.

I have a single else if that checks if the age value is less than 18 should the first if fail to find the value to be above 18. if it is below 18, we display a message to the screen saying you are old enough to enter. We can also have else statements. These do not check a condition but rather execute a body of code should all previous ifs fail. This can be useful should the user enter an incorrect value and we need to notify them of such. Our program looks as follows.

Picture
Picture
Picture
If statements can be used to check conditional expressions on strings, bools and more. The logic is the same. We can also use the "or" operator, || and the "And" operator, && to check multiple conditions at once before executing a body of code. With the && operator, both conditions must be met in order for the code to execute. However, with the || operator, only one of the conditions has to be true. For example.
Picture
Picture
Picture
In the next tutorial in this series, we'll be looking at how to use loops.

Until next time!

Comments

Introduction to C# in Visual Studio Part 1: Variables

1/1/2019

Comments

 
Hey there, Gamers and Game makers! 

Welcome to a new tutorial series, An Introduction to C# in Visual Studio. In this weeks tutorial, we're going to be looking at what variables are in C#. The various types and how to use them. So, let's get started!

First thing you'll need is to have Visual Studio installed with the C# language package installed along side it. Once you have done so, click New, then New Project and select Console App. For the purpose we'll be using a console application rather than a desktop application for ease of the tutorial. Go ahead and call the project whatever you like.
Picture
You'll be presented with the a basic hello world program. Don't worry about what you see for now. We'll be only looking at variables for this tutorial. So, what exactly is a variable. You can think of a variable as a container for information and different types of variables hold different types of information. A variable will reserve space in memory for whatever type of information it's to store once it has been created, or declared, to use the proper terminology.

What types of variables are there? The five most common ones you'll deal with are int, float,bool, string and char. The int and float variables represent numbers. An int variable deals with whole numbers only while a float can handle decimal numbers. A bool is a variable that stores a true or false value and a string is simply a string of text. The char variable stores a single alphabet character.

Let's look at some examples. Starting with how to declare an int variable. I start by declaring the type of variable by typing the word "int" followed by a name for the variable.Since an int is used for whole numbers, I'm going to call this variable "num1". I then assign a value to the variable by using the "=" sign followed by the value I wish to assign which in this case is "2". I then end the declaration with a semicolon. It's very important you do this as you'll get an error otherwise.
Picture
This is all well and good but what can we do with int variables? Let's say we have more than one int variable. We can use basic mathematical operations on them in order to say, return the sum of those int variable. Let's try doing just that. I already have one int variable, so, I'm going to create a second int variable called "num2" with a value of "4" and also create an int variable called "sum" that will store the sum of my other two int variables.
Picture
As you can see, we have a variable that will store the sum of our two numbers, but, how do we actually get the sum of those two numbers and assign it to the sum variable? It's nearly as you would expect to do it on paper, we add the two variables using an addition sign. We say sum is equal to num1 + num2. Be aware that while in this instance the + sign is being used for addition, it can also be used for concatenation, which we'll get to at a later stage.
Picture
Great! We now can add our two numbers together. However, we can't see the result at the moment. This makes it difficult to tell if the calculation is working and if it's working correctly. So, how do we display the result of our addition? We can actually borrow a line from the default hello world program for this. You may have noticed that line of code that says Console.WriteLine("Hello World!");Well, a Console.WriteLine() is used to display whatever is between the brackets to the console window. We can therefore use it to display the result of sum. To do so, it would look like this:
Picture
Now, we're ready to run our console app for the first time and actually see the result displayed in the console window. Go ahead and click Start. As there should be no errors, the program should compile and you'll be given a window which looks like this:
Picture
This same logic can be applied to floating point numbers or doubles. Try it out for yourself and see what kind of results you get!

Let's take a look at strings. We declare strings much like how we did for ints. We start off with the data type which in this case is a string followed by a name for the variable. In this case I'm going to use the variable to store my name, so, I simply call it name followed by the string value of "Dan". If you use a Console.WriteLine(), you can print that value to the screen as you did before with sum.
Picture
Now, remember I mentioned concatenation before? Now's the time we're going to use it. So what is concatenation when it comes to strings? Concatenation of strings is when we take two or more strings and join them together. They don't always have to be variables. I can write a string in my Console.WriteLine() along with a variable if I want and it'll display it in the console. For example:
Picture
Picture
Let's take a look at a bool variable. As I've said before, a bool variable is used for storing a true or false value. This can be used for checking certain criteria. For example, if you are over 18 or not after entering you age for validation. A bool value could be used. Let's look at how we declare a bool. As with our previous variables,  a bool is declared much the same. The keyword followed by a name and value. It's important to point out, you don't always have to assign a value when declaring a variable. For a bool for example, it may not make sense to assign true or false until after a certain check has been made. Defaulting it to say a true value might create a problem. I can display the current value to the console as before using a Console.WriteLine().
Picture
Picture
In the next tutorial, we'll look at using if statements.

Until next time!

Comments

What I've Been Playing: December 2018

28/12/2018

Comments

 
Hey there, Gamers and Game Makers!

This week, we're going to be taking a look at some of the games I've been playing over the last month.

Spider-Man

Picture
Spider-Man is definitely among my top games of the year. Aside from having a fantastic story, the mechanics of the game are outstanding. Nothing feels as satisfying as swinging around a richly detailed New York city, fighting crime and uncovering secrets and easter eggs. Spider-Man is the type of game that's so fun to play that you'll keep coming back to it even after completing the story. It's the superhero game I've wanted for a long time.

Call of Cthulhu

Picture
I'm a massive fan of the works of HP Lovecraft. So, as you can imagine, I was very excited for a new game set in his universe of works. Especially as this particular game was inspired by the old school table-top Call of Cthulhu game. So, does Call of Cthulhu live up to expectations? Yes and no. The problem with any game based on the works of Lovecraft is the expectations are always going to be set high. Perhaps to high to ever actually meet. 

For me, the game didn't scare me at any point but actually you can say that's not a failing of the game as the works of Lovecraft are designed not to scare you right off the bat but, to rather unnerve you more and more as you progress over the course of the story. The game does well in parts to present the player with scenes of horror that would take a toll on their sanity. The game offers you multiple outcomes based on your choices but none of the variations alter the outcome drastically and thus there isn't much there to make you play again.

The game is not a bad interpretation of Lovecrafts works but it's also not a great one. The game has some interesting mechanics and the story is interesting enough to hold you throughout but I feel this is still not the Lovecraft game we've been waiting for.

Red Dead Redemption 2

Picture
Red Dead Redemption 2 is by far one of the most detailed games I've ever played. At the time of writing this, I'm actually not that far into the main story of the game. Simply because I keep getting distracted by all the things going on in the world. While the level of detail in both the world and mechanics is something to truly admire, I feel the detail on the mechanics can sometimes be perhaps a bit much. For example, the need to dress to mach the temperature of your current environment is an interesting mechanic, it can sometimes become annoying. Maintaining your cores can also feel a bit tedious at times. That said, that's a very small complaint that doesn't stop me enjoying all the game has to offer and I feel RDR2 is a game I'll be playing for a long time to come.

Hitman 2

Picture
Hitman 2 is a game I have a great amount of fun playing. The level of detail is insane in each mission. From the level design right down to the NPC routines and multiple unique ways to eliminate your targets. What I enjoy about playing Hitman 2 is it shows how bad of an assassin I can be. One minute, I'm in the middle of planning the most fiendish way of killing my target and the next, I'm rushing to hide the body of the random guy who saw me poisoning a drink while the cops are at the door and everything is spiraling out of control. Hitman 2 is also a game that really offers a lot of reasons to replay missions to find all the ways you can eliminate a target. Hitman 2 is easily up there with my favorite games of the year.

Until next time!

Comments

Tutorials Are Coming Back!

25/11/2018

Comments

 
Hey there, Gamers and Game Makers!

Yup, you read that title correctly. Tutorials are making there way back to the blog soon enough. I've been planing out tutorials for a new introduction to coding course followed by some more advanced coding tutorials. I'm also going to do some tutorials or the art side of game development for both 2D and 3D.

I also want to do some more theory based blogs discussing game design. I'm still in the process of considering if I'll make any Youtube tutorials or if I'll keep this purely on the blog. The tutorials will most likely kick off with the new introduction to coding tutorial series. If you have suggestions for tutorials you would like to see, feel free to leave a comment below or shoot me an email on the contact page!

Until next time!

Comments

Embrace the New!

25/11/2018

Comments

 
Hey there, Gamers and Game Makers!

I've spent quite a long time making games. So, naturally, over the years I developed my own pipeline if you will for how I make games. This has been changing over the last year with the introduction of new tools for art and asset creation. Combined with a hectic college schedule, I've had to change and adapt to how I make games. At first, there's a natural resistance to this. However, since making these changes, I've actually been making far better projects. The combination of time restrictions and scope forces my creative side to work that bit harder to make something fun and interesting in a shorter space of time as well as taking more risks with ideas.

So, if you're resisting a change, don't. Give it a chance and you'll start to see how it can result in you improving your projects.

​Until next time!
Comments

Christmas Jams!

25/11/2018

Comments

 
Hey there, Gamers and Game Makers!

So, with college being very hectic this year with constant projects and exams, I've had very little time for game dev work outside of continuing work on the long term project. While that's fun to work on, because it's a long term project, it's hard to get that sense of completion from making a game.

So, I've decided to remedy that by using the extra time I'll have over the Christmas break to make a bunch of small games. I've been keeping a list of small projects I've wanted to make. I'll make them in a somewhat game jam style structure. I'm going to give myself two days per project but if one takes my interest, I may spend longer on that. The goal is to create a few small yet polished little games in a short period of time. It'll be a way of releasing some of the creative energy I've had to bottle up as of late with college work.

Once, I have these games made, I'll more than likely put some if not all online for folks to play. I'll post more about that at the time. So, be prepared for a mini explosion of games from me after Christmas!

Until next time!
Comments

The 3 States of Something New

25/11/2018

Comments

 
Hey there, Gamers and game Makers!

Have you ever decided to start learning something new? It's great, right? You get so excited about it and you gather everything you need. But, have you ever noticed that excitement fade away quite quickly? In this week's blog, we're going to look at the three states of starting something new.

#1 Buying/Getting Tools

Starting to learn something new is pretty exciting. You get excited about the tools/software you're going to need to get. You get excited about the possibilities of what you can do after you've learnt this tool or process. This stage of the process is the most exciting because it's basically the concept or planning phase. It's still new and captivating to you because you haven't actually done anything yet. It's all still possibilities.
Picture

#2 Learning

The learning stage starts off great. You're still excited and enthusiastic about this. However, this is where we tend to become less excited as we go. Sometimes the learning curve is that bit steeper than we first thought. It's when we hit this little bump in the road that we can become disheartened. Don't feel bad though. This happens to us all at some point. Keep in mind learning something new can take time. If it interests you, then keep at it and you'll start to get past that initial block.
Picture

#3 Practice

Now, here's the part where most people fall down. You've just spent a lot of time learning this new tool or skill.. But, if you don't keep practicing it, you'll very quickly lose all that progress you made learning it. To avoid that, it's simple enough. Practice. Yeah, it's a pretty cliché line, but, it's true, practice makes perfect. Or as near too as possible. So, I'm not saying spend hours and hours of each day practicing. You can but, you don't have too. Rather, simply spend a short amount of time often keeping basic skills sharp. Try to keep learning new elements of your tool or skill in order to expand. You'll find the more you enjoy this, the easier it is to practice.
Picture
Until next time!
Comments

Everybody Should Build a Robot!

1/11/2018

Comments

 
Hey there, Gamers and Game Makers!

In this week's blog, I'm going to be talking about why I think everyone should build a robot.

No, I'm not super lonely and need to build a friend.....maybe. I'm talking more so about why things like the Arduino and Raspberry Pi are so important. Before college, I was very much a software focused guy. I had basically no interaction with hardware beyond the basics of my PC. All that changed one fine day when my hardware lecturer introduced me to the Arduino.

Picture
So, for those who aren't familiar with what an Arduino is. It's a microcontroller which basically means it's a small computer on a single integrated circuit. The great thing about an Arduino is that you can build nearly anything with them. During my first year of college, I built things ranging from temperature sensors to rhythm pattern locks which was basically a lock that would not open unless a specific knock pattern was made. Taking the secret door knock to the next level!

Outside of college, I ended up ordering both an Arduino and a Raspberry Pi along with a bunch of parts and sensors. I ended up using an Arduino to build a robot car that could find its way around the environment either by line tracking or using sonar sensors. The really cool thing about building these things is that you still need to code the logic for all this in an IDE for the Arduino. The great thing here is you're not only learning to code but you're seeing a physical real world result of your code. It's a pretty satisfying feeling seeing a bunch of parts and sensors come to life when you write good code behind it all.

Picture
The Raspberry Pi is much similar to that of the Arduino except it's more like a fully fledged computer. While not that powerful compared to a desktop, you can still do amizing things with a Pi and they're a great starting point if you want to get down and dirty with coding a computer or learning about Linux based systems. My advice would be, if you have an interest in code but also like the idea of building something. Try your hands at something like the Arduino and you'll be amazed at all the things you can make and that it'll actually make you a better programmer.

Until next time!

Comments

Post-mortem: Hide The Body

1/11/2018

Comments

 
Hey there, Gamers and Game Makers!

It's that time again when we dive into one of my past games and see what worked and what didn't work. This time we'll be looking at my most recent game, Hide The Body.

Picture
So, as you can probably guess, Hide The Body is a game about hiding bodies. Specifically about doing so in a short space of time before the cops kick in the door and pin the crime on you. Hide The Body was born from a similar concept I had already made. A stupid game I made in a short space of time called Hide The Porn. I'll leave it up to you to figure out what that was about. While Hide The Porn was very rough around the edges, it did have a solid gameplay loop. One that would fit very well with Hide The Body. Now, with Hide The Body, I wanted to create a game that implemented that core gameplay loop and improved upon the games mechanics. 

While the theme of Hide The Body is quite grim on the surface, it was important that the game not take itself seriously. The idea was the game been very difficult yet amusing and down right goofy. Visually, I went with a low poly style as it was the most disempowering to the grim theme. I gave it a noir black and white style. This served two purposes. One, it was visually a style I found very appealing and two, it acted as a game design element to keep visual gameplay uniform.

Picture
As for the gameplay loop itself, it was simple. Hide all traces of a crime within a short amount of time. The actual time duration from level to level was unknown to the player. The only cue was the rising tension in the audio. This served to stress the player even more. If you hid everything in time, you won. If you didn't, you lost and time was always very tight. Balancing this was very difficult as there is a fine line between hard yet fun and just purely frustrating. It was also important that replying a level was fast as if you were stuck on a hard level and you kept having to wait a minute to reply the same thirty seconds of gameplay, you'd soon become frustrated at the waiting. 
Picture
So, let's look at what worked. The gameply loop was much tighter and refined from what it was in Hide The Porn. It felt a more polished game overall. The game struck the balance between difficult and fun very well providing that real sense of satisfaction upon beating a level. Visually the game felt like it was its own thing. It felt very cohesive and very much suited to the theme of the game itself. The game was also my first game to be published on the Steam store which in itself was a success to me. This brought a new market to the game along with new reviews and feedback I wouldn't have gotten elsewhere.

The game had a successful launch and was met with largely positive reviews. While the game is quite niche, it found an audience that enjoyed it and provided feedback that led to patch updates that greatly improved the game. 
Picture
So, what didn't work? Well, this is not so much something that didn't work as it's just a wish. I would have liked to have had more levels at launch but time simply didn't allow for that. But, given the difficulty of the game, having 20 levels at launch was still a good number. I would also have liked to have had more animations in the game but the drawback in that was being a game that focused on fast time sensitive gameplay, adding in animations for every action would have been counter intuitive to that process.

While the game had a decent market launch, it didn't break any sales records. On the upside, the analytics gained from the launch and maintenance of Hide The Body has provided fantastic information for future releases and marketing. Overall, this game is one I'm very proud of. It's a game that has a solid gameplay loop with good visuals that doesn't take itself seriously. It's a game that knows who it is and it's one I still enjoy playing.

Until next time!

Comments
<<Previous
Forward>>

    Archives

    April 2019
    March 2019
    February 2019
    January 2019
    December 2018
    November 2018
    October 2018
    September 2018
    August 2018
    July 2018
    June 2018
    May 2018
    April 2018
    March 2018
    February 2018
    January 2018
    December 2017
    November 2017
    October 2017
    September 2017
    August 2017
    July 2017
    June 2017
    May 2017
    April 2017
    March 2017
    February 2017
    January 2017
    August 2014
    November 2013
    September 2013

    Categories

    All

    RSS Feed

© COPYRIGHT 2020. ALL RIGHTS RESERVED.