Tag Info

Hot answers tagged

5

One way to go is to model Weather as Random Process using Hidden Markov Model(HMM). For full explanation of it, check Hidden Markov Model - Wikipedia This will solve the following problem: I'm in state A. From state A, which is the next state i should go into.In other words, if you are in Cloudy State, where should you go next:Remain in Cloudy state or go ...


4

One way to go is to split the whole world into chunks, and load just the chunk the player character is currently in (or any number of chunks that are closest). This way you only have to listen for events in this chunk. This does not mean you have to split everything into "levels". Minecraft is a fairly good example of splitting a giant world into chunks that ...


4

So what you want is like this? As Stephan says, you have the right idea, just repeat it until you're all out of movement. 1. Measure length to next vertex along first slope. while( impending movement vector > length to next vertex ) { 2. Subtract length from impending movement vector. 3. Position impending movement vector at vertex... 1. ...


2

You are constructing a function from several inputs to meet a desired output. This function should factor the amount of each attribute in conjunction with the importance. Your use of value pairs for such a function also coheres excellently with a documented decision model. I believe that a weighted sum is in order. The weighted sum model takes in each ...


2

The only new constraint that inertia lays onto path-finding is continuity, which means no sudden breaks in velocity. Start by generating an A* path, but with a big twist. The reason A* by itself is not appropriate is because it violates continuity, so lets make a new one. A* chooses the best path as the shortest path, but with inertia the shortest path is ...


2

This may not be ideal, but I've found an answer on another Q/A-site. Multiply all AttackerValues (lets call it AttackRating) Multiply DefenderValues [Without DefenseFitness, see top] (lets call it DefenseRating) Divide AttackRating with DefenseRating (lets call it Rating) Divide Rating with DefenseFitness (lets call it RawDifficulty) Raw Difficulty is a ...


2

Typical approaches to reduce processing are: Spatial subdivision / coherence - Don't process everything in the whole world, instead only do so in pertinent regions - usually only those in close proximity to the player(s). - Group units close together as a single unit to reduce overall count (Rome: Total War). Common in real-time rendering fields. ...


1

It's all about tradeoffs. But first, occlusion culling is to hide what is being hidden by other objects, not what falls outside the viewing frustum. What you described is called frustrum culling. Sure, you can do that and only request to draw polygons that you will see, but those calculations, along with the time required to update the index buffer may ...


1

Pathfinding algorithms like A* can deal with inertia (or any other dimension you can throw at it) just fine. The key is to treat them as an additional dimension, and create a higher-dimensional search graph to search in. To keep things simple, let's suppose we have only two speeds: slow and fast, and this path: A --(sharp turn)-- B ----------- C ...


1

You are describing the proper algorithm. If you loop while you have remaining movement left, it wont matter how many segments you have to cross over. All of the calculations you describe are O(1) calculations so performance isn't an issue. Keep in mind that all terrain is triangles under the hood, so Trig and/or Dot Products may possibly offer some ...


1

You could also think about "crossfading" from one weather state to the next when they switch. Basically the weighting of the old state will go from 1.0 to 0.0 over time while the new state goes from 0.0 to 1.0 over the same amount of time. This is used of course in audio to switch from one audio track to another but its also used in skeletal animation ...


1

There isn't any libGDX function for this particular problem, but it should be something like: Vector2 closestToFinger(Vector2[] vectorsArray, Vector2 touchPosition) { float shortestDist = 0; Vector2 closestVector = null; for(point in vectorsArray){ float dst2 = touchPosition.dst2(point); if(closesVector == null || dst2 ...



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