AI:HughAI: Difference between revisions

From Spring
Jump to navigationJump to search
Hoijui (talk | contribs)
mNo edit summary
→To install: added link to github repo
 
(12 intermediate revisions by 3 users not shown)
Line 1: Line 1:
== What is HughAI ==
== What is HughAI ==


HughAI is a Java port of CSAI2, which was a partially refactored version of [[AI:CSAI]], a fast rush AI, written in C#, by Hugh Perkins.
HughAI is a an AI written in Java.  Works quite well at fast rush attacks.


== To install ==
== To install ==
Line 13: Line 13:
1. Download HughAI from:
1. Download HughAI from:


http://manageddreams.com/hughai/HughAI.2009sep09.tar.bz2
sorry, no up to date link. github repo here: https://github.com/hughperkins/HughAI


2. untar (using Winzip or your favorite zip utility) into AI/Skirmish, so you should have the following directory structure:
2. Remove any old AI/Skirmish/HughAI directory
 
3. untar (using Winzip or your favorite zip utility) into AI/Skirmish, so you should have the following directory structure:


  AI/
  AI/
Line 24: Line 26:
         ... other files ...
         ... other files ...


3. Run springlobby, create a single-player game, and do "add-bot"
4. Run springlobby, create a single-player game, and do "add-bot"


Note that the AI needs to be playing as Arm, and on Balanced Annihilation. On anything else, it will probably just sit there and do nothing :-D
Note that the AI needs to be playing as Arm, and on Balanced Annihilation. On anything else, it will probably just sit there and do nothing :-D
Line 32: Line 34:
== Mods and maps ==
== Mods and maps ==


It only really works with Balanced Annihilation, unless you start to tweak the config files.
Works with BA mod, with the AI running as ARM.


== Play-style ==
== Play-style ==
Line 40: Line 42:
Otherwise, its playstyle is essentially to rush.  If it doesn't beat you within a few minutes, it's basically not going to do very much else just yet ;-)  Maybe in the future though ;-)
Otherwise, its playstyle is essentially to rush.  If it doesn't beat you within a few minutes, it's basically not going to do very much else just yet ;-)  Maybe in the future though ;-)


== Can it beat other AIs? ==
== Cheating / maphack ==
 
In the gui, in the 'config' tab, click 'maphack' then 'apply' or 'save' to enable maphack.
 
Unclick it, and then 'apply' or 'save' to disable it.
 
== To disable gui ==
 
Either:


Yes ;-)  Replay against E323:
- run spring in windowed mode, in the gui, in the config tab, unclick 'guiactivated' and then click 'save', or
- in the config file BA_2.xml, change guiactivated from 'yes' to 'no'.


http://manageddreams.com/hughaireplays/HughAIbeatsE323.tar.bz2
== Can it beat other AIs? ==


Of course, it's all a bit fragile, and there's a lot of luck involved, so I'm sure it's pretty easy to make a replay of E323 being the winning AI :-D
Yes ;-)  it beats E323 v2.12.0 sometimes.


== Configuration ==
== Configuration ==
Line 52: Line 63:
There is a gui with a tab 'Config' that can be used to configure many things.
There is a gui with a tab 'Config' that can be used to configure many things.


A few extra things are configurable in the config file 'BA_2.xml' , in the AI's directory.
A few extra things are configurable in the config file 'BA_<side>.xml' , in the AI's directory, where side is core or arm.


There are also a number of workflow xml files in the BA_workflows subdirectory.  Currently, only one of the workflows are used, so there's no point in adding more than one for now ;-)  In the future, it might simply randomly select from one, at random, so a human enemy doesn't know if the AI will tech or rush or whatever.  Sounds reasonable?
There are also a number of workflow xml files in the BA_<side>workflows subdirectory.  Currently, only one of the workflows are used, so there's no point in adding more than one for now ;-)  In the future, it might simply randomly select from one, at random, so a human enemy doesn't know if the AI will tech or rush or whatever.  Sounds reasonable?


The workflow config files define what will get built essentially, with a priority, a unitname, and a quantity.
The workflow config files define what will get built essentially, with a priority, a unitname, and a quantity.
Line 68: Line 79:
== Console ==
== Console ==


For techies, there's a console, where you can directly write Java code:
For techies, there's a console, where you can directly write Java code.
 
[Media:http://manageddreams.com/hughai/ConsoleInAction2.png]


== Soure-code ==
== Soure-code ==
Line 76: Line 85:
The sources are available from the following git repository:
The sources are available from the following git repository:


git://github.com/hughperkins/HughAI.git
https://github.com/spring/HughAI
http://github.com/hughperkins/HughAI/tree/master


More details on the architecture can be found in the file src-ai/architecture.txt, in the sources, which I try to keep somewhat up-to-date, but really, if you have any questions, just ask me ;-)
More details on the architecture can be found in the file src-ai/architecture.txt, in the sources, which I try to keep somewhat up-to-date, but really, if you have any questions, just ask me ;-)
[[Category:AI]]

Latest revision as of 12:28, 17 April 2025

What is HughAI

HughAI is a an AI written in Java. Works quite well at fast rush attacks.

To install

To install

Make sure you have hoijui's Java Interface v0.1 installed. I believe this is installed automatically if you have Windows. Other platforms may have varying mileage.

Once you have Java Interface 0.1 installed ok:

1. Download HughAI from:

sorry, no up to date link. github repo here: https://github.com/hughperkins/HughAI

2. Remove any old AI/Skirmish/HughAI directory

3. untar (using Winzip or your favorite zip utility) into AI/Skirmish, so you should have the following directory structure:

AI/
  Skirmish/
    HughAI/
      0.1/
        SkirmishAI.jar
        ... other files ...

4. Run springlobby, create a single-player game, and do "add-bot"

Note that the AI needs to be playing as Arm, and on Balanced Annihilation. On anything else, it will probably just sit there and do nothing :-D

It's fairly early days yet, so don't expect too much just yet ;-) I'll update this message as it gets better.

Mods and maps

Works with BA mod, with the AI running as ARM.

Play-style

It's a non-cheating AI by day ... but if you go to the 'Config' tab on the gui and tick the box next to 'maphack' and then click 'apply' or 'save' ... it will become a cheating maphack AI!

Otherwise, its playstyle is essentially to rush. If it doesn't beat you within a few minutes, it's basically not going to do very much else just yet ;-) Maybe in the future though ;-)

Cheating / maphack

In the gui, in the 'config' tab, click 'maphack' then 'apply' or 'save' to enable maphack.

Unclick it, and then 'apply' or 'save' to disable it.

To disable gui

Either:

- run spring in windowed mode, in the gui, in the config tab, unclick 'guiactivated' and then click 'save', or - in the config file BA_2.xml, change guiactivated from 'yes' to 'no'.

Can it beat other AIs?

Yes ;-) it beats E323 v2.12.0 sometimes.

Configuration

There is a gui with a tab 'Config' that can be used to configure many things.

A few extra things are configurable in the config file 'BA_<side>.xml' , in the AI's directory, where side is core or arm.

There are also a number of workflow xml files in the BA_<side>workflows subdirectory. Currently, only one of the workflows are used, so there's no point in adding more than one for now ;-) In the future, it might simply randomly select from one, at random, so a human enemy doesn't know if the AI will tech or rush or whatever. Sounds reasonable?

The workflow config files define what will get built essentially, with a priority, a unitname, and a quantity.

The higher the priority, the earlier the units will be built.

You can add in the same unit on multiple lines, with different priorities, so you can say: ok, first build a couple of stumpies, then a jeffy, then some more stumpies, or whatever.

Limitations /ways to beat it

Survive the initial rush, and it will probably not do too much else.

Console

For techies, there's a console, where you can directly write Java code.

Soure-code

The sources are available from the following git repository:

https://github.com/spring/HughAI

More details on the architecture can be found in the file src-ai/architecture.txt, in the sources, which I try to keep somewhat up-to-date, but really, if you have any questions, just ask me ;-)