DragonPrime - LoGD Resource Community
Welcome Guest
  • Good afternoon, Guest.
    Please log in, or register.
  • April 22, 2018, 01:01:07 PM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1]   Go Down
  Print  
Author Topic: Making initiative a buffable stat  (Read 2496 times)
0 Members and 1 Guest are viewing this topic.
Torne
SVN Users
Codemeister
*
Offline Offline

Posts: 259


Code ninja


View Profile
« on: April 14, 2006, 03:54:22 AM »

I've been considering for quite some time how to make initiative into a buffable stat - a number of my races, and other parts of my game, would work quite well if they could increase or decrease the chance of the player being surprised in battle. I wanted the scheme to fulfil these conditions:

  • Player should never be surprised every time, nor get the jump every time, no matter how much they are buffed/debuffed
  • The more you're buffed/debuffed, the less additional effect it has (helps with the last one, and stops players becoming too uber)
  • Transitive - doesn't matter which order different modules buff the stat in, the result is the same odds
  • Stacks with the base chances as they currently are (1 in 2 for normal fights, 2 in 3 for fights below your level, 1 in 3 for fights above your level)

I thought about various tricks with percentages and so on but couldn't initially think of a way to satisfy the above. But, an idea struck me today Wink

Start with an initiative score of 0. Allow modules to buff/debuff the player by adding or subtracting from the current initiative (by small but integer amounts: +/-1 would be a reasonable buff, +/-2 would be quite powerful). Once the final initiative score is tallied, use it to modify the base chances like this:

  • Start with a rational fraction as the chance of being surprised: it will initially be either 1/2, 2/3 or 1/3 depending on the level.
  • If the initiative score is positive, add it to both the top and the bottom of the fraction.
  • Else, if the initiative score is negative, add its absolute value to just the bottom of the fraction.

This works quite neatly: it never reaches 100% or 0% chance of being surprised; the more you've been buffed/debuffed, the less additional effect it has; and it's both transitive and symmetrical.

Here's an example of the odds you end up with:

Initiative scoreBelow levelAt levelAbove level
-30.3330.2000.167
-20.4000.2500.200
-10.5000.3330.250
00.6670.5000.333
10.7500.6670.500
20.8000.7500.600
30.8330.8000.667

So, I'm looking for comments: what do you think of this scheme, do you think I've missed any requirements, would it be valuable to have this in core?

I've not coded it yet but will be doing so sometime this weekend (as a core patch).
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Play LoGD on Dragonprime

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Recent Topics
DragonPrime LoGD
Who's Online
28 Guests, 0 Users
Home Forums News Downloads Login Register Advanced Search