implementing spells
Some people would spend no more than 10 minutes to bring up a public repository, but I’m taking my time. I am a long-time darcs user for my personal projects and don’t know git. A public repo today should be a git repo, today’s standard, not a version system with beautiful theory and ugly popularity. I want to get up to speed.
On the side, I’m thinking about the large number of skills that bots want to know and I’m trying to figure out how to fit them into the smallest amount of code. I noticed that a lot of spells share similar structures and should share code.
All the spells I list below can share backbone code which is at least partially data driven. I’m imagining something like this for each spellcasting unit:
- Does it have the energy and tech to cast?
- Is some suitable target nearby?
- Find the best target, taking into account the whole situation including any maneuvering needed to get into position first.
- If the best target is not good enough, no spellcasting action. Carry on as usual.
- If we’re too far away, move toward the position.
- We’re in position. Cast.
Each spell would need its own evaluator code “how good is this potential target?” It looks to me as though everything else that differs between them can be kept in a table of data and the rest of the code can be shared. Unless I get a better idea, I expect I’ll implement this eventually and suddenly support a large number of spells.
All of the spells below, but I’m thinking especially of hallucinate and dark swarm, benefit strongly from tactical coordination. That can be made to fit the framework. The tactics boss could decree things like “broodling if it’s an emergency, otherwise hold on until we can make a coordinated attack” simply by adjusting the “it’s good enough” threshold value. But even uncoordinated spells, which is all that most bots ever implement, would be fun and would pose problems to the opponent.
Consume and recall may fit a little awkwardly into the framework. They both depend on prepared units standing ready. But even they seem doable.
target is a unit
- optical flare
- restoration
- defensive matrix
- irradiate
- lockdown
- yamato cannon
- hallucinate
- feedback
- mind control
- parasite
- broodling
- consume
target is an area
- EMP
- nuke
- psionic storm
- maelstrom
- disruption web
- stasis
- recall
- ensnare
- dark swarm
- plague
Comments