# Tag Info

129

Metroid's just using tiles, nothing special going on there. Aquaria however is doing something rather clever. If you'll notice, a lot of those rocks on the bed get repeated several times. Here's one of the rocks for instance: It looks like they've just dumped sprites along the edges of their terrain. It's kind of like what Metroid did - a massive arsenal ...

26

there are two cases of this problem. First is the intersection and second that is overlaping (containing). First (intersection / polygon inside circle): Find closest point on every edge of the polygon to the circle's center. If any distance between closest point to the center is less than radius, you got intersection or overlap. Second (circle is whole in ...

26

Draw a line to infinity and count how many times you cross the shape (even or odd), not counting the segment where the creature lies. Then check whether the creature is going left or right of that line. In this example, we cross the shape twice (so even) and we go to the left. The result is immediate from this table: # Crosses | even | odd ...

13

I would advise that even if you are going to write all your own code, that you download Recast and build the sample application as it has visualisations that show the generated navmesh and it allows you to test the path-finding with a simple point and click interface. You can learn a lot just by playing with that. As you have already realised, there are two ...

13

With i going from 0 to n-1 inclusive: pointX[i] = ( sin( i / n * 2 * PI ) * radius ) + xOffset; pointY[i] = ( cos( i / n * 2 * PI ) * radius ) + yOffset; Edit: As Lars Viklund mentioned in the comments, this is only safe in languages like javascript in which integer division returns a floating point number rather than a integer. In other languages you ...

13

"Cracks" in the geometry mostly. These games have a few things in common, they have gravity and they have collision detection. These anomalies are locations where the collision detection failed in some way. It could have been sharp edges, gaps or a number of other geometry anomalies. Could even been issues with time steps in the physics engine, where the ...

10

The simplest solution is to generate a random point within the rectangle and reject it if it lies in the polygon. You would repeat the process until you got a valid point. This same algorithm is used to uniformly distribute points over an area or volume, except points that are considered outliers are rejected. This type of sampling is known as rejection ...

9

OpenGL wiki's pseudocode (as referenced by Peter Taylor, as well) is correct. What you want is the normal of the plane the triangle, quad or other polygon represents. All you need are two edges of any planar polygon that share a common vertex. The number of edges does not matter. All you need is to get enough information to define the plane, and then get ...

9

You will need to process all the points at least once so if this check is done only once there isn't much you can do to speed up the test other than brute-forcing it using parallelism. If the test is going to be run multiple times there are ways to pre-calculate tables to help, such as a grid of cells marked as [definitely inside (green in image), outside (...

7

It looks like any regular 3D model. The only thing that's "2.5D" about it is the fixed camera and play space.

7

For MMO due to their nature, wide adoption is a must to survive. They need to have a window which enables them to run on mediocre pc. So, no matter how tech progresses forward, MMO should be always the least to take full advantage of it. And poly count doesn't matter too much, if you can cover this up with your art style and/or other visual stuff. For ...

7

Technically? Yes. It's no different to, say, a polygon with the shape of a D with 5 points viewed edge-on. A polygon is just a closed shape which has 3 or more vertices and edges. A shape with only two vertices is just a line. Meanwhile a shape with 3 vertices and only 2 edges cannot be a closed shape: most libraries would just join the first and last ...

7

TL;DR You need to implement boolean operations using BSP trees. Well, it seems we are talking about Constructive Solid Geometry here. I have implemented CSG on a commercial level so I know a thing or two about it. The classic paper about CSG is called Merging BSP Trees Yields Polyhedral Set Operations, to be honest it's too much to explain here, but ...

7

What you are seeking is a solution to the "point-in-polygon" problem. It is described in Wikipedia here:           You can find C code following the links to Computational Geometry in C, or at many other locations found by searching for "point-in-polygon" code.

6

A good reference for a wide public is to check the average computer specs around christmas discounts. Also a good option is to have severall levels of details for your game so that you can adapt your graphic performances according to the computer specs.

5

r2d2rigo's answer is almost correct. Here is the correct matrix code to set up a BasicEffect that matches SpriteBatch (from Shawn Hargreaves' blog): Matrix projection = Matrix.CreateOrthographicOffCenter(0, viewport.Width, viewport.Height, 0, 0, 1); Matrix halfPixelOffset = Matrix.CreateTranslation(-0.5f, -0.5f, 0); basicEffect.World = Matrix.Identity; ...

5

The easy/naive solution would simply be to take your existing points, and for each point have a corresponding point that's at the same Y position but off screen. From there, create your polygon by taking, say, points 0, 1, 1's pair, and 0's pair and pass that to your DrawPoly method. Then continue on with (1, 2, 2's pair, 1's pair), etc.

5

The standard approaches are (pick one): Increase your boundary width AND/OR reduce the maximum speed of your bullet so that it can never jump through a wall in a single update (requiers a bit of Pythagoras to figure out the maxium distances / minimum boundary widths); Perform continuous collision detection (CCD), usually by raycasting to detect collision ...

5

There are tons of source snippets for a method that performs a test for "point inside polygon". The principle comes from Jordan's curve theorem for polygons (http://www-cgrl.cs.mcgill.ca/~godfried/teaching/cg-projects/97/Octavian/compgeom.html). The naive way would be: having that method, call it PointInsidePolygon(Point p, Polygon poly): bool isInside = ...

5

It depends on what information you have available from your shape data structure, but a creature moving CW along the outline of a shape will always have the inside of the shape on its right, and a creature moving CCW will have the inside of the shape on its left.

5

I think it's not possible to say that there is one particular reason why clipping through the world happens. Due to the differences in game engines/ physics procedures between games, any number of reasons can lead to this. Stemming off this, I'm quite sure that falling out of the world has not been eliminated, necessarily. Having a few large-scale game ...

4

Focusing on poly count and other rendering minutae is really putting the cart before the horse. Your question depends entirely on what client engine you're going to use, and so can't be answered. Onwards to predicting future hardware platforms. Many projects have been sunk by assuming that hardware speeds will always advance. Look at what happened during ...

4

I would loop through your array two points at a time, extrapolating two more points (by using the X value for each of the two and making the Y value 0) to give you the bottom of your shape. Pass those four points into ccDrawPoly() and repeat until you run out of array values. so, if you have say: P1 = (0, 25) P2 = (5, 30) P3 = (10, 20) P4 = (15, 25) for ...

4

On OS X, you can use PhysicsEditor. It is a tool for Box2D or Chimpmunk but there is a txt export for your need. The main difficulty is to find a mac. Note: there is a windows version too. But i didn't use it. Try it and add a comment if it is useful.

4

1) select polygon 2) Edit Mesh->Extrude

4

You will need an active edge list, which contains a list of all polygon edges intersected by the current scanline. You will also need an in/out flag for each polygon on the scanline. The flags are toggled on/of as you cross an edge for a polygon. The rules are drawing for each pixel along a scanline are; no polygon flags are 'in', then draw background ...

4

Yes, it's typical to convert into triangles. When reading the mesh in, it's simple to convert a quad into a triangle. It will depend on the format you're exporting to. For example, the format I use, Blender will export all the vertices, then it will export index information for triangles and quads. So it's a simple matter of arranging the indices to take a ...

4

If you want to permanently change quads to tris in Blender use Ctrl+T in Edit-Mode

4

My guess would be that older engines probably used a quick and simple ray vs triangle test to detect collision with the geometry. That means even the tiniest gap (or a precision error in the calculations) could let the player through occasionally. More modern games will probably use a more expensive test with a sphere or capsule representing the player, and ...

Only top voted, non community-wiki answers of a minimum length are eligible