2 Attachment(s)
(Resolved) Trying to create an Event Tree
Attachment 191171
OK, I've got it exactly figured out.
It's now counting correctly AND giving me back a Tree that I like (although it might take a lot of rolls to do that).
Using a seed of 250 I'm getting back branches as deep as 12 which is more than enough. I can tweak numbers to adjust this.
I'm shooting for around 5K total nodes. Sometimes it comes back with 13K and some times it comes back with 1,300.
If you have guts and a few minutes to watch numbers scroll, try the new upload with a Seed of 250. It does work but it can take a minute.
Also too, this is a Tool to Build a Tool. I mocked up a quick and dirty Editor Form that doesn't do anything or load while the program is running.
Just open it to see what the plan is.
That will save to a file that will essentially be a database of the data.
The whole point of this is to not have 5K strings of text in the .exe plus it allows the game to be any flavor I want just by changing the branch file.
Attachment 191170
I mentioned I'm trying to create a game. I know nothing about it except I play a lot of PC games - mostly rpgs. I don't know how to use Big0 or game theory or really much of anything that applies. I just want to see what I can do. If I decide to stick with creating games then I'll learn more and look back and realize how lame my first attempt was. :)
So the problem is that a random event gets chosen. The fewer of those there are, the faster the game gets old.
I want a huge top-level (for a one-person game developer) set of choices. Say 250 or more at least.
But then I want the tree to drop significantly to maybe five choices.
Then have that reduce again but *maybe* give five choices.
The problem is that when I try to roll a D5 I think I'm getting so many fives that I'm running out of stack space.
E.g.
(edited to clarify)
If Seeds = 5 then Seeds = RollDie(D5) ' Should eventually give a number less than five. Numbers less than five have one subtracted on each iteration. So if it rolls a 3 it will create a RollDie(d2) - 1 and eventually hit one and exit.
elseif seeds<5 then seeds = RollDie(seeds -1)
else seeds = 5
Also, I want each branch to be random so every time a parent node creates a child branch (excuse me if my terminology is wrong) I want each child branch to be random number of nodes.
So it has five children.
First child has three children. Second child has five, third has 1 (end of the line), etc.
In other words, what I'm trying t create a very top-heavy tree that gets smaller very fast but once it's small I don't want it to peter-out too quickly. I'd like some branches to be really deep.
This is the working code along with some rem'd out stuff I've played around with.
Anyway, I have two questions.
First, I'm not counting Total number of nodes and branches correctly or displaying all the branches. When it gets back to top level and the branch length is two or less it's not showing up in the textbox.
But the bigger question is how to get what I want - Top-heavy, much smaller after that but then declines more slowly.
PS. When it's all said and done, I have to think of whatever all these options will be and whatever available choices that results in.
So in the end I think I'm up for maybe about 5,000 nodes in total.