User Tools

Site Tools


dev_todo:artifacts_treasurelists

The basic idea of this is to make remove a lot of the hardcoding from the server:

Add template objects - objects that don't appear by themselves, but instead modify the object they are applied to.

That is to say, you make up objects of type 'template'. The values and what not would work similar to how the artifacts file.

However, instead of hard coded chances of artifacts in the treasures.c, instead use these templates in treasurelists.

Thus, you could have a treasurelist like:

treasureone template_helms
   arch template_xebinon
     chance ..
   more
   arch template_blindness
      chance ..
   more
...

Then the helms themselves would have a 'randomitems template_helms'

The advantages of this:

  • Basically all fields in the template (artifact) could now be set in the object, were as right now some of the fields in the artifact file are used for matching.
  • Better control of how often artifacts show up (now in treasurelist instead of hard coded into treasure.c). Could also easily disable double artifact items (eg, strange ring of wizardry) (not that those are really a problem, but just the ability to disable that could be nice)
  • Ability to apply more than one template to an object. Eg, you could have templates for the special abilities, like now, and different template for materials. Then, you could have something like:
randomitems helm
  list helm_special_abilities
     chance 5    # 5% of helms are special
  more
  list armor_material_change
     chance 25    # 25% of helms are not made of the normal material
  more
  arch cursed
     chance 3    # 3% of helms are cursed
   end
end
  • Given that the templates would be archetypes, I could certainly see the java editor better able to handle this (eg, you select the template, and then an object, and hit the 'apply template to object' button or the like)

The biggest disadvantage of this is a bunch of new treasurelists would be needed. I have thought that the treasure list code could be extended also.

However, my thought on that are a bit more modest:

  • Add min_nrof and min_magic fields (eg, if nrof is 20 right now, 1-20 objects are created. It would be better to do something like
min_nrof 10
max_nrof 20

To say to generate 10-20 of those objects.

Likewise, min_magic could be used to say 'make this object at least min_magic'. Thus, treasurelists could be used to make the magic bonus of the weapons and whatnot.

  • Add a min and max difficulty for each entry. Thus, instead of using list transitions to make sure too god objects aren't created, this could be done in just one list. For an object to be created, in must be between min and max difficulty, based on the difficulty of the map (max difficulty is there so you could make it so junk items don't appear on high level maps. Also add a diff_factor to increase chances:
    randomitem helm
        ...
        arch damned
            min_diff 30
            chance 5
            diff_factor 2

So at level 37, chance is not 19 (37 - 30) * 2 + 5 = 19%

The treasurelist stuff would actually be relatively easy to do - at least point #1 would not cause nay problems with existing treasure lists (just new fields really).

It may be desirable to disallow combinations, but not sure if extra logic should be added to the treasurelists for that - I'd almost be inclined to have multiple treasurelists - the treasure code really dictates what is generated, not what is not generated.

dev_todo/artifacts_treasurelists.txt · Last modified: 2006/09/18 02:27 (external edit)