jdolan / quetoo

Quetoo ("Q2") is a free first person shooter based on id Tech2. GPL v2 license.
http://quetoo.org
204 stars 28 forks source link

Pan's buglist of map editing issues and other errors #658

Open Panjoo opened 2 years ago

Panjoo commented 2 years ago

I will report here the issues that I come across while finalizing the DM maps. The more I actively work in the mapeditor again and test all kinds of things ingame, the more little bugs I find. (If I encounter more things I'll add to it here.)


Buglist:

[new]

Paril commented 2 years ago

Degenerate windings are triangles that are super thin that they get collapsed into an invalid triangle (one that has two identical points), so the entire face is just removed. It shouldn't be a problem in most cases, but there are known cases where this results in a missing triangle (edge outside has a couple). The second warning is because portals are generated from brush sides, but because of floating point inaccuracies it's possible for a portal winding to end up not being able to find the brush side it came from. It's not fatal but does indicate something that we should look into.

cg_add_entity_shadows 2 and 3 were experimental to try to make them look nicer on angles & allow shadows to be dropped down edges (for instance you'd see an overhang of a shadow if somebody was standing above you over a lip), but it's too buggy and I'll probably just remove it. It'd be better for us to spend our time later on doing proper shadow mapping.

We have a doppler effect applied to the listener, so when you move around sounds you'll hear the pitch shift. It might be a tad too strong. You can adjust the intensity with s_doppler (the default is 1.0 but it can be any value). It's a global listener effect so it can't be disabled per sound. It's possible our doppler is just too strong, but keep in mind you move pretty fast in the game so maybe it's just working as intended.. we can increase the speed of sound if need be.

This image here is puff_cloud on impact: seems fine to me, are you referring to a different effect? No, this image probably doesn't need to be 512x512 given the in-game sprite size.

Panjoo commented 2 years ago

"...but there are known cases where this results in a missing triangle (edge outside has a couple)" I've noticed this, it happens fast when you're manipulating the vertexes. But I managed to fix most of the offending brushes by remaking them.

As to the doppler effect, if you load the testmap and bounce on the jumppad next to the misc_sound (I added a visible cube there), you'll notice that it's as if the pitchchange can't keep up with your speed. It just sounds strange right now.

_"...puffcloud seems fine to me, are you referring to a different effect?" Yes, I'm referring to the player breath fx, visible in cg_third_person - I think this is using the same image? See pic: puffydaddy

Paril commented 2 years ago

Oh, breath cloud is a different image. We probably forgot to scale it when we changed over to the new size system (sizes used to be relative, like a size of 1.0 meant that the image was rendered at full res; now it's absolute, but we must have missed moving this one over to the new size)

re soundtest, it sounds correct to me, but maybe you're right in that the doppler effect is too strong by default. I just left on the default values for speed of sound (343), which is defined in meters per second. I'll play around with speed of sound.

Paril commented 2 years ago

Pushed a change to speed of sound to match our unit system, and breath cloud.

Regarding the rocket launcher: I think I can fix this. We have a check that ensures that the start point of a projectile is never inside of a wall, but we don't have a way for players to fire "around" objects that are immediately blocking the start position.

Paril commented 2 years ago

https://streamable.com/7xme2o Made some adjustments to aiming which should make it easier to aim down shafts that are blocked by the weapon position.

Panjoo commented 2 years ago

https://streamable.com/7xme2o Made some adjustments to aiming which should make it easier to aim down shafts that are blocked by the weapon position.

This makes me happy - much better from the looks of it.

Pushed a change to speed of sound to match our unit system, and breath cloud.

Can I re-download the snapshot from here to check the sound speed change?

Paril commented 2 years ago

Yeah; you can keep this bookmarked ( https://ci.appveyor.com/project/Paril/quetoo ), if it shows green and says "develop" then the snapshot .zip should be updated for you to grab.

jdolan commented 2 years ago

The footsteps thing is confusing.

Let me guess: you were editing the materials file and typing r_restart or even map $map and it was still complaining about a footstep you weren't even using anymore?

This is because the footsteps come from the collision material, not the renderer material. There are two copies of this data loaded within the game. The server uses the former, the client uses the latter. When you edit the footsteps and r_restart, the client sees the change, but the server does not. And even if you map $map, we don't reload the map if it is already loaded (maybe we should).

I can fix this by loading the renderer material by name, using the collision material that was returned. But, @Panjoo please confirm that if you load some other map and then reload the one with the footsteps (or simply quit and relaunch the game) you do indeed get the correct footsteps.

I tested this just now on Edge and assigned metal2 and wood3 to two floor textures and they worked just fine as long as I completely relaunched the game.

Paril commented 2 years ago

Alternatively, a method to reload all cm materials for editing purposes which syncs with both server & client. Not as easy as a "force map reload" option, but..

jdolan commented 2 years ago

I'm actually thinking it would make sense to treat footstep samples as proper material assets (since they are). Then the client doesn't have to do anything bodgey, and we'll include custom footsteps in quemap -zip too.

Paril commented 2 years ago

Not a bad idea. Makes sense.

Panjoo commented 2 years ago

jdolan: please confirm that if you load some other map and then reload the one with the footsteps (or simply quit and relaunch the game) you do indeed get the correct footsteps.

This is very odd. Now the steps sounds work again. (I did download a newer snapshot though, so... dunno) When the footsteps wouldn't change and showed up as invalid I tried everything, and first thing I did was relaunch the game. Tried it for different textures to no avail and even checked the folder for the wav files. No idea what went wrong.

jdolanI'm actually thinking it would make sense to treat footstep samples as proper material assets (since they are). Then the client doesn't have to do anything bodgey, and we'll include custom footsteps in quemap -zip too.

Yes, but as long as the mapper always has the option to change and override the chosen footsteps for any material asset.

Paril: Pushed a change to speed of sound to match our unit system, and breath cloud.

I installed the snapshot and tested the same soundtest map. I wouldn't change too much now, it sounds just about right here :)

jdolan commented 2 years ago

The game will no longer crash on NULL sound samples.

I also refactored the footsteps code quite a bit, and it's much easier to play with now in-game. You can simply edit the footsteps name in the materials file and r_restart. I also fixed a bug where custom footsteps did not work on upward moving entities.

Panjoo commented 2 years ago

Nice going, doing it via r_restart is better than having to constantly exit and relaunch the game for little edits. There's also less change to make mistakes too while testing and switching between 10 open windows.

Paril commented 2 years ago

Can't we just make alpha test threshold a material parameter? Makes sense that people might need/want different thresholds there. I mean ideally if you know the material is going to be alphatest the texture would just have 0 or 255 alpha values, but..

jdolan commented 2 years ago

Pan and I talked about that over email. We certainly could make it a material param, but we were going to first try setting the global to 0.5 and adjusting textures accordingly. If that’s proving to be a pain then we can def just add the material param.

Panjoo commented 2 years ago

Hmm I'd love a material parm for this and have the option to just manually adjust the stuff. It's good to have good default values but adjusting and fiddling until things look good is what mappers like to do. It's usually just for one or two textures. But my plants and other alpha_test textures look cool @ 0.5 so whatever you decide is fine right now.

jdolan commented 2 years ago

Hey dude! Your new issue with the messed up textures is because of the footsteps fixes I made. Thorn ran into the same problem and he and Paril nailed this down. All you need to do is pull the game data from develop. You'll notice that when you do, the footsteps files have changed (step_1.wav is now step_default_1.wav, etc). Because the game isn't finding these files, it is failing to resolve all materials. Sorry!

Also, alpha_test is now a material parameter. It behaves similarly to light: if you specify it on a material, that material will automatically add SURF_ALPHA_TEST to any faces that reference it.

So your materials might look like:

{
  material pits/chainlink
  alpha_test .3
  roughness 1
  hardness 2
  specularity 2
}

Or

{
  material edge/tallgrass
  roughness 1
  hardness .5
  specularity .5
  surface alpha_test
  alpha_test .4
}

Or, to use the default alpha test value of 0.5, just add the surface param and do not specify alpha_test:

{
  material edge/tallgrass
  roughness 1
  hardness .5
  specularity .5
  surface alpha_test
}
Panjoo commented 2 years ago

Nice, nice! It's getting more fun with these little extra's. I'm up to date again with latest snapshot and develop game data.

Btw, netradiant needs a quetoo.game file instead of a default_project.proj. I already edited it though.

What's cont Atmospheric do again, is that for fog/dust/etc brushes so that they don't eat decals? And surf Liquid is just warp I guess. I think I got it.

jdolan commented 2 years ago

That's the idea with CONTENTS_ATMOSPHERIC, yes. And the flag will automatically be applied by quemap to any brush side that has common/fog or common/dust on it. So you don't even really need to mess with it in NetRadiant, unless you're using the contents filters to show / hide them. Side note, I added a lot of handy features like that in GtkRadiant 1.6, as well as smooth camera movement, if you want to take a look. I've also been working on Trenchbroom support, which is quite usable already. But I digress...

I'm currently working out a bug with CONTENTS_ATMOSPHERIC. You may have noticed a brush error on Edge near the glass windows / crates. Don't worry. It'll be fixed soon.

Paril commented 2 years ago

Just out curiosity, @Panjoo did you move Edge's origin point recently? I noticed our bot navigation files are offset now.

Panjoo commented 2 years ago

@Paril What is 'recently'? The last version of Edge that I uploaded myself dates July 8 2020. But yes I did. If I recall correctly I think I moved the entire level to a different spot because of the blocks that slice up the map in 1024x1024 pieces, which produced some unfortunate cuts and polys.

Paril commented 2 years ago

Hmm. I'll look into it. JD says we don't have block slicing any more (it's an old thing that Q2/Q3 did in the past but we don't need it any more) so it shouldn't be an issue; similarly we use high precision positions, so there's no more of that weird limitation where you move differently if you're on the positive planes of the map.

Anyways, was just wondering why all of the navigation nodes were all pushed around. I remember fixing this once but was surprised to find the issue back again. I've repositioned the nodes now anyways. Moving the entire map shouldn't be necessary going forward, but, if it is for whatever reason let me know so I can think of a solution that won't completely bork our nav nodes.

Panjoo commented 2 years ago

I see, but at the time when I made that map adjustment the VIS was not ditched yet, at least not to my knowledge. Is it complicated to make a new bot nav file? I thought it was just running around the map while in some sort of 'record-mode' and doing some jumps so the bots will do the same.

Paril commented 2 years ago

It's not difficult but the in-game editor needs polish. I only really developed it to work for my needs. It can also take a while to get everything perfect, and the bots have some navigational quirks that I'm still ironing out.

jdolan commented 2 years ago

@Panjoo Caustics can now be specified in worldspawn, as requested. Default is 1.0.

I'll look into these other lighting issues now.

jdolan commented 2 years ago

Alpha test issue is also fixed. Thanks for the test map!

jdolan commented 2 years ago

I'll continue to look into the lighting issues. Something odd is up. It's difficult to tell with the textures, as well, but here are the problem areas you called out with just the lightmap rendered:

The lava lighting here does seem uneven. I'm not sure it's totally wrong or unnatural, but I agree it doesn't seem quite right.

quetoo023

Below you can see the hot-spot on the ceiling from the little light on the func_train. It shouldn't be casting any light above, since it's a downward facing light, so something is indeed off here.

quetoo022

And lastly, the wall you can't seem to get red light on. You can see it is actually getting some, but the corner across the hall from it has a lot more.

quetoo021

My hunch is that the indirect light is set too high, and so you're getting unnatural bounces where incoming light is actually amplified instead of absorbed and diffused. That would explain the lava issues.. not the func_train one. But I'll run a couple experiments and report back.

Panjoo commented 2 years ago

Good job so far on the caustics and _alphatest. The more things I can finetune the better it's going to look.

As for the lava, I can always add a couple extra lights in places where I want that extra red glow, so even if there is something wrong here, it's not something that I can't cover up and make look good. A bigger problem to me is the surfacelight leakage thing. I keep finding areas where surfacelight is reaching places it should never reach: leakage

jdolan commented 2 years ago

I was going to look into the light issues last night but decided to play a video game for the first time in months instead, heh. Can you try something, tho? Can you bake the map without indirect (—no-indirect I think). I’m suspicious that most of these issues are related to the indirect pass but have not confirmed yet.

Panjoo commented 2 years ago

OK, compiled the map without --indirect. (ambient .37 .31 .25 / brightness 2 /no other worldspawn keys) Many parts become too red, while other parts still lack light.

As I mentioned earlier, something is wrong here. It took over 61 minutes (3667279 ms) which is a horrible compile time for this map. And I even blocked out a portion of the map by placing a big cube over it, so 61 minutes for 2/3 of fragpipe. Takes me back to Q2 compile times in 1999 on my Pentium 233. lol :P

no-indirect-light

Paril commented 2 years ago

Potentially related to the fast trace changes?

jdolan commented 2 years ago
Lighting maps/fragpipe.bsp

Loaded 39 materials from maps/fragpipe.mat
Building patches         [100%] 22 ms
Direct lightmaps         [100%] 16271 ms
Direct lightgrid         [100%] 552 ms
Indirect lightmaps       [100%] 31620 ms
Indirect lightgrid       [100%] 1311 ms
Caustics lightmap        [100%] 1666 ms
Caustics lightgrid       [100%] 218 ms
Fog volumes              [100%] 221 ms
Finalizing lightmaps     [100%] 181 ms
Finalizing lightgrid     [100%] 97 ms

Lit maps/fragpipe.bsp in 52811 ms

quemap finished in 54485ms

🤔

jdolan commented 2 years ago

Did Pan get a debug build by accident?

jdolan commented 2 years ago

Anyway, yea, something is clearly fucked up with the lighting and I'll look into it this weekend at the latest.

jdolan commented 2 years ago

Btw, Pan, is this a modified fragpipe.map or do I have this version?

jdolan commented 2 years ago

quetoo024

Here are my results with the fragpipe.{map|mat} that's in Git (in map-fragpipe.pk3) right now, using quemap -bsp -light --no-indirect maps/fragpipe.map. It compiled in 17 seconds, and I'm not seeing that crazy red light.

In fact, for direct lighting only, I think the results look very good. It does make me think that a smaller default patch_size is worth considering, as you can pretty clearly see where the patch lights are "centered" near the lava and slime.

I think you may have accidentally added some monster of a light somewhere? Or several? That could blow up your compile times, and would explain the shitty red light that's nearly global, but clearly affected by direction somehow.

There is something wrong with the little light on the func_train. I'll look at that more closely soon. We may need to ditch it, but hopefully not. And I also agree that something is not right with indirect lighting. That will take some testing and tweaking, which I can also get into this weekend.

Panjoo commented 2 years ago

quemap -bsp -light --no-indirect maps/fragpipe.map

I'm not familiar with the --no-indirect option, is that something new that I don't know? Doing a quemap --help gives me this, and that option is not listed;

-light             LIGHT stage options:
 --antialias - calculate extra lighting samples and average them
 --indirect - calculate indirect lighting
 --bounce <integer> - indirect lighting bounces (default 1)
 --radiosity <float> - radiosity level (default 0.125)
 --brightness <float> - brightness (default 1.0)
 --contrast <float> - contrast (default 1.0)
 --saturation <float> - saturation (default 1.0)
 --luxel-size <float> - luxel size (default 4)
 --patch-size <float> - patch size (default 16)

So I did a quemap -bsp -light (which I guess must be that --antialias or something that I'm never gonna use because it takes too long). But the --indirect compile takes like 40 seconds

Btw, Pan, is this a modified fragpipe.map or do I have this version?

You should have it, I'm certain I pushed all them latest (2020) versions to master. But I haven't seen the newer fragpipe ingame since, same with Tokays and Pits. You probably took them out because you were in the middle of big changes at that time, iirc. I remember emailing you screenshots to compare all the maps and changes and whatnot, But anyway, I'm on a roll here now and will make sure we have all the right versions and redo the lighting. Well, as soon as it works.

Paril commented 2 years ago

Afaik, indirect is implied now. He reversed the option so that --no-indirect turns it off, but it's on by default.

Panjoo commented 2 years ago

So, if I compile with: quemap -bsp -light --indirect it takes 40 seconds, but if I compile with quemap -bsp -light (which you say is the same thing: --indirect by default) it takes an hour?

Paril commented 2 years ago

Ya. indirect isn't an option;

This is with the repo versions (like in the develop builds). It might be different on the older builds. Make sure you're using the quemap from the develop.

Panjoo commented 2 years ago

Thnx, I'll check it out later.

Paril commented 2 years ago

That being said, JD has been talking about fixing the indirect bug you've been seeing. He's been excited about it; it should be faster and also more precise for you. Coming soon:tm:!

jdolan commented 2 years ago

Making some progress.. quetoo000 quetoo001 quetoo002 quetoo003

Still some work remains to dial indirect lighting in, but I think this is headed in a very good direction.

Paril commented 2 years ago

I do wonder if we can just have a mode that does a light per luxel rather than patches. It'd be like the "super bake" since it may take a while, but, it might give the most precise output

jdolan commented 2 years ago

I mean.. quemap -light --patch-size 4 maps/fragpipe.map

Panjoo commented 2 years ago

I can't compile this stupid map without having to wait for way too long and I'm starting to get frustrated again. I'm already using this snapshot https://ci.appveyor.com/project/Paril/quetoo The compiler seems amost stuck at the second "Indirect lightmaps" stage. First one also take like 4 minutes. You keep showing screenshots of the old version, can you try it with the files I attached?

fragpipe-newfiles.zip

jdolan commented 2 years ago

Here's your version of the map in my current WIP branch that addresses light bleed:

quemap -bsp -light --radiosity .5 maps/fragpipe-new.map
...
Lighting maps/fragpipe-new.bsp

Loaded 40 materials from maps/fragpipe-new.mat
WARNING: LoadMaterial: Failed to resolve fragpipe/ggrat4_2add
Building patches         [100%] 59 ms
WARNING: LightForEntity_light_spot: Entity 128, Brush 0: light_spot at (1536.00 560.00 248.00) missing target and _angle
WARNING: LightForEntity_light_spot: Entity 129, Brush 0: light_spot at (288.00 1352.00 352.00) missing target and _angle
WARNING: LightForEntity_light_spot: Entity 130, Brush 0: light_spot at (1856.00 1416.00 164.00) missing target and _angle
WARNING: LightForEntity_light_spot: Entity 131, Brush 0: light_spot at (1216.00 1416.00 164.00) missing target and _angle
WARNING: LightForEntity_light_spot: Entity 132, Brush 0: light_spot at (512.00 1352.00 352.00) missing target and _angle
WARNING: LightForEntity_light_spot: Entity 133, Brush 0: light_spot at (400.00 1352.00 352.00) missing target and _angle
WARNING: LightForEntity_light_spot: Entity 152, Brush 0: light_spot at (1536.00 752.00 248.00) missing target and _angle
WARNING: LightForEntity_light_spot: Entity 162, Brush 0: light_spot at (1536.00 1112.00 332.00) missing target and _angle
Direct lightmaps         [100%] 12907 ms
Direct lightgrid         [100%] 513 ms
Indirect lightmaps       [100%] 8444 ms
Indirect lightgrid       [100%] 374 ms
Caustics lightmap        [100%] 982 ms
Caustics lightgrid       [100%] 145 ms
Fog volumes              [100%] 141 ms
Finalizing lightmaps     [100%] 118 ms
Finalizing lightgrid     [100%] 49 ms

Lit maps/fragpipe-new.bsp in 24668 ms

quemap finished in 26556ms

...

quetoo004 quetoo005 quetoo006 quetoo007

The lighting looks a bit flat (too large a sun size, with the fixes I made, and too high an ambient value maybe?), but compiles in 25s and looks reasonable (no artifacts).

We've already identified there are issues with indirect light. I don't know why it performs so badly for you, but just don't bother with it for now :) You can rough-in the lighting with --no-indirect until I can merge this branch in.

Paril commented 2 years ago

I'm not sure either - I ran it on my end just to make sure that I wasn't missing something:

Direct lightmaps         [100%] 4299 ms
Direct lightgrid         [100%] 141 ms
Indirect lightmaps       [100%] 2749 ms
Indirect lightgrid       [100%] 87 ms
Caustics lightmap        [100%] 358 ms
Caustics lightgrid       [100%] 31 ms
Fog volumes              [100%] 27 ms
Finalizing lightmaps     [100%] 39 ms
Finalizing lightgrid     [100%] 22 ms

Lit maps/fragpipe-new.bsp in 8325 ms

C:\quetoo\bin\quemap.exe finished in 10036ms

I was missing a grate texture but other than that.. indirect has never taken longer than direct for me so I dunno

Panjoo commented 2 years ago

missing-tex.zip

This lighting is just temp and experimental, and flat, yes. When I picked the colors I had my ingame contrast setting at 1.1 Also, I don't have the light-fixing snapshot yet. So far I found that picking the right ambient is everything. You can have all else in place and totally ruin a map's atmos with the wrong amb values. In other maps I wasn't happy with the atmosphere until I made tiny changes to the ambient and it immediately looked better. It's rather tricky to get it right, dunno what it is. Compiling with just the sunlight (so no ambient) shows almost no light. So the ambient basicly decides the entire feel.

quemap -bsp -light maps/fragpipe-new.map
Building patches         [100%] 30 ms
Direct lightmaps         [100%] 86570 ms
Direct lightgrid         [100%] 2797 ms
Indirect lightmaps       [100%] 51987 ms
Indirect lightgrid       [100%] 1546 ms
Caustics lightmap        [100%] 9822 ms
Caustics lightgrid       [100%] 263 ms
Fog volumes              [100%] 160 ms
Finalizing lightmaps     [100%] 553 ms
Finalizing lightgrid     [100%] 21 ms

Lit maps/fragpipe-new.bsp in 155756 ms
quemap finished in 161173ms

And now all of a sudden it compiles as it did before. Still slow on this old PC... but not 61 minutes like yesterday. Go figure. However, I see the same uneven lava light problem in this spot, just looks weird: quetoo070

(Edit: oh yea duh, no surprise it still looks the same... lol)