xmoonproductions.org https://www.xmoonproductions.org/ |
|
Randomizing fluid parameters? https://www.xmoonproductions.org/viewtopic.php?f=27&t=3680 |
Page 1 of 1 |
Author: | juddre [ Thu Feb 12, 2015 6:50 pm ] |
Post subject: | Randomizing fluid parameters? |
@xpadmin: While making improvements to the Brown Dungeon mod, I played around with some of the fluid parameters and started thinking that it might actually be cool to use partly random parameters. Currently all the body fluids are produced in a deterministic fashion, i.e. point your dick in the same direction and the cum/pee will always fall in the same place and in the same pattern. As any male knows, that is not the case in reality. However, the fluid parameters seem to be set once when initializing, and then just referred to at runtime, which prevents randomization. That might of course be just an artifact of how the scripts are currently written, but I don't understand the script loading/execution model well enough to tell if/how randomization could be achieved, so I thought I would just ask. Is it possible, and if so, how? |
Author: | xpadmin [ Fri Feb 13, 2015 3:13 pm ] |
Post subject: | Re: Randomizing fluid parameters? |
These parameters make the fluid particles more 'random': Code: vel_dis = (0.01,0.01,0.01); // Speed noise (in meter/sec) pos_dis = (0.01,0.1,0.01); // Position noise in meter |
Author: | juddre [ Sat Feb 14, 2015 8:11 am ] |
Post subject: | Re: Randomizing fluid parameters? |
xpadmin wrote: These parameters make the fluid particles more 'random': Code: vel_dis = (0.01,0.01,0.01); // Speed noise (in meter/sec) pos_dis = (0.01,0.1,0.01); // Position noise in meter Yes, that lets you create different kinds of streams. But what I would like to do is to randomize the stream parameters, conceptually something like this: Code: vel_dis = (Rnd(100)/100,Rnd(100)/100,Rnd(100)/100); pos_dis = (Rnd(100)/100,Rnd(100)/100,Rnd(100)/100); Of course the above won't work because the statement will only be evaluated once when a level is loaded. How to make it work? I can work around the problem somewhat by creating different fluids which only differ with regard to the vel_dis and pos_dis parameters, and randomly choosing which fluid to use, but that limits the amount of variation possible. |
Author: | xpadmin [ Sat Feb 14, 2015 11:45 am ] |
Post subject: | Re: Randomizing fluid parameters? |
@juddre The fluid randomization is as you described it, so: Code: vel_dis = (0.01,0.01,0.01); // Speed noise (in meter/sec) pos_dis = (0.01,0.1,0.01); // Position noise in meter means: Code: vel_dis = (Rnd*0.01,Rnd*0.01,Rnd*0.01); pos_dis = (Rnd*0.01,Rnd*0.01,Rnd*0.01); Where Rnd is a random float between 0 and 1 |
Author: | juddre [ Sat Feb 14, 2015 8:37 pm ] |
Post subject: | Re: Randomizing fluid parameters? |
xpadmin wrote: @juddre The fluid randomization is as you described it, so: Code: vel_dis = (0.01,0.01,0.01); // Speed noise (in meter/sec) pos_dis = (0.01,0.1,0.01); // Position noise in meter means: Code: vel_dis = (Rnd*0.01,Rnd*0.01,Rnd*0.01); pos_dis = (Rnd*0.01,Rnd*0.01,Rnd*0.01); Where Rnd is a random float between 0 and 1 Ugh. I suck at explaining. Sorry. If I have understood correctly, the above randomization is rerun for every fluid particle. But I want to run a randomization step once for each fluid event (e.g. user commanding character to pee), so that on one time when the character pees the stream is straight and thin, and on another time it might spray all over the place. In pseudocode: Code: when_character_pees_do: { // Randomize stream speed noise level vel1 = Rnd; vel2 = Rnd; vel3 = Rnd; // Randomize stream position noise level pos1 = Rnd; pos2 = Rnd; pos3 = Rnd; for_each_drop_do { // Speed randomization for each drop, according to stream speed noise level vel_dis = (Rnd*vel1,Rnd*vel2,Rnd*vel3); // Position randomization for each drop, according to stream position noise level pos_dis = (Rnd*pos1,Rnd*pos2,Rnd*pos3); } } Now, I can get a fair approximation by creating a variety of fluids with different speed and position noise levels and randomly choosing one of them, but I was wondering if there's a way I can achieve what I want more cleanly? |
Author: | xpadmin [ Sun Feb 15, 2015 12:09 pm ] |
Post subject: | Re: Randomizing fluid parameters? |
Ahh I understand. See what I can do for the next (sub)-release. |
Page 1 of 1 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |