Malkior 476 Posted April 18, 2018 Due to recent discussions, I have decided to start up a new pseudo-project thread to hopefully realize the capabilities of MDLEdit and finally create a mod I've been wanting for a long while. In this particular project, I'd like to discover all that MDLEdit can do with Emitters. My personal level of expertise is more or less novice level (I just now learned what nodes are in a 3d model file), so I may take a bit to pick up on some subjects. So, to get the ball rolling, I want to change the spawn rate and possibly vary the dispersal of rain droplet effects in TSL. Additionally, I would like to change the size and if possible the number of sprites in smoke and fire. (Both of these would be for TSL for the time being.) Firstly, which files will I need to crack open in order to do this? Is there a method or format I need to use? (Like converting them to binary for example) Quote Share this post Link to post Share on other sites
DarthParametric 3,785 Posted April 18, 2018 Rain is probably a shader, not a particle effect. Quote Share this post Link to post Share on other sites
bead-v 251 Posted April 18, 2018 (edited) Firstly, which files will I need to crack open in order to do this? Is there a method or format I need to use? (Like converting them to binary for example) You need to find the model files (.mdl and .mdx) for the effects, as well as the textures they use. You can get the texture names by opening the model file in MDLedit. Then you can either edit the values directly in MDLedit or decompile the model, then edit the parameters with a text file or with Kotormax if you want. Kotormax has some logic in place that prevents you from choosing nonsensical parameters, but then again, we know very little about how exactly the parameters work, so it would be great if we try out all possibilites. Read the visual effects section of this pdf to get an introduction into emitters: https://neverwintervault.org/project/nwn1/other/custom-content-guide-v30 Also, here are some tests I did with emitter flags: Edited April 18, 2018 by bead-v Quote Share this post Link to post Share on other sites
JCarter426 1,215 Posted April 18, 2018 I want to change the spawn rate and possibly vary the dispersal of rain droplet effects in TSL. Rain is probably a shader, not a particle effect. The rain does use particles, but I'm not sure if you can edit them. As far as I can tell, the weather system is generated from an emitter that follows the camera, a 10 meter cube or something like that. Presumably the game uses some sort of model for this, but you'd have to figure out what it is. It's easy enough to create rain with the fountain emitter, though, and it's even possible to have rain (or snow or whatever) in the first game. Quote Share this post Link to post Share on other sites
DarthParametric 3,785 Posted April 19, 2018 Hrm, so it is. I always thought that, given it was set in the ARE, it was just a shader. But I can see the models for it, fx_Rain in the case of rain. Looks to be a simple fountain emitter covering a 6m x 6m area. Oddly, it's positioned at 4m under world zero, not sure what that is about. I wonder how the placement/activation for it works? I can't see anything obvious. Hardcoded maybe? Scripted? You'd surely want to be able to toggle the effect off and on to account for indoor/under cover areas. Quote Share this post Link to post Share on other sites
JCarter426 1,215 Posted April 19, 2018 I wonder how the placement/activation for it works? I can't see anything obvious. Hardcoded maybe? Scripted? I'm guessing the game renders it and attaches it to the camera if the flags in the ARE are set... otherwise it doesn't. I don't recall any script functions that would turn it on or off, and I also don't recall needing any specific OnEnter script for it to work. I've known weather to work in 231, 301, 506, 601, and 605. So it would be hard coded if anything. I know The Witcher has randomly-generated weather, and I believe this already supported by the engine and not anything they specifically cooked up for The Witcher. So whatever it is, it does seem to be something that can be triggered on and off... although I don't know if it works in KOTOR. You'd surely want to be able to toggle the effect off and on to account for indoor/under cover areas. Each room in the ARE has a flag to allow weather, though I don't know how this works. I remember assisting someone in editing this before without any luck - rain would show up everywhere or nowhere. The game definitely doesn't have this problem for modules that are already set up for rain, however. Quote Share this post Link to post Share on other sites
Malkior 476 Posted November 19, 2018 It's me again. Long time, eh? I finally have the rain model open in MDLEdit and ready for testing its settings, but I am unsure of how I would do so. Do I inject the MDL into the Module file, or is the Override a better bet? Alternatively, is there a totally different far more efficient method for testing that I haven't thought of? I am also planning to change the campfire, lightning, and explosion sprites if I can. Time is obviously much harder for me to come by these days, so I won't be able to reply and/or test this every single day of the week. (having to focus on work has been challenging to continue on what is essentially a hobby) However, I hope to eventually have something to show for all of this you've helped me with. Quote Share this post Link to post Share on other sites
Kexikus 995 Posted November 19, 2018 You can put the compiled MDL (and MDX) in the Override. You don't even have to restart the game to load an updated model if you replace it while the game is running. All you need to do is to reload a savegame. Quote Share this post Link to post Share on other sites
Malkior 476 Posted November 19, 2018 Alright. I have another question, if that's okay. I'm not entirely versed in the MDLEdit interface. Do I change the Emitter settings by changing the Controller Data (Data 0:, Data 1:, Data 2:, etc..) , or do I change each individual parameter (Value count, Timekey Start, etc..) or are those supposed to be those values? Quote Share this post Link to post Share on other sites
JCarter426 1,215 Posted November 19, 2018 Right click the controller you want to edit > edit values. Quote Share this post Link to post Share on other sites
Malkior 476 Posted November 27, 2018 Thanks so much for the help! Here are some fruits of my labor. Again thank you so much for the help without which none of this would have been possible. 2 Quote Share this post Link to post Share on other sites
ebmar 893 Posted November 27, 2018 (edited) 13 minutes ago, Malkior said: Here are some fruits of my labor. Hide contents Again thank you so much for the help without which none of this would have been possible. Awesome! It's reddish tone blends really well with the game; particularly with the HK scene. Edited November 27, 2018 by ebmar 1 Quote Share this post Link to post Share on other sites
Malkior 476 Posted December 2, 2018 If I may be so bold, I must ask for you guys' assistance yet again. (Fun fact, "Guy" literally refers to Guy Fawkes and can be used for either sex; technically it just means "Peculiar people" which has been used with both good and bad connotations #themoreyouknow ) Anyway, I've been trying with little to no success to edit the lightning effect so that the spokes are wider or at least differently arranged. Is there some model that I'm missing which controls how the Lightning spell effect looks? Secondly, I really want to change how the grass behaves and/or how close-up the texture on the grass floor looks in-game. Is there a model or config file that would allow me to alter it? Again, thank you so much for your help thusfar. Quote Share this post Link to post Share on other sites
DarthParametric 3,785 Posted December 2, 2018 Both your issues are texture-based. I think there have been a couple of Force Lightning retextures. I'd track them down and have a look at what they did for pointers. Grass varies depending on what module you are talking about. K1 Dantooine has like half a dozen grass textures as I recall. Quote Share this post Link to post Share on other sites
ebmar 893 Posted December 2, 2018 (edited) 1 hour ago, DarthParametric said: Both your issues are texture-based. And to be noticed about these differences seems to be important, particularly with FX_Lightning: K1 uses no TXI semantic and alpha channel to the texture While TSL uses "blending additive" on its TXI, along with alpha along the black part of the texture TSL also implying the same method to their FX_laser_xx which K1 are don't. 🤔 Edited December 2, 2018 by ebmar Quote Share this post Link to post Share on other sites
Malkior 476 Posted December 4, 2018 Update: Okay, so I found out the reason I couldn't locate the lightning emitter... Turns out that "Omen Emitters" are just that; they control the lightning that comes out of your hands during the animation. Sorry about that, it seems the solution was right in front of me the whole time.. 😐 A tad sloppy, but it seems I'm not quite skilled with quaternions yet. (I'm using a calculator online to convert them to and from Euler coordinates) Thanks Ebmar and Darth Parametric for the info on the lightning texture; I have since made my own version (Which is more or less the same as the one in these screenshots), but it's always good to see what others have been able to do. The grass will be another issue entirely. I'm hoping there's some master MDL file hiding in the game assets (As it seems the animation had to come from *somewhere*) but it's also possible that the modelers just kept the slices of grassy area and incorporated them into the area MDL (Which would be next to impossible to find), so I'm going to focus on recreating the grass texture as I had previously albeit hopefully a bit cleaner than my first attempts. I guess in the meantime I will plug away at changing the textures, and if I find more models or anyone has any info on what they're called (Or how the heck to effectively use quaternions), that can be posted here. Again, thanks so much for the help, folks. 1 Quote Share this post Link to post Share on other sites
JCarter426 1,215 Posted December 4, 2018 On 12/1/2018 at 11:10 PM, Malkior said: Secondly, I really want to change how the grass behaves and/or how close-up the texture on the grass floor looks in-game. Is there a model or config file that would allow me to alter it? There are two things at play here. The first is the grass texture file, which you can edit like any other texture, and that is determined by the module's ARE file as Grass_TexName. In addition to the texture name, the ARE file configures everything else about the grass. The two other settings of interest are the Grass_QuadSize and Grass_Density. The quad size determines how big the grass is. The "quad" in question is essentially a single instance of the texture. Each blade of grass is a rectangular plane with the grass texture drawn on each side. So the quad size is just how big those rectangles are. Increasing the quad size can produce giant corn field-sized stalks of grass. The density determines how spread out the grass is over a surface. It's something like how many quads per square meter, though I'm only guessing with the units. So a higher density means thicker grass, more rectangles closer together. The game distributes the grass quads semi-randomly over any walkmesh that has the grass material on it. There are other settings in the ARE file for affecting that probability, but I'm not entirely sure how they work and I doubt it's worth messing with them. Quote Share this post Link to post Share on other sites
DarthParametric 3,785 Posted December 4, 2018 The grass plane textures are actually 4 textures in one. The probabilities determine the percentages of each quadrant that are spawned (upper left, lower left, upper right, lower right). You may find it easier to create the diffuse and alpha mask for each separately, then bring them together in a single image. Quote Share this post Link to post Share on other sites
JCarter426 1,215 Posted December 4, 2018 Oh, that makes more sense than what I was thinking. And it's obvious considering what the textures look like, but it's been a while since I did look at them. So you could get some interesting results by adjusting the probabilities too. Like in the example above, two of the tiles have some pink flowers, and I would guess they're given lower probabilities than the other two. Quote Share this post Link to post Share on other sites
DarthParametric 3,785 Posted December 4, 2018 For Dantooine, LL is ~2%, UL is ~8%. Despite that, you get a pretty heavy amount if you have more than a single flower head per quadrant. Quote Share this post Link to post Share on other sites
Malkior 476 Posted December 17, 2018 I feel like a novice asking this, but do I have to inject the ARE file into the MOD file? Also, I went a little ham with the rain effect and I was wondering, can you add another ambient sound effect (I want to add the sound of pouring rain to the background audio) in addition to the constant thunder to the ARE, or is there a better way to do that? Quote Share this post Link to post Share on other sites
DarthParametric 3,785 Posted December 17, 2018 2 hours ago, Malkior said: do I have to inject the ARE file into the MOD file? Yes. At least if you want to make a public release. 2 hours ago, Malkior said: can you add another ambient sound effect I may be mistaken, but I believe you can only specify a single ambient sound track. However, similar to what @ebmar asked about in a recent thread, you could probably use scripting to get around this. In fact given your comment about thunder, you may be better switching them so that the rain is the default track and the thunder is one you script to play at various instances. You could also potentially harness the same scripting to play a room animation that adds some lightning VFX. 1 1 Quote Share this post Link to post Share on other sites
Kexikus 995 Posted December 17, 2018 2 hours ago, DarthParametric said: Yes. At least if you want to make a public release. Why is that? I've never seen any harm done by ARE files in the Override. Quote Share this post Link to post Share on other sites
DarthParametric 3,785 Posted December 17, 2018 Modding standards. Just chucking stuff in the Override is lazy. Quote Share this post Link to post Share on other sites
ebmar 893 Posted December 17, 2018 On 12/17/2018 at 12:03 PM, DarthParametric said: ...given your comment about thunder, you may be better switching them so that the rain is the default track and the thunder is one you script to play at various instances. As a friendly reminder and an addition to DP's awesome idea; SFX's wise- it is important also to export the audio to 22050 Hz's WAV [props to @JCarter426 for the insight!]. Either Mono or Stereo will work as long as they are using the aforementioned sample-rate. 🤔 Quote Share this post Link to post Share on other sites