Well I was talking about both.Sandstormer wrote:I apologize for misunderstanding you. It seems that you are talking about editing the source code itself to change/extend the lighting within the engine as a whole, not merely changing the behavior of the lighting through DDF within a WAD file.
My first question was if there was some way to randomize elements within the DDF scripts.
But if there is not, then I would suggest some changes tot he source code.
I ultimately devoted more of my post to how I would change the source code, and that would probably be the better option in the end, but I would be up for either.
Well for example, here is what I have for the tall red torch:Coraline wrote: Second, what does your DDF dynamic light code look like, and what is the intended effect? I can take a look at it. . .
Code: Select all
[BRONZE_RED_TORCH:46]
RADIUS=16;
HEIGHT=96;
SPECIAL=SOLID,PASS_MISSILE,NOSHADOW;
DLIGHT.TYPE=modulate;
DLIGHT.INTENSITY=300;
DLIGHT.COLOUR=#ffbb10;
STATES(IDLE)=TRED:A:4:BRIGHT:dlight_colour(#ff7010),
TRED:B:4:BRIGHT:dlight_colour(#aa2004),
TRED:C:4:BRIGHT:dlight_colour(#fa5025),
TRED:D:4:BRIGHT:dlight_colour(#a98030);
First off, I still need to adjust the colors a bit; some of the frames a little too yellow. Second off, the way it flickers exactly in time with the sprites animation (every four ticks) is not realistic.
Now I could revise that script so that it has more lines and flickers its color/intensity at a more natural rate, but that doesn't solve the third and biggest issue. That issue being: all the tall red torches in a level are going to "flicker" in the exact same synchronized pattern. When one flickers to a slightly darker slightly orange hue, they all are that same slightly darker orange hue, for the exact same duration. And that just doesn't look right.
Now I could resolve that third problem if there is some way to randomize elements in DDF scripts that I do not know of. If I could make every instance of the torch start on a different line in that idle sequence, the problem would be solved. Or if I could write multiple sequences and have a line that has the object randomly pick what sequence to use, I could use that. If I could generate some randomized values to feed into the DLIGHT_SET() command, I could work with that.
The point is that I would need a way to get individual instances not following the *exact* same sequence as all of their siblings.
But probably the best effect would be to make some additions to the source code to add some new commands in the DDF scripts. (Unless the scripts allow me to create new functions I can call within the script? Still new here; don't know everything.)
What I am envisioning is something that would look like this in the DDF script:
Code: Select all
[BRONZE_RED_TORCH:46]
RADIUS=16;
HEIGHT=96;
SPECIAL=SOLID,PASS_MISSILE,NOSHADOW;
DLIGHT.TYPE=modulate;
DLIGHT.INTENSITY=300;
DLIGHT.COLOUR=#ffbb10;
DLight_LFireFlicker(300, 190, #ff7030, #cc3020); // THIS IS WHAT I CHANGED.
STATES(IDLE)=TRED:A:4:BRIGHT:NOTHING,
TRED:B:4:BRIGHT:NOTHING,
TRED:C:4:BRIGHT:NOTHING,
TRED:D:4:BRIGHT:NOTHING;
The idea is that the DDF script can call a command that will automatically start a sequence of how the light will behave, following a sequence of changing its intensity and/or color without needing it to be written in the DDF script.
This provides the advantages of having less DDF code to write to produce such an effect, and by extension, making it much easier to add such lighting effects to a list of objects.
The code I posted a couple posts ago is about what I imagine I would write into the source code, that is, the functions these new DDF commands would call. But I'm just calling it "psuedo-code" because I don't know exactly what commands would work with 3DGE's code. I just wrote a "tick" function to supplant whatever function would be called each tick for each instance that has been told to utilize the lighting pattern. Likewise other functions (RandomRange, Math.Lerp,) I just slapped in there not knowing what the code in 3DGE would actually need to call. It's all really messy but I was just trying to hammer out the basic pattern of how the light would change.
So...
At this point I'm basically asking "What's the best route to proceed?"
Are there randomizing options in the DDF scripts I can use? Or will there be in the near future? Or was the psuedo-code I wrote "close enough" to the real code that you are willing to put it in? Or am I just going to have to deal with these limitations?
(I hate to sound like a tool, but right now I'm not willing to make changes to the source code myself; I'm a pretty amateur programmer and it would take me a lot of time (and help) to get involved at that level, and I've got another project I'm working on that I need to finish before I can get that deep into modding Doom.)