Are you, in fact, a pregnant lady who lives in the apartment next door to Superdeath's parents? - Commodore

Create an account  

 
Mindy - Engine

This thread is intended to discuss efforts to integrate an AI engine into an external AI program.
Rather than writing a new engine from scratch, it seems better to investigate existing engines that we may incorporate.

Anthony suggested Wesnoth, which he said has a pretty decent AI engine.
White mage suggested C-Evo, which is also an existing open source AI engine.

Thoughts?
--I like ILSe
Reply

I suspect both are optimized for the details of what they're programmed in to. c-evo is probably a good choice as a strategic AI, since mom strategy shouldn't be that different from civ strategy (other than spellcasting...), but I don't know if it includes a tactical AI at all, civ doesn't really have a tactical map. wesnoth is mostly a tactical AI, and may be too dependent on the specific assumptions of that game's units.
Reply

Anthony Wrote:I suspect both are optimized for the details of what they're programmed in to. c-evo is probably a good choice as a strategic AI, since mom strategy shouldn't be that different from civ strategy (other than spellcasting...), but I don't know if it includes a tactical AI at all, civ doesn't really have a tactical map. wesnoth is mostly a tactical AI, and may be too dependent on the specific assumptions of that game's units.

I have downloaded C-Evo to see what's in it and how it allows you to define an AI.
It shows that C-Evo has a programmer's interface in pascal for the AI.
Btw, they also have a C++ programmer's interface.

Here's a part of their AI that shows how one should write or extend it.

Main function of the C-Evo plug-in AI module.
Code:
procedure TAI.DoTurn;
var
uix: integer;
begin
// correct tax rate if necessary
if RO.Money>RO.nCity*16 then
  ChangeRates(RO.TaxRate-10,0)
else if RO.Money<RO.nCity*8 then
  ChangeRates(RO.TaxRate+10,0);

// better government form available?
if RO.Government<>gAnarchy then
  if IsResearched(adTheRepublic) then
    begin
    if RO.Government<>gRepublic then
      Revolution
    end
  else if IsResearched(adMonarchy) then
    begin
    if RO.Government<>gMonarchy then
      Revolution
    end;

// do combat
for uix:=0 to RO.nUn-1 do
  if (MyUnit[uix].Loc>=0)
    and not (MyModel[MyUnit[uix].mix].Kind in [mkSettler,mkSlaves]) then
    ProcessUnit(uix,Roam);

ProcessSettlers;

// do discover/patrol

OptimizeCityTiles;
SetCityProduction;
end;

So they have defined a set of functions that an AI developer can use.
This set of functions is oriented to strategic AI, although the concept can also be used for tactical combat.
--I like ILSe
Reply

IMHO understanding a code (unless very well detailed and described) took the same time that you need to rewrite it.
Even if we understand it, it may not work for us, or it needs to use ingame powers MoM do not have or we miss MoM ingame powers they do not handle.

My best guess is to use the knowledge of MoM we (I mean of you) have to improve the details we do not like (like breaking a wall).

However, since my contribution to understanding other AI is negligible, feel free to continue on this path, too. thumbsup
Only the people crazy enough to think they can change the world of Arcanus and Myrror can do it. rolleye
Reply

The challenge I see is to find a language that other people will be comfortable with to program AI rules.

Seeing what C-Evo and Wesnoth offer and in particular what they don't offer, I just had a new idea.

We could create an engine in C++ that allows a higher level language to interact directly and indirectly with MoM.
We could define a language interface for any language to do just that.
I'm just wondering... what language would AI people be comfortable with?
Python? Java? Perl? C#? A custom language? Or yet another?

Anyone?
--I like ILSe
Reply

Yes! Allowing AI to be programmed in multiple languages is my strong preference. I recommend Python and Java for a start.
Reply

Okay, I've created a python interface to MoM.
It features that you can:
  1. connect to MoM,
  2. read data, for instance gold or mana,
  3. write data back to MoM.


You can find it here: MoMProcess-python-Windows.zip.

To run it you need Python, which you can download here:
http://www.python.org/ftp/python/3.2.3/python-3.2.3.msi

To run the example it's easiest to start a command prompt and type:
C> C:\python32\python example_momprocess.py

Btw, the example will do a lot more if you have MoM running in the background! smile
--I like ILSe
Reply

I afraid,it will not work on my win7 os.
Reply

Asfex Wrote:I afraid,it will not work on my win7 os.

It works on my win7 os.
What does not work for you?
--I like ILSe
Reply

Mom tweaker write 'could not find mom window'.
I afraid there is the same engine.
Reply



Forum Jump: