Also There Already Is A Quake Wiki
#12665 posted by czg on 2013/03/26 14:20:14
Why don't you guys go work on that one instead?
Re: 12656
#12666 posted by necros on 2013/03/26 14:51:01
Sounds good to me. Necros?
You're asking about Fifth's terrain method? I would recommend triangles instead of cubes, but yeah, the essential method is the same. You build a flat mesh of stuff and then pull vertices up and down to make terrain.
Kinn
#12667 posted by SleepwalkR on 2013/03/26 16:08:14
As has been said, the compilers don't give a toss about whether or not brush planes/verts are in integer coords, or powers of two or anything like that.
That is misleading. The compilers do not give a toss about vertex coordinates at all because they will recompute them (and try their best to fix any errors). And of course as far as the compiler is concerned, floating point coordinates for plane points are fine, too. But these have inherent problems in that there is always rounding involved. When the editor saves the map file, it will round the floating point coordinates and when the compiler loads the points, rounding may occur again.
So bottom line: The only way to accurately transport any brush through a map file is to use integer coordinates for plane points. Everything else will result in vertices not showing up where you saved them unless the plane points happen to be all integer.
That said, the errors introduced by floating point coordinates are usually negligable in the BSP - it will look just fine. However, it might be the source of two problems: Microleaks and wandering vertices. By the latter I mean that vertices don't have exactly the same coordinates after saving and reloading the file.
I think for TB, the best way to go is to keep the vertex editing as it is. The user already has a way to correct almost all errors. However, I intend to:
- Recompute all vertices when the user leaves vertex mode. This way, the user sees what QBSP will see.
- Let the user choose whether they want floating point or integer coordinates for plane points.
- Show warnings for brushes with off-grid vertices and floating point plane points (can be suppressed).
- Improve error handling when loading maps (auto-heal super degenerate edges and such).
I think that gives us the best of both worlds. You can use TBs vertex editing unrestricted, and the editor will show you have the geometry will actually look like in game when you leave vertex mode. Users with very old compiler tools without floating point support can also still use the editor.
Sleepwalker
#12668 posted by Tyrann on 2013/03/26 20:53:39
The suggestion of snapping the plane points (not verticies!) to a 0.125 makes the most sense - you won't get any rounding errors in that case. You could make it a configurable option too - 0 for no rounding at all, but place a warning on it or bury deep so only people who really know what they are doing will mess with it.
#12669 posted by Tyrann on 2013/03/26 20:55:50
you won't get any rounding errors in that case
No rounding errors during writing the file or reading it back, just to be clear. Obviously precision limits still apply to everything after that, but then the ball is in the compiler's court ;)
No
#12670 posted by RickyT33 on 2013/03/26 21:03:32
Bad idea - that's not what I mean - you can still end up with bad surfaces, from a mathematical point of view. If you have a surface with four or more corners, then in order for that surface to be truly flat the corners have to be on the same plane. So snapping (even to a 0.125 grid) can still result in surfaces not being flat.
I just mean when I'm creating brushwork, for stuff like 24 sided circles and weird angled stuff, it would be nice to work at 1/8th of the scale I am currently limited to working at on a 1x1 grid.
Trenchbroom
#12671 posted by RickyT33 on 2013/03/26 21:04:35
Can split a four corner face into two three corner triangular faces, I know that....
Automatically I Mean
#12672 posted by RickyT33 on 2013/03/26 21:04:49
RichieT23
#12673 posted by rebb on 2013/03/26 21:36:14
But it's only the plane-definition triangle that would have it's points snapped to grid, so it won't matter how many points there are in the face/winding ( see czg's post ).
Yeah
#12674 posted by Kinn on 2013/03/26 22:00:14
ricky - you can't make invalid planes just by altering the plane coords, and you won't make an invalid brush with such a tiny amount of snapping unless the brush is basically degenerate already.
Tyrann
#12675 posted by SleepwalkR on 2013/03/27 06:32:06
What if the snapped plane coordinate cannot be represented as a floating point number? I'm still a bit confused by floats, to be honest. Also, where did you get this idea? Does any editor do this kind of snapping?
#12676 posted by kinn from shitty mobile on 2013/03/27 20:55:43
but surely any multiple of 0.125 within a realistic range (ie a range of values you'd find in a quake map) can be represented perfectly in floating point unless im missing somthing?
#12677 posted by Tyrann on 2013/03/27 20:58:17
With standard single precision, you have 23 bits of mantissa, so if you stick to 1/8 precision you will use 3 bits for the fractional coordinate and you have 20 bits left. Which means that any coordinate on the 1/8 grid will have a precise floating point representation with the coordinate range +/- 2^20 (1048576).
I'm not aware of any other editors that snap to a fractional grid, but I do remember looking at a version of radiant some time ago and seeing the code which always snapped their plane points to integers.
Haha Yeah
#12678 posted by SleepwalkR on 2013/03/27 21:05:11
Well I have an algorithm that will find quasi-optimal integer points for any given plane, but even then it doesn't work too well. I could try snapping to .125 or an even lower value and see how that goes.
#12679 posted by Tyrann on 2013/03/27 21:10:34
Yeah, that only says how precise the final representation can be. You may (and probably will) need extra precision for intermediate calculations. It's tricky stuff!
#12680 posted by rebb on 2013/03/27 21:13:07
The Doom3 editor supports 0.5, 0.25, and 0.125 grids.
Yes, Grids
#12681 posted by SleepwalkR on 2013/03/27 21:24:36
I can add that to TB in a jiffy, but the major problem right now is how to represent the planes with maximum precision across file saves.
#12682 posted by JneeraZ on 2013/03/27 21:34:55
One option, and you probably don't want to do this, is to go the Worldcraft route. Store maps in your own format and export to MAP for compilation. That would retain perfect precision at all times and only need to snap once, eliminating drift.
#12683 posted by rebb on 2013/03/27 21:41:19
Of course, but it does show that even id ( and JC ) are fine with that kind of granularity.
And as others have stated already, certain fractional steps ( 0.5, 0.25, 0.125, 0.0625 ... ) should not cause rounding errors - as long as the absolute value "in front of the dot" is not too large.
This page is pretty handy to see whats going on : http://www.h-schmidt.net/FloatConverter/
0.125 Plane Point Rounding != Vertices On The Grid
#12684 posted by SleepwalkR on 2013/03/27 21:44:22
If you limit the plane point coordinate precision, you will be unable to snap vertices to the grid in certain situations.
Willem
#12685 posted by SleepwalkR on 2013/03/27 21:45:37
It will eliminate drift, yes, but it leaves the problem of finding good representations of your brushes when exporting the map file. You must remember that TB will also support games like Hexen 2, where floating point compatible compilers are not available. I think it's better that the user actually sees what the geometry will look like to the compiler.
#12686 posted by rebb on 2013/03/27 21:50:18
But it would mean you don't have to use integers, but could use certain fractions of floats for your drift-free plane definitions - which could mean more accuracy to what the user intends - or am i seeing this wrong ?
#12687 posted by Spiney on 2013/03/27 21:57:08
Sorry if I sound like an idiot for asking, but if a brush is just a collection of planes at a certain vector how can they even become degenerate? Convexity?
The Brushes Won't Degenerate
#12688 posted by SleepwalkR on 2013/03/27 22:05:54
But if you limit the precision of the plane points, you limit the number of points where a vertex can be because not every plane can be represented with limited-precision plane points. As the easiest case, think of a plane that is parallel to the XY plane with a Z value of 0.4. This plane cannot be represented with integer precision plane points. The closest approximation is the XY plane itself.
The problem is that it is impossible to represent the many brushes which can be created with TB's vertex editing (or arbitrary rotation, for that matter) if you limit the precision of plane points. Of course, the smaller the value you snap the points to, the smaller the errors will become.
In any case, I feel the best way is to leave this to the user. I will add a setting to the map properties dialog that will allow the user to choose between integer coordinates and floating point coordinates, and to increase the maximum number of digits written to the map file to a really high value so that the rounding will be minimal.
Well All I Can Say Is 'I Wish Worldcraft Could Go Down To 0.125
#12689 posted by RickyT33 on 2013/03/27 22:24:43
That would help me a lot, without me having to learn a new editor.
|