NishantSingh

Member
  • Content count

    6
  • Joined

  • Last visited

Community Reputation

109 Neutral

About NishantSingh

  • Rank
    Newbie
  1. Game Night -- Resident Evil 6 !!!!
  2. Protect our "Rights to Free Speech , Piracy and Prosperity." Stop SOPA.
  3. Thank you all for your B'day wishes . Love ya all !!!! And Happy Diwali :D :D :D
  4. Tile based game NPC's / Collision

    As checking for collision in your game is slowing down things , you are probably checking your character for collision with every tile in your map per frame which are even not visible on the screen.i.e if your level has 500 tiles you are checking 500 collisions for each Npc per frame resulting in 500 n collision checks which is not acceptable.you need to consider only those tiles which are visible on the screen and check collisions with them only . As Tiblanc mentioned implementing a scrolling camera , you can use it to filter the objects . Create a camera bounding box and use it to filter tiles first that will be visible on the screen.So , assume now you know you have 50 tiles visible on the screen out of 500 and also you know NPCs currently visible from camera . So , you will only check 50 collisions per visible NPC per frame . To further speed up things you can use spatial partitioning techniques like grids.
  5. Unity Which game engine to choose?

    if you are comfortable with C# and have worked in XNA , consider looking at SunBurn Game Engine .
  6. 2D collision

    Collision detection works in two phase - Broad phase and Narrow phase. Since you are working on a 2D game and i assume a platformer , you should use QuadTree for BroadPhase or just store your tiles in a 2D array grid and create a mapping function that would take a coordinate as input and generate the row and column index (i and j) that contains the input coordinates. If the grid[i,j] contains a tile , you can directly check collision with that tile. For Narrow phase , depending on the accuracy you need for your game , you can just create a rectangle(Bounding Box) surrounding your character and tiles and gems etc and check collision between Bounding box of two objects . For example - check if the rectangle enclosing your character intersects with the rectangle enclosing your gem. If they intersect , there is a collision . If you need more accuracy you will need to create a convex hull for the character (Quick hull algorithm can be used to create Hull) and check collision between the hulls instead. XNA also supports pixel level collision detection for Sprites . There is a sample on App hub on this . You shall consider looking at it. However , Rectangle bounding box shall do just fine for a 2D side scroller game. The Rectangle Structure in Microsoft.XNA.Framework contains two methods Rectangle.Contains(Rectangle) and Rectangle.Intersects(Rectangle) that can help you with checking collision between them. There are overloads for vectors,etc as well to Contains() and Intersects() methods . This is a platformer game i had programmed : [url="http://www.youtube.com/watch?v=OZJkz559nrs"]Platformer game[/url] . I had used 2D array grid to store map and Rectangle as bounding box for all entities in game . I used an offset on Rectangles while checking collision to get more accurate results .
  7. Binary space partitioning

    kewl that answers my question . Thnx a lot . I guess i will just do some google to find how to partition a model for rendering case
  8. Binary space partitioning

    I understand that i have to store the polygons in the positive and negative halfspaces of the dividing plane and split the polygon being intersected by dividing plane . What i am failing to understand is which polygons?? Polygons that make the model or Polygons from the convex hull or Bounding Volume of the model ? What will be my input ?? Polygon soup or Model Vertices + Indices (and i will construct triangles and then split them)?? And how do i store them once i recognize the polygons in negative and positve halfspaces?? Do i create two new models and store the polygons belonging to opp halfspaces in one model each? Also if that is the case how can i partition a model in XNA ?
  9. Binary space partitioning

    Hello , I have been reading Real Time Collision Detection to understand the various concepts related to collision detection in games. And I am having some problem understanding Binary Space Partitioning . I am failing to understand what does "polygon" represent here when you say divide the polygon if it the selected dividing plane intersects it. Is it the Polygons that make the model or the Polygons of the Convex hull of the model ?? For example , if there is a cube exactly in the center of the room and i select a dividing plane along the diagonal of the room . It will intersect the cube as well along the diagonal or maybe into two halves depending on its orientation . So , need i divide my cube in to two separate models(or create two modelmesh for the cube model each mesh storing the two halves of cubes) or just the convex hull of the cube ?? I assume in case of a solid leaf BSP for collision queries , Convex hull will do the job . However , what about Node -Storing BSP for rendering or Leaf-Storing BSP?? Incase we need to divide the polygons of the model itself , Could someone please direct me to some article explaining the same. Also if there is any support for model partitioning in XNA ? Ty Nish26