Choose Your Language

Friday, 19 June 2009

Counting The Costs!

Here is my problem: Why would a player bother to use an amethyst (normally 100gp value) and some powdered silver (normally 50gp value) to craft some Holy Water worth around 25gp on average? It just does not make any sense. Furthermore, the clerics who tend to supply Holy Water would quickly go out of business at these costs, no matter how charitable they are.

This is why I have to confess at having to sort out another “mechanic’s problem” before I can get back to writing the plot. Furthermore, this is just one example of a complete system rife with cost anomalies that would drive a player to despair if they looked closely enough. But it’s only a fantasy world, I hear you say. I know I could have just gone with the flow, but after having put so much effort into encouraging crafting, why have the whole thing spoiled due to bad game economics?

2DA Nightmares!
Sorting through the tangled web of 2da files that handles cost has not been easy, and I have discovered a number of further “problems” along the way. One file in particular has grabbed my editing attention: iprp_spells.2da. Examining this file, I discovered a large discrepancy between the costs of casting spells of the same level. Some spells even did not have a properly calculated cost element in place, meaning some high level spells could be cast at a cost cheaper than a 1st level spell!

This was not the only 2da file with problems. The baseitems.2da also needed some editing to help bring prices back in line with D&D costs (e.g. shields and everything else halved), and also to help alleviate the cost of preparing potions (multiply factor). To sort out the problem of craft items being worth more than the final product (like the Holy Water above), I ended up reworking some of the costs of the individual crafting items (reducing their worth) and changed one or two of the items required for various items in the crafting.2da file. This also meant I had to update the information in my crafting tome that PCs can find in the game. I will also need to re-evaluate all the costs in the nx2_crafting.2da file as well to reflect a more consistent cost when crafting items using the various materials that have changed price.

Finally, I am also working through the des_crft_spells.2da because there are some spells that can currently be made into potions that should not be able to. I am following the rule that potions only work on the imbiber. E.g. It’s absurd to consider a Light potion can be brewed to allow a PC to cast Light on a fellow PC.

I spent quite some time working out the formulae for calculating costs of items before I found this piece of information in the itempropdef.txt file, which confirmed what I had already figured plus gave me the missing factor that was to be found in the itempropdef.2da.

E Cost

A factor that determines the final cost of an item. The actual calculation may or may not involve summing all the "cost" values of item properties, squaring this value, multiplying by 1000, adding this to the base value of the item, then squaring the sum of all the negative "cost" values, subtracting this from the positive/beneficial sum, then multiplying this value by the base item multiplier.

With this new knowledge in mind, I started to examine why certain items calculated at certain costs and discovered that some 2da files had errors in them. As one example, notice how the costs for adding the 70% of weight reduction to an item costs more than better values. I have altered the iprp_weightcost.2da file to use the following figures to correct for errors and alter for Althéa costs. (NB: Although I have kept the rows in the same order, this table is not meant to represent the actual 2da file, but a table to show my figures and results. I decided to cost weight reduction at roughly 10gp per 1% reduction.):

Updated With Correct Values November 2014
Consistent Costing
Another issue with the iprp_spells.2da file is that it contains the costs of setting a spell on an item at different levels. The problem with this is (in my opinion) is that it automatically defaults to the highest level (and therefore costs) for the PC. This just serves to add further confusion for the player when using one of these varying level spells, because one time a spell may cost X amount to craft an item, while another time it has increased to Y. To resolve this issue, I calculated what I believed to be the correct cost for each spell level as if cast by the lowest spell caster level possible, so that now, a player knows exactly how much it costs to craft an item with a particular spell. Check the table below for my current set cost figures and the equivalent item values.

Scalable Power

From this, I also developed the “Scaleable Power” system, which has always been a part of the Althéa scroll system: Casting power (for scrolls) scales to the user rather than the original creator. Furthermore, as long as a PC can use an item, it will automatically cast at the user’s highest spell casting level, regardless of magic type. E.g. A 1st level wizard / 15th level cleric would be able to cast a Fireball scroll as if caster level 15, because they have at least one level in wizardry that allows them to be able to read the scroll. However, I have introduced one check that must also be satisfied: The user must have a Wisdom, Intelligence or Charisma score equal to the spell level + 10 to be able to use the magic in the item. E.g. In the above example, the PC must have a Wisdom score (most likely key attribute in this case) of at least 13 (as Fireball is a 3rd level spell).

Both scrolls and wands scale in this way, with one further exception for the wand: The power of a wand will only scale if the PC knows the spell it is casting. (Awaiting new SpellKnown function in patch v1.23) If they do not know the spell, then the wand casts at the lowest level that the spell can be cast, with a minimum of 5th level (the level any crafter has to be to craft the wand in the first place). E.g. A Wand of Ice Storm used by a 17th level cleric would only cast at 7th level. (The lowest level to cast Ice Storm.) However, the same wand in the hands of a 10th level wizard who knows the Fireball spell would cast at 10th level. UPDATE: I have introduced another part to the craft system that means wands will now only cast at the level they are created. I will explain more in my next post.

Potions are always set to work at the lowest level that the spell could be cast, but at a minimum of 3rd level (the level any crafter has to be to brew the potion in the first place). NB: There are some “Special Brew” potions (E.g. Heal) that do work at higher levels, but are outside the ability of the PC to craft. PCs can only brew potions that are 3rd level or lower. UPDATE: Potion crafting has also altered. Again, I will explain more in my next blog.

There is a downside to all this, of course, and that is I have to add a small amount of code to every spell script that requires power scaling. (That is a lot of scripts!) Now, considering this, I may opt to only scale certain spells (even though any spell is potentially possible), simply due to time constraints.

And this is where I ask the readers to give me feedback on “MUST HAVE” spells to scale with use. Please leave any comment you think will be helpful. Thanks!


Anonymous said...

Looks complicated! This is the sort of stuff that drives me crazy--the base in game files that are full of problems. It's awfully time consuming to go through them and...seems like it could drive a man crazy.

Spells that *must* scale would be(short list which comes to mind):
1) Any spell which scales with damage(fireball, etc).
2) Short term buffs like haste/displacement(every round counts here unlike, say, ghostly visage which is 60 seconds per caster level).
3) Summons(again, short duration).

Off the top of my head, those are the ones I would say *have* to be there. That's quite a few spells already, but they'd be great.

Also, since I know I'm interested, are there any plans to release the scaled spells to the vault? I know I'd love it, anyways.

Lance Botelle (Bard of Althéa) said...

Hi Chaos Wielder,

It is hard trying to keep sane when going through this lot.

I agree with all your suggestions for spells, and I have been going through them gradually with a friend tonight. We are compiling a list and making notes of alterations required as well as we go along. E.g. I will be increasing the summon spells to the 1 hour per level again. :)

I have no problem sharing the scaled spells, but I don't know if people would always understand how (and why) I have changed the way spells work with scrolls. Do you think others would not mind having scrolls work the way I said instead of the current NWN OC way? I think the way I handle scaling is better (overall) than the NWN way, but players may not like the change of approach. What do you think?

If you like it, I am more than happy to share the 2da altered file, pre-spell-hook script and altered spell scripts. (I have already noted 21 spell scripts and I have not even reached the end of 1st level spells yet!)

I will try to keep everybody posted about specific spell alterations as well as time goes by. Hopefully, I may even have a list of spells (with alterations made) by the next blog post. You never know. :)


Wyrin said...

THat sounds like a fair bit of work! I got into the spell scripts when i was playing about with the spellcasting framework (have you checked it out - has lots of functions for modifying level

CW listed the key points - anything where duration/power is going to be greatly effected by level. But that's still lotta spells. What levels are PCs likely to achieve in the game? Might make it easier to stagger this part of the work?

Are you taking any of the spell focus feats into account for these?

Lance Botelle (Bard of Althéa) said...

Hi Wyrin,

Thanks for the heads up on the "spellcasting framework". I did not know about that and so am taking a look at it as I type. :) It certainly appears to have a lot of interesting points and maybe I can use (or adapt) some of it to save me some work. ;)

I like to try to write mechanics ahead of time if possible, but if it gets too much, I suppose I could restrict the changes to the first few levels of spells for the time being.

As far as any spell casting feats are concerned (including spell focus), I don't think I need to consider it as far as spells on items go. My idea is that items can contain the "basic" spell that can be "optimised" according to the caster's level. However, that optimisation is limited to level as opposed to being able to add more features to that spell (like the spellcasting features), which are only available to the caster's own spells *from memory* as opposed to an item they carry.

Did I understand and answer you correctly ... or did I miss something in what you were asking?

Thanks. :)


Anonymous said...

Chaos Wielder is right: spells with 1 round/level and magic missile absolutely have to scale or they will be useless.

But I'm concerned about the ability (WIS, INT or CHA) check for scrolls. That way some non-spellcasting classes won't be able to use them, and it is them that need these items most.

Does that check need to be done for wands too? If not I don't think the above would be a problem.

Lance Botelle (Bard of Althéa) said...

Hi Anon,

I am making sure that every spell that has a duration based on level does scale. Furthermore, I am also introducing a new GUI to allow PCs to make scrolls work at a minimum level (at extra cost) for casters other than themselves. (i.e. Scrolls can be made to work at levels higher than the PC can currently cast if the player decides to build them that way.) I hope to explain all this a bit more later, but basically, it combines existing rules with scalable scrolls, only mine will be a lot more flexible. :)

It is only *scrolls* that require the WIS/CHA/INT checks. So, a PC using UMD who wants to cast a scroll will also have to have one of these attributes match the level of the spell plus 10.

Wands and potions do not require this check at all. :)

I hope to share more soon. It is a lot more complicated to get my head around than I first thought, but so far, a "power selection" GUI presents itself to the player if they want to make an item a minimum level and limits the choices to the amount of gold carried to the cost and a minimum and maximum level according to minimum spell requirements and the PCs maximum spell casting level. I also have to take into account if they are using an item to create another item (some combinations work, like some wands to make some potions).

I think its looking good though. :)


Frank Perez said...

I like the attention to detail that you're giving to the cost of producing magic items. I actually haven't been giving it much thought, but you're absolutely right. Holy water should be more expensive than the materials that go into it. Otherwise, no one would bother trying to produce holy water.

Good thinking there. :)

Lance Botelle (Bard of Althéa) said...

Hi Frank,

Exactly .. The problem is, I have opened up a can of worms with this and am having to edit a number of iprp 2da files to get to my own liking. I hope to give more details in my next blog post. :)


Sunjammer said...

It appears from your table that the the Cost and Actual GP Cost figures for 30% and 70% have been swapped, i.e. 30% of weight should cost 700gp while 70% of weight should cost 300gp.

Lance Botelle (Bard of Althéa) said...

Hi Sunjammer,

Good to see you on the blog! :)

Yes, that was the conclusion I came to. I think it must have occurred when they added some extra values. I think most of the "anomolies" I have found come from expansions. The iprp_spells seems to have more "disputable" issues than most regarding spell costs. However, as you are proabably aware by now, I am editing most references to costs in these files now, so hopefully I will automatically pick up and correct any other errors.

Keep in touch. :)


McGnome said...

Yeah, the costs are always a pain. We always ran out of time and could never get to the point where we could adjust them.

One thing to keep in mind is that when you have encounters often, your supply of gold will be higher than if it were a PnP game. Even if you cut rewards drastically, given the higher rate of encounters in a cRPG, your supply will be higher. Which usually means costs should be higher.

Lance Botelle (Bard of Althéa) said...

Hi McGnome,

Good to have you aboard. :)

Rewards for encounters is something I am looking into. At the moment, I am not sure just how much (if any) gold will be on a basic encounter. I don't mind a find in a lair, but may keep "wandering" hauls to a minimum. Maybe have a few dozen coins on a creature encounter at most ... more if they locate a lair perhaps.

At worse, even if there are more encounters due to it being a CRPG, I will probably keep the treasures to a minimum ... or different in some way. (Like recovering essences and/or creature objects, which can then be sold or used in crafting.)

Your point is well made though.