SUBSIM Radio Room Forums



SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997

Go Back   SUBSIM Radio Room Forums > Silent Hunter 3 - 4 - 5 > SH5 Mods Workshop
Forget password? Reset here

Reply
 
Thread Tools Display Modes
Old 08-01-12, 07:59 AM   #1
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by gap View Post
On a side note:
I see you like random variables as much as I do
I guess you're currently using pseudo-random numbers coming from an uniform distribution, since most programming languages got quick functions for generating them. Nevertheless normal distribution is by far the most common distribution as far as physics and natural events are concerned. Have you ever thought of using it?
There are some methods for converting "uniform" random numbers into "normal" ones. For example, here's a really easy method for doing it:

http://www.protonfish.com/random.shtml

In this example, the mean (Mu) would be the result of your formula before randomization, while you should choose wisely a realistic standard deviation value (Sigma) based on the amount of variation from the mean you want for the event you try to simulate.

Another conversion method, a bit more complex:

http://www.taygeta.com/random/gaussian.html
I'm using a kernel function that is present in the game to get the random number. I'll have to 'open up' this kernel function and see how it's getting the random number.

I'll post the zone (box) damage routine calculations when I get back from a job this morning
TheDarkWraith is offline   Reply With Quote
Old 08-01-12, 12:45 PM   #2
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,160
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by TheDarkWraith View Post
I'm using a kernel function that is present in the game to get the random number. I'll have to 'open up' this kernel function and see how it's getting the random number.
Try and see: I think that knowing the routine devs have put in place for generating random numbers is worth the time you would have to spend for discovering it!

Using gaussian distribution would allow us to model a wider range of outputs for some random events, keeping in the same time the probability of unlikely events reasonably low.

Quote:
Originally Posted by TheDarkWraith View Post
I'll post the zone (box) damage routine calculations when I get back from a job this morning
okay
gap is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 07:21 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Copyright © 1995- 2026 Subsim®
"Subsim" is a registered trademark, all rights reserved.