Tag Info

New answers tagged

0

You can create a polygon that captures everywhere the light can reach. Drawing a light (with shadows) then only requires one draw call and no render target switches. The basic set-up is: Draw everything than can be lit For each light Compute the polygon of where the light can reach Draw the polygon using additive blending I've wrote a small ...


1

I guess the two parts I'm having trouble understanding is in #3, how would the waiting be accomplished since thread sleeps are often not accurate enough? Can't answer this for sure as I haven't seen the XNA source code. MonoGame uses thread.sleep // NOTE: While sleep can be inaccurate in general it is // accurate enough for frame limiting ...


2

I believe you want something like the below. It will keep track of the most recently pressed key in the variable _movementKey and set the movement key to none when the most recent key is released. So the end result should be _movementKey contains the key that dictates direction, it will always be most recently pressed key and will be reset to Key.None when ...


1

The way I might approach it is to create a list of all possible hex center locations during the initialization stage before the game loop starts. Then during the game loop, if there is a mouse click within 1.5 tile radius (or whatever dist you think is approp) of a white tile, simply iterate the list and find the closest list Point to the click point. If the ...


1

By computing the velocity as some factor of the difference between the start and end position, you can achieve the association you want: var velocity = (endPosition - startPosition) * scale; The hard part be will choosing a value for scale. You can initially try constants -- such as 1.0f or 0.5f. This makes the velocity directly proportional to the start ...


0

It really depends on what you're trying to render. For example, if you're rendering layers of clouds that are transparent to the background but not necessarily to each other, one useful trick is to draw the background, then non-transparent cloud layers, then draw the background again at 50% transparency over the other layers.


0

Found the problem. XNA's content pipeline doesn't seem to be able to handle animated FBXs correctly. So XNA has a bug. Luckily Blender 2.68a and older has a "fix" for this. Just check "XNA rotation animation hack" when exporting the FBX.


1

I will assume that the player collides with the ground only on the middle point. We can do an approximation of the height of the terrain at a given point with this: double x = 4.6; double relativeX = x / widthBetweenPoints; int terrainIndex = Math.floor(x); double ratio = relativeX - terrainIndex; int y = Points[terrainIndex] * (1 - ratio) + ...


1

The BayazitDecomposer class was made assembly-internal in commit 101497, which was aimed at centralizing the input validation for the triangulation algorithms in a single place according to the check-in comment: Removed sanity checks from all triangulators and moved them into Triangulate. Added asserts into each triangulation algorithm that checks if ...


8

For newcomers to this question, it looks like Microsoft has put up XNA installers for Visual Studio 2010/2012/2013. I haven't personally tested to make sure these work, but they might be worth a look: https://msxna.codeplex.com/releases/ EDIT: After running all included installers for the Visual Studio 2013 release (running VS 2013 Ultimate on my ...


0

If you use a textured quad, you have some additional flexibility over the geometry that you wouldn't have with a SpriteBatch. This will allow you to implement the skewing you're after. You can then implement the skew: Pinch the top two vertices in on the X axis (or push the bottom two vertices out along the same axis). That is, create a quad with corner ...


0

You could use normalized vectors to check to see if the laser is pointing at the camera, and then only draw the end points if it is. If the angle allows you could stop drawing the mid section the instant it starts pointing at the camera and drawing the end section.


1

A GPU works in screen-space coordinates which go from -1~1 for both x and y dimensions. The projection matrix (in combination with the view matrix) takes care of how 3D world coordinates are mapped onto two-dimensional screen space coordinates. If you use the same field of view and aspect ratio for each resolution the player will never see more (or less) ...


4

I think what Valve does is using a Navigation Mesh (source) together with a Visibility Graph. The navigation mesh covers all of the walkable space in (usually) convex regions. A* or Dijkstra's is used to plan paths between regions, while local movement techniques are used for moving agents inside regions. (This is very easy since regions are convex you can ...


2

From what I understand from your question: You don't want your model/dashboard to have so much shadow on it from certain angles. Here is a picture of a textured model with just the default lighting enabled: The dark side: Well if you want to make it look like there is lighting coming from the model you can add Emmisive Light. Change you ...


3

One thing you can do is not let the character travel diagonally when the path crosses the corner of a wall. The character is free to travel diagonally out on the open, but not next to a wall. This is done in your a* algorithm.


1

As per your comment my reading was wrong. I thought LocalPos was relative to the player, because I assumed that's what HelperMethods.PointToLocalSpace was supposed to be doing. But if LocalPos is still world coords, then your description at the end of the question gives it away. Your if statement: if (Math.Abs(LocalPos.Y) < ExpandedRadius) can be ...


3

Yes you should factor the size of the character into the A* calculation. There are basically two ways you can either make your character larger, which complicates the computation. Alternatively you can make the wall wider and pretend your character has 0 width.



Top 50 recent answers are included