Trying to find a constant or an equation

  • Thread starter Thread starter Some text.
  • Start date Start date
  • Tags Tags
    Constant
Click For Summary
SUMMARY

The discussion focuses on developing a turning rate equation for a spaceship game, where the turning ability is dependent on the ship's speed, which ranges from 0.0 to 3.0. The desired turning rates are 0.015 at maximum speed (3.0) and 0.028 at a lower speed (0.5). Participants suggest using mathematical functions such as quadratic equations (a - x²) for a nearly constant turning rate at low speeds, or trigonometric functions like inverse sine or inverse tangent for a plateau effect at both ends of the speed range. The goal is to create a smooth curve rather than a linear relationship.

PREREQUISITES
  • Understanding of basic programming concepts
  • Familiarity with mathematical functions and curves
  • Knowledge of game physics principles
  • Experience with graph sketching and function analysis
NEXT STEPS
  • Research quadratic functions and their applications in game mechanics
  • Explore trigonometric functions like inverse sine and inverse tangent for smooth transitions
  • Learn about implementing physics-based movement in game development
  • Investigate curve fitting techniques for dynamic gameplay adjustments
USEFUL FOR

Game developers, particularly those working on physics-based mechanics in 2D or 3D environments, and programmers seeking to enhance player control through responsive turning rates.

Some text.
Messages
4
Reaction score
0
I am programming a little spaceship game, and my quandry is as follows;

I want the ship's turning ability to be relative to it's speed.
Though the particular values of each have to fall within a specific range.

So for speed of 3.00 (max), i would like a turning rate of about 0.015
And for speed 0.5 or so, i want it to be around 0.028

So I am trying to organise an equation or two to produce these figures as a result of speed, as this is the driving force(Ranging from 0.0 to 3.0). A nice curve would be ideal, rather than a straight line.

Much thanks for any help, I am tired, can't code straight and can't find a way to crack this.
 
Physics news on Phys.org
Try by sketching a graph of what you want then think of functions that look like it.

Could be a-x2 if you want nearly constant turning rate at low speed, then decreasing faster and faster with speed. Or inverse sin, inverse tan, sigmoid, etc. if you want the turning rate to plateau at both ends of the speed range.
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 15 ·
Replies
15
Views
2K
  • · Replies 1 ·
Replies
1
Views
954
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 8 ·
Replies
8
Views
8K
Replies
5
Views
3K
  • · Replies 12 ·
Replies
12
Views
1K
  • · Replies 5 ·
Replies
5
Views
1K