søndag den 16. marts 2008

Peoples SDK screenshots

Hi again.

Half a year ago, i was working on an MMO engine, which turned out to be quite good. However, in the past months i have not had time to develop it further, but now things have changed. I have improved and expanded the engine so that it now supports better terrain rendering, better material system, AI and much more. I am also renaming the engine to Peoples SDK, since it can be used for much more then just MMO's, and it is not just cold bin libraries anymore, it also contains programs like a world editor and a patch manager. I am now releasing a little eye-candy from the engine, so you can see what kind of graphics it supports. The first three screenshots are with directional lighting, and the last is with dynamic lighting:

Btw. i am tired of using the terrain textures from remiers site, so if you have some nice terrain textures you would like to share, please send them to my e-mail (steffan88@gmail.com).

3D model collision

For a long time, 3D collision has been the biggest problem I have faced in the field of game development. XNA comes with the BoundingBox and BoundingSphere classes that provide a very fast collision solution. However, these classes do not give you very accurate collision detection when applied to 3D models, because they do not check each triangle in the model.

The solution to this problem is writing a CollisionMesh class. This class will be will be used to check Model vs. Model collision, using the model’s triangles.

However, the kind of collision checking is very costly, so it is important to minimize the amount of times we use this method. We can do this by using the BoundingBox class, to check if two models are even close to each other. If model1 and model2’s bounding boxes don’t collide, there is no reason to make the very costly triangle collision test.

Also, it is a good idea to use a low-poly version of you 3D model for collision testing, depending on how accurate your collision needs to be.

For a concrete example of this collision theory, download this sample. Here is a short walkthrough, on how to use the CollisionMesh class:

Creating a CollisionMesh is very simple:

Model MyModel = Content.Load("MyModel");
CollisionMesh collisionMesh;
collisionMesh = CollisionMesh.FromModel(MyModel, Vector3.Zero, Vector3.Zero);
After this, use the following code to check if a movment with the movmentVector, will result in a collision:

Vector3 movmentVector = new Vector3(1,0,0);
bool result = collisionMesh.Move(movmentVector, otherCollisionMesh);

Making a Real Time Strategy game

I am currently making an RTS from scratch using visual C# 2005 and XNA GSE 2.0. I will be sharing some of the experience I get while working on this project, so if you are interested in RTS development, you should check out this blog. Here is a list of things that will be talking about in my blog, but don’t be surprised if other things pop out.

  • Advanced world editor
  • Binary level format
  • Terrain rendering
  • Terrain culling
  • 3D modelling
  • Unit AI
  • Dynamic 3D Path finding
  • Networking (using System.Net)

This is not an “RTS ONLY” blog, so you might see other XNA related stuff as well. If you are new to XNA and C#, I can recommend Riemers XNA tutorials, XNA creators club (They have great code samples) and Ziggyware (for the latest XNA news)