Skip to main content

Questions tagged [floating-point]

Floating point numbers are approximations of real numbers that use a form of scientific notation to store significant figures and an exponent. Use this tag for questions that pertain to the use of floating point numbers in games.

0 votes
1 answer
181 views

I'm making a game (shocker) in pygame and had issues with tile-based collision detection. There are 5 different non-empty tile types (pictured below) which can be rotated in increments of 90 degrees ...
Sad Robot's user avatar
0 votes
0 answers
106 views

When I calculated the inverse matrix, I found that the error in using the float data type would cause the inverse matrix calculation error. Is there any good solution? ...
noodle_run's user avatar
0 votes
2 answers
259 views

The game development library SFML has a Vector2 class template (and a Vector3 for that matter), which can use any arithmetic ...
JensB's user avatar
  • 157
1 vote
1 answer
483 views

I'm trying to solve a lerp problem on my velocity, searched some stuff here and there, but found nothing that solved it. Can you help me? ...
Murilo Melo's user avatar
0 votes
2 answers
212 views

So an object has a position, velocity, and is affected by gravity. ...
CPlus's user avatar
  • 153
1 vote
2 answers
224 views

Most of the numeric quantities used in games (aside from integers for counting or indexing objects) are single-precision floating point. This is IEEE format, which allows for numbers as big as 1e38 ...
rwallace's user avatar
  • 125
0 votes
1 answer
920 views

There's solutions to convert float to RGBA but I would like to encode a float depth value in RGB format and save the three components in three separated unused alpha channels and recompose when needed....
philB's user avatar
  • 333
0 votes
1 answer
2k views

As far as I know, you can walk for 30 million meters in either direction in Minecraft to reach the end of the world. My question is, how does Minecraft handle loss of precision when dealing with ...
Moons's user avatar
  • 103
6 votes
3 answers
4k views

I'm working on a game, and my intent is to avoid use of floating point for unit positions. To that end, I'm using 32-bit integers for all positions, with a millimeter scale. However, for rendering, I ...
Nairou's user avatar
  • 634
3 votes
2 answers
4k views

For comparing floats they recommend using Mathf.Approximately At the same time, they don't use it, for example, for comparing types such as vectors. From Vector3....
Serg's user avatar
  • 393
1 vote
6 answers
825 views

I'm working on a browser MMORPG in PHP and MySQL and today got a bug report about int32 overflow, due to the player having too much money. When I was designing the core system, I completely forgot ...
matronator's user avatar
3 votes
0 answers
204 views

If you check Quake 1 source code (sys_linux.c), you can see something like this: ...
user1095108's user avatar
52 votes
6 answers
19k views

I'm creating a physics game involving rigid bodies in which players move pieces and parts to solve a puzzle/map. A hugely important aspect of the game is that when players start a simulation, it runs ...
jvn91173's user avatar
  • 624
0 votes
1 answer
272 views

For a better context this question is related to this one: What's the largest "relative" level I can make using float? When the player is moving too far away from the center, all the ...
jokoon's user avatar
  • 5,253
2 votes
1 answer
245 views

I've noticed that games like Diep.io are using floating decimal points for thin stroke lines on the grid. I have even tried this myself, by adding 0.5 to all of the ...
Jacob Gunther's user avatar

15 30 50 per page
1
2 3 4 5