Jump to content
  • Advertisement

Mr.Big

Member
  • Content Count

    7
  • Joined

  • Last visited

Community Reputation

109 Neutral

About Mr.Big

  • Rank
    Newbie
  1. Yeah that's basically what i'm looking for. Just the characters/enemies are 2D yet all the surroundings 3D. That video illustrates what I'm trying to do exactly..   Now that I know the terminology for it, I'll take a look around at some resources. Thanks!   Edit: Wow. Looks tricky.. this should be fun...
  2. Basically I've come across a few games that use this convention, and I'm curious on how its done and want to implement it.   Something similar to this; This video seems to have accomplished it really well. There are a lot of pretty bad implementations of it too.   I just want to know where to start, what to look out for, any tips or advice.   Cheers
  3. The plan was to draw a 256x256 map, and have a "portal" somewhere on the map that leads to another map. So loading all the maps when the game loads is out of the question.   My plan was to have a text file for each map with a whole bunch of vertices, followed by objects on the map with a position to draw it at.   map1.map, "Home Town"; 0,1,0,3,1,0,0,4,3,5,6,2,0,2,3,8,4,2,0,28,169,474,935,742,42,36; "House.obj", 56,0,56; "Car.obj", 56,0,80;     I have absolutely no idea how XNA loads objects, but this was my thought on how to do it.   Edit: Oh, and didn't need collision detection as I was just going to define each tile as walkable or not-walkable.   Does this sound like a reasonable, efficient way to draw a map?   Edit2: Actually, since the maps will all be 256x256, there's really no point in storing the x and z vertices in a text file since they will all be quads (tiles). The only thing that needs to be stored is the height of each group of 3 vertices. Which I suppose could be done with a height map image?
  4. Ok cheers for the tips. I only chose triangle strip because I thought it was more efficient at drawing triangles. That was what they taught us at university anyway, but that was a long time ago. Haven't really done any game programming since I finished - this is my first foot back in the water.   Are there any tutorials on drawing triangle lists? Or some jumping-in-to-xna guides? I tried following the MSDN tutorials but they seem to miss out key important parts to get things done that a fresh person to XNA wouldn't have any idea about.   Edit: This is what I've come up with so far but its not drawing anything.   using System; using System.Collections.Generic; using System.Linq; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.GamerServices; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; using Microsoft.Xna.Framework.Media; using Microsoft.Xna.Framework.Net; using Microsoft.Xna.Framework.Storage; namespace RO3 { /// <summary> /// This is the main type for your game /// </summary> public class Game1 : Microsoft.Xna.Framework.Game { Matrix worldMatrix; Matrix viewMatrix; Matrix projectionMatrix; GraphicsDeviceManager graphics; SpriteBatch spriteBatch; GraphicsDevice device; Effect basicEffect; VertexPositionColor[] primitiveList; int points = 8; short[] triangleListIndices; public Game1() { graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; } protected override void Initialize() { graphics.PreferredBackBufferWidth = 1000; graphics.PreferredBackBufferHeight = 1000; graphics.IsFullScreen = false; graphics.ApplyChanges(); Window.Title = "RO3"; InitializeTransform(); InitializeTriangleList(); base.Initialize(); } protected override void LoadContent() { device = graphics.GraphicsDevice; basicEffect = Content.Load<Effect>("effects"); } private void InitializeTransform() { worldMatrix = Matrix.CreateTranslation(new Vector3(-1.5f, -0.5f, 0.0f)); viewMatrix = Matrix.CreateLookAt( new Vector3(0.0f, 0.0f, 1.0f), Vector3.Zero, Vector3.Up ); projectionMatrix = Matrix.CreateOrthographicOffCenter( 0, (float)GraphicsDevice.Viewport.Width, (float)GraphicsDevice.Viewport.Height, 0, 1.0f, 1000.0f); } private void InitializeTriangleList() { primitiveList = new VertexPositionColor[points]; for (int x = 0; x < points / 2; x++) { for (int y = 0; y < 2; y++) { primitiveList[(x * 2) + y] = new VertexPositionColor(new Vector3(x * 100, y * 100, 0), Color.White); } } triangleListIndices = new short[18] { 0, 1, 2, 2, 1, 3, 2, 3, 4, 4, 3, 5, 4, 5, 6, 6, 5, 7 }; } protected override void UnloadContent() { // TODO: Unload any non ContentManager content here } protected override void Update(GameTime gameTime) { base.Update(gameTime); } protected override void Draw(GameTime gameTime) { device.Clear(Color.DarkSlateBlue); basicEffect.CurrentTechnique = basicEffect.Techniques["ColoredNoShading"]; foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes) { pass.Apply(); } RasterizerState rs = new RasterizerState(); rs.CullMode = CullMode.None; device.RasterizerState = rs; //drawing code goes after this DrawTriangleList(); base.Draw(gameTime); } private void DrawTriangleList() { GraphicsDevice.DrawUserIndexedPrimitives<VertexPositionColor>( PrimitiveType.TriangleList, primitiveList, 0, // vertex buffer offset to add to each element of the index buffer 8, // number of vertices to draw triangleListIndices, 0, // first index element to read 6 // number of primitives to draw ); } } }
  5. Hello everyone. First time XNA project here, so still learning the ropes.   My first idea for a starter project was to make a tile based game. Each movable terrain square would be one quad (or 2 triangles). Then use some method to determine which tile the mouse is over and clicking it moves the player there.     So what would be the ideal way to do this in XNA? My first thought was to create a triangle strip and a text file with all the vertices and heights and load it in and draw it.   Any other suggestions?
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!