Tag Info

Hot answers tagged

128

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 ...


25

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

"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

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 ...


10

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 ...


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 ...


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 ...


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

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

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

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

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 ...


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

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

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

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

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 ...


4

Why do we use axis-aligned bounding boxes (AABBs) in collision detection? This question has been asked and answered more than once on this site, but I will answer it here again, briefly. AABB checks are an optimisation. And the optimisation works as follows: You do the very cheap check before you even approach doing the order-of-magnitude more expensive ...


4

In general when polygons get smaller than one or two pixels in either width or height you can get aliasing from that. This is generally called Geometry Aliasing. It is most noticeable when the small polygons have significantly different colours to the ones next to them. Different normals can also be a problem because specular highlights will change the ...


4

From my litte experience with terrain rendering, one of the visually most offensive things that happens when naively reducing the polycount with increasing distance is that -for example- the peaks of mountains can get "cut off" or valleys vanish. This obviously will happen when removing vertices uniformly from the mesh and these landscape features simply ...


4

Whenever a frame is rendered, your graphic card must translate the coordinate in 3-dimensional space of every polygon corner (aka vertex) to the two-dimensional space on the monitor. This is done by multiplying each vertex with a projection matrix which represents the current position, angle and field-of-view of the camera. Only after this is done, the ...


3

They use the same models again and again in Trine. They use a lot of batched rendering. Because of their unique camera angle, a lot of the meshes get culled with frustum culling. The levels are hand-made by artist. They are just very good at re-using the same models over and over again.


3

It is there for the sake of completeness and consistency with the other APIs. There are vector forms of glVertex, glColor, glTexCoord, etc. glEdgeFlag is part of that group of functions; therefore, there is a vector version of glEdgeFlag.



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