I've become very interested in a monster power calculation which I mentioned in passing in another thread. Magnate asked me to look at eval_r_power in init1.c and pointed me at ticket 869, review and revise said algorithm. I've read the algorithm pretty closely and though I don't have any specific suggestions (yet!) I noticed a few omissions (e.g., ARROW_1-4) and likely errors (e.g., if (rsf_has(r_ptr->spell_flags, RSF_TELE_LEVEL) && spell_dam < 40) spell_dam = 25; when I assume you would want the assignment to be 40 or the test 25). I don't think these minor issues are contributing to the power ratings being out of whack as described in the ticket but ironing those out seems like an obvious starting point before making suggestions.
I just want to be able to print the monster list and their current power ratings so as I iron those issues out I can verify my results. I've written maybe 10 lines of C in my life but am quite comfortable with a number of descendants (especially PHP, Java, Perl, and JavaScript... I'll give you 1 guess as to what I do for a living). I'm on a Mac and can get it to compile which is always a bonus. I'm using r2035 for now.
Reading the code I came across emit_r_info_index in init1.c which sounds like a real winner (once one realizes "r_info" refers to monsters... heh). So I tacked this on after the description:
I also tried doing it as a comment before appending it to the description. Then over in init2.c I dropped the conditional from this line in init_r_info:
I don't know if arg_rebalance is true or false (I assume) or what. I also tried explicitly setting it to true.
So I build, launch, roll a character, take a turn in town, and quit assuming it would spit my new monster.txt out but that doesn't appear to be the case. Honestly I'm not even sure where to look (I assume in the "package contents" of Angband.app).
Or, is this just a totally silly approach to begin? Am I missing something else fundamental?
Don't ask me why my curiosity is so piqued by this obscure and utterly unimportant function and ticket with zero gameplay value. I like to think of myself as a special brand of crazy.
I just want to be able to print the monster list and their current power ratings so as I iron those issues out I can verify my results. I've written maybe 10 lines of C in my life but am quite comfortable with a number of descendants (especially PHP, Java, Perl, and JavaScript... I'll give you 1 guess as to what I do for a living). I'm on a Mac and can get it to compile which is always a bonus. I'm using r2035 for now.
Reading the code I came across emit_r_info_index in init1.c which sounds like a real winner (once one realizes "r_info" refers to monsters... heh). So I tacked this on after the description:
Code:
file_putf(fp, "D:%d:%d\n",r_ptr->power, r_ptr->highest_threat);
Code:
if (arg_rebalance) r_head.emit_info_txt_index = emit_r_info_index;
So I build, launch, roll a character, take a turn in town, and quit assuming it would spit my new monster.txt out but that doesn't appear to be the case. Honestly I'm not even sure where to look (I assume in the "package contents" of Angband.app).
Or, is this just a totally silly approach to begin? Am I missing something else fundamental?
Don't ask me why my curiosity is so piqued by this obscure and utterly unimportant function and ticket with zero gameplay value. I like to think of myself as a special brand of crazy.
Comment