3D Tetris - XNA Gaming Heaven

Computers, Gaming, Programming, Student, University, Xbox 360 Add comments

3 weeks ago, we were given an assignment to work on in small groups. The assignment was to make a game for the Xbox 360 in XNA Game Studio Express, which could either be 2D or 3D. The possibilities were endless, and so me and my partner Conrad decided to go all out and port one of the most popular 2D games (Tetris) to a 3D environment.

When our lecturer first heard about this, he was concerned that it might be a bit too much work for 3 weeks, and that we should start out small, perhaps trying to make 2D Tetris, and then if we thought we could port it across, start to make it in 3D. Fuck that we thought, and started planning a 3D game engine.

Of course, being lazy students, we didn’t do much but plan for the first 1.5 weeks, and then realised we had so much to do in very little time. So we started out by building an environment, which had a rotatable platform, and an array of booleans that would act as the movable area for the blocks. We then decided that even if Tetris 3D was even possible to play in 3D, it would be the hardest game ever…and so we did what any irrational programmer would do…make it harder. We renamed out project “3D Psychedelic Techno Tetris”, applied a spinning background with awful clashing colours, and added the aptly named “Logical Song” by German techno band Scooter…on and infinite loop.

Programming went better than we had ever expected, and we soon had a fully playable game that used a multitude of clever and intuitive methods to move and detect blocks. Without intending to do so, we had inadvertently created the first fully operational 3D Tetris Engine, which could be easily modified, and content (such as new bricks) easily plugged in. Since everything in controlled by a series of constants and calculations, you can easily change the size of the platform, the shapes of the blocks, and even the way the camera moves around the grid, and the game will work out how to make it playable. As so many people have claimed for so many different products: “It just works”.

So I guess I should get down to features:

- Blocks spawn at the top of the environment and move down until they either hit the platform or another block.
- Blocks can be rotated about the X, Y, and Z axis.
- A “shadow” block predicts where the block will come to rest if you were to do nothing further to it.
- Lines and columns that are “complete” will disappear and blocks above will move down to fill the gaps.
- The next block is displayed in the top right corner, and score / level system components are kept track at the bottom.
- The camera can be moved 360 degree around the platform, as well as up above the platform for a birds-eye view, and down the bottom for a normal tetris view.

Some pictures:

The game when you have just started. The first brick is floating above the platform, whilst the shadow brick predicts where it will fall. Both the current brick and the next brick are the same, and examples of the new types of brick we created in the game for the 3D version. Other than the standard bricks, there are 5 extra bricks to make the game more challenging.
Tetris Start

An alternate view is gained by rotating the camera.
Tetris Alternate View

An example of how things can rapidly build up if you don’t play well enough.
Tetris Build

What happens if you really mess up…
Tetris Fail

I should point out that all images above were prepared by myself in the game, and I am really not as bad at this game as it appears. I am in fact the current world champion at 3D Tetris, with a score of 3800 at level 8, and I welcome anyone who reckons they can score more than me.

Popularity: 4% [?]

These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • StumbleUpon
  • NewsVine
  • Slashdot
  • Netscape
  • Technorati
  • blogmarks
  • Spurl
  • YahooMyWeb
  • BlinkList
  • Reddit
  • TailRank
  • feedmelinks
  • Furl

8 Responses to “3D Tetris - XNA Gaming Heaven”

  1. Ewan Marshall Says:

    Easy compared to terrain generation and smoothing alone ;), and I will eventually beat your score…

  2. Apologies… | The Atheist Blogger Says:

    […] university, with a lot of coursework due in, including writing a ball game in Java, and a game of 3D Tetris in XNA (C#). What with all that to do and the numerous number of parties and fun times to be had, […]

  3. Jamie Dale Says:

    So when I asked you if the game you were making for the XBOX 360 was using XNA and you said “no”, you did in fact mean “yes”. Or was that another game?

  4. Adrian Hayter Says:

    I must have misunderstood you. I was making another game (not for the 360) using Java, so maybe thats where the confusion occurred.

  5. Jamie Dale Says:

    I asked you if you were using a 360 DevKit or XNA, you said DevKit. I’m not sure how that could have got confused with Java.

  6. Adrian Hayter Says:

    Ah, well we use both so thats probably where I didn’t read the second option :P We use XNA to write the program and then DevKit to transfer it to the Xbox as far as I am aware.

  7. Jamie Dale Says:

    That sounds strange to me. XNA does not require a DevKit to put the content onto the 360, it is, after all, managed code and runs in the .NET VM on the 360.

    A DevKit is just like a normal console except you can run unsigned, unmanaged code. DevKits also have a compiler and usually debug tools as well. On a DevKit, even the dashboard is an application to launch yourself.

    It would look like this: http://www.xb360info.com/images/xbox360.devl.foto1.jpg

  8. Adrian Hayter Says:

    Maybe someone has been throwing terms around lightly. All I know is we have a bunch of 360’s that we can upload games to, which we have programmed in XNA. They may have one been referred to as “devkits” by someone.

    Anyway, apologies for the misunderstanding in terms and in your question. Let’s not stretch it out even further.

Leave a Reply

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Login