CSAI vs AAI 0.75
Moderators: hoijui, Moderators
- hughperkins
- AI Developer
- Posts: 836
- Joined: 17 Oct 2006, 04:14
CSAI vs AAI 0.75
Tried a single match of CSAI vs AAI 0.75 on Small Divide, AA2.23
To my surprise CSAI won! Ok I got lucky, but it shows potential.
Here's the replay: http://manageddreams.com/csai/061023-Sm ... vs-aai.sdf
CSAI is in red at topleft
AAI is in blue at bottomright
Want to try for yourself? Get it here: [snipped, please see http://taspring.clan-sy.com/wiki/AI:CSAI for download link]
CSAI is written in C#, using an event-based publisher/subscriber architecture, so it's pretty easy to modify.
To my surprise CSAI won! Ok I got lucky, but it shows potential.
Here's the replay: http://manageddreams.com/csai/061023-Sm ... vs-aai.sdf
CSAI is in red at topleft
AAI is in blue at bottomright
Want to try for yourself? Get it here: [snipped, please see http://taspring.clan-sy.com/wiki/AI:CSAI for download link]
CSAI is written in C#, using an event-based publisher/subscriber architecture, so it's pretty easy to modify.
Last edited by hughperkins on 24 Oct 2006, 22:38, edited 1 time in total.
- hughperkins
- AI Developer
- Posts: 836
- Joined: 17 Oct 2006, 04:14
New version of CSAI:
*commander no longer blocks himself in
*factory entrances no longer blocked
*scouts created
4 matches CSAI vs AAI 0.75 on Small Divide, AA2.23:
http://manageddreams.com/csai/061023-Sm ... 3b1-20.sdf (win)
http://manageddreams.com/csai/061023-Sm ... 3b1-21.sdf (win)
http://manageddreams.com/csai/061023-Sm ... 3b1-22.sdf (lose)
http://manageddreams.com/csai/061023-Sm ... 3b1-23.sdf (win)
2 matches CSAI vs AAI 0.75 on Comet Catcher Remake v02, AA2.23
[http://manageddreams.com/csai/061023-Comet Catcher Remake-v02-0.73b1.sdf] (stalemate)
[http://manageddreams.com/csai/061023-Comet Catcher Remake-v02-0.73b1-0.sdf] (win)
CSAI plays ok as ARM on landmaps running AA2.23.
Latest CSharpAI download: [snipped, please see http://taspring.clan-sy.com/wiki/AI:CSAI for download link]
Documentation moved to wiki:
*CSAI itself: http://taspring.clan-sy.com/wiki/AI:CSAI
*Global AI C# interface: http://taspring.clan-sy.com/wiki/AI:CSAIInterface
*commander no longer blocks himself in
*factory entrances no longer blocked
*scouts created
4 matches CSAI vs AAI 0.75 on Small Divide, AA2.23:
http://manageddreams.com/csai/061023-Sm ... 3b1-20.sdf (win)
http://manageddreams.com/csai/061023-Sm ... 3b1-21.sdf (win)
http://manageddreams.com/csai/061023-Sm ... 3b1-22.sdf (lose)
http://manageddreams.com/csai/061023-Sm ... 3b1-23.sdf (win)
2 matches CSAI vs AAI 0.75 on Comet Catcher Remake v02, AA2.23
[http://manageddreams.com/csai/061023-Comet Catcher Remake-v02-0.73b1.sdf] (stalemate)
[http://manageddreams.com/csai/061023-Comet Catcher Remake-v02-0.73b1-0.sdf] (win)
CSAI plays ok as ARM on landmaps running AA2.23.
Latest CSharpAI download: [snipped, please see http://taspring.clan-sy.com/wiki/AI:CSAI for download link]
Documentation moved to wiki:
*CSAI itself: http://taspring.clan-sy.com/wiki/AI:CSAI
*Global AI C# interface: http://taspring.clan-sy.com/wiki/AI:CSAIInterface
Last edited by hughperkins on 24 Oct 2006, 22:39, edited 1 time in total.
Hi Hugh,
I get this error when spring is spawning CSAI:
Maybe because I have .NET Framework 2.0 installed instead of 1.1?
I get this error when spring is spawning CSAI:
Code: Select all
GlobalAI1: Metal analyzer rebuilding cachefile
GlobalAI1: Creating new cachefile for mod XTAPE.sd7
GlobalAI1: C# AI initialized v0.0008, team 1
GlobalAI1: Please say '.csai help' for available commands
GlobalAI1: Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at AICallbackToGiveToCS.ClosestBuildSite(IUnitDef unittobuilddef, Float3 targetpos, Double searchRadius, Int32 minDistance)
at CSharpAI.CommanderController.CommanderBuild(IUnitDef unitdef) in
h:\dev\test\CSharpAI\CSAI\CommanderController.cs:line 211
at CSharpAI.CommanderController.CommanderBuildPower() in h:\dev\test\CSharpAI\CSAI\CommanderController.cs:line 233
at CSharpAI.CSAI.InitAI(IAICallback aicallback, Int32 team) in h:\dev\test\CSharpAI\CSAI\CSAI.cs:line 127
GlobalAI1: Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at AICallbackToGiveToCS.ClosestBuildSite(IUnitDef unittobuilddef, Float3 targetpos, Double searchRadius, Int32 minDistance)
at CSharpAI.CommanderController.CommanderBuild(IUnitDef unitdef) in h:\dev\test\CSharpAI\CSAI\CommanderController.cs:line 211
at CSharpAI.CommanderController.CommanderBuildPower() in h:\dev\test\CSharpAI\CSAI\CommanderController.cs:line 233
at CSharpAI.CommanderController.DoSomething() in h:\dev\test\CSharpAI\CSAI\CommanderController.cs:line 132
at CSharpAI.CommanderController.UnitFinished(Int32 deployedunitid, IUnitDef unitdef) in h:\dev\test\CSharpAI\CSAI\CommanderController.cs:line 280
at CSharpAI.CSAI.UnitFinishedHandler.Invoke(Int32 deployedunitid, IUnitDef unitdef)
at CSharpAI.CSAI.UnitFinished(Int32 deployedunitid) in h:\dev\test\CSharpAI\CSAI\CSAI.cs:line 175
- hughperkins
- AI Developer
- Posts: 836
- Joined: 17 Oct 2006, 04:14
- hughperkins
- AI Developer
- Posts: 836
- Joined: 17 Oct 2006, 04:14
Spring is ready for that now. Spring is awesome.From what I've seen on the Net about AI, there are several games, developed to provide a training base for AI developers. You think Spring will be ready for that kind of thing anytime soon?
Btw, I've been meaning to say at some point that whoever added the code to Spring to make GlobalAIs possible, this is so cool! The GlobalAI interface is well done, it's easy to port to different languages, and it works well.
Last edited by hughperkins on 24 Oct 2006, 18:22, edited 1 time in total.
SJ added the globalAI interface, however I find it not to be well done sicne despite cain and jelmer deciding on a way to expand the interface, I am the only one who has bothered to actually make use of it, and every other patcher has flewn in the face of the agreement and added methods directly to IGlobalAI and IAICallback, making it even more spaghetti like, rather than doing ti the correct way.
Also, there are [quote] tags, they're much more convenient/clearer than using email style quoting....
Also, there are [quote] tags, they're much more convenient/clearer than using email style quoting....
- hughperkins
- AI Developer
- Posts: 836
- Joined: 17 Oct 2006, 04:14
What is the official method for expanding the interface?SJ added the globalAI interface, however I find it not to be well done sicne despite cain and jelmer deciding on a way to expand the interface, I am the only one who has bothered to actually make use of it, and every other patcher has flewn in the face of the agreement and added methods directly to IGlobalAI and IAICallback, making it even more spaghetti like, rather than doing ti the correct way.
Note that for purposes of porting the interface to other languages, keeping all methods in just a few classes works quite well. Methods and properties with simple, non-pointer types can be easily, and automatically, ported.
The main problem is that AI's use springs internal UnitDef structures (and others), so whenever a new spring is releases, the binary compatibility is broken and AIs have to be re-released as well.
It would be really great if we make this CSAI thing portable btw, so it can be included in spring itself. If people would then change to .NET for AI writing, you have a system where linux users and windows users can use the same AI releases and where AI's don't have to be re-released with new spring versions!
It would be really great if we make this CSAI thing portable btw, so it can be included in spring itself. If people would then change to .NET for AI writing, you have a system where linux users and windows users can use the same AI releases and where AI's don't have to be re-released with new spring versions!
- hughperkins
- AI Developer
- Posts: 836
- Joined: 17 Oct 2006, 04:14
New release of CSAI
[snipped link]
*Metal maps now supported
*Pack grouping heuristic added
*Enemy selection algorithm improved
*Added memory for enemy buildings
Replay fighting AAI on SpeedMetal, AA2.23:
http://manageddreams.com/csai/061025-Sp ... 73b1-2.sdf
[snipped link]
*Metal maps now supported
*Pack grouping heuristic added
*Enemy selection algorithm improved
*Added memory for enemy buildings
Replay fighting AAI on SpeedMetal, AA2.23:
http://manageddreams.com/csai/061025-Sp ... 73b1-2.sdf
Last edited by hughperkins on 25 Oct 2006, 19:28, edited 1 time in total.
But then the C# interface would need changing every release and we'd need to support the extras so we'd release anyway.
and perkins:
IAICallback:
HandlCommand()
GetValue()
IGlobalAI:
HandleEvent()
All further additions where meant to be passed through these functions so that the interface did not change. Instead people decided to go around the agreement and directly add new methods to the IAICallback and IGlobalAI interfaces, despite doing changes to IGlobalAI becoming very annoying for us major AI developers who had to change to support it, when we only should be supporting the events we want to use, not to mention how much messier it made the interface. It also encourages directly calling the AI within spring rather than calling a function of the AI handler, which is what would be needed by the agreed method, thus introducing inflexibilities and future issues, aswell as making it more awkward to change the code, aswell as for people to track down where these calls are coming from..
Colorblind is particularly bad when it comes to this and did the most of changes that dont conform, and is still doing so with the groupAI interface.
and perkins:
IAICallback:
HandlCommand()
GetValue()
IGlobalAI:
HandleEvent()
All further additions where meant to be passed through these functions so that the interface did not change. Instead people decided to go around the agreement and directly add new methods to the IAICallback and IGlobalAI interfaces, despite doing changes to IGlobalAI becoming very annoying for us major AI developers who had to change to support it, when we only should be supporting the events we want to use, not to mention how much messier it made the interface. It also encourages directly calling the AI within spring rather than calling a function of the AI handler, which is what would be needed by the agreed method, thus introducing inflexibilities and future issues, aswell as making it more awkward to change the code, aswell as for people to track down where these calls are coming from..
Colorblind is particularly bad when it comes to this and did the most of changes that dont conform, and is still doing so with the groupAI interface.
- hughperkins
- AI Developer
- Posts: 836
- Joined: 17 Oct 2006, 04:14
- hughperkins
- AI Developer
- Posts: 836
- Joined: 17 Oct 2006, 04:14
I think that jcnossen's point is that if the C++/C# interface were integrated into Spring itself, then it would be recompiled automatically anyway, and the actual C# AIs might not need recompilation.AF wrote:But then the C# interface would need changing every release and we'd need to support the extras so we'd release anyway.
We could possibly make this the case by, for example, making IGlobalAI in the C# interfaces no longer an interface, but a class with empty methods. Then, if we want to implement a method, we override it in our derived class.
Code: Select all
class GlobalAIBase
{
public void UnitIdle( int id )
{
}
}
Code: Select all
class MyAI : GlobalAIBase
{
}
Code: Select all
class MyAI : GlobalAIBase
{
public override void UnitIdle( int id )
{
}
}