個人檔案eXtreme's Place相片部落格清單更多 工具 說明

部落格


3月19日

Update - 3rd Person Camera

I just wanted to inform you that 3rd person camera has been added to Spaceship's Journey game! It still too rought and I need to come up with a way of smoothing it but it's working thanks to John Sedlak who has been helping me out!

Screenshot (CMD Shows It!)
Image Hosted by ImageShack.us

By making 3rd person camera I have only added more to my "Objective list" but this is very important step in making any kind of game..

Feature I still need to implement:
-Smooth movement
-Camera rotation around model
-Collision detection
-Shooting
-HUD
-Menu

Cheers!
3月17日

About my Spaceship's Journey game


To be honest I haven't really thinked about storyline mostly because I knew things I need to implement no matter what storyline might be - 3rd person camera, movement, spaceship's rotations etc..So once I have those features working great I'll think more about storyline and leave programming a side for a while..

At the moment, when game start you'll see two spaceships.
Your and enemy's (I'll also change the look of those spaceships in the future), trying to move and rotate around will also affect enemy (basic AI) so it'll be little hard to hit him...maybe too hard at this point, but I'll make it easier in the future!

Screenshot of the gameplay
Image Hosted by ImageShack.us

Feature I still need to implement:
-3rd person camera
-Collision detection
-Shooting
-HUD
-Menu


It will still be a long way just to get to the stage called "something that looks like a game", but this is fun and I really enjoy working on it in my free time! From time to time, if something has been added to this game I'll be sure to write post about it!
Cheers!

Introduction To 3D Game Developing


3D Space

In the game development (just like in the real life) 3D world is an empty space.Every object in that space can be defined by X, Y and Z coordinate.X represent horizontal line, Y represent vertical line while Z represent depth.

The only one type of element that can be drawn in 3D space is point.Unbelievable as it might sound, every model you see in your everyday game is represented by a n-points.By connecting n-points you can draw anything from lines, to spheres..
But before you're able to do that, we need to learn another thing called Vector.



Vector

"Vector is a concept characterized by a magnitude and a direction." - Wikipedia says.Now because I'm not going to act as professional game developer (which I'm not) I'm going to say it using my words:

Put it simple vector is an arrow graphically.
It's invisible in the game or anywhere else you might be using it..
There are two types of it : Scalar and Quantity.

Scalar type represent vector defined by magnitude but without any direction being associated.
Quantity type represent vector defined by magnitude and direction (Arrow's head point in the vector is its direction).

Example
Imagine you have given a point A in 3D space.You know its X, Y as well as Z coordinate position, and you're asked to represent that point by using Vector. X = 2; Y = 3; Z = 15

First write down the Vector3 (3 means 3 value are involved) skeleton -> A (x, y, z)
Next simply replace the given coordinates with your skeleton code -> A (2, 3, 15)
That's it, working with vectors can only make your life easier!

After knowing vector you're able to position your model in 3D Space using XNA (and even move it around), but to be able to render them you're going to need to know what Matrix is and how can it ruin your life..



Matrix

Forget about popular movie called "Matrix" it's not such fun in game developing world..
I'll explain it using my method, if you're up for some complicated theoricaly explanation just google for it!

In XNA (and game development in general?) when you want to render your model in the game, you're going to need to define three things - Matrix World, Matrix View and Matrix Projection.

-Matrix World
If you want to rotate your model in any direction, translate it and do such major things you'll mostly create World Matrix for that purpose.

Example:
Matrix World = transforms[mesh.ParentBone.Index] * Matrix.CreateRotationY(spaceShip.modelRotationY);

-Matrix View
View Matrix is very simply - it just affect your camera.You mostly just need to setup CameraLookAt method there using camera position, camera's target and UP vector.

Example:
Matrix View = Matrix.CreateLookAt(spaceShip.cameraPosition, Vector3.Zero, Vector3.Up);

-Matrix Projection
Projection used to be quite challenging at first, but once you get feel of it, you can master it.It creates perspective by combining aspectRatio and FieldOfView.

Example:
Matrix Projection = Matrix.CreatePerspectiveFieldOfView(MathHelper.ToRadians(45.0f), aspectRatio, 1.0f, 10000.0f);

Now you might have learned something about Matrix, and next time you see them you'll at least know what each Matrix does.Of course you're going to need to understand them much better if you plan on making some complicated camera systems!



Conclusion

I hope you enjoyed reading this first article about 3D Space, there might be something wrong, etc but hopefully you learned something new.I'll soon introduce you to my hobby game I'm writing in free time and share some code out of it!
Till then, Have Fun!
3月16日

Welcome!

I'll kick this blog off giving you deep introduction into 3D.I hope this will be interesting for you and you'll learn a new things you didn't know before.Before I start writing anything, keep in mind that I'm by no means professional game developer, it's just hobby for me, so I'm just next XNA user!

For the further reading, no C# knowledge is required, however if you want to learn to develop games on your own (using XNA) you're going to need to learn it.

So let's begin!