PDA

View Full Version : Pathfinder Fully Evaluating the Sacred Geometry Feat



Cognoscan
2015-07-07, 05:05 PM
So I'm really late to the party on this, but a friend of mine introduced me to the Sacred Geometry (http://www.d20pfsrd.com/feats/general-feats/sacred-geometry) feat, and I just had to break it.

For those not familiar with the feat, it allows you to add 2 metamagic effects to a spell for free, without requiring you to take any metamagic feats. The only catch is that you have to solve a math problem:

1. Roll a number of d6 equal to your ranks in Knowledge(engineering)
2. Using addition, subtraction, multiplication, and division, get a single prime number from the resulting rolls.
3. The prime number desired varies depending on what level the spell would be if the metamagic effects were applied

There's another feat, Calculating Mind (http://www.d20pfsrd.com/feats/general-feats/calculating-mind), that changes this to use d8, but it's not really worth it, as I will show shortly.

I wrote a program to brute force solve any set of dice rolled for any target spell level. If there is a solution, my program can find it. There's an app on the android store that does much the same thing, but I wanted to write my own so I could see what the true probabilities are for finding a solution. I ended up running my brute force solver for every possible combination of dice, from 1 die up to 8 dice. So the results are exactly how likely you are to pull off casting a spell with a given number of dice.

Without taking "Calculating Mind", 6 ranks in Knowledge(Engineering) is enough to cast 9th level spells with a 92% success rate. Near 100% success occurs upon reaching 8 ranks. With "Calculating Mind", this occurs approximately 1 rank sooner, making the additional feat of little benefit.

This is, as we all knew, a completely broken feat. Either the player can use this program to always cast with 2 metamagic feats applied to a spell, or they can take forever finding a solution, knowing that one exists. Still, it's pretty cool that it requires at a bit of algorithm work to get your godlike powers.

My full probability results are below:



Using d6 for dice:

Dice | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
--------|-------|-------|-------|-------|-------|-------|-------|-------|
Level 1 | 0.333 | 0.556 | 0.917 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 |
Level 2 | 0.000 | 0.056 | 0.528 | 0.944 | 0.996 | 1.000 | 1.000 | 1.000 |
Level 3 | 0.000 | 0.000 | 0.250 | 0.779 | 0.983 | 0.999 | 1.000 | 1.000 |
Level 4 | 0.000 | 0.000 | 0.069 | 0.542 | 0.930 | 0.995 | 1.000 | 1.000 |
Level 5 | 0.000 | 0.000 | 0.000 | 0.361 | 0.864 | 0.985 | 0.999 | 1.000 |
Level 6 | 0.000 | 0.000 | 0.000 | 0.134 | 0.791 | 0.969 | 0.996 | 1.000 |
Level 7 | 0.000 | 0.000 | 0.000 | 0.063 | 0.674 | 0.959 | 0.996 | 0.999 |
Level 8 | 0.000 | 0.000 | 0.000 | 0.046 | 0.628 | 0.942 | 0.992 | 0.999 |
Level 9 | 0.000 | 0.000 | 0.000 | 0.046 | 0.532 | 0.918 | 0.987 | 0.998 |

Using d8 for dice:

Dice | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
--------|-------|-------|-------|-------|-------|-------|-------|
Level 1 | 0.375 | 0.500 | 0.898 | 0.999 | 1.000 | 1.000 | 1.000 |
Level 2 | 0.000 | 0.156 | 0.586 | 0.960 | 0.999 | 1.000 | 1.000 |
Level 3 | 0.000 | 0.000 | 0.311 | 0.853 | 0.992 | 1.000 | 1.000 |
Level 4 | 0.000 | 0.000 | 0.176 | 0.712 | 0.971 | 0.999 | 1.000 |
Level 5 | 0.000 | 0.000 | 0.105 | 0.595 | 0.950 | 0.997 | 1.000 |
Level 6 | 0.000 | 0.000 | 0.035 | 0.398 | 0.903 | 0.991 | 0.999 |
Level 7 | 0.000 | 0.000 | 0.006 | 0.283 | 0.866 | 0.991 | 0.999 |
Level 8 | 0.000 | 0.000 | 0.000 | 0.210 | 0.844 | 0.987 | 0.999 |
Level 9 | 0.000 | 0.000 | 0.000 | 0.131 | 0.754 | 0.974 | 0.998 |


As for the program itself, I've included the full source code, written in C, below. Just compile it and you too can have your own completely broken feat! Plus, as a bonus, it even adds parentheses to the equation, which the Android app does not do.



/*
* Program: SacredGeometry
* Author: Cognoscan
* Date: 2015-07-07
*
* Brute forces a solution to the Sacred Geometry feat in pathfinder, if a
* solution exists. Takes in a target level, and a set of dice rolls. It then
* runs through every unique permutation of the dice rolls and tries all
* possible operand sequences. If there is a solution, it will find it. May take
* a while for large dice pools, but honestly, I'm pretty sure it becomes
* exponentially more likely that a solution exists as dice pool size increases.
* So don't bother with a full 20 dice unless you need to.
*/


#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>

const int goals[9][3] = {
{ 3, 5, 7},
{11, 13, 17},
{19, 23, 29},
{31, 37, 41},
{43, 47, 53},
{59, 61, 67},
{71, 73, 79},
{83, 89, 97},
{101, 103, 107}};

void swap(int*, int*);
void reverse(int* array, int length);
int intCompare (const void *a, const void *b);
void printResult (const int dice[], const int ops[], int length, int result);
bool nextPermutation(int data[], int length);
int computeTest(int working, int index, int lvl, const int data[], int ops[], int length);

int main(int argc, char *argv[]) {
int dice[20] = {0};
int lvl = 0;
int ops[20] = {0}; // 20 large so we can index into ops[19] without causing an exception
int count = 0;
int goal = -1;

// Grab Spell Level
printf("Pathfinder - Sacred Geometry\n");
printf("Feat Solution Finder\n");
printf("============================\n");
printf("Spell Level: ");
while(!scanf("%i", &lvl));
lvl = (lvl > 9) ? 9 : lvl;
lvl = (lvl < 1) ? 1 : lvl;
lvl--;

// Grab Dice Rolls
printf("Dice Rolls (spaces between, end with 0): ");
while(count < 20) {
if(!scanf("%i", &dice[count])) break;
if (dice[count] < 1 || dice[count] > 8) break;
count++;
}

// Permutation algorithm expects sorted array
qsort(dice, count, sizeof(int), intCompare);

// Run Recursive brute-force algorithm on each permutation. Stop when goal is
// found or when there are no more permutations
goal = computeTest(dice[0], 1, lvl, dice, ops, count);
while((goal < 0) && nextPermutation(dice, count)) {
goal = computeTest(dice[0], 1, lvl, dice, ops, count);
}

// If goal value was reached, print the solution
if (goal >= 0) {
printResult(dice, ops, count, goals[lvl][goal]);
} else {
printf("No valid result found!\n");
}
return 0;
}

// Swap two numbers
void swap(int* a, int* b) {
int temp = *b;
*b = *a;
*a = temp;
}

// Reverse a given array of some length
void reverse(int* array, int length) {
for(int i=0; i<length/2; i++) {
swap(&array[i], &array[length-1-i]);
}
}

// Integer compare function for qsort
int intCompare (const void *a, const void *b) {
if ( *(int*)a < *(int*)b ) return -1;
if ( *(int*)a > *(int*)b ) return 1;
return 0; // They are equal
}

// Get next permutation of data array, given an initially ordered array where
// a[k] <= a[k+1]. Returns false when all permutations have been done. If there
// are repeated values in the data, it handles them by only generating distinct
// permutations (no repeats due to repeated values).
bool nextPermutation(int data[], int length) {
int k = -1;
int l = 0;
// Find the largest index k such that a[k] < a[k+1]
for (int i=length-2; i>=0; i--) {
if (data[i] < data[i+1]) {
k = i;
break;
}
}
if (k == -1) return false;
// Find the largest index l greater than k such that a[k] < a[l].
for (int i=length-1; i>=k; i--) {
if (data[k] < data[i]) {
l = i;
break;
}
}
if (l <= k) return false; // This should never happen.
// Swap the value of a[k] with that of a[l].
swap(&data[k], &data[l]);
// Reverse the sequence from a[k + 1] up to and including the final element a[n]
reverse(&data[k+1], length-k-1);
return true;
}

// Print a Valid solution, with parentheses
void printResult (const int dice[], const int ops[], int length, int result) {

printf("Valid: %i = ", result);
// Print out opening parentheses
for (int i=0; i<length-1; i++) {
if (ops[i] < 2 && ops[i+1] >= 2) {
putchar('(');
}
}

printf("%i ", dice[0]);
for (int i=1; i < length; i++) {
switch(ops[i-1]) {
case 0: printf("+ "); break;
case 1: printf("- "); break;
case 2: printf("* "); break;
case 3: printf("/ "); break;
}
printf("%i", dice[i]);
if (ops[i-1] < 2 && ops[i] >= 2) {
putchar(')');
}
putchar(' ');
}

printf("\n");
}

/*
* Recursive Testing of all possible operand sequences on a given data set.
* Inputs:
* working - result of last operation. When first called, this should be data[0]
* index - Current index of data[] that is being used to perform next operation
* lvl - For indexing into goals array to see if valid solution was reached.
* data[] - The data being operated on
* ops[] - Array to record the operands used.
* length - Total length of data[] array
* Returns:
* -1 if no valid solution reached, otherwise the index of the goal value reached.
*
* Operand keys are:
* 0 - Addition
* 1 - Subtraction
* 2 - Multiplication
* 3 - Division
*/
int computeTest(int working, int index, int lvl, const int data[], int ops[], int length) {
int ret = -1;
// Final value computed. Test against target values
if (index == length) {
if (working == goals[lvl][0]) return 0;
if (working == goals[lvl][1]) return 1;
if (working == goals[lvl][2]) return 2;
return -1;
}

// Test with the 4 possible arithmetic operations
for (int i=0; i<4; i++) {
switch(i) {
case 0: ret = computeTest(working+data[index], index+1, lvl, data, ops, length); break;
case 1: ret = computeTest(working-data[index], index+1, lvl, data, ops, length); break;
case 2: ret = computeTest(working*data[index], index+1, lvl, data, ops, length); break;
case 3: if (working % data[index] == 0) {
ret = computeTest(working/data[index], index+1, lvl, data, ops, length);
} else {
ret = -1;
}
break;
}
// Check to see if we found a solution
if (ret >= 0) {
ops[index-1] = i; // Record the operand
break;
}
}
return ret;
}

OldTrees1
2015-07-07, 05:57 PM
I forget where but there already was a thread that discussed Sacred Geometry.

That thread(as time went on) ended up deductively proving the exact minimum number of ranks needed to ensure you would succeed. I'm serious, the proofs included why 1 less rank would not ensure and how every single result could be made given each of the possible dice rolls. That minimum number was laughable of course.

They likewise deductively proved that the d8 was worse than the d6 (although I think there was a qualifier attached to that conclusion).

Cognoscan
2015-07-07, 06:34 PM
Do you perhaps mean this thread (http://www.giantitp.com/forums/showthread.php?363930-Sacred-Geometry-and-Arithmancy/page6)? The proofs were pretty much entirely hand-evaluating each possible combination that could come up, not exactly an easy thing to do at higher values. Besides, it can be pretty difficult to conclusively prove that a given combination is *not* valid. I'm a bit more inclined to trust tossing every single combination into a solver and see which ones have solutions. Looking at some of these though, I see that rounding my percentages neglects things like literal one in a million chances discussed in that forum thread.

Renen
2015-07-07, 06:42 PM
I remember another post with a data table similar to yours. I think they proved that after level... I wanna say 8, you basically auto win.

grarrrg
2015-07-07, 06:43 PM
They likewise deductively proved that the d8 was worse than the d6 (although I think there was a qualifier attached to that conclusion).

Boiled down to d8's _might_ help at low Skill Ranks, but at _BEST_ d8's would be equivalent to d6's at high levels, in some cases being overall worse.


I remember another post with a data table similar to yours. I think they proved that after level... I wanna say 8, you basically auto win.

8? Heck, I'd say as low as _4_ ranks it's almost a sure thing.
4 Ranks> 2nd level spells is ~95%
5 Ranks> 3rd level spells is ~98.5%
(squiggles added, as I'm not taking the time to recalculate to confirm your numbers)
Anything after 5 ranks just gets better and better, higher level Spell or not.


Do you perhaps mean this thread (http://www.giantitp.com/forums/showthread.php?363930-Sacred-Geometry-and-Arithmancy/page6)? The proofs were pretty much entirely hand-evaluating each possible combination that could come up, not exactly an easy thing to do at higher values.

You have fun with your coding, we'll have fun with our by hand (http://www.giantitp.com/forums/showthread.php?363930-Sacred-Geometry-and-Arithmancy&p=17889602&viewfull=1#post17889602). :smallwink:


In any case, that feat is broken-overpowered as all heck. And the "downside" of increased casting time is not much deterrent.

Cognoscan
2015-07-07, 07:12 PM
You have fun with your coding, we'll have fun with our by hand (http://www.giantitp.com/forums/showthread.php?363930-Sacred-Geometry-and-Arithmancy&p=17889602&viewfull=1#post17889602). :smallwink:


I gotta say, I'm crazy impressed by all the by hand calculations. I coded it because I couldn't figure out a good system for doing it by hand. There are some pretty clever tricks in there!

Chronos
2015-07-07, 07:31 PM
Is there any rule of good game design that isn't violated by that feat? It's overpowered, it's the biggest violator ever of Grod's Law, the fluff doesn't remotely resemble the crunch, and so on.

ExLibrisMortis
2015-07-07, 07:45 PM
Is there any rule of good game design that isn't violated by that feat? It's overpowered, it's the biggest violator ever of Grod's Law, the fluff doesn't remotely resemble the crunch, and so on.
Well, it's great for a one-shot, which is about the time it'd take to get bored of doing this manually each time (and bored of the OPness, and so on).

Snowbluff
2015-07-07, 07:46 PM
Is there any rule of good game design that isn't violated by that feat? It's overpowered, it's the biggest violator ever of Grod's Law, the fluff doesn't remotely resemble the crunch, and so on.

It's none of these things. It makes MM usable, it's only as strong as the strongest MM (lawl), you need a trick to beat the MM limit on spell level (one invented by me), and it's easy to use if you're good with dice (you do play DnD, right?).

Heck, if you are using it to maximize a spell, it actually can save you time. :smalltongue:

OldTrees1
2015-07-07, 07:47 PM
Is there any rule of good game design that isn't violated by that feat? It's overpowered, it's the biggest violator ever of Grod's Law, the fluff doesn't remotely resemble the crunch, and so on.

Yes.
It is optional so that means it passes several good game design rules and it fails to fail and good game design rules that are not applicable to it. But both of those are cheaty answers to your rhetorical question.

It even fails the "improved versions should not be weaker" rule.

Aditus
2015-07-07, 08:10 PM
It's none of these things. It makes MM usable, it's only as strong as the strongest MM (lawl), you need a trick to beat the MM limit on spell level (one invented by me), and it's easy to use if you're good with dice (you do play DnD, right?).

Heck, if you are using it to maximize a spell, it actually can save you time. :smalltongue:

What is the trick to beat the limit on spell level? That was about the only thing about the feat that seemed reasonable...

Oazard
2015-07-07, 09:27 PM
What is the trick to beat the limit on spell level? That was about the only thing about the feat that seemed reasonable...

I didn't look at each Snowbluff's post that I preciously keep in my archive of Snowbluff's posts, but I think it involves Heighten Spell and some metamagic reducing traits. (http://www.giantitp.com/forums/showthread.php?399428-Early-Entry-What-Early-Entry&p=18853816&viewfull=1#post18853816)

Snowbluff
2015-07-07, 09:39 PM
What is the trick to beat the limit on spell level? That was about the only thing about the feat that seemed reasonable...

As above.

IN short:

1) Take a trait to reduce Metamagic
2) Take Sacred Geometry: Heighten

For different reading of spells:
3) Take Second MM reduction trait for a different spell

IDR if it's self-fulfilling, so you might have to take Heighten Spell separately.

EDIT Also someone's archiving my posts. Am I more influential than I thought or are Canadians fond of my antics?

grarrrg
2015-07-07, 10:17 PM
EDIT Also someone's archiving my posts. Am I more influential than I thought or are Canadians fond of my antics?

Eh, not that weird.
I got an archive of gararaarrg's posts.
I keep referencing his stuff for some reason.

Extra Anchovies
2015-07-07, 10:53 PM
It's none of these things. It makes MM usable, it's only as strong as the strongest MM (lawl), you need a trick to beat the MM limit on spell level (one invented by me), and it's easy to use if you're good with dice (you do play DnD, right?).

Heck, if you are using it to maximize a spell, it actually can save you time. :smalltongue:

If I'm reading your post right, you're saying that SG isn't an overpowered feat. I sincerely hope you're joking.


As above.

IN short:

1) Take a trait to reduce Metamagic
2) Take Sacred Geometry: Heighten

For different reading of spells:
3) Take Second MM reduction trait for a different spell

IDR if it's self-fulfilling, so you might have to take Heighten Spell separately.

Can I get a more detailed step-by-step of how this works? My reading of the combo (using Magical Lineage, since you didn't specify a trait) is that it lets you Heighten your spells to [highest level you can cast]+1.

Snowbluff
2015-07-07, 11:10 PM
If I'm reading your post right, you're saying that SG isn't an overpowered feat. I sincerely hope you're joking. I have 11 levels of play with it. It's not. It's strong, but I've much more powerful tools in my kit from just being a caster.


Can I get a more detailed step-by-step of how this works? My reading of the combo (using Magical Lineage, since you didn't specify a trait) is that it lets you Heighten your spells to [highest level you can cast]+1.

Heighten Spell by 1.
Level is improved by 1, cost is reduced to normal slots via trait

You now can cast a level of spells above your normal.
Ergo, the range of Sacred Geometry is improved.

After that, you can Heighten a spell of a higher level, but with a smaller effective cost.

It creates a self fulfilling loop that lets you modify a spell to count as one level than you can cast, which let's you modify a spell to a higher level than that, and so on.

So, I cast Magic Missile lvl. 2 from a first level slot.
So, I use Sacred Geometry to cast Magic Missile lvl.3 from a first level slot, which would be level slot 2 that's cast from a first level slot.
So, I use Sacred Geometry to cast Magic Missile lvl.4 from a first level slot, which would be level slot 3 that's cast from a first level slot.
etc.

Extra Anchovies
2015-07-07, 11:17 PM
I have 11 levels of play with it. It's not. It's strong, but I've much more powerful tools in my kit from just being a caster.

"Weaker than full casting" doesn't make something not overpowered, because full casting is the most overpowered thing in the entire game.

Sacred Geometry gives too much for one feat even if you assume that its core function is balanced, because it gives you two metamagic feats from one feat slot. That is higher than the intended balance point for metamagic feats (1 metamagic feat = 1 feat slot); therefore, Sacred Geometry is overpowered. The fact that the two selected metamagic feats can only be applied via SG's core function is trivial and not a factor in the feat's power balance.


Heighten Spell by 1.
Level is improved by 1, cost is reduced to normal slots via trait

You now can cast a level of spells above your normal.
Ergo, the range of Sacred Geometry is improved.

After that, you can Heighten a spell of a higher level, but with a smaller effective cost.

It creates a self fulfilling loop that lets you modify a spell to count as one level than you can cast, which let's you modify a spell to a higher level than that, and so on.

Hm. Interesting. It even loops up without you having to take any actions. That's pretty damn cheesy. Nice job.

Snowbluff
2015-07-07, 11:29 PM
"Weaker than full casting" doesn't make something not overpowered, because full casting is the most overpowered thing in the entire game. Yes. Do you know who uses the feat? The casters. What good does this actually do? Nothing they could not do in the first place. It's literally only as strong as the spells you can cast in the first place.

Heck, I argue it's a good feat. Blasting is suddenly way more slot efficient. You know those seedy 6/9 casters that walk around, questioning their lack of viable MM use due to limited spell slots? They can use MM now.


Sacred Geometry gives too much for one feat even if you assume that its core function is balanced, because it gives you two metamagic feats from one feat slot. That is higher than the intended balance point for metamagic feats (1 metamagic feat = 1 feat slot); therefore, Sacred Geometry is overpowered. The fact that the two selected metamagic feats can only be applied via SG's core function is trivial and not a factor in the feat's power balance.
*AHEM*
"Strong than a metamagic feat" doesn't it not balanced, because metamagic feats are generally pretty mediocre."

Metamagic feats cost more than a feat normally, as in they take spell slot, so I consider them weak. It is a good point that Sacred Geo is better.

HOWEVER, there is a counterpoint.
1) Sacred Geo increases the casting time unless you quicken,

2) Doesn't allow you to use the metamagic feats the regular way (for things like keeping the casting time down).

3) Doesn't let you make effectively more powerful spells than you are normally can without an exploit. An exploit that eats one to two traits that may or may not be helpful. It's not "Make more metamagic," it's "save some spell slots."

4) Takes up skill points to use.

So it's definitely better, just my experience tells me that the basic model from which we examined it initially way overvalued its abilities.


Hm. Interesting. It even loops up without you having to take any actions. That's pretty damn cheesy. Nice job.

Thanks. It's my first major contribution to the meta, I think ( the Canadians might correct me, not sure). Though, it is kind of like what I'd imagine having your first kiss be with a cousin would be like. Stupid PF. :smalltongue:

bekeleven
2015-07-07, 11:51 PM
Hm. Interesting. It even loops up without you having to take any actions. That's pretty damn cheesy. Nice job.
Thanks. It's my first major contribution to the meta, I think ( the Canadians might correct me, not sure). Though, it is kind of like what I'd imagine having your first kiss be with a cousin would be like. Stupid PF. :smalltongue:
This is basically the definition of bootstrapping (https://en.wikipedia.org/wiki/Bootstrapping). Most bootstrapping in D&D involves looping self-qualification.

Oazard
2015-07-08, 04:10 PM
EDIT Also someone's archiving my posts. Am I more influential than I thought or are Canadians fond of my antics?

Yes. :smalltongue:




Thanks. It's my first major contribution to the meta, I think ( the Canadians might correct me, not sure). Though, it is kind of like what I'd imagine having your first kiss be with a cousin would be like. Stupid PF. :smalltongue:

After research, I think it's also your only one, boss. Excluding your axiom which is older than this trick.

https://31.media.tumblr.com/tumblr_m3pp1qJQOy1qkpz7co1_r1_500.gif