prototype SK-creating algorithm
Hello!
I've developed a program with prototype algorithm for SK-creating.
It is written with Borland Delphi 7, and use databade technologies (ms access 2003). I think installed BDE (borland database engine (installs automatically with delphi 7 or may be downloaded independently for free)) is required to run this program.
The algorithm searches for all combinations of equipping given chasises with given items, then searches for a spell-sequence that would make combatant satisfy the requirements. It is possible to upgrade the algorithm for searching all spell-sequences for each item combination.
The checking of combatant satisfaction is made in CheckCombatantSatisfactory and RecursSpellSeqStch procedures (they can be inspected even with notepad in ucombatantcreation.pas file). The important things about the checkings - they can be easily modified (and should be, because I didn't spent any time long to think, for example, about how to change 'general attack' or 'general damage' parameters of SK if he has soul vortex and so on); the checking may be replaced with "battles" of planned SK with some forces.
The database is filled with a minimal amount of data, including units, items and spells. That data can be copied from other sources, which I don't currently have.
The program has some currently unused code (I cutted functionality when I saw that I spent more time then I planned).
The algorithm is time-consuming. It can be made more quick, but it would require work, and it still won't work fast.
The algorithm, being modified and upgraded, can be used to make calculations and store data in database on thug creation for each mod, so that AI could create thugs without time-spending during thew game, by the cost of some disk spase. For that, battle-simulation algorithm should be added. How it can work:
- database should store units type and numbers for PD (10 and 20, for example) of each nation of the mod
- all recruitable and summonable commanders of current nation should be taken as possible chasises
- all forgeable items (by recruitable/summonable commanders) should be taken as existing items
- algorithm should automatically calculate possible thugs that can crush PD of different nations
- technology and cost requirements for each thug should be calculated and stored in different cross-tables of mod database.
Then, during runtime, AI would be able to simply look in database for thugs which he can create at cuyrrent research level.
Also, AI that calculate PD-breaking thugs can be extended - for example it can use a part of AI that hires army. By the same methods, it's not hard to imagine an algorithm that would calculate SC's for destroying, for example, 4000 gold and 4000 resourses costed army of each nation (it would need to use an AI algorithms that recruite armies and assign orders to mages, in order to see which army SK should be able to crush).
Well, that work was made to show that advancements in AI are quite possible.
One of the ways to get more sofisticated AI - open savedgame file formats (ftherlnd, .trn, .2h) to community. Then it would be possible to make independent AI programs for making 2h files, then run multiplayer games and then use that programs for computer players.
P.S. I didn't test bdesetup, because I don't know how to uninstull already installed BDE without uninstalling Delphi 7.
|