#651 posted by necros on 2014/05/04 18:44:33
i feel this is just a map bug that went unnoticed due to an engine bug.
the problem lies with the map.
Angle Vs Angles
#652 posted by LordHavoc on 2014/05/04 18:57:20
Just to clarify, this is "angle", so that second approach I mentioned won't work as this isn't an incomplete vector.
A spot fix for specific map names to ignore "angle" "-1" seems to be the safest solution but still a complete hack and I don't like hacks.
One Specific Workaround
#653 posted by LordHavoc on 2014/05/04 19:13:18
The engine could detect the following combination:
classname == func_train
origin == 0 0 0
angles != 0 0 0
And clear the angles in that case.
Any entity with origin 0 0 0 that is using angles is suspicious, but a func_train is highly suspect.
#654 posted by metlslime on 2014/05/05 07:56:43
I believe the cause for this is a mapper who started with a func_door with angle -1, then later changed the classname to func_train/plat to get better behavior, but didn't clear out the "angle" key.
As to the question of fixing it with an engine hack, i guess testing for "func_train" or "func_plat" with angle != 0 would be a fairly targeted way to do it. It's a hack no matter what unfortunately, and I'm not 100% against hacks (for example i put in a hack for the large shell ammobox texture) but what worries me is we don't know the complete list of existing levels that have this problem.
#655 posted by metlslime on 2014/05/05 07:57:40
I believe the cause for this is a mapper who started with a func_door with angle -1, then later changed the classname to func_train/plat to get better behavior, but didn't clear out the "angle" key.
To be clear, i mean that of the 3-4 cases I know about, the cause seems to always be the same.
(not That I Know About Func_trains)
#656 posted by megaman on 2014/05/05 10:51:34
but if they're not supposed to have angles, why don't you just always throw it away?
#657 posted by metlslime on 2014/05/05 10:52:30
quakec could do that. Engine doesn't know what is supposed to have what.
Func_train Angles And Origins
#658 posted by LordHavoc on 2014/05/05 10:53:19
In engines that support rotating platforms (which darkplaces for example does), I can't just throw away angles on func_train automatically.
But in the specific case that the func_train has origin 0 0 0 (which is the default for any brush model), the angles make no sense - as it would just orbit around the center of the map.
#659 posted by Spirit on 2014/05/05 11:12:39
That's something I could see in abstract maps though.
Havoc:
#660 posted by metlslime on 2014/05/05 20:38:48
fair enough. I was assuming that all mods with rotation support would use func_rotate_train isntead, but i guess that isn't guaranteed.
#661 posted by ericw on 2014/05/05 23:27:18
How bad would the side effects be of reverting to the original rounding code? whereabouts in the code is the rounding?
The hacks do sound dangerous to me, unless they were restricted to the known filenames with this bug.
The only good news is mappers won't make this mistake on new maps, since most SP mappers probably test in a fitz0.85 derived engine and/or darkplaces.
Rounding
#662 posted by LordHavoc on 2014/05/06 05:24:09
The rounding is only for the networking (I.E. visual only), if the engine supports rotation in the underlying sv_phys.c code, then even if the visuals are not rotated, the physics will be (leading to a rather confusing jump and fall-through in this case).
DarkPlaces supports that, so I can't really just revert my rounding change.
Furthermore, the same rounding change gives a significant improvement in aiming, where it is widely known that stock quake has kind of a "down and to the right of the crosshair" characteristic, the aiming is more accurate because of this rounding fix (although darkplaces goes further and uses 16bit angles for aiming so you can hit a pinpoint location across the room).
Negative Angles
#663 posted by Baker on 2014/09/02 00:52:57
It is okay to throw away negative angles for a func_train.
Even in DarkPlaces, negative angles don't make any sense (except for func_wall or func_door where -1 and -2 have special meaning) because negative angles are invalid.
Rotated brushes/entities in any map editor have positive angles from 0 to 359.999999.
[This excludes the idea that someone would write custom func_train code that supported angles, but even then the values would be positive].
FitzQuake Sky Slowness
#664 posted by Baker on 2014/09/02 01:06:22
My main reason for bumping this thread is this.
FitzQuake renders rather slow compared to other engines because of the sky. The sky draws first and in the case of a skybox, it literally draws the entire screen.
I'd like to Z-fail the sky, but I want the fog to render on the sky in the proper FitzQuake manner. And I'm not entirely sure what process sky entities does.
I always use A Roman Wilderness of Pain (arwop) map ROMAN1 as the example of an fps killer in engine testing. In Mark V, I get 20 FPS. DirectQ gets an insane 169 fps. In other engines, typically the fps is close to 30, which sounds low but is a 50% improvement over FitzQuake. (Even on a low end video card, some other engines often are hitting 600 fps with ease on id1/start.bsp and the FitzQuake renderer struggles to break 300).
FitzQuake does rendering far better than other engines, in my opinion, but the slowness is an obstacle and I think it is exclusive to the sky.
[There are other ways to increase the FitzQuake frame rate, like using 3 texture units to draw texture, fullbright and lightmap in the same pass, instead of using 2 texture units, but even if I essentially disable that with gl_fullbright 0, I still get 20 fps on ARWOP (no improvement).]
#665 posted by metlslime on 2014/09/02 01:18:50
with modern graphics cards, fitzquake could draw skyboxes using a cubemap (directly rendering the sky faces instead of drawing an actual giant cube.) And for the classic scrolling sky, i think you could do it with a pixel shader.
To Disagree
#666 posted by Preach on 2014/09/02 01:43:32
[This excludes the idea that someone would write custom func_train code that supported angles, but even then the values would be positive].
I don't think engines should make this kind of assumption based on the mods that exist today. Suppose someone writes a mod that unifies func_train and func_rotate_train under the former name. Then a negative angle is a deliberate signal to the mod - make the rotation towards the next waypoint move in the positive direction.
Hmm
#667 posted by ericw on 2014/09/02 04:30:00
Baker, I'm surprised sky is a bottleneck.
If I make Sky_DrawSky return immediately without drawing anything, I get essentially no change in fps. This is with a fairly fast cpu (2.3ghz i7), 2 year old laptop gpu (nvidia gt 650m).
For me over half the time in the roman1.bsp starting position is spent drawing entities (mostly on alias models), a bit less than half drawing the world. In Mark V I get 90fps, 205fps with "r_drawentities 0" and 135fps with "r_drawworld 0" (but r_drawentities 1). Try setting those to draw only the world / only entities, to see relatively how much time is spent on each.
#668 posted by Spike on 2014/09/02 05:11:36
sky is expensive in terms of overdraw - if its drawn fullscreen anyway.
the vanilla code is ugly as heck, it warps in a horrible way as you move around.
the skybox code that seems to be fairly abundant has a few issues with certain situations, like side windows, that increase overdraw unnecessarily, which can be expensive. a good example is dm2, where the side windows (that noone remembers are there) result in the sky basically covering the entire screen.
it can be significant when you're framerate limited, but at least the worst-case is limited to (less than) only half the framerate.
#669 posted by Baker on 2014/09/03 06:07:43
@preach
I suppose so, I hadn't considered that. The traditional func_train would never move up/down like a door or plat. ;)
@ericw
Load up a skybox and instead of not drawing the sky, don't draw the world.
Now I understand what you say in regards to speed, I'm not blaming the fps in arwop on the sky (make no mistake) -- if you load up ARWOP and in Mark V and type in "cl_shownet 1" and then type "sv_cullentities 2" (which is DarkPlaces/FTE anti-wallhack level of culling server-side) --- you will watch the network traffic drop by 2/3rds --- ARWOP is a prime example of a beneficiary of network optimization (DarkPlaces and FTE probably breeze by it).
But I think the sky may be costing 100 fps on a map like id1\start.
I'll be finding out ...
And By The Way ...
#670 posted by Baker on 2014/09/03 06:21:09
Make no mistake, I love the FitzQuake renderer, obviously.
The sky has been bothering me for years! And it reared up yet again.
The way the rest of the rendering works, I have never been able to determine or intent of the sky drawing the way it does --- everything else in the engine is clearly a clockwork and quite deliberate.
My only guess is to render fog on it consistently. And I intend to find another way to do that, if so.
Baker:
#671 posted by metlslime on 2014/09/03 07:08:21
Goals of the fitzquake sky rendering:
* sky should only be visible when looking at a sky brush, not void
* if a sky brush is in front of some other geometry in the PVS, you should see sky, not the geometry behind it.
* brush entities with sky texture on them should look like sky too
* sky should be rendered as if it was a giant cube, and should not be distorted by the actual geometry of the sky brushes or the movement of the camera
So what i do is clear the zbuffer, then draw all the sky surfaces (brush faces) untextured (to write to the zbuffer), then draw the skybox with the depth-test reversed so that only farther objects pass the test. This means the giant, distant box of the sky will only appear on portions of the screen where the sky brushes were already rendered. Then I draw the rest of the world, and since the sky surfaces have correct depth values, they occlude any polygons farther away.
Even when drawing the scrolling cloud sky, i use a giant cube that has been subdivided enough to approximate the dome shape (r_sky_quality controls the subdivisions)
There's also some code to attempt to draw less than a full box, when only part of the screen shows sky. This was disabled for skyboxes (couldn't get it right at the time, due to tjunctions), but enabled for the cloudy sky (since it's subdivided into a grid anyway, there are no tjunctions.)
@metlslime
#672 posted by Baker on 2014/09/03 22:53:17
I've been looking at MH's home work, and because I want any speedup I do to render identical to FitzQuake 0.85, I think I'm going to try this:
1) Instead of drawing the sky first, run through the sky texture chain + sky entities and see if any sky surfaces are visible. Set frame_skyshown to true or false.
2) Provided frame_skyshown, at end of drawing instead of beginning, either do a sky surface stencil pass or draw with glColormask (FALSE, FALSE, FALSE, FALSE) using sky surfaces + sky entity surfaces.
3) Then use the drawing code more or less as-is.
I understand the trickery of handling the skybox, ironically the software engine Makaqu supports skyboxes in WinQuake and draws the skybox only on those brushes (and it looks perfect too).
While tempting to give that a shot in Fitz, I think I'll try the more simple method outlined above at least at first.
Hopefully, it results in some fps.
Baker:
#673 posted by metlslime on 2014/09/04 00:15:40
Stencil buffer sounds like a reasonable way to do it. At the time I didn't want to introduce a new hardware requirement but since every card for 15 years has had stencil, it's probably safe :)
Metl
#674 posted by ericw on 2014/09/21 21:11:34
In Fitz 0.85's Host_Game_f (), do you remember why this is commented out?
//Cbuf_InsertText ("exec quake.rc");
We were discussing re-adding it in Quakespasm. Not doing it creates a disparity between the "-game" flag and the "game" console command, where "-game" will exec the mod's quake.rc possibly with custom settings, but "game" won't. This is a problem for some mods, e.g. those that set an increased max_edicts required for their maps in their quake.rc.
The only issue I can see is execing quake.rc might trigger a video mode change, if the gamedir you're switching to has some different vid_width/vid_height saved in the config.cfg. But it's easy to work around that with the vid_locked mechanism.
#675 posted by Spike on 2014/09/21 21:43:02
@ericw
startdemos
stufftext
both are annoying every time you change gamedir. and yeah, engines that unconditionally shove a vid_restart into configs are annoying too.
if you can change gamedir without any side effects then you're a miracle worker.
your current settings getting wiped is pretty annoying too, if you bind your controls then change gamedir.
changing gamedirs without restarting is actually quite complicated if you want to to do it properly. plus its annoying if its not done properly.
FTE checks if the various configs change over the gamedir change, so it doesn't oblierate settings if there was no point in doing it in the first place. this helps reduce how annoying it is. There's still other issues, but they don't appear as often thanks to this. :P
|