Tag Info

Hot answers tagged

26

For formulating a diminishing returns equation, I'd immediately think fractions. This is a graph of y=1/F y will get smaller as F gets larger. This will give you a steady drop-off that never reaches 0. From this you can transform it to get the sort of curve that you want. Using numbers > 0 will always give positive output that is never 0. Honestly, I'd ...


15

Diminishing returns = decreasing derivative Since you still want some returns even at higher levels means that the derivative should be positive, otherwise building more farms would decrease the food production (which might even make sense if you take into account logistics and upkeep costs) It should approach zero assymptotically, if it goes towards a ...


5

It sounds like what you're looking for is either a transformation matrix, or a quaternion. Transformation Matrix I will just run down how to do this using a transformation matrix, since its probably the easier of the two to understand. A transformation matrix in 3D is a 4x4 matrix defined as follows: H = [xx, yx, zx, tx; xy, yy, zy, ty; xz, yz, ...


4

Would a linear diminishing return do? production per farm = (1 - (0.05 * (f/10)) ) * production rate. This gives a total production (rate * # of farms) peak at f = 100.


4

In general, a linear equation will start with y = mx + b, where b is your starting value, and mx is how you adjust the starting value as x increases. So the first part of your equation, the b, will be 10 because you want farms to start at 10 food. y = mx + 10 Next, in your case, you want to adjust the food by produced by every ten farms. So you will ...


3

Here are four options that you can try: A) Scale & threshold existing output You can ensure that the gradient saturates at some maximum value before reaching any of the cell borders. This will tend to make small holes of uniform size, but you can introduce size variation by assigning a random scale factor to each seed point and scaling distances to ...


3

Others have pointed out how you can use the sign of the dot product to broadly determine the angle between two arbitrary vectors (positive: < 90, zero: = 90, negative: > 90), but there's another useful geometric interpretation if at least one of the vectors is of length 1. If you have one unit vector U and one arbitrary vector V, you can interpret the ...


2

If the resulting scalar is 0; then it means the 2 vectors are perpendicular to each other (angle difference 90 degrees) . If the resulting scalar > 0; then the angle difference between them is less than 90 degrees. If the resulting scale is < 0; then the 2 vectors are facing opposite directions ( or angle difference > 90 degrees). This can be useful in ...


1

There is such an equation, but it's not easy to obtain. Because the magnus effect depends on the ball's current velocity, it changes when external forces are applied. You cannot calculate the position of the ball by linearly summing the contributions of different forces. If you were hoping you could simply add a few terms to x(t) = ½ a t² + v t, you're out ...


1

You might want to consider an algorithmic solution that matches the situation. That is, consider why there are diminishing returns in your game situation, and model those. Multiple facilities of the same type might have diminishing returns is that there might be other resources or facilities which they depend on, or which result in bottlenecks, or other ...


1

Create an octree and in each leaf cells put the list of all triangles from B that intersect the cell, mark at each levels whether or not the cell is empty. If one cell at any level has only 1 poly note the poly so you can stop the search early (large floor/wall triangles). You can keep sub-dividing cells until you have a reasonable number of triangles in ...


1

A normalized direction is a point on the unit sphere, so you need 2 angles. I assume you have a coordinate system where Y is up. Your two variables are phi (0 <= phi <= pi) and theta (0 <= theta <= 2pi). You obtain the normalized direction vector as follows: dir.x = cos(theta)*sin(phi) dir.y = cos(phi) dir.z = sin(theta)*sin(phi) Source for ...


1

When using a R/H Cartesian coordinate system with the Y axis as vertical and row major matrix transforms (common for DX9), and you set your model in your world such that when rendered using an Identity matrix, the nose of the aircraft will be pointing down the -Z axis: then the negate of the third row of the transform matrix can be used as a direction ...



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