My problems with JA


(mslaf) #1

Hello everyone.

I’m creating my first map for Jedi Academy and I have encountered several problems. Because I’m not a Q3A engine guru I’d appreciate your help in solving them.

I use:

  • q3map2 v2.5.12 – the latest “stableâ€? at this moment,
  • GtkRadiant 1.2.13 (1.2) and
  • QMapToolz.

When compiling the map I use the following ‘generic’ options:
BSP: q3map2.exe -meta …
VIS: q3map2 -vis -saveptr …
LIGHT: q3map2 -light -fast …

The first problem and question is about the “Vis stage” processing. I’ve noticed that some structures, the entities to be more specific, are visible for the game engine even if the player is separated from them! Is it a problem with my map, game engine or q3map2?

Here is the fist example:
http://www.mslaf.com/projects/corda/problems/problem_visproblem11.jpeg
http://www.mslaf.com/projects/corda/problems/problem_visproblem12.jpeg
http://www.mslaf.com/projects/corda/problems/problem_visproblem13.jpeg

And the second one:
http://www.mslaf.com/projects/corda/problems/problem_visproblem21.jpeg
http://www.mslaf.com/projects/corda/problems/problem_visproblem22.jpeg

The entity’s type is func_static.

Second question is also about the Vis stage processing and the “custom� hints. When I add some not rectangular hint brushes a strange thing happens. The hint used in one room seems to be applied to any other rooms that are located in a completely different part of my map. Where’s a problem. It looks like unnecessary waste of portals:)

Screenshot from an editor:
http://www.mslaf.com/projects/corda/problems/problem_badhints.jpeg

This one is the most frustrating problem: the “vertex” shaders. I’ve got some of them used in my map and when I apply such shader to a normal brush everything is fine but when I apply it to the entity (like an infamous func_static) the shader becomes black - no light is applied to it. What’s wrong?

This is my shader:
textures/mslaf_floors/flooree_02a_vxphong
{
qer_editorimage textures/mslaf_floors/flooree_02a
q3map_material SolidMetal
q3map_shadeangle 120
q3map_nonplanar
q3map_splotchfix
q3map_onlyvertexlighting // for ShaderEd2 “compatibility”:slight_smile:
q3map_nolightmap
{
map textures/mslaf_floors/flooree_02a
rgbGen vertex
}
}

One example:
http://www.mslaf.com/projects/corda/problems/problem_vxphong1_normal.jpeg
http://www.mslaf.com/projects/corda/problems/problem_vxphong1_lightmap.jpeg
http://www.mslaf.com/projects/corda/problems/problem_vxphong1_fullbright.jpeg

and the second example:
http://www.mslaf.com/projects/corda/problems/problem_vxphong2_normal.jpeg
http://www.mslaf.com/projects/corda/problems/problem_vxphong2_lightmap.jpeg
http://www.mslaf.com/projects/corda/problems/problem_vxphong2_fullbright.jpeg

The funny thing is, that the problem disappears when the map is leaked!

Is there a way or a shader that would tell the q3map2 TO NOT create portals in specific places? The skip shader doesn’t work and the antiportal is for different things.

This is a standard behavior:
http://www.mslaf.com/projects/corda/problems/problem_antiportal1.jpeg

and I’d like to have something like this:
http://www.mslaf.com/projects/corda/problems/problem_antiportal2.jpeg

but I’m not sure if it’s technically correct or possible.


(pazur) #2

hi mslaf, … witam :wink:

  1. I had this vis issue with func_plats and script_movers in RTCW. Seems to be usual for this kind of entities

  2. Strange… maybe the walls are not properly aligned to each other and “leak” somewhere, but since you are checking vis that accurate thats not likely. I’m curious what ydnar is going to say about this.

  3. Phong in vertex shaders? Thats new to me. From my experience vertex shaders look always darker than lightmapped shaders. _minvertexlight in worldspawn helps. If you are trying to save lightmapdata i would go for an usual lightmap shader and a _lightmapscale of 8 or 16

  4. As far as i know there is no such shader. To prevent such portals i would map in the “caulk-hull” method, but i guess u know that


(mslaf) #3

Thx Pazur, / Cześć:)

2.I’m not so prudent about the vis:) but with such behavior the number of portals will easily increase. I’ve noticed that in a small level, q3map2 created about 3000 portals. When I removed these hints the number decreased to 500.
3.As I said I’m not an expert and I could name it incorrectly but it’s definitely a vertex shader. It works fine on the normal brushes and doesn’t work on entities. That’s a problem. I was deleting brush by brush on my level to find out the reason but with no success. When I create a new map it works fine for a while and some day it breaks. It’s interesting why it works when the map is leaked?
4.I was wondering if it’s possible to have a vis stage based on defined hints/areaportals rather that internal algorithms.


(ydnar) #4

Thanks for your well-thought-out- questions and numerous screenshots. That helps immeasurably.

  1. Why are you using func_static entities? It’s better to compile them into the BSP as a func_group (or just part of worldspawn) unless they’re designed to move or disappear from the map. The reason they’re visible from the entire map is because they touch too many vis clusters and the engine marks them as SVF_BROADCAST. This means they’re visible everywhere.

  2. Hint faces are used as primary BSP splitters. They split the BSP before normal brush faces. You could probably avoid the far splits by putting an axial hint brush around your existing hint brush before it in the map file.

  3. No need to use vertex shaders on brushes explicitly like that unless your map is really huge. If it’s a bug (and I’m looking into that) then consider just using a normal texture or phong-shaded lightmapped shader on your entities.

  4. Portals are implicit between BSP leaves. If you want to suppress those portals, then make the visible structure there detail and use a simple axial caulk hull.

y


(mslaf) #5

Thanks for your well-thought-out- questions and numerous screenshots. That helps immeasurably.

You are welcome, I’ve learned it from my network users that were calling me because an error “something-somethingâ€? occurred on their computers:)

  1. Why are you using func_static entities? It’s better to compile them into the BSP as a func_group (or just part of worldspawn) unless they’re designed to move or disappear from the map. The reason they’re visible from the entire map is because they touch too many vis clusters and the engine marks them as SVF_BROADCAST. This means they’re visible everywhere.

If I get it right and according to documentation, func_groups are entities for the editor and compiler. I’m not sure if they’re even recognized by the engine. Sorry if I didn’t mention it before but these are all movable elements and that’s why I used func_statics. I obviously don’t use func_statics for grouping brushes. But this SVF_BROADCAST flag or attribute could be the reason and I’ll check it out. Is this flag checked during the loading phase or all the time?

  1. Hint faces are used as primary BSP splitters. They split the BSP before normal brush faces. You could probably avoid the far splits by putting an axial hint brush around your existing hint brush before it in the map file.

Ha! That’s why the areaportal didn’t work. It’s used at the end. I’ll try it and let you know.

  1. No need to use vertex shaders on brushes explicitly like that unless your map is really huge. If it’s a bug (and I’m looking into that) then consider just using a normal texture or phong-shaded light mapped shader on your entities.

Well, my map will be really huge and I’m trying to use as many vertex shaders as it’s possible. They seem to be more efficient for the renderer but especially for my CPUs during compilation. In the bright areas they look like normal light mapped surfaces and there’s no need to increase the BSP size with additional lightmap data. I use them on the entities because they’re are partially reflective so they must be vertex.

If it’s a bug you will probably fix it before I finish my map. Till then I replace them with normal light mapped shaders with the _lightmapscale = 128 or something like this.

  1. Portals are implicit between BSP leaves. If you want to suppress those portals, then make the visible structure there detail and use a simple axial caulk hull.

That’s a good solution, pointed previously by Pazur. Unfortunately sometimes it’s hard to do it without heavy reconstructions in the map file.

Thank you for your help.


(SCDS_reyalP) #6

I made another shader called subtlehint to deal avoid this. It is exactly like ‘hint’ but without the surfaceparam hint. So it has the same priority as a normal brush. You can mix hint, subtlehint and skip on one brush, if you need to. Having the name contain ‘hint’ lets it be filtered with the filter hints command. For this reason, I also made hintskip (exactly the same as skip) so brushes with mixed skip and hint would filter correctly. Those shaders are included in the current RTCW and ET gamepacks for radiant.

HTH.


(mslaf) #7

I made another shader called subtlehint to deal avoid this. It is exactly like ‘hint’ but without the surfaceparam hint. So it has the same priority as a normal brush. You can mix hint, subtlehint and skip on one brush, if you need to. Having the name contain ‘hint’ lets it be filtered with the filter hints command. For this reason, I also made hintskip (exactly the same as skip) so brushes with mixed skip and hint would filter correctly. Those shaders are included in the current RTCW and ET gamepacks for radiant.

Ha! It’s a coincidence because I was just about to try it myself. I’ve created something like this:

textures/mslaf_system/hintbrush
{
qer_editorimage textures/mslaf_system/hintbrush.jpg
qer_nocarve
qer_trans 0.9
surfaceparm noimpact
surfaceparm nodraw
surfaceparm nonsolid
surfaceparm nonopaque
surfaceparm trans
q3map_nolightmap
q3map_structural
}

and the far splits are no longer created. Works great! Thanks SCDS_reyalP for pointing this idea.

Maybe I’m wrong but if it works like the “hintâ€? shader what’s the point of using the “realâ€? hint shaders?


(SCDS_reyalP) #8

Sometimes you want the hint to be higher priority (for example, to cut off splits that would otherwise extend outward from your normal structure). I suggest using the portal viewer plugin to understand the results.

The official shaders have gone back and forth between having surfaceparam hint and not, which seems like a fair indication that there really is a need for both.

Probably a good place to bring up Spogs q3map explanation http://www.planetquake.com/spog/stuff/technical.html in case you haven’t read that yet.


(mslaf) #9

Thank you SCDS_reyalP.