Hey, just poking my head above water to look around at things again
Anyways, I had a thought about the lovely dynamic symbol table code that AFK uses. Currently, it just uses this to avoid having to keep a hard-coded table of function pointers hanging around, but I remember a project from the Dawn of the Internet ™ that did one better.
Back in 1991 or thereabouts, there was a very cool game that I used to play on the Sun 3 workstations called XTank. It was a multiplayer top-down tank game where you could design your own maps, vehicles, weapons... and even AI code for robot players. I remember it came with a "gnat" player which was easy to beat... unless you loaded up several of them. If more than one were loaded, they'd cooperate and act as a team and were very devastating.
One other thing I remember about this code was that it used dynamic linking to allow you to re-compile and add new AI code while the game was running. Basically, instead of the usual static linking that merges all the object files into one executable, this code used the dlsym functions to pull in individual object files at run-time.
It occurs to me that this would be possible here as well, provided that all calls to spells/skills/commands go through the appropriate lookup function rather than calling them directly. My question is, how many places do you think calls to dlsym'd functions actually exist?
The functionality of this is slightly diminished with copyover code... but it might still be interesting if used for more than just bug fixing. One example I can think of might be to load different versions of the look command based on time of day, rather than putting all the logic into one big function.
Anyways, just stumbled upon the xtank game again, so it got me thinking.