The floating-point tag has no wiki summary.
1
vote
2answers
81 views
Getting around limitations posed by float in space game
I'm working on a procedurally generated game set in outer space. As in the real world, the game universe will be pretty much 99% empty, with planets/stars/solar systems etc... being very far apart.
...
4
votes
1answer
91 views
How do I deal with floating-point error given a far-away camera?
Whenever a camera is "far" away (its location is some "large" vector), trouble arises when rendering objects close to it: It is the classic precision loss from subtracting 2 floating point numbers.
I ...
6
votes
3answers
407 views
How do I generalise Bresenham's line algorithm to floating-point endpoints?
I'm trying to combine two things. I'm writing a game and I need to determine the grid squares lying on a line with the floating-point endpoints.
Moreover I need it to include all the grid squares ...
2
votes
1answer
73 views
how did coordinate-handling in old flightsimulators work?
Im currently working on a combat flight simulator pure for own fun.
Using a floating-origin i thought the float inprecision was history, however this was the case untill i tried adding multiplayer to ...
2
votes
2answers
234 views
How can I simplify this code to compute the shortest rotation between two angles?
The following code will find the shortest rotation (in radians) (from pi to -pi) that I need to apply to from to leave me with to.
Scalar rotationBetween(Scalar from, Scalar to)
{
Scalar fromMod ...
6
votes
2answers
332 views
What's the largest “relative” level I can make using float?
Just like it was demonstrated with games like dungeon siege and KSP, a large enough level will start to have glitches because of how floating point works. You can't add 1e-20 to 1e20 without losing ...
2
votes
3answers
1k views
How to reset the world in an infinite runner game to prevent an overflowing float?
Im following Mike Geig's 2D infinite runner tutorial. However, I'm seeing a potential problem of overflowing the float
How can I reset all objects and camera back again to the origin?
The approach ...
0
votes
1answer
83 views
Point rotation around point, accuracy question
I study OpenGL ES 2.0. But I think it's more a C++ question rather then an OpenGL one.
I am stuck with the following rotation question: It is known, that rotation transformation can be applied using ...
2
votes
1answer
85 views
Deterministic calculation in JavaScript [closed]
I want to create a multiplayer game with HTML/JavaScript and only send user input between players. I read some articles for C++, saying that I could not expect floating point to get the same results ...
0
votes
2answers
103 views
Algorithmic error in tile engine? [closed]
I'm toying with creating a tile-based 2D java game engine. I can render the "local" area without issues(I.E. deciding which local tiles to render). The problem came when I introduced floating point ...
0
votes
1answer
81 views
XNA Float values don't work as parameter
With the Microsoft XNA Framework I can change the color of a tinted texture by changing it's integer values like so:
Int x = 255;
if(true) { x--; tint = new Color(x, 255, 255); }
Draw(texture, ...
1
vote
0answers
125 views
Handling angles in multiplayer games
I am developing a small 2d multiplayer game. My most recent concern is, that trigonometric functions can take up a lot of time in any processor, and I was wondering if I could reduce this.
So in my ...
3
votes
1answer
216 views
Continuous world and very large levels: going around the FPU limitations with Ogre3D
I'm currently using Ogre3D, and I'm wondering is it's possible to have a very large level (hundreds of kilometers) using the right scenemanager. Storing or having the level is not a problem, since I ...
0
votes
1answer
200 views
Issues calculating frame independent movement
I'm developing a Breakout style game in C++ using SDL. The problem so far is that the ball slows down and speeds up for no particular reason.
The slowdowns usually last a few seconds.
EDIT : When ...
12
votes
3answers
721 views
What caused “falling out of the world” and what fixed it?
A lot of early 3D games had the problem where you'd be trundling merrily along and suddenly everything was black, with an island of what looked like the hollow facade shell of the scene you'd been ...
3
votes
1answer
121 views
Vertices shaking with large camera position values
Basicly when i set the position of my camera (my character in game) to a high value, the geometries seems to be shaking, the higher the position value, the more they shake. On low position values you ...
1
vote
1answer
903 views
Unity3d Transform.position float range
I thought floating point has a very large range, for example up to 3.4*10^38.
However today I tried to set my player's Transform.position.x to 1000000 in the GUI and it gave me a warning:
"Due to ...
-1
votes
2answers
143 views
JavaScript “Floats”, or ThreeJS wrong positioning? [closed]
I want to learn how to use Vectors with 3D.
Here is a strange Error I have encountered today.
Instead of stopping exactly on the other Cube, I get this:
When I change the IF to (cube.position.y ...
3
votes
1answer
1k views
Should I use float, double, or decimal for stats, position, etc?
The problem with float and double is that they are not exact. If you are to do something like store replays, the values would have to be exact.
The problems with decimal is that they are ...
6
votes
1answer
1k views
Floating Point Precision (fp:precise vs. fp:fast)
In C or C++, does the compiler option of floating point precision really make a difference in real world (small/indie) games?
From my observations, setting fp:fast is many times faster than ...
1
vote
2answers
356 views
Deterministic Multiplayer RTS game questions?
I am working on a cross-platform multiplayer RTS game where the different clients and a server(flash and C#), all need to stay deterministically synchronised.
To deal with Floatpoint inconsistencies, ...
3
votes
4answers
781 views
How can I view an R32G32B32 texture?
I have a texture with R32G32B32 floats. I create this texture in-program on D3D11, using DXGI_FORMAT_R32G32B32_FLOAT. Now I need to see the texture data for debug purposes, but it will not save to ...
3
votes
2answers
1k views
Python float 32bit to half float 16bit
I'm trying to write a 3D model exporter addon for Blender in Python and need some help.
The spec of the 3D format uses some compression on the vertices, there is a vertex buffer that contains ...
-1
votes
2answers
317 views
Could a large number, such as 255.000255 be converted to it's RGB channels in a Shader language?
If I had a Vertex Shader constant holding one float value, like:
255.000255
Where: The first 3 numbers are actually red (255), next three are green (000), then the last three are blue (255).
... ...
4
votes
4answers
3k views
Conversion of a number from Single precision floating point representation to a Half precision floating point
Hope it is relevant here.
I have a code where I have to work on Half precision floating point representation
numbers. To achieve that I have created my own C++ class fp16 with all ...
35
votes
8answers
4k views
How are deterministic games possible in the face of floating-point non-determinism?
To make a game like an RTS networked, I've seen a number of answers here suggest to make the game completely deterministic; then you only have to transfer the users' actions to each other, and lag ...