Page 8 of 10

Posted: Tue Apr 05, 2005 1:02 pm
by Aaron
ok, here we go with more double posts, but my new table format in xml.

<formula iten_name_base="[item_type] of [modifier]">
<skill>alchemy</skill>
<container>cauldron</container>
<recipe>
<object arch="philosical" number=7>
<alt object arch="liquid" number=7 />
</object>
</recipe>
</formula>

have to run to next class, but this should be self explanatory...

iten name base, with an alternate modifier. you could but Phil [item_type] or [item_type] of [attack_type] but that will need a lot of arch editing...

container and skill needed are pretty self explanatory

recipie is a list of objects, with (relevant) arch type and number. arch could be [weapon] or [dagger] or [philosical item]. object contains alt object, which could replace it. g2g bye

Posted: Tue Apr 05, 2005 1:22 pm
by Rednaxela
OK. The XML is nice for readibility, but one issue crossfire will then need to either impliment it's own XML parser, or bring in more dependencies.
Casper wrote:Of course you will need to re-write the archetypes and make them more heriarchial. Perhaps make them xml-based too.
Ouch, that would either take a lot of manual work, or still take a fairly significant amount of work creating a converter for... not to mention drastic changes to code all over the (both to the server, and the map editors)

Posted: Tue Apr 05, 2005 2:12 pm
by cavesomething
Rednaxela wrote:OK. The XML is nice for readibility
I feel compelled to disagree here.

XML is nice for parsing by multiple unknown parsers, it gives a standard way of telling them what the fields mean. This makes it a reasonable choice for a web page or a heavily formatted document. (such as OOo uses).

It loses this advantage when there is only one parser (as is the case with the cf server).

However XML is pretty poor as far as human readability goes. Yes it might be 'human-readable' but so is postscript, for some value of human. XML is (to human eyes) an ugly mess of arrow brackets and terms which are abstract and non-obvious.

The advantage that XML posseses in readability is only when compared to binary formats, binary formats are not relevant here.

Don't think that just because XML is a buzzword that it is any good, nor that it is suitable for the purpose of defining recipes.

Posted: Tue Apr 05, 2005 2:51 pm
by Mith
cavesomething wrote:Don't think that just because XML is a buzzword that it is any good, nor that it is suitable for the purpose of defining recipes.
agreed, XML is hard to read, but it is a nice way to structure data (note: it is one of the many nice ways to structure data)

i would prefer XML above something like
water;the wise;alchemy;cauldron;7 water
oil;philosophical;alchemy;cauldron;7 oil

but i think the formulae file in it's current form fits our needs, maybe a begin and end tag are useful, just like map files use, but that's it.

all these redundant XML tags increase the risk of breaking things (typo's anyone?)

Posted: Tue Apr 05, 2005 8:41 pm
by Aaron
i dont use xml because its a buzzword?. i like it, and can easily read xml and html. and there were tabs, but the damn system killed them. ok, ill do a xml like format that increases readability, and quickness. it will be similar to the old format, but use my formats lables.

Code: Select all

<begin>
   arch="Philosical [salt]"
   container="cauldron"
   skill="alchemy"
   recipie="7 [salt]s"
<end>
that would make a philosical salt out of 7 of any salts. what is cinnabar? is that a salt? should i do one for mercury? and heres some code that should make a rod with thurmatulrgy(sp)

Code: Select all

<begin>
   arch="Rod of [spell]"
   container="thurmatologist's workbench(sp)"
   skill="thurmaturgy(sp)"
   recipie="100 scrolls of [spell], 100 platinum coins, 1 glowing crystal"
<end>
if the code is added for that, it should dynamicly decide how many levels to make to add, and make a rod of spell with one level per 100 scrolls. so when this system get finished, it might solve the whole rod making problem. of course, it would also require 100 plat per level, and 1 crystal per level... :twisted:

Code: Select all

<begin>
   arch="[staff, wand] of [spell]"
   container="carpenters bench"
   skill="thurmaturlgy"
   recipie="[100, 10] scrolls of [spell], [10,1] [wood], 1 glowing crystal"
<end>
i know this isnt a recipie yet, just using it to demonstrate a point.

should make a staff of whatever spell its enchanted with, determined by the 100 scrolls, the lowest level scroll determining the overall level of the staff. 10 wood could be chairs, tables, beds, clubs, or whatever. instead of 5 different recipies for every different wod product found in the game, tou get one nice one. if all 100 scrolls arent the same match, an object one class lower should be created ex:start staff, end wand, and the excess material used up. if that doesnt work, then a failure is called, and the appropriate punishment is decided.

the trickey part is how to tell it i want a staff or wand. the output depends on the input, which could be 100 or 10 scrolls for a staff or wand, respectively. also the wood will limit it. but i need some ideas of how to put that in. should i just declare the max, and have the code make upthe rest? if i declare all of them, it could get very long for enchanting swords-club-dagger-1 handed sword-2 handed, etc.

heres a better example:

Code: Select all

<begin>
   arch="[weapon] of [enchantment]"
   container="forge"
   skill="smithery"
   recipie="1 [weapon], 1 [body part], 1 [potion]"
<end>
this should make a weapon based of what was put in, but of course if you put in enough dagger, you might end up with a sword :-). the one body part is probably depending on the the weight or the amount the part is enchanted. in the old code, it was about 1 dragon steak, 3 zans wings, 2? electroplasms. the one potion will also determine the attacktype. if none, you would need a water of the wise or phil oil. wine would probably work if you were making a sword of confusion, or adding statpotions would increase your stats. the attacktype will be taken from the potion (think sunfire) or the body parts resistance (zombie=cold). the code should dynamicly decide on the suffix, which in this case could be a sword of cold +2 (assuming a couple swords were used), a broad sword of cold (assuming enough swords were used to make a larger sword, a sword of (confusion or cold) assuming wine and a zombies corpes was used, or a sword of strenght +3 (str +1) if a potion of strenght was used.

the varying ingredients works better in this example than it did in the staff example. long post, sorry, got rambling, hope it keeps you busy.

Posted: Wed Apr 06, 2005 12:25 am
by Rednaxela
Nice format now :-) (however the brackets on the begin and end are somewhat redundent)

About the rods, I think that 1 glowing crystal per level is too extreme (though that pattern is ok for the other ingredients, though I suggest you look into some of the formulas and such mentioned on the rod crafting topic), I think a better formula for the number of crystals would be (x^2)/110 always rounding up to at least 1 where x is the level, but I don't know how that could be shown in this formula format. That formula would still be 110 crystals for lvl 110, and would still be 1 at 1, but a lvl 50 rod would be a still very large, but reasonabl 23 crystals.

Also, the mana capacity of the rod should depend on the avgrage capacity of the crystals used in the rod, or something along those lines anyways.

Posted: Wed Apr 06, 2005 1:22 am
by Aaron
i know, i was demonstrating problems with my forumla, and i contributed alot to it. but how much of the guessing and assighning item values should be left up to the code, and how much should the developer have to specify?

Posted: Thu Apr 07, 2005 10:58 pm
by Aaron
i think the begin and end brackets where on purpose... someone suggested that i add them for legibility. the code should skip them, but the user will find it easier instead of relying on comments about every recipie... well now that i have a mostly OKed format, i will procede to rewrite the table. anyone who know's C want to help? im learning, but i dont feel up to writing an AI...

Posted: Fri Apr 08, 2005 12:03 am
by Aaron
heres my attempt at the dynamic table... as i write it, ill list the problems i come across...

potions: how to say i want a potion of [elemental protection] in the name
potions: why the hell do potions have spell effects? cant people just cast spells or use scrolls? making these work will be the hardest...
potions: elemental attacktypes will be the easiest to make. the whole system seems to be built for them and weapons... i might just make exceptions for odd items.
arrows: seems like this will use the dragonling eating code. instead of giving resistances though, it gives attacktypes

random thought: looks like this will be going on for a while. i might have to wait untill i get home to get this uploaded, so ill edit in a link. this is really damn big. looks like something to do during math class...

Posted: Fri Apr 08, 2005 8:13 pm
by Casper
Aaron wrote:potions: how to say i want a potion of [elemental protection] in the name
I don't quite understand this question.
Aaron wrote:potions: why the hell do potions have spell effects? cant people just cast spells or use scrolls? making these work will be the hardest...
No, an alchemist will use potions.
Aaron wrote:random thought: looks like this will be going on for a while. i might have to wait untill i get home to get this uploaded, so ill edit in a link. this is really damn big. looks like something to do during math class...
Yes, this is a largish project you undertook.

Also in your formulae file you need a way to specify how many of what make roughly how many of somehting else.
eg. how many arrows in an arrow +1?
How many daggers in a sword?
What about a 2h sword?
Will a dagger and a 1h sword get a 2h sword?
Could I melt two helmets together into a chainmail or into a helmet +1?
If I throw in some diamonds in will they become stronger?
What if I want to make a diamond dagger, and throw in 10000 diamonds and a dagger?