View unanswered posts | View active topics It is currently Sun Apr 28, 2024 3:27 pm



Reply to topic  [ 6 posts ] 
 Randomizing fluid parameters? 
Author Message
Rank 12
Rank 12

Joined: Sun Feb 10, 2013 7:54 pm
Posts: 80
@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?


Thu Feb 12, 2015 6:50 pm
Profile
Site Admin
Site Admin

Joined: Thu Feb 07, 2013 11:16 am
Posts: 1865
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


Fri Feb 13, 2015 3:13 pm
Profile
Rank 12
Rank 12

Joined: Sun Feb 10, 2013 7:54 pm
Posts: 80
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.


Sat Feb 14, 2015 8:11 am
Profile
Site Admin
Site Admin

Joined: Thu Feb 07, 2013 11:16 am
Posts: 1865
@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


Sat Feb 14, 2015 11:45 am
Profile
Rank 12
Rank 12

Joined: Sun Feb 10, 2013 7:54 pm
Posts: 80
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?


Sat Feb 14, 2015 8:37 pm
Profile
Site Admin
Site Admin

Joined: Thu Feb 07, 2013 11:16 am
Posts: 1865
Ahh I understand. See what I can do for the next (sub)-release.


Sun Feb 15, 2015 12:09 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 6 posts ] 

Who is online

Users browsing this forum: No registered users and 157 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group.
Designed by X-Moon Productions.