Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


emforce

Member Since 16 May 2009
Offline Last Active Apr 22 2015 11:26 AM

Topics I've Started

Tutorial Site for Game Developers

20 April 2015 - 06:21 AM

Hi Guys,

 

I've recently been working on a tutorial site that focuses primarily on game developers and helping people to write beautiful code. The current tutorial series I've been working on is based on design patterns with a gaming twist and comes complete with java code examples.

 

If you want to check it out and tell me what you think then here's the link: Tutorial-Edge

 

Cheers guys!

 

 


xna splitscreen

03 September 2010 - 08:26 AM

So I am trying to add splitscreen to my game and i cant get it to render to two viewports properly. basically it just renders to the right viewport which is not what I want. Anyway if you could have a look at my code and tell me what I am not doing properly then that would be a great help!

Heres my code:




private void DrawModel(Model model, Matrix world)
{
Matrix[] transforms = new Matrix[model.Bones.Count];
model.CopyAbsoluteBoneTransformsTo(transforms);

foreach (ModelMesh mesh in model.Meshes)
{
foreach (BasicEffect effect in mesh.Effects)
{
effect.EnableDefaultLighting();
effect.PreferPerPixelLighting = true;
effect.World = transforms[mesh.ParentBone.Index] * world;

// Use the matrices provided by the chase camera
effect.View = view;
effect.Projection = projection;
}
mesh.Draw();
}
}


/// <summary>
/// This is called when the game should draw itself.
/// </summary>
/// <param name="gameTime">Provides a snapshot of timing values.</param>
protected override void Draw(GameTime gameTime)
{
GraphicsDevice device = graphics.GraphicsDevice;

device.Clear(Color.CornflowerBlue);

DrawModel(shipModel, Player1.World);
DrawModel(shipModel, Player2.World);
DrawModel(terrainModel, Matrix.Identity);

view = Matrix.CreateLookAt(camera.Position, camera.LookAt, camera.Up);
projection = Matrix.CreatePerspectiveFieldOfView(camera.FieldOfView,
camera.AspectRatio, camera.NearPlaneDistance, camera.FarPlaneDistance);

if (twoplayer)
{



GraphicsDevice.Viewport = leftViewport;

GraphicsDevice.Clear(Color.CornflowerBlue);


view = Matrix.CreateLookAt(camera2.Position, camera2.LookAt, camera2.Up);
projection = Matrix.CreatePerspectiveFieldOfView(camera2.FieldOfView,
camera2.AspectRatio, camera2.NearPlaneDistance, camera2.FarPlaneDistance);



DrawModel(shipModel, Player1.World);
DrawModel(shipModel, Player2.World);
DrawModel(terrainModel, Matrix.Identity);


GraphicsDevice.Viewport = rightViewport;

GraphicsDevice.Clear(Color.CornflowerBlue);


view = Matrix.CreateLookAt(camera.Position, camera.LookAt, camera.Up);
projection = Matrix.CreatePerspectiveFieldOfView(camera.FieldOfView,
camera.AspectRatio, camera.NearPlaneDistance, camera.FarPlaneDistance);

DrawModel(shipModel, Player1.World);
DrawModel(shipModel, Player2.World);
DrawModel(terrainModel, Matrix.Identity);


}


base.Draw(gameTime);
}


}





Restricting 3D movement XNA c#

23 August 2010 - 09:54 AM

Guys I was trying to get the basics down for my game and I can't seem to be able to restrict the characters movement on the X and Z axis. I have the following code:



// Prevent ship from flying under the ground
Position.Y = Math.Max(Position.Y, MinimumAltitude);

//Prevent ship from flying past the floor boundaries
Position.X = Math.Max(-650000.0f, 65000.0f);
Position.Z = Math.Max(-650000.0f, 65000.0f);

although this just stops the character from moving off this one spot.

One way I thought I could fix this is using some sort of sin or cos function to restrict its movement although how I would implement it is beyond me so any help would be really appreciated!

Virtual Town

04 August 2010 - 09:47 PM

Hi guys. So I have decided that I am going to create a virtual medieval town this year for my portfolio and I am going to be doing it in XNA and C# so I was wondering if any of you guys could help me out.

Currently I would like it to be a purely AI powered town that will grow/decrease in size depending on variable factors. I would like each person in this town to have his own AI which will help him decide things like, what job to get and what he should do in various circumstances.

But I was wondering if anyone has ever done this before and documented their path.
And I was also looking for various articles on pathfinding and things that you would deem relevant to the task at hand.

If you would like to know where I am at right now with my project, then I can tell you that I am just laying down the foundations and am soon going to start work on a (simple) procedural terrain generator.

Thanks :)

Portfolio work for Uni

04 August 2010 - 08:13 AM

Hi guys.

So I just got my results in my exams and they are just enough to get me into uni, but I want a guarantee so that I get into the uni I want. So here was my idea...

I want to create 1 program/demo that will knock the socks off any person looking at my application and I am going to be using XNA and C# but I want to do something that is both technically challenging and very visually interesting. AKA eye catching.

But I don't really know what to do. If you could give me any ideas that would be great! :D

Thanks!

PARTNERS