btw is there any recommended sector light mode for this, or does it really matter that much?
Also random screenshot because I found the look of this area interesting.


I actually had this crash too with Project Brutality. I'm curious if it has to do with custom title maps or something else.Gorec wrote:just downloaded the latest version of the mod,not sure why this happens, tried on 4.7.1(fresh) and on dev build
My bad - this is because it's looking for a CVar called "rl_sensors" that I removed. I'll fix that, but try adding rl_sensors 1 on the console.Gorec wrote:just downloaded the latest version of the mod,not sure why this happens, tried on 4.7.1(fresh) and on dev build
Thanks for the feedback! I'm working on some performance issues. Found at least one bug that has a small negative impact, working on z-height adjustments, etc. I have been running this on "Software" sector mode, but I don't think it matters.mamaluigisbagel wrote: btw is there any recommended sector light mode for this, or does it really matter that much?
ZScript is not slow at all. It's quite fast, and several orders of magnitude faster than something like ACS. Of course, as with any programming language, you still have to carefully optimize your algorithms while accounting for the language's quirks.Hey Doomer wrote:I suspect that performance can be improved further by using fewer markers and more dynamic lighting, which seems to have far less performance impact than ZScript calls. ZScript is just slow. If you type "stat vm" in the console you can see these calls regularly spike as Relighting does its thing.
ZScript is a JIT-compiled language, and a subtraction is only a few instructions. It'll certainly be considerably faster than portal checking, 2 multiplications, 2 additions and a square root.these are rough estimates within a bounding box assuming that simple subtraction is much faster than Distance2D function. That may not be true given ZScript's pokey speed, but that's my working theory.
No worries. ZScript's CheckProximity is slow, that's the bottleneck I think. Exactly what I meant, I assumed a loop using an iterator would be slower than a (?compiled) function. Also meant that subtraction is probably faster than Distance2D - possibly not for similar reasons. But it's all good.phantombeta wrote: ZScript is not slow at all. It's quite fast, and several orders of magnitude faster than something like ACS. Of course, as with any programming language, you still have to carefully optimize your algorithms while accounting for the language's quirks.
The attached file has these optimizations, along with some other ones, like storing the closest lights for sight checking instead of calling CheckProximity.

Spoiler:
Spoiler:Light colour:
Spoiler:However, the mod worked really well. As I said, the performance issues that I was experiencing have now gone and the overall visual effect is very nice indeed, especially for a high-level mod that is calculating the changes as it goes (which is always going to be a bit blunter than a mapper carefully agonising over light levels and light placement). It really added a new dimension to a map that I am incredibly familiar with (outside Ep1, E2M2 (and E3M9) is probably the Doom map that I am most familiar with).
Attempt to save pointer to unhandled type NativeStruct<CVar>




Oops, guess I forgot to make the CVar variables transient when I made my optimizations.mamaluigisbagel wrote:Tried the newest version and noticed any time I try to save the game with this mod loaded, the save fails with this message.
Attempt to save pointer to unhandled type NativeStruct<CVar>
Spoiler:As an unrelated note, ZScript is case insensitive, so you can write type, function, variable, etc. names from gzdoom.pk3 in the same casing as your own code for consistency. I recommend doing that, for consistency and readability.