Posts Tagged ‘XNA’

8Weekgame – Competition 2 – Named & Shamed

 

Hi Everyone,

 

Just a quick post to show you the awesome model a pal of mine done, Peter MacSorely (“Thanks Pete”):

 

Im now cleaning up my code to create some enemies flying around, and looking at doing some afterburner effects. LOTS to do:

  1. Enemies and AI
  2. PLayership weapons and upgrades
  3. Parallex scrolling
  4. Particle Effects for the starfield
  5. Shatter effect for exploding enemies
  6. Scoring system
  7. HUD
  8. Menu Screens
  9. Music and sound effects

I dont think im going to get it done the pace im going. Last week was meant to be immense coding, but due to a screaming/poorly Jude, only Collisions was done! DOH! I will be carrying on after the 8Weeks is up so i can release it via Xbox Live Indies Games and look to create a Windows Phone 7. I have also named the game X-Typed, as this is a R-Type like game, and i couldnt have XType because Jaguar has nicked that!

 

On a plus note, i did manage to purchase a HTC HD7 Windows Phone 7 phone, and i can say, its AWESOME.

 

 

 

 

Enhanced by Zemanta
Advertisements

Info – ShaderToy – HLSL

Nick Gravelyn has created a cool App that compiles HLSL on the fly! I havent learnt HLSL (High Level Shader Language), but it is something that im coming too in my book XNA Game Studio 3.0.
Check this out if you have any knowledge of HLSL here.

NB: You will need .NET Framework 4.0 found here.

Direct3D 10 Graphics Pipeline
Image via Wikipedia
Enhanced by Zemanta

8WeekGame – Competition 2 – Details

I havent talked about this for a while. The first competition was a roaring success in terms of what was achieved – ie 3 Games made in 8 weeks. Shawson did a blinder in Javascript using some of the new HTML5 Canvas elements, and ManicSpaceman won the competition, which was well deserved.

Now the 2nd competition will begin on 04/10/10, but this time the brief is simply:

  • 2D side scroll
  • 1 playable level
  • Cannot use pre-made libraries (Apart from standard ones line XNA)

Shawson has decided this time to use C# XNA due to winning a competition, where he won a MSDN Ultimate subscription worth £13,000! Well done Shaw!

I have already thought about the type of game i want to do, which will be a space side scroll, with space ships, aliens etc. This time round i will design the game properly before coding so that i know what im doing before the competition starts. The rules state we cannot begin coding the game until 04/10, but we can design!

Martin has decided to do a Double Dragon clone, and Shawson is toying with Cannon Fodder, so a diverse selection!
Anyway i will blog more info when i have it.

Info – Game Programming Terminology – Part 2

**This post follows on from Info – Game Programming Terminology – Part 1.

As per my previous post, the following are terms which you may find useful, again these are inspired by my knowledge and Chad Carters excellent book, XNA Game Studio 3.0 – Unleashed.

Effects:

Effects are quite simply used to get any 3D object to be shown on the screen, with effects like:

  • Textures
  • Light
  • Position of Points

One of the XNA classes to use is BasicEffect which will have one or more technique, and a technique will have one or more passes.

NB: More info to come on the explanation on technique and pass.

Index Buffers:

As we mentioned in the previous post, vertices are stored in Vertex Buffers, which is an area in memory containing lists of vertices. So an index buffer is an area in memory that stores indices that correspond to our Vertex Buffer.

For e.g. if you wanted to draw triangle, you use 3 points (x,y and z if needed) in the vertex buffer, i.e 3 x Vectors (x,y,z). If you want to draw a Rectangle (2 triangles), you could use 6 Vertices in the Vertex Buffer. But because the vertex structs in XNA are memory intensive, AND some of the vertices would be duplicated, then you only need to use 4 in the Vertex Buffer.

The Index Buffer will store 6 indices that correspond to the vertices, in the order we want them rendered. This means only the indices are duplicated and not the complex vertex data.

Good example of this is explained here.

Info – Game Programming Terminology – Part 1

I have started doing Chad Carters book, XNA Game Studio 3.0 – Unleashed, and im now on Chapter 4, Creating 3D Objects. Chad writes the book in a very unique way, where he starts with 3D Game logic first before 2D. You may think this is silly, but it is helping me solidify my current knowledge of 2D XNA programming, and making me delve into 3D, way before i would of without this book (maybe never). So hats of to Chad because i think it is actually the way to do things.

On reading i up some new terminology (to me anyways), which i will share with you now, plus some that i already knew, but the newbies of the gaming world may not know:

Vertices/Vectors:

This is an important part of 3D and 2D gaming. All game objects are represented by points in space as a Vector. These are x, y and z coordinates (Cartesian).

Within XNA there are various Vector structs:

Vector2 (X,Y)

Vector3(X,Y,Z)

Vertex Buffers:

The 3D objects we talked about are made up of triangles. This is because the Graphics cards are designed to use triangles as the basic primitive. For e.g. a rectangle is made up of 2 triangles. A triangle in 3D space is 3 vertices.

Vertex buffers are used to store the 3D points in memory. XNA uses the coordinate system by:

x = goes from left to right  – e.g. left = -1 right = 1 (Horizontal axis)

y = goes up and down – e.g. down=-1 up = 1 (Vertical axis)

z = goes forward and back – forward=-1 back=1 (Depth axis)

A lot of 3D geometry going on here, but as Chad says in his book, even though XNA does a lot for you, it is good to know the math behind it.

Info – My YouTube Channel

My YouTube channel can be found here. At the moment this only includes videos of Manic Mummies, my 1st game i did under the 8WeekGame competition. I hope to add more videos of upcoming games and video Tutorials for XNA, so please subscribe for future content.
I will post on here also to let people know when new content is up though, and hope to tie in Tutorials from here to a Video tutorial on YouTube.

Info – How The XNA Framework Operates – Beginners

Unlike Windows programs (which are event driven), XNA programs runs in a continuous loop until the game exits. While the game is running, the Garbage Collector releases/reclaims managed referenced memory which isnt used. On a normal Windows PC, there are 3 Generations of memory, but because the Xbox 360 uses the .NET Compact Framework assembilies, there is only 1 Generation. This can cause Latency within your programs if you are not careful with memory and the GC needs to run often.

As i said previously, the main application calls your game (inherited by Microsoft.Xna.Framework.Game). The Game class contains various methods which are called during runtime in the following order:

  1. Main games Initialize method.
  2. Each game component Initialize methods (if you have any)
  3. If your game has any Drawable game components, then their LoadContent methods are called.
  4. Main games LoadContent methods are called.
  5. Main games Update methods are called.
  6. Each game components Update Methods.
  7. Main games Draw methods are called.
  8. Each game drawable components Draw methods are called.
  9. The game then loops around 5-8 (ie Update then Draw methods for the main game and components)
  10. If you reset the device, then UnloadContent is called.

This is a basic illustration of what goes on within the nuts and bolts of the loop. The XNA Framework handles the Game Loop within the Framework, either by a fixed or variable step timing. The default is fixed step and it targets 60 FPS (1/60th second).
What this means is that Update method is only called when the Game member TargetElapsedTime elapsed. If it is not time to call Update again, the Draw is called. Microsoft have also built an IsRunningSlowly, which means the game is running under 60 FPS, so XNA tries to compensate and calls Update extra time until caught up (without calling Draw in between).

For more information on the Application Model Overview – See here.

Tutorial – How To Start a New XNA Project

Again, this is aimed at beginners who have just started using Visual Studio 2008. To start a new project:

XP Users:

  1. Use the mouse and hit Start icon in the left hand side.
  2. Navigate through All Programs->Microsoft Games Studio <Version number>Microsoft Visual Studio 2008
  3. This will start Visual Studio IDE. Now to start a new Project navigate either:i) If VS2008 takes you to the Start Page tab (With the MSDN RSS Feeds etc), on thre top left hand  square  will will a square with clickable links:

ii) Or you can navigate by using File->New-Project and selecting one of the required XNA templates (Which should be under C#)

Tutorial – Installing XNA Games Studio

This ia quite an easy one really. You will need the following to begin coding XNA games:

  1. A PC (!)
  2. Visual Studio Express/Professional/Team Edition. If you want to code for Windows 7 Modile, you will need the 2010 edition.
  3. XNA Games Studio 3.1 or 4.0 (Only beta version is available at time of writing) for Windows 7 Mobile.
  4. You can sign up for the Creators Club website for free. If you want to install games on your Xbox you will need to pay a 4monthly fee of £39.99 or £60.00 for annual.

Then all installed and ready to go. There are requirements for Graphics Cards and shader models, but all modern cards should be ok for your needs.

The hardware requirements are though from Microsofts website:

“Hardware requirements are identical to those for Visual Studio 2008, plus a graphics card that supports DirectX 9.0c and Shader Model 1.1 (Shader Model 2.0 is recommended and required for some Starter Kits). Zune development requires the Zune 3.0 firmware.

Hello world!

Welcome! My first post of many hopefully to document/rant about my journey learning XNA! The book im reading at the moment is XNA Game Studio 3.0  Unleashed (Chad Carter). I have just started this, but just flicking through it , there is alot! I hope to garner enough skills and knowledge to truely be a force to reckon with once our 2nd 8weekgame competition kicks off again in October.

More to come when i know it!