Tag Info

Hot answers tagged

3

Take an arrow image without any perspective Rotate the image by the desired amount of degree Scale the image vertically.


3

If you're working with a uniform-weighted grid and don't need to worry about dynamic pathing, Jump-Point Search is an extremely efficient pathfinding algorithm. It's extremely fast, usually ten-to-thirty times as speedy as A*. It achieves this through symmetry reduction, which is a method by which empty spaces are ignored.


2

Disclaimer: this is not the academic approach to reduce complexity but it will work in this case. Build a 3d uniform grid or an Octree (depending on data distribution) of Edge arrays around the scene. Add each edge to the appropriate slot (based on the edge's center) in the grid / Octree. If the edge's center is epsilon away from the inner border of the ...


2

This indeed should be very simple, so I suspect you may have gotten some details wrong. The overall goal is to match up the center of the camera with the midpoint of the players. As you've found though, those values aren't immediately available to you, so you need to work them out. What you might have are (leaving out the Y axis stuff since we don't need ...


2

Flocking behaviors is the way to go. This link gives a great explanation on how to code flocking in really any game engine.


2

One way would indeed be to try out the four possible moves for every tile (or rather the ones that have recently moved) and check for matches, then store them as hints. You wouldn't need to do this as often as you might think (especially if you only do it for tiles that have moved); you would only need to swap every tile twice since the one next to it would ...


1

The usual implementation for this is to have only a MaxMove function, and negate the value returned. You only need to remember the top level move, although remembering the path to the move that constitutes the principal variation can be helpful to understand the result, you only need to make the best move and re-run the search from the new position after ...


1

Here is my implementation of Zehelvion's suggestion. An octree wasn't necessary but his suggestion helped to formulate the following method: private static int[] GenerateAdjacency(Vector3[] positions, List<int> positionIndices) { // faces within mesh int ncFaces = positionIndices.Count / 3; // vertex count ...


1

atan2(y1-y2, x1-x2) or maybe atan2(-(y1-y2), x1-x2), depending on the coordinate system.


1

you say it's so complicated to implement a path-finding algorithm, but it isn't... and what's even better, once you have implemented one you can use that algorithm whenever needed again... i can provide you with an simple one (A* it is - and it is easy) and it's so open you can use it on hexfields, squared fields or even on cubes... private ...



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