Just A Little

Small change in numbers: We’re now at 17,270 errors.

One of the problems I have to solve is to find a clean way to create global references to specific spells and skills without them actually being globals (which are ugly and disgusting and a horrible thing to put in code).

For example, in C, we used something like skill_bash which was just an integer referring to the skill number for bash. At runtime, when all the skills were initialized, the value of skill_bash would be set. It didn’t really matter what order skills were created in, because skill_bash would always point to the bash skill, whether it be number 35 or 350. The problem with this method is that is uses a global variable. It’s something that can be done in C#, but what, really, is the point of having a value containing the bash skill if you someday decide to take the bash skill out of the game. Then you have a bunch of useless code lying around doing nothing.

Not that bash will be removed from the game — this is something more likely to be an issue with spells.

I’ll have to look into reflection, delegates, etc. to see if there is some sort of common-sense way to handle this. I also have to keep in mind that someday I may want to convert the skill and spell tables to files that load at runtime and can be tweaked and adjusted without recompiling the entire codebase.

Since skills are so heavily involved in the game engine, it will be nearly impossible to decouple them completely.

1 thought on “Just A Little

Comments are closed.