ddf editing; looking for features

Are you experiencing a problem? Maybe you can't get your scripts to do what you need, or are frustrated by a feature you just can't seem to get working? Let us know about it here and we will try our best to help you out!
User avatar
Marscaleb
Posts: 89
Joined: Sat Jun 25, 2016 12:57 pm
Location: California or Utah
Contact:

Re: ddf editing; looking for features

Post by Marscaleb »

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.
Well I was talking about both.
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.
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. . .
Well for example, here is what I have for the tall red torch:

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);
But the effect isn't quite right and needs to be tweaked.
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;
(Alternatively that DLight_LFireFlicker() could be called from a STATES section, to allow scripts to activate/deactivate the lighting pattern when certain states are triggered, but for this example we want the object to always use this lighting pattern.)
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.)

User avatar
RUNSABER
Posts: 132
Joined: Sat Mar 14, 2015 3:10 pm

Re: ddf editing; looking for features

Post by RUNSABER »

Sorry for responding late, bud! Ive been focusing my time on drawing, finishing up code and gameplay balancing for DAMNED and I JUST got a new 64-bit OS laptop for more soon shenanigans ^_^

The best way to randomize your commands would be with my favorite function and that is the JUMP command. When I first read about it in RTS scripting, I flipped shit and said ",screw this, there's no way in hell I'm working with percentages". But then, as I worked on my own mod experimenting with alternative attacks for monsters, I revisited JUMP and #COMMAND calls . And now I use them to create random spawners, flickering/phasing lights, programming defensive states for enemies, support characters and so forth. JUMP states are like #Command calls, except you can use them to force running scripts to jump to another frame or state for things, weapons, items and so on. You can also use a percentage ratio to determine at WHAT percentage the JUMP will occur. At 5%, there is a small chance of the script jumping to the specified state or frame. Take monster counts or attacks into consideration and that percentage doesn't seem very frequent but you'll see the difference. Ill write a tutorial for this soon once I get my new computer set up!
Official 3DGE64 Project Portal - Public Repository for 3DGE 64.

User avatar
Marscaleb
Posts: 89
Joined: Sat Jun 25, 2016 12:57 pm
Location: California or Utah
Contact:

Re: ddf editing; looking for features

Post by Marscaleb »

RUNSABER wrote: Ill write a tutorial for this soon once I get my new computer set up!
Yeah that would be great; I don't see any documentation for a JUMP command in the edge wiki, so I'd like to know how to implement it and use it.

User avatar
RUNSABER
Posts: 132
Joined: Sat Mar 14, 2015 3:10 pm

Re: ddf editing; looking for features

Post by RUNSABER »

There's still a lot to grow and improve on here at the home of 3DGE . While the masters are doing work on the engine behind the scenes, users like me work and mod the game to learn more about it. I'm more of a mapper than a modder which is why I chose this port but the lines between the two have blurred significantly. Keep a check up on the wiki with the "Recent Changes" link and I'll be sure to add tutorial topics in this subforum for ease of access!
Official 3DGE64 Project Portal - Public Repository for 3DGE 64.

User avatar
Marscaleb
Posts: 89
Joined: Sat Jun 25, 2016 12:57 pm
Location: California or Utah
Contact:

Re: ddf editing; looking for features

Post by Marscaleb »

You know, I think something that would be really useful is an example map with all the stuff 3DGE can do.

One, it would make a handy reference. Want to see how to set something up? Just look at the example wad.

Two, speaking as someone who only recently came across 3DGE, the existing documentation does very little to actually describe what this source port is capable of. And even if the documentation were better fleshed out, there is a big difference between reading a long document and actually running a game and seeing "Oh, I could do that with just a little bit of text editing!"

Seriously, when I was looking at Doom source ports, what interested me the most about 3DGE was simply that it actually properly darkened the brightness of the walls according to distance, which is something I have not seen other 3D-capable ports do. (Plus the HQ2X scaling for sprites. OMG best thing ever!) So I decided to take a closer look.
I started reading the wiki, and it basically said "3DGE can do a bunch of really cool stuff with DDF, and then RTS can do even more!" And I honestly can't find much about what it actual does.
The most eye-opening experience I had with it was when I downloaded and played some quake weapons mod, or moreover, when I opened that wad in Slade and realized that all it contained was the graphics, sounds, and a couple DDF files. And yet it fundamentally redesigned all of the weapon logic, made grenades that bounce around the level, and blood that works much better than the blood effect that comes with 3DGE.

After that I went back and looked at the wiki, but honestly it still didn't answer much about what 3DGE and DDF can really do. I guess I can make custom effects for doors and lifts and stuff? And change the colormap for individual sectors if I want to fade out to a color other than black?
I feel like I'm still missing a lot of the system's power, and it took me too long just to get this far.

User avatar
3rd_3ye
Community Manager
Posts: 291
Joined: Sat Jun 09, 2012 5:58 am

Re: ddf editing; looking for features

Post by 3rd_3ye »

Hello marscaleb! It's great to see 3dge getting the look-over treatment, the down side being the port is in the midst of some rather radical upgrades. The old Edge 1.35 had several example maps of th gl based features availible. These maps may not work with current 3dge, as the bsp has been refactored, but they do provide an overview of the basics.

http://edge.sourceforge.net
The banlist has been updated successfully.

User avatar
RUNSABER
Posts: 132
Joined: Sat Mar 14, 2015 3:10 pm

Re: ddf editing; looking for features

Post by RUNSABER »

You're talking about Chronoteeth's QUACK mod! :D a majority of the wiki is derived from old Edge references on that previous port. I'm actually making a mapset based around that mod to show off the port features. The JUMP commands by pointing scripts to a set frame at an initiating percentage. Let's say you have a MISSILE state. You want that state to jump to an alternative attack defined as MISSILE2. You begin the very first frame of the MISSILE state with a JUMP command. Like so:

Code: Select all

NULL:A:NORMAL:JUMP(STATE:X,X%)(,)(;)
The X is the frame number or entry, and also the percentage at which the frame immediately jumps to suggested frame. Disregard FRAME3. only set frame by your command.
The comma allows the state to engage the command, and the semicolon is a substitute for a loop without specification.

If the Baron of Hell wants to attack a second time after his range attack with a red fireball, you command him to jump to an additional attack state:

Code: Select all

STATES(MISSILE)=BOSS(OR NULL):E:0:NORMAL:JUMP(MISSILE2:1,30%),
BOSS:E:4:NORMAL:FACETARGET,
BOSS:F:4:BRIGHT:RANGE_ATTACK,
BOSS:G:4:NORMAL:REFIRE_CHECK!

STATES(MISSILE2)=BOSS:E:4:NORMAL:FACETARGRT,
BOSS:F:4:BRIGHT:RANGE_ATTACK(BARON_FIREBALL2),
BOSS:G:4:NORMAL;REFIRE_CHECK;
What this tells the DDFATK is that it needs to jump for a second attack every 30%. If your monster attacks often, you'll see this attack often, regardless of the percentage due to the minattackrate percentage. Use the special and jump values to determine the ratio of how often the the jump will occur. Only applies to attacks, though. You can this state for lights like so;

Code: Select all

STATES(IDLE)=NULL:A:0:NORMAL:JUMP(IDLE2:1,30%),
CNDL:A:1:BRIGHT:(DLIGHT_SET(40),
CNDL:B:1:BRIGHT:(DLIGHT_SET(80);
STATES(IDLE2)=CNDL:A:1:BRIGHT:(DLIGHT_SET(60),
CNDL:B:1:BRIGHT: (DLIGHT_SET(30),
#IDLE:1;
The definition commands the candle to run its normal idle states. The jump commands the definition to jump to another state at a small percentage. The means the candle will do its normal idle state and has the chance of jumping to a self-definef state that calls back to the beginning. Thus, creates a random loop of commands working alongside another.
Official 3DGE64 Project Portal - Public Repository for 3DGE 64.

User avatar
RUNSABER
Posts: 132
Joined: Sat Mar 14, 2015 3:10 pm

Re: ddf editing; looking for features

Post by RUNSABER »

Sorry if its a bit jumbled: I wrote that last night while I was intoxicated, in the happening of my phone dying (which it did) I saved the copy to pasta it later.
Official 3DGE64 Project Portal - Public Repository for 3DGE 64.

User avatar
Corbachu
Site Admin
Posts: 778
Joined: Fri Jun 08, 2012 11:22 am
Gender:
Contact:

Re: ddf editing; looking for features

Post by Corbachu »

I have limited time, but I managed to zip up some simple DDF tutorials and demo WADS for almost every important feature of the 3DGE engine. Note that these tutorial WADS might be slightly outdated as things might or might not have changed, but they all still work fine.

I still plan on assembling a more robust and up-to-date package of 3DGE features, but this will have to do for now -- I apologize for the long wait. :oops:

https://sourceforge.net/projects/edge2/ ... z/download
\(סּںסּَ` )/ۜ

User avatar
Marscaleb
Posts: 89
Joined: Sat Jun 25, 2016 12:57 pm
Location: California or Utah
Contact:

Re: ddf editing; looking for features

Post by Marscaleb »

Coraline wrote:I have limited time, but I managed to zip up some simple DDF tutorials and demo WADS for almost every important feature of the 3DGE engine. Note that these tutorial WADS might be slightly outdated as things might or might not have changed, but they all still work fine.

I still plan on assembling a more robust and up-to-date package of 3DGE features, but this will have to do for now -- I apologize for the long wait. :oops:

https://sourceforge.net/projects/edge2/ ... z/download
Ho
lee
CRAP

That's impressive. The Hub example particularly has got me re-thinking about what I would want to do. But on top of that, portals, mirrors, the RTS menu... This is far beyond what I thought it might be able to do.

FYI the ladder example is broken, and the sniper example doesn't work right.

@RUNSABER

Okay, with some examples there I think I can follow. It is good to know I can create dummy states to use.
Would there be any problems with stacking jump commands? And would I be correct to assume I could just slip them in wherever I want in a state's script?

With this, I could create the randomized flickering effect I want, but the DDF file will be a bit longer. I'll just be downgrading my light patterns idea to a suggestion.