Author Topic: NWNCX Suggestion - open "hard coded" visual effects to modification/addition  (Read 6686 times)

Legacy_virusman

  • Sr. Member
  • ****
  • Posts: 448
  • Karma: +0/-0


               Last time I tried the beam VFX, I think NWMax was exporting a broken model. I had to edit the vaules manually.
               
               

               
            

Legacy_OldTimeRadio

  • Hero Member
  • *****
  • Posts: 2307
  • Karma: +0/-0


               Same experience here.  I had had this problem before (years ago) and I switched to the Bioware Aura export scripts running under Max 5, where I had no problem.  Unfortunately, somehow my Max 5 installation went poof...literally.  Just gone.  I think it happend when updating another version of Max.  Which is major suck, BTW.  So I can't go back and just export one now.  However, at some point if nobody can get it done I have a couple of that type of emitter which I did export and save off.  I'd have to find them to do a comparison.  Not entirely sure where I put them though.

The way I look at it, an emitter is basically a constructor, in this case with a fx_ref target.  Anyway, my general line of thinking was that the problem was probably because of NWMax either exporting blank values or not exporting them, whatever is the opposite of what it does now.  That was my guess at the time.

NWMax is really closely based on the Bioware Aura scripts when whatever it was wasn't contained in the .DLL.  The emitter stuff wasn't in the DLLs, which was just AABB and some unused NURBS code, IIRC.  So there's probably some little tweak that needs to happen, not a big fix.  Just not sure what that tweak is, at the moment.

Sometimes, compiling the VFX was necessary to keep it from crashing.  Velmar or someone mentioned this and I had it happen to me, too.  Will run 100% of the time perfectly if pre-compiled but will crash or crash some percent of the time if left as ASCII and compiled at run time.

Hope that's useful.
               
               

               
            

Legacy_virusman

  • Sr. Member
  • ****
  • Posts: 448
  • Karma: +0/-0


               Does anyone have the original Bioware export scripts? The Vault page just points to the nonexistent NWN site.
               
               

               


                     Modifié par virusman, 17 juillet 2012 - 12:01 .
                     
                  


            

Legacy_OldTimeRadio

  • Hero Member
  • *****
  • Posts: 2307
  • Karma: +0/-0


               

virusman wrote...

Does anyone have the original Bioware export scripts? The Vault page just points to the nonexistent NWN site.

Here you go. 
               
               

               
            

Legacy_MerricksDad

  • Hero Member
  • *****
  • Posts: 2105
  • Karma: +0/-0


               ok tried compiled, same deal. Ran a comparison on a few exported files and there seems to be some differences in orientation and floating point accuracy. However if you manually set them to be duplicate files in notepad++ they still crash. If you copy the original file and paste it over what you manually made exactly the same, its no crash. Figure that one out. Sometimes when I set alternate textures instead of using fxpa_white, the animation plays but the rays go behind me to point 0,0. On the next use its a total self-shutdown.

I also noticed there is sometimes a pause or jerk before the actual beam graphics play. Beam graphics and hand graphics seem to be attached but play AFTER target hit graphics. Its at the point where the beam is calculated that I think something goes wrong. This may be the floating point accuracy difference. It may also be the color floats for all I know.

One thing I don't understand is why the direction of the beam goes screwy and points to 0,0. This happens when targeting objects or creatures.
               
               

               
            

Legacy_OldTimeRadio

  • Hero Member
  • *****
  • Posts: 2307
  • Karma: +0/-0


               Ah, here we go.  I really hope this works for you.  I managed to pull up my notes on lightning and I think this is essentially what we're talking about:

Clicking on the lightning emitter itself breaks the emitter.

Can click on the REF no problem

Birthrate MUST be nine.  Just clicking on the Emitter changes the birthrate from 8 to 2.  Apparently on lightning, the only way to get it to work is that the birthrate MUST be 9.
However, subdivisions plays into this.  Apparently, if you have something like 12 subdivisions, the birthrate changes to 33 and that's apparently fine.

Is there some ratio that needs to be upheld?

That's all I got for now.  Give that a whirl, possibly in a text editor.  I'm hip deep in skin mesh ATM, can you (or anyone else) post back here if that works for you?
               
               

               
            

Legacy_MerricksDad

  • Hero Member
  • *****
  • Posts: 2105
  • Karma: +0/-0


               It doesn't fit the bill of what's in the base files. The birthrate is what creates the subdivisions, but its a bit off. If you select 3, you only see 2. If you select 33, its a little less. The numbers 1,  5 and 10 always crash for me. I've not found any evidence to suggest that simply clicking an element in gmax changes anything on the panel or in the saved mdl. The only changes I did see were in floating point accuracy and that the first entry in orientation is set to 1 instead of 0. It may just be a simple mistake in their math functions, and would also explain the delay before the beam fx are fired, and in the targeting of point 0,0.

I was also thinking that using some trailing emitters would be a better maker for beams. Use a projectile that goes directly to target. So far I cannot even come close to making NWN make beams anything similar to diablo 3, but with projectiles I bet it would be easy. Back in 2007 I made a very good looking Aganazzar's Scorcher. Unfortunately I lost most of my files when I moved to this machine.
               
               

               
            

Legacy_OldTimeRadio

  • Hero Member
  • *****
  • Posts: 2307
  • Karma: +0/-0


               Hrm.  MD, can you do me a favor?  Make an emitter in NWMax and set the birthrate to something...say 10.  Your choice as long as it's something other than 2, and probably higher than 2.  Go up in the emitter properties and change it from whatever the default is to "Lightning".  Now, scroll down and check out the birthrate again. 

Did it change to 2?  Mine changes it to 2.  That's in my GMax install with NWMax.  When I'm actually modding I use a heavily butchered customized version of NWMax Plus so NWMax seems like a good common ground for testing this behavior.

My head is full of skin mesh/UV mapping nonsense at the moment so I want to be clear: We are not able to get a replacement beam effect out of NWMax at the moment using the workflow that should produce a beam as beam-y as all the non-flamelash beams, correct?  From my experience a year+ ago, some types of emitters which should be possible to create in NWMax, aren't.  I may be incorrect in holding that opinion but when I dropped down to the Bioware Aura scripts I recall everything being much more robust though obviously less elegant.

BTW, I think your emitter idea sounds wonderful.  I dunno about beams as dynamic as the Diablo 3 ones, though, but one of the great things about this game is you can usually hack something into the rough shape you want.
               
               

               
            

Legacy_OldTimeRadio

  • Hero Member
  • *****
  • Posts: 2307
  • Karma: +0/-0


               BTW, I'm not saying this is the case but you can't always count on a decompiled model to accurately reflect what is in a compiled model.  This only crops up in the very tiniest sliver of cases, but you can use NWN Explorer Reborn 1.63's "Raw Model"/"Raw Model Hierarchy" (and sometimes "Binary") tabs (they're at the bottom of the window) to potentially get a clearer view of what's actually going on in the model.  Either if you suspect that it is not being decompiled correctly or to make sure your settings were compiled correctly.

There are only a handfull of modders who would ever need to inspect things that closely, though.
               
               

               
            

Legacy_MerricksDad

  • Hero Member
  • *****
  • Posts: 2105
  • Karma: +0/-0


               Woot! Offline today so I wasn't able to take your approach, but I worked out a lot already
ok, here's some data on beams
birthrate = number of segments in a beam minus 1
most numbers in the birthrate field seem to cause the game to crash as soon as math is performed to make a beam.
I have found these birthrate numbers to be ok: 3, 9, 33; and these numbers are bad: 1, 5, 6, 12, 22. I didn't bother with too many more yet.
Some beams with bad birthrate numbers shoot the beam off in random directions on first use, usually toward (0,0), while others close the game in 3-5 seconds without warning.
<x>Start = affects near hands
<x>End = affects near target
where <x> is color, alpha, size
so you can make a beam wider or thinner at the hand or target, but you cannot make the beam shrink or grow in place without adding animation
beams cycle through what looks like a random 3d point path where each segment is angled from the other based on lightningRadius and lightningScale. Setting both to 0.1 makes a larger width beam much like the lightning bolt effect in diablo 3
to get a good active looking beam effect, you need at least 4-6 lightning emitters. I used a big blue one, a medium cyan one, and 4 small white ones to make a really nice lightningbolt. framerate and game speed was not affected during beam play
it may be beneficial to mix a beam and a projectile that zips right to the target to produce diablo 3's pulsing beams.
the closer you are to your target, the smaller segments will be, squishing your texture. Pick a texture that looks good large and small.
beam segments overlap by a percent. A 256px texture was shown to overlap about 8-16 pixels. I suggest either cropping the edges of your beam texture more than fxpa_white was cropped, and/or alpha the edges. Cropping too far makes blank spots between plates.
since transparent beam textures or alpha'd emisions overlap, I suggest pill shaped textures with all corners rounded off UNLESS you have ZERO lightningRadius and lightningScale values, in which case all you need is the percent cropping
lightning takes textures that run top to bottom like fxpa_white. I can find no way to rotate the texture during lightning
a lightning emitter NEEDS a reference node which MUST be parented by the emitter. If the reference node is missing or parented incorrectly, the game will crash usually in 3-5 seconds of attempting the beam.
beams can accept new textures generally without issues. See percent clipping comment above.
beams can use animated textures. Be sure to clip all images on the sprite sheet by the same percent.

It is very possible to make some wicked awesome beams, especially by stacking multiple beams of different colors, textures and lightningRadius and lightningScale. I need to find a reliable place to post some images, but I basically duplicated the diablo 3 lightning bolt effect
               
               

               
            

Legacy_MerricksDad

  • Hero Member
  • *****
  • Posts: 2105
  • Karma: +0/-0


               http://www.facebook....52200912&type=3

thats my new NWNCX public facebook album. I will add to it until I get a packet up for nwvault
               
               

               


                     Modifié par MerricksDad, 17 juillet 2012 - 09:37 .
                     
                  


            

Legacy_OldTimeRadio

  • Hero Member
  • *****
  • Posts: 2307
  • Karma: +0/-0


               Looks very nice!

Are you actually making these in NWMax, though, or editing them in notepad?  From what I'm seeing, if you're on the modifier tab (which you're going to be on if you're editing an emitter) and you select the emitter, your lightning/beam is instantly hosed.  Only editing in a text editor to change the birthrate manually will fix it.  Can you confirm?
               
               

               
            

Legacy_MerricksDad

  • Hero Member
  • *****
  • Posts: 2105
  • Karma: +0/-0


               These beams I am currently doing in notepad++ but I will be making my own beam software in the next few weeks. nwmax sucks for beams, and copy and paste in notepad is maddening with having to scroll way down and modify stuff all the time. Since its all tree structure, one of my old css tree scripts should be a good start for that program. I'll probably post it when its done, or at least the source.

So anyway, this is what I see: some beams import into nwmax and the birthrate is set to 2 even if you don't play with it. But for me not all of them do that. It may be because of my mods to nwmax. When I export anything from nwmax, a model is just as I had it except the model faces backwards, but if I understand correctly, that is actually something you can set in the import panel. And of course all integers are converted to ridiculous floats a fraction smaller than they need to be (why why why). I use a personally modified version of nwmax I modded when making 800+ tile tilesets with 4 variants of height and 8 types to choose from per edge. I modified nwmax so I could use it as a level editor because at 4 height variants, the toolset just doesn't understand you anymore. I also had to put in a lot of tweaks to work on my anatomy kit so nwmax would stop messing up my node weights. For all I know I put something in there to stop nwmax from messing with its own panel to complete a few of its rules.
               
               

               
            

Legacy_virusman

  • Sr. Member
  • ****
  • Posts: 448
  • Karma: +0/-0


               As I see, many of you have fixes and modifications for NWMax. Could you upload your code anywhere? I think everyone would benefit from that. Even if it's something you changed for yourself, others may find it useful.
               
               

               


                     Modifié par virusman, 17 juillet 2012 - 10:37 .
                     
                  


            

Legacy_OldTimeRadio

  • Hero Member
  • *****
  • Posts: 2307
  • Karma: +0/-0


               I don't actually have a fix for that yet.  Currently it looks like it's just the birthrate that needs to be changed (to 9) but I'm looking over the code of aurora_helper_emitter.ms at the moment to make sure I need to make a change at all.  I'll probably post something shortly.  It may just be a workflow or it might be a couple of different solutions and let the modder pick.

Birthrate seems to be 2^lightningSubDiv + 1.  Assuming someone tested this out at a point in time and it worked, I'm checking to make sure I just don't need some different workflow.

Gimme a few minutes.  It looks like it might be just as easy to switch from Lightning type to some other type, then back.