I finally looked at alchemy.c, and... <SNARL!>

A place for people to post strange occurances that could be potential bugs.

Moderator: Board moderators

Post Reply
Mental Mouse
Regular
Posts: 82
Joined: Fri Jun 20, 2008 10:13 am
Location: Charlottesville, VA

I finally looked at alchemy.c, and... <SNARL!>

Post by Mental Mouse »

OK, I've been complaining for a while about the excessively nasty backfires from alchemy. Well, I finally broke down and looked at the source... and lo and behold, around line 700, I find this:

Code: Select all

  /* Ingredients. Longer names usually mean rarer stuff.
     * Thus the backfire is worse. Also, more ingredients
     * means we are attempting a more powerfull potion,
     * and thus the backfire will be worse.  */
   for(item=cauldron->inv;item;item=item->below) {
        strcpy(name,item->name);
        if(item->title) sprintf(name,"%s %s",item->name,item->title);
        danger += (strtoint(name)/1000) + 3;
	nrofi++;
   }
The "strtoint()" function comes from common/recipe.c, and adds the ASCII values of the lowercase versions of all characters in the buffer, multiplied by the item count. In the above formula, that comes out to adding "about 1" for every 10 letters in the name, times the count. (Spaces and apostrophes count for less.) Because, you know, a "bottle of philosophical oil" (24 letters) is so much rarer than a "titan's head" (only 9 letters)! </sarcasm>

May I suggest that things could be made much saner by simply eliminating that part of the danger formula? If you want to check for rare ingredients, I note that recipe.c already has functions that look up an object's source archetypes -- so how about using the monster's *level* for corpses and body parts, and the difficulty rating for alchemical products?
mwedel
Regular
Posts: 86
Joined: Tue Jul 17, 2007 5:23 am
Location: Santa Clara, CA, USA

Post by mwedel »

I think the problem is that the alchemy code itself is in need of a large re-write.

As such, there isn't as much interest to go in and make smaller adjustments/tweaks, when all that may go away.

The problem is that major rewrite needs to be done.
Mental Mouse
Regular
Posts: 82
Joined: Fri Jun 20, 2008 10:13 am
Location: Charlottesville, VA

Alchemy re-write

Post by Mental Mouse »

If I actually went in and did that, how would I politely submit that for general review? (I wouldn't want to shove my initial re-write straight into the code-base!)

I would probably want to introduce a few new ingredients while I was at it, such as water of amethyst (but then amethysts would have to get into the treasure-lists), acid (and perhaps lye), and more advanced oils. For that matter, P-oil (and the new oils) should be more available in the shops, and water should be generally available in more quantity! As it stands, Scorn's alchemy shop looks like the *only* place where water is available in unlimited quantity, and beginning alchemists *need* it in large quantities.

And I'd want organs and corpses in general to remember the level of the monsters they came from!
mwedel
Regular
Posts: 86
Joined: Tue Jul 17, 2007 5:23 am
Location: Santa Clara, CA, USA

Post by mwedel »

First step would probably be to send mail to the mailing list broadly describing the changes you are looking to make.

After that, you make the changes. Do some testing - make sure things work. Then give a little advanced warning, and commit into the trunk.

If you're concerned about your changes, you could put them up as a patch or the like for others to review. I'm just not sure how many folks would go and actually review them.
Leaf
Forum Aficionado
Posts: 1994
Joined: Tue Apr 29, 2003 5:55 pm
Location: Minnesota, USA
Contact:

Post by Leaf »

mwedel wrote: If you're concerned about your changes, you could put them up as a patch or the like for others to review. I'm just not sure how many folks would go and actually review them.
Recommendations and guidelines for submitting patches is summarized at,
http://wiki.metalforge.net/doku.php/cod ... in_patches
"Put another, more succinct way: don't complain, contribute. It's more satisfying in the long run, and it's more constructive."
Eric Meyer
SilverNexus
Junior member
Posts: 165
Joined: Mon Jun 25, 2012 5:33 pm
Location: Planet Earth

Post by SilverNexus »

Another possible use for organs and corpses maintaining their level would be for dragon resistance gain. For example, if a level 10 dragon player kills a level 4 orc with 25% resistance to cold (a weird example, I know), the level 10 player should have a better chance to gain resistance if the orc were level 50 (although how they would manage to defeat it is beyond me).

The only problem I see is that, on multiplayer servers, higher level characters could run around and fetch flesh for a low-level dragon ally, so that that ally gains large quantities of resistance early and becomes useful without having to do anything. Then, now that the dragon is resistant to everything, the game becomes far too easy for that character.
Ryo
Forum Fanatic
Posts: 752
Joined: Mon May 19, 2003 9:16 pm
Location: Paris, France

Post by Ryo »

That is exactly as the resistances for dragons work, unless I'm mistaking :)

FLESH items get some resistances, and dragon players eating them have a probability (based on their resistance points in the concerned resistance) to gain some resist (whao, talk about 'resist' redundance :))
SilverNexus
Junior member
Posts: 165
Joined: Mon Jun 25, 2012 5:33 pm
Location: Planet Earth

Post by SilverNexus »

I realized that's how dragon resistances do work, I was just thinking about what would happen if monster level was also taken into account for resistance gain. It would, like so many other changes, require a bit of rebalancing to take place.
That SilverNexus guy? You needn't worry about him.
He is level negative 4 in oratory, and his singing is worse.
Ryo
Forum Fanatic
Posts: 752
Joined: Mon May 19, 2003 9:16 pm
Location: Paris, France

Post by Ryo »

SilverNexus wrote:if monster level was also taken into account for resistance gain.
Monster level is taken into account already :)

Check server/types/food/food.c line 293 (trunk revision 18313)
SilverNexus
Junior member
Posts: 165
Joined: Mon Jun 25, 2012 5:33 pm
Location: Planet Earth

Post by SilverNexus »

ryo wrote:Check server/types/food/food.c line 293 (trunk revision 18313)
Yep, I see it is. Thank you for the clarification.
That SilverNexus guy? You needn't worry about him.
He is level negative 4 in oratory, and his singing is worse.
Post Reply