(May 17th, 2020, 03:12)Seravy Wrote: You mean a random game generator?
There is one included but it's not integrated into the game, you run it from DOS, it tells you the random settings and you select them manually.
Of course you can share yours! Whether I want to include it or not I can only say after seeing it though.
New Random game generation algorithm for Caster of Magic 6.01 (2020 May 16):
Begin
Choose your own Difficulty. If you won your last game play at same level or 1 level higher. If you lost last game play at same level or 1 level lower. [Revolting Raiders counts as +1 level difficulty, Monsters Gone Wild counts as +1 level difficulty]. So there are a total of 9 levels of difficulty now.
Generate random integer from 1 to 10. If rolled >3 choose 4 opponents. Else choose rolled number of opponents.
Generate random integer from 1 to 5. Choose Land Size accordingly. (1=tiny)
Generate random integer from 1 to 5. Choose Power accordingly. (1=min)
Generate random integer from 1 to 3. Choose Minerals accordingly. (1=poor)
Generate random integer from 1 to 3. Choose Climate accordingly. (1=dry)
Generate random integer from 1 to 14, which determines Wizard picture. (1=Merlin, 2=Raven)
Generate random integer from 1 to 5
If 1, choose Plan A
If 2, choose Custom then Wizard picture then go to Plan B
If 3, choose Custom then Wizard picture then go to Plan C
If 4, choose Custom then Wizard picture then go to Plan D
If 5, choose Custom then Wizard picture then go to Plan E
Plan A [given Wizard]:
Select Wizard that corresponds to Wizard picture.
Go to Select Race.
Plan B [throwing darts at the board blindfolded]:
Count number of skills still available [initially 18. 1=Alchemy, 2=Warlord,…]
Count number of empty book slots still available [initially 50]
Generate random integer from 1 to max total [available skills + available book slots]. [initially it is 68].
Pick that individual skill or 1 book [initially 10/68 probability to choose a single life book]
If there are 0 picks to spend go to Select Spells
If you were in Plan E before go to Plan E
Go to Plan B
Plan C [Book favor]:
Generate random integer from 1 to 2
If 1 then go to Roll a Skill
If 2 then go to Roll Books
Roll a Skill:
Generate random integer from 1 to # of skills not already check marked [initially 18]. Each skill has equal chance of being selected. Select the skill that was given by random integer
If there are 0 picks to spend go to Select Spells
If you were in Plan E before go to Plan E
Go to Plan C
Roll Books:
Generate random integer from 1 to number of book colors that still has empty book slot [initially 5]. This determines what color of books you will choose next. Generate random integer from 1 to LesserOf(number of empty books slots available to be chosen in that color, number of picks available to spend). Select # of books in color given by the integer.
If there are 0 picks to spend go to Select Spells
If you were in Plan E before go to Plan E
Go to Plan C
Plan D [Skill favor]:
Generate random integer from 1 to NumberOf(unchecked skills + available number of book colors) [initially 23, 1-18 corresponds to individual skills, 19- 23 to individual books in each of the 5 colors]. A random integer represents a skill or a single book in one color.
If there are 0 picks to spend go to Select Spells
If you were in Plan E before go to Plan E
Go to Plan D
Plan E:
Generate random number from 1 to 3.
If 1 go to Plan B
If 2 go to Plan C
If 3 go to Plan D
Select Spells
Uncheck all spells.
Repeat:
Generate random integer from 1 to # of unchecked spells at Common Spell level [first time: 1 to 10]. Select spell that corresponds to random integer [first column is 1 to 5].
End Repeat
Do same for Uncommon Spells
Do same for Rare Spells
Select Race:
If Myrran then generate random integer from 1 to 4.
If 1 go to Arcanus race.
If >1 go to Myrran race.
Arcanus Race:
Generate random integer from 1 to 9. Select Arcanus race that corresponds to the integer.
Myrran Race:
Generate random integer from 1 to 5. Select Myrran race that corresponds to the integer.
Select Color:
Generate random integer from 1 to 5. Select color that corresponds to random integer.
End
It’s not perfect, but pretty close to be considered fully random. If there is a demand, I could improve it further, but this worked pretty well for myself. I can do a probability analysis on it, which I have not done yet.
======
How can I access your Random Game generator? Also, what is its pseudocode?