There is value in designing generic systems that are basically highly flexible. The merits of such systems is that their attributes are sufficiently generic so that they may be reused in different forms without requiring a complete redevelopment of the system every time something is changed. In short, it saves a lot of unnecessary busywork.
An example of a generic system is seen in how someone would make...say...a fireball spell and magic missile spell. A generic system can generate both the fireball and magic missile's effects without requiring excessive external development. In short, one will not be coding the two spells independently.
To achieve the development of a truly generic system, commonalities must be distilled from the forseeable requirements. A magic missile spell deals direct damage from homing projectiles while a fireball deals AOE damage from dumb projectiles. A possible generic system would have variables like damage, speed of projectile, area of effect and a boolean value for homing. Therefore, a fireball may have attributes like AOE: 50, damage: 20, speed: 40, homing = true while a magic missile may have AOE:0, damage: 30, speed: 50, homing = false.
The balancing factor here, however, is whether creating the generic system will indeed save more effort than it takes to do everything in a one-off manner. Yet, it is generally a good idea to go generic even if the obvious gains are marginal, simply because one can never forsee whether the easily created variants are going to come in handy just beyond the forseeable future.
Sunday, November 14, 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment