Posted by
| David Haley
USA (3,881 posts) bio
|
Message
| There's a complicated design question here, namely who is responsible for constraints on interaction. You can have per-object constraints, so that object X defines how it interacts with objects of type t1, t2, etc. But then if you add a new object, you have to go to all previous objects (that need to be aware of it) and add the constraints.
You also need to consider whether constraints are negative or positive; this can dramatically affect how many things you need to change.
Consider a shield that says something like:
(1) "I protect against all forms of damage except fire"
now consider a shield that says:
(2) "I protect against cold, poison, crushing, piercing, lightning, etc." (i.e., the list of damages except for fire)
If you add a new form of damage (acid, or whatever) then shield 1 requires no change, but shield 2 does require a change. Shield 1 expressed its constraint as a negative (I protect against everything but not fire) whereas shield 2 expressed it as a positive (I protect against x, y, z).
Of course, option 1 can have its issues too, in that something might have made sense back when you created the object but later on doesn't. Let's say you create a new damage type (radioactive blast) that isn't fire but really is similar to it for the purposes of damage protection. You now have to go back and find those constraints and fix them.
Note that per-object constraints can be easily extended to per-type constraints, which reduces the amount of work necessary as you can change a type rather than all instances of the type. You still end up with a potentially large web of interactions.
The problem here results from new kinds of interaction being added, not new things of existing interaction being added. If you can add a Colt 45 and model it as, essentially, a bow an arrow that shoots a really fast arrow made of metal, then as long as you can handle bows already it should be ok. As long as something uses existing interactions, you don't have to go change the rules of interaction. But clearly, if you add a whole new kind of interaction (like a lightsaber in a world of swords) you will have to go make other things aware of how this new thing affects them. |
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
http://david.the-haleys.org | top |
|