|
-
Jun 14th, 2024, 09:52 AM
#41
Thread Starter
PowerPoster
Re: I can't figure it out.
 Originally Posted by yereverluvinuncleber
Please use better titles to your posts.
ok. I'll do better.
-
Jun 14th, 2024, 10:06 AM
#42
Thread Starter
PowerPoster
Re: I can't figure it out.
 Originally Posted by OptionBase1
Post _ALL_ the code and maybe we can find it.
I'm on the verge of something huge that I plan to market - photorealistic sound. I'm not giving that away.
-
Jun 14th, 2024, 10:30 AM
#43
Re: I can't figure it out.
 Originally Posted by cafeenman
I'm on the verge of something huge that I plan to market - photorealistic sound. I'm not giving that away.
What is the ratio of McGuffins to Hertz? Is it the same as the ratio of leprechauns to unicorns?
-
Jun 14th, 2024, 11:24 AM
#44
Thread Starter
PowerPoster
Re: Is RND biased?
OK, this may give away the game, but you have to calculate hertz/pounds for the torque collector then divide that by the screen aspect ratio which is modified by the wing-loading.
It's basic math but putting it together right takes a lot or r & d.
-
Jun 14th, 2024, 11:34 AM
#45
Re: Is RND biased?
 Originally Posted by cafeenman
OK, this may give away the game, but you have to calculate hertz/pounds for the torque collector then divide that by the screen aspect ratio which is modified by the wing-loading.
You can do that all you want, but it ain't gonna fly. You gotta go metric to make it work - and it's hertz/km you need for the torque collector, other wise you're just spinning your wheels.
-tg
-
Jun 14th, 2024, 11:45 AM
#46
Thread Starter
PowerPoster
Re: Is RND biased?
As I said, I'm on the verge of something really big that will turn all conventional thought upside down. I left out the real ingredient - the mean hydrodynamic chord.
Now I've just destroyed my entire future by giving away the secret.
I hope my cats forgive me.
-
Jun 14th, 2024, 11:58 AM
#47
Thread Starter
PowerPoster
Re: Is RND biased?
Being serious for a minute, this is an example of a sub that I believe is totally even that differs slightly from the others. This is one of those coin-flip subs I mentioned earlier (the nonsense discussion above reminded me of the discoencabulator).
Code:
Private Sub ReturnToHomeBase()
Dim m_CallStacker As New cCallStacker
Static nReturnToBase(1 To 3) As Long
Dim nRnd As Long
m_CallStacker.Add NAME & ".ReturnToHomeBase(Private Sub)"
AddPlayerMessage AddAsterisks("You return to Home Base to rest for 8 Hours.")
nRnd = RollDie(d3)
nReturnToBase(nRnd) = nReturnToBase(nRnd) + 1
Select Case nRnd
Case 1
AddPlayerMessage AddAsterisks("You decoupled the turboencabulator right in front of your whole family at dinner."), 2000
mw_Player.AddAttributePoints idx_Player_Attribute_Energy, idx_Damage
Case 2
AddPlayerMessage AddAsterisks("You correctly coupled the retroencabulator in front of your whole family at dinner!"), 2000
mw_Player.AddAttributePoints idx_Player_Attribute_Energy, idx_Buff
Case 3
AddPlayerMessage AddAsterisks("You accidentally activated the discoencabulator in front of your whole family at dinner!"), 2000
AddPlayerMessage vbCrLf & vbTab & "Your whole family danced together and had the time of their lives.", 1000
mw_Player.AddAttributePoints RandomAttributeID, idx_Buff
AddPlayerMessage vbCrLf & vbTab & "... until Grandma broke her hip.", 2000
mw_Player.AddAttributePoints RandomAttributeID, idx_Damage
End Select
ShowChoiceCount "nReturnToBase", nReturnToBase
End Sub
-
Jun 14th, 2024, 12:00 PM
#48
Thread Starter
PowerPoster
Re: Is RND biased?
Code:
' Declarations
Public Enum PLAYER_ATTRIBUTES
idx_Player_Attribute_Braintrust = 0 ' B - Braintrust (Formerly Tech Savvy)
idx_Player_Attribute_Readiness ' R - Readiness (Formerly Situational Awareness)
idx_Player_Attribute_IntestinalFortitude ' I - Intestinal Fortitude
idx_Player_Attribute_Cheer ' C - Cheer (Formerly Joy Sparks)
idx_Player_Attribute_Karma ' K - Karma (Formerly Fate)
idx_Player_Attribute_Energy ' E - Energy (Formerly Health Points)
idx_Player_Attribute_Advancements ' A - Advancements (Formerly Tech Points)
End Enum
Public Const MIN_PLAYER_ATTRIBUTE As Long = idx_Player_Attribute_Braintrust
Public Const MAX_PLAYER_ATTRIBUTE As Long = idx_Player_Attribute_Advancements
Public Function RandomAttributeID() As PLAYER_ATTRIBUTES
Dim m_CallStacker As New cCallStacker
m_CallStacker.Add NAME & ".RandomAttributeID(Public Function)"
RandomAttributeID = RollDie(MAX_PLAYER_ATTRIBUTE + 1) - 1
End Function
-
Jun 14th, 2024, 02:12 PM
#49
Re: Is RND biased?
 Originally Posted by cafeenman
As I said, I'm on the verge of something really big that will turn all conventional thought upside down.
Doing that would turn some people right side up.
My usual boring signature: Nothing
 
-
Jun 18th, 2024, 07:58 AM
#50
Re: Is RND biased?
You mentioned in one of your posts in one of your thread that would like to resume a session from a fixed starting point the Rnd value list.
I created a small sample which is capable of doing this:
Code in a module:
Code:
Option Explicit
Private m_lCalls As Long
Private m_lSeed As Long
Public Sub RNDInit(ByVal lSeed As Long)
m_lCalls = 0
m_lSeed = lSeed
If m_lSeed = 0 Then m_lSeed = 100 * Timer
Rnd -1
Randomize Abs(m_lSeed)
End Sub
' generates a random value between min and max
Public Function RNDVal(ByVal lMin As Long, ByVal lMax As Long, Optional ByVal lIteration As Long = -1) As Long
Dim i As Long
If lIteration <> -1 Then
RNDInit m_lSeed
For i = 1 To lIteration - 1: Rnd: Next
m_lCalls = lIteration - 1
End If
RNDVal = Int((lMax - lMin + 1) * Rnd + lMin)
m_lCalls = m_lCalls + 1
End Function
To test in a Form with 2 command buttons:
Code:
Option Explicit
Private Sub Form_Load()
RNDInit 12345
End Sub
Private Sub Command1_Click()
Debug.Print RNDVal(0, 255)
End Sub
Private Sub Command2_Click()
Debug.Print "Item 4", RNDVal(0, 255, 4)
End Sub
-
Jun 18th, 2024, 05:03 PM
#51
Thread Starter
PowerPoster
Re: Is RND biased?
Current state of the game. I have a new monitor (old one got a lot of burn-in and was drawing a ton of amps) so have to reboot. I wanted a screenshot before I ended the app.
Numbers are pretty good regarding distribution. I think they're all within spec of being equally, randomly selected.
But the Reputation bar is skewed way positive. It's the Green line right below the stats. It should stay dead center as it is simply a count of Instances, not points.
It has a max of 1000 a min of 0 and it starts at 500.
So one good thing adds one Rep. One bad thing takes away one Rep. It's at-a-glance if the instances are evenly distributed or not.
-
Jun 18th, 2024, 05:39 PM
#52
Thread Starter
PowerPoster
Re: Is RND biased?
 Originally Posted by Arnoutdv
You mentioned in one of your posts in one of your thread that would like to resume a session from a fixed starting point the Rnd value list.
I created a small sample which is capable of doing this:
Code in a module:
Code:
Option Explicit
Private m_lCalls As Long
Private m_lSeed As Long
Public Sub RNDInit(ByVal lSeed As Long)
m_lCalls = 0
m_lSeed = lSeed
If m_lSeed = 0 Then m_lSeed = 100 * Timer
Rnd -1
Randomize Abs(m_lSeed)
End Sub
' generates a random value between min and max
Public Function RNDVal(ByVal lMin As Long, ByVal lMax As Long, Optional ByVal lIteration As Long = -1) As Long
Dim i As Long
If lIteration <> -1 Then
RNDInit m_lSeed
For i = 1 To lIteration - 1: Rnd: Next
m_lCalls = lIteration - 1
End If
RNDVal = Int((lMax - lMin + 1) * Rnd + lMin)
m_lCalls = m_lCalls + 1
End Function
To test in a Form with 2 command buttons:
Code:
Option Explicit
Private Sub Form_Load()
RNDInit 12345
End Sub
Private Sub Command1_Click()
Debug.Print RNDVal(0, 255)
End Sub
Private Sub Command2_Click()
Debug.Print "Item 4", RNDVal(0, 255, 4)
End Sub
OK, so I think I misunderstood what you're telling me and I apologize for that.
For your thing to work I would need to save every time I used rnd, right?
I don't think I said that I wanted to save that state of the game (random-wise) though. I don't want to do that. I would like to be able to save the game stats and reload that and the rnd would just get reinitialized.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|