Thursday, 31 March 2011

Update

A few updates:
  • I made a calculator a few days ago (with a twist)
  • All the games I make will be uploaded to MediaFire (the file hosting site) where they'll be available to download via a link on the right-hand side of this blog. Hopefully MediaFire will makes it easy to download them.
  • Over the past 3 days I've been working hard on a text-based game currently called 'Battle Monsters' (don't worry, this isn't going to be its final name).
Basically the tutorials I'm following told me to make a very simple fighting game, where you can choose to either attack or defend. This gave me all sorts of ideas for improvements, but what intially started as a few good ideas has spiralled out of control. The game's code is now so vast I'm having trouble navigating it. Just as well I learned how to use methods, which are essentially 'mini-programs'. They're great because they let you call (use) a piece of code whenener you want it.

I have a burning enthusiam for this current game, but I know soon it'll burn out and I'll be left with a mountain of unfinished and confusing code. So I'm trying to rein the game's scope as much as possible. I hope that once I've finished the initial foundation of the game everything else will be easy, and cosmetic.

Once I've finished this game I'll eventually move on to super-cool graphics! (and not just text-based games).

Here's some screenshots of 'Battle Monsters':

Sunday, 27 March 2011

My second game

I've been working on a text-based game (the only game I can make right now). It took an hour and an half, so not too long.

My 2nd game, Pun Escape


I've started using DO / WHILE statements which means I can make the game repeat itself. I can see how powerful the DO / WHILE statements are now. In this new game, the user types something, the game gives a response, then it goes back to the beginning. It means the user can type the same thing twice and get the same response, or achieve tasks (or just do anything) in different orders.

So you can examine the room, examine yourself, pick up items, etc, in any order you want. I'm making it sound better than it actually is, but only because this is the tool I needed for the 1st game I made.

I've called it 'Pun Escape'. It's based on a stupid puzzle my mom told me when I was a boy. It begins as you find yourself in a room with no doors and windows, and you have only a table and a mirror with you to help you escape.

I made sure to include lots of variations on what people could type.
e.g. to 'go to the table', there's like 20 variations the game would also pick up, such as 'examine table', 'look at table', inspect the table'. Because it's spirit-crushing when someone gets annoyed at a game because of unusability. Including so many variations reminds me of Douglas Adams' text game, The Hitchhikers Guide to the Galaxy. It's the only text game I've played which doesn't annoy due to the program not recognising something you type. Here's a version of it.

The Hitchhiker's Guide to Galaxy (flash version, hence the fancy graphics).


And here's a link to Pun Escape

I'm not sure how good these file hosting sites are. The first 1 I used requires the downloader to enter their email address. And the download button doesn't work for me, for this new one.

My first game

I've made a game! Well, it's a game in the sense that it changes based on user input. And it's really short, but it's still 'a game'. I call the game 'The Cake is Inevitable'.

My creme de la creme, 'The Cake is Inevitable'.


Here's a link to it as a download: http://www.filehosting.org/file/details/214517/The_Cake_is_Inevitable.exe

I would have liked to have known how to make the program go back to a previous line of code, because in one section I wanted the program to repeat itself until a certain statement is true. At the moment all I know about looping is 'if / then' statements. I'm sure other loop statements hold the answer.

The Endless Blue

Here's the default game for a new Xbox Windows Game. Yes, it's just an empty blue screen. The tutorial I'm following says it's actually 'infinite space in 2D or 3D' which makes it sound more exciting.

default xbox windows 'game' (playtest mode)

Now I'm confused because a lot of jargon is being thrown at me, including:
  • methods (e.g. the main game method, constructor, initialise, loadcontent)
  • statements
  • classes (e.g. an input class)
  • variables
I think methods are a collection of statements. Like, mini-programs. They have names and purposes. I've never seen the word 'method' used in this context before though.

Maybe a 'statement' is a single line of code?

I'm fairly familiar with variables. They hold values or even text information.
E.g. the variable 'number of lives' could be 3, and can change throughout the game.

I don't know what a class is.

Saturday, 26 March 2011

Hello World!

Day 2



When I opened Visual Studio today, a new option was available: XNA Game Studio 4.0! I guess the program had to be restarted for this option to appear.
Creating a new XNA game studio project in Visual Studio

















Choosing 'Xbox 360 Game' creates a new project file. I was surprised to see the new file already comes with some code. It's not a lot of code though. I'm not sure what it does either.
Pre-existing code for XNA game studio projects.















Since there's so much pre-existing code, I don't think this is the best way to start learning C#. I might get confused about what I've done and what was already there when I started. I wonder what project type I should choose to get the least amount of pre-existing code?

I'm going to follow a tutorial where you make a pong game. It suggests you start with a Windows game (an option under XNA game studio). I guess if I made a xbox game I'd only be able to playtest it on an xbox? (And playtesting on the xbox requires a paid membership to the xbox creators' club)

A new problem. When I playtest the pre-existing code, I get an error message saying my graphics card isn't good enough (even though my laptop is less than 1 year old).

error message when trying to run a game using F5


Thankfully there's a solution, which I found here. It was to have the game use a 'Reach' profile instead of the default 'HiDef' profile. (Maybe my laptop can't run high definition graphics then?) This webpage has an easy walkthrough to set the game to Reach graphics.

The solution explorer
This may be a good time to look at the 'solution explorer'. A strange name for what seems to be a menu where you select different aspects of the game. The most important option appears to be Game1.cs and Program.cs, which is the code for the game.


Friday, 25 March 2011

Day 1

XNA game studio in my start menu.
Today I've taken my first steps to making an xbox indie game.

First I installed visual studio 2000 and Microsoft XNA Game Studio 4.0.

After this I'm not sure what to do...

Clicking on XNA game studio in the start menu brings up a list of programs and links, but none of them is actually a program to make games with.

I've been googling what to do next, and I've eventually found this bit of helpful text (here):

You have heard all the buzz, you might have even seen some cool games that people said were written with XNA, but you're still not sure what exactly XNA is and what you can do with it. "XNA" the term is a brand, it refers to all the Microsoft Technologies that have to do with developing games. This includes both DirectX and the XNA framework. Most of the buzz lately is due to the XNA framework and chances are that is why you are here.
The XNA framework is an API. What that means is that it is a framework developed by Microsoft to help you make games faster. It's not a drag and drop game maker and you will need to learn how to program before you can use it. It is easy to use, but you will have to be somewhat technical to develop games with it.
The XNA framework is not a game engine. It does not include physics, collision detection and other things often found in game engines. It is a game development framework, but how the game works is programmed entirely by you.
XNA Game Studio is the environment you develop in. XNA Game Studio is basically a plug-in that gets installed into one of the currently supported Visual Studio environments. Typically XNA framework games are written in C#, but there is some support for other .NET languages with some slight functionality lost.

From this I gather that:
  • XNA Game Studio is a.k.a. XNA framework
  • You write in C#
  • C# is a .NET language
  • You use the XNA framework in Visual Studio

I've opened Visual Studio and there isn't an obvious choice from here. I guess I'll choose file > new > project.

Starting a new project in Visual Studio


The options when you start a new project in Visual Studio
Now what do I choose? There's no obvious choice like 'XNA framework' or 'Xbox Indie Game'. I thought it could be 'Console Application' (since the Xbox is a console) but googling the term gives:
A console application is a computer program designed to be used via a text-only computer interface, such as a text terminal, the command line interface of ...

It seems I also need to learn how to program (using C# (how is this pronounced? 'see hash?)). I've ordered a £15 book from amazon, which was recommended for beginners on this thread.


It seems the next step is either to join the App Hub for around £60, or to learn some C#. I think I'll do the latter first - at least see if programming is for me, before I shell out that much money.