New answers tagged

1 vote

How to compute XP thresholds when scaling changes for each level range?

You are overcomplicating it. Doing the math once and storing it in a dictionary or list is perfectly fine. The time and memory footprint for the calculation (or read it from a config/ database) is so ...
Zibelas's user avatar
  • 3,383
0 votes

Simulate Velocity For A Projectile Moving Along A Spline

I think when a projectile is thrown it should have a burst of speed at the start and begin to rise slower as it reaches its peak height. Then as it starts to fall it should gradually begin to fall ...
Kevin's user avatar
  • 4,961
-2 votes

Simulate Velocity For A Projectile Moving Along A Spline

Remove the spline and split speed into 2 components X,Y ie Vector2. Fix a horizontal velocity.X from the spline. Apply a negative rather large value to velocity.Y, and each step adjusted for delta ...
agone's user avatar
  • 338
0 votes

How to tell whether an expression is independent from frame rate?

Your conclusion assumes a fixed delta-time: u^deltatime​ Which is an invalid statement if delta-time varies across steps. Almost a given on modern systems. There ...
agone's user avatar
  • 338
0 votes
Accepted

Inconsistent Speed Of A Projectile Traveling On A Bezier Curve

Well, unfortunately I wasn't able to figure this out. But I didn't want to abandon this thread without closing the loop. If you are on Unity 2022 LTS you can simply use the Unity Spline package. It ...
PayasoPrince's user avatar
4 votes
Accepted

How to properly split damage against armor?

If I've understood correctly, I'd do this as a two step process... Calculate how much the armor absorbs, then apply the rest to the player. Something like: ...
Basic's user avatar
  • 1,166
1 vote

Calculating average ttk given accuracy and healing

Partial answer: no healing In your case the healing is the culprit, which makes the whole thing extremly hard to calculate. I hope my equation for the special case of h = 0 (no healing) helps you ...
datacube's user avatar
  • 201
0 votes

A good genetic system?

To "see the parents" in their young ones you could implement following system: each stat has a 33.3% chance to be inherited from the father, 33.3% chance to be inherited from the mother and ...
datacube's user avatar
  • 201
3 votes

Calculating average ttk given accuracy and healing

If an approximation is sufficient then on average the target will take p*d damage per second and heal for h, so their net life loss will be p*d-h per second. Assuming p*d-h > 0, the time to kill is ...
Brady Gilg's user avatar
1 vote
Accepted

How to tell whether an expression is independent from frame rate?

One way we can formalize this is to say we have a function \$f\$ that takes some input game state \$ {\bf x}_0 \$ and a timestep \$ \Delta t\$ and transforms it into the resulting game state \$ {\bf x}...
DMGregory's user avatar
  • 132k
1 vote

How to tell whether an expression is independent from frame rate?

I am wondering if there is a general approach to determining whether the expression that updates the value is "pinned" to real time, meaning that running one frame with delta time x is ...
1 vote

How to tell whether an expression is independent from frame rate?

You are asking the difference between a mathematical derivative and a discrete derivative: Given an expression S(delta_time) which calculates how much to increase a value by each frame, an increase ...
agone's user avatar
  • 338
0 votes

How to move in 3D space in first person mode?

Camera has it's own set of axes. You generally store any two of the three : camFront, camRight and ...
brightprogrammer's user avatar
0 votes

Test if a point is inside a 3D cuboid, given the 8 corner positions, through code

If you can guarantee that the 8 points form a prism with pairs of opposite faces parallel (even if the corners aren't perpendicular), then we can simplify this significantly. We'll construct a ...
DMGregory's user avatar
  • 132k
1 vote
Accepted

Euler Angle X is wrong after using Quaternion.LookRotation

If you want to enforce angular limits, keep it in terms of angles from the start. Don't count on an automatic conversion from quaternions to Euler angles to give you angles in a specific range, ...
DMGregory's user avatar
  • 132k
0 votes

Euler Angle X is wrong after using Quaternion.LookRotation

If you want to isolate the heading of a look direction then zero out the up and use the atan2 function directly. ...
ratchet freak's user avatar

Top 50 recent answers are included