Showing developer posts only. Show all posts in this thread.

Johan

Studio Manager Paradox Tinto
Administrator
Super Moderator
Moderator
16 Badges
Dec 14, 1999
18.242
38.600
  • Diplomacy
  • Teleglitch: Die More Edition
  • War of the Roses
  • 500k Club
  • Crusader Kings II: Holy Knight (pre-order)
  • Europa Universalis III: Collection
  • Magicka: Wizard Wars Founder Wizard
  • Hearts of Iron IV Sign-up
  • Stellaris Sign-up
  • Imperator: Rome Sign Up
  • A Game of Dwarves
  • Lead and Gold
  • Magicka
  • Starvoid
MeanTimeToHappen = the value given after modifiers..
noOfDays = basically, how many days are between checks.. (currently 1)

Code:
		float daylyChance = float(1.0f - exp( log(0.5f) / MeanTimeToHappen ));
		float chance = float(1 - exp( noOfDays * log(1 - daylyChance)) );
		return chance;  //0-1% chance of event happening that day