FWGS / xash3d-fwgs

Xash3D FWGS engine
1.58k stars 241 forks source link

ref: disabled verbose reporting about tracer invalid color index #1810

Closed SNMetamorph closed 2 months ago

SNMetamorph commented 2 months ago

Fixes messages spamming in mods such as Sven Co-op 4.8

a1batross commented 2 months ago

What's the point of this? Why not to turn it into DPrintf or Reportf, if it's bothering you?

We still have bugs like #388 and it won't fix the issue for them, just like it less noticeable and harder to debug.

SNMetamorph commented 2 months ago

We still have bugs like #388 and it won't fix the issue for them, just like it less noticeable and harder to debug.

It's not fixable from engine side, because this is bug of mod itself. GoldSrc does not any validation of color index, but still have buffer with 12 colors just like as we have. Therefore, any index above 12 will cause undefined behavior in such cases, while no reporting anything about invalid color index. This PR clarifies behavior in such cases, and fixes not reason, but consequences of #388

a1batross commented 2 months ago

So you're telling me, GoldSrc just reads whatever is out of bounds color array and interprets as an RGB...

Still, it would be nice to have such message for mod developers at higher dev level, though it might be better to catch it not when it draws, because it will be printed each frame, but when it creates. Then it should be in cl_efx.c. Also, I don't think we will increase tracers color set anyway, as there is no real reason for this for now. :)

SNMetamorph commented 2 months ago

So you're telling me, GoldSrc just reads whatever is out of bounds color array and interprets as an RGB...

Exactly. In function R_DrawParticles: изображение

SNMetamorph commented 2 months ago

Still, it would be nice to have such message for mod developers at higher dev level, though it might be better to catch it not when it draws, because it will be printed each frame, but when it creates

Yes, this is good idea. But somehow we should have option to disable these messages for abandoned mods that won't be fixed anyway.

a1batross commented 2 months ago

I'll merge it for now, restoring the message might be done later.

GoldSrc seems to print it only in R_UserTracerParticle impl.

a1batross commented 2 months ago

I wonder if we could replicate the broken values that GoldSrc from those versions had. If they don't get changed, of course.