what's up

what's up

Here is where ideas can be collected for the skirmish AI in development

Moderators: hoijui, Moderators

Post Reply
cain
AI Developer
Posts: 124
Joined: 09 Aug 2005, 10:04

what's up

Post by cain »

uhm, hello?

I've been away for 5 yearish, I came back and everything is different now :mrgreen:


there is a java interface, there are no traces of single player scripts, group ai is MIA, every major mod I was playing has almost disappeared (with the exception of BOTA, I think), and AF and submarine are no longer flaming each other :mrgreen: :mrgreen:

what should I check too?
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: what's up

Post by AF »

Submarine checked out quite a while ago.

I am the only AI developer left from your generation of AI devs.

For those who do not know, cain wrote an AI called ZcAIn ( IIRC ) and was active years ago back when AI development her was in its prime

  • JCAI was mothballed by Zaphod, ( who changed his username to jcnossen, and became an engine developer/project lead, though he has seen almost no activity here in the last year or two )
  • Submarine went to University, and aside from the occasional surprise feature release, little or nothing has been heard from him since.
  • Veylon was forced to abandon work on OTAI due to a lack of resources time and internet access. What was a promising project was crushed by circumstance
  • Krogothe abandoned MyAI, and started KAI, rewritting it half a year later twice. 6 months later, he joined forces with 2 students doing a masters in AI, and the three of them used a massive update of KAI for their dissertation. KAI became the best AI, and no AI managed to topple it for at least a year
  • Krogothe having gone to university abandoned KAI, and it was picked up by Kloot and renamed to KAIK.
  • Reth arrived and released RAI. So far RAI hasn't been worked on much by other people, but it has been ported to Java.
  • After the addition of lua widgets, groupAIs became hopelessly obsolete. They were outcompeted and outdone by lua widgets
  • Most of the AIs from your era have either died due to lack of maintenance or been mothballed. Only RAI, KAIK, and AAI remain, all of which are in a pseudo limbo in that engine devs fix compile bugs but nobody is improving or correcting logic
  • NTai was worked on then abandoned by myself in favor of a new AI called Shard for my dissertation
  • Community apathy for the native AI interfaces is at an all time high, with many favouring pure lua gadget based AIs
  • After a devastating break of 2 years in which all API development ground to a halt and VS was no longer a valid compile target (ABI compatibility forced mingw32), the community designed a new API, and Hoijui set about implementing it. Hoijui is now the maintainer of the pure C API and its C++/Java variations
  • The biggest obstacle facing AIs is the problem of custom game mechanics. Lua gadgets allow for huge deviations from the OTA game mechanics, leaving all the native AIs ( except Shard and certain experiments with KAIK ), powerless to cope. Lua gadget AIs have been written for some games, but these are bundled in the game archive itself, are normally based on CRAIG (an AI framework by Tobi, though other AIs exist ), and are heavily customized to those games

If you take your old AI, you should be able to recompile it using the legacy API, with some minor modifications. I recommend you work using the C++ Wrapper API, or join in with Shard. If you need help setting up a new project, let me know what your questions are. Take a look at the Shard repo for an example of a C++ API using the new OO interface.

Shard has a core of C++ but its logic is almost entirely lua, so the C++ component should be easy to understand. There is also a project with a blog post on my website called Minor which is the C++ Wrapper inequivalent of an empty AI with a visual studio project.


Welcome back and I hope we see more of you =)
cain
AI Developer
Posts: 124
Joined: 09 Aug 2005, 10:04

Re: what's up

Post by cain »

wow, that's a lot of stuff to digest!

so, lua widgets in mods now mandates logic that controls units that conflict with AIs? I got that correctly?

btw, zcain code is long lost, and it won't come back from the dead; also,
fileuniverse, which had the latest source version known to date, is now a parked domain.


so, no plans for single player campaigns support currently exists?
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: what's up

Post by AF »

There is a mission editor over at the ZeroK project, and Argh wrote a commercial campaign that was laughed out of the community for the most part.

Games bundle widgets and gadgets. Widgets implement unsynced things, such as UI dialogs, metal maker AIs, anti comnapping behaviours, etc.

Gadgets implement synced behaviour, e.g. a 3rd resource, custom teleports, jump jets, research, etc. Gadgets can do unsynced operations, widgets can only do unsynced operations.

The difference being that you can write and include your own widgets by dropping them in certain folders, whereas gadgets are bundled in the game archives.
cain
AI Developer
Posts: 124
Joined: 09 Aug 2005, 10:04

Re: what's up

Post by cain »

well, thank you AF.

I wonder if I can get back on track once more. I'm lurking around and it seems that without the single player drive, AI development became irrelevant and dwindled
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: what's up

Post by AF »

Its not quite as simple as that:

API Apathy

Spring moved to mingw32 for windows builds to escape sync issues between linux and windows.

This meant all AIs had to be built using mingw32 too, which raised the barrier to entry. Most who remained developed using VS2010 in custom spring builds and then rebuilt for mingw32. The number of new people arriving fell, and things became a lot harder for those unfamiliar with the *nix development tools.

This persisted for almost 2 years, during which, little or no work was done on the API itself.

By the time Hoijui had started on the API rehaul, it was too late, and AI development was minimal, and the major AIs had died and been put in their 'limbo' maintained as legacy by engine devs.

Now that we have a new API and have been using it, the old developers have not returned, and the influx of new developers isn't as high as one would hope.

Community Apathy

The community has always demanded we work for them, though some have been exceptional in helping AI developers, thing have taken a turn for the worse thanks to the above.

Most content devs are aware of the problem of native AIs maintainers going awol. They are blissfully unaware of the danger of lua AI coders going awol as their lua AIs so far are simple and can be maintained by non AI devs who can code lua already. These people actively support and endorse use of Lua AIs, some saying native AIs should be removed altogether.

Some believe that AI developers abandoned them ( such as the late Argh ), and that we simply didnt care enough to support the new game. They cite the oncoming on lua mechanics and the failure of AI to keep up with it. Which brings us to the next one:

Lua mechanics

Trepan having added gadgets, did not add a way for AIs to talk to them.

For ~6 months this remained the same, until he added a callback, but he did not give any information beyond 'it has been added, now shutup', citing that it was our job to figure it out and that it was simple enough to take 5 minutes.

This persisted until the new AI API, during which only Kloot had used this API succesfully ( an experimental build of KAIK for using SWIW, but evnne this he admitted was far from complete and done on a whim ).

Hoijui copied the API callout into the new API, but said he had no idea how it worked but that it would be useful, and wouldnt comment any further.

Eventually Kloot explained in a post that you could write on the palm of your hand.

We're currently standardising in another thread, and once we have this set up, we can start making leaps and bounds. There are a number of games that have escaped native AIs but need rudimentary changes that require comms to support, e.g. Conflict Terra, CA/ZK.

Academia

Academia it appears has abandoned us. Originally because the engine was too unstable, and it was not a nice dev environment. Now because no game stands still enough to conduct academic research upon it
cain
AI Developer
Posts: 124
Joined: 09 Aug 2005, 10:04

Re: what's up

Post by cain »

that's a pretty clear and well thought analysis.

and what are you and the other old fella up to? apart your shard project, I mean.

it seems from your post that ai devs are not closely involved into the interfaces definition and development like it was back in the days.

and I see there is a big change right behind the corner for .83 version. Probably a bad time to jump along and test some of the new tricks I learned in this years, even if the java interface looks quite interesting to me.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: what's up

Post by AF »

on the contrary I wrote up the design for the current API, and Hoijui set about implementing it. Granted what Hoijui has done isn't quite what I designed, and he's made many design decisions I disagree with since, but its an improvement.

As far as I am aware I am the only 'oldtime' AI dev left, unless we count you. All the other AI devs are new, and busy themselves with nonAI things
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: what's up

Post by hoijui »

well.. you had the initial idea of a C interface, that's about it.
the design has been done in a joint venture, and you did maybe 1/5th of it. the very basics (coding worth about 1 day) were done by some guy that was around for a very short time only, z.... something.
the main thing that you contributed was to use Lua info files, which is, as i explained many times already, the worst part of the whole architecture, as it is very inflexible and cumbersome in many ways.

@caine
i am glad to hear you are interested in the Java AI Interface :-)
as you have maybe seen, there is HughAI already, and there are some non-public AIs also, for example a port of KAIK by cranphin and BAI by Petah. there were more, but i don't remember the names or devs.
cranphin said that it is stable, and in master it is fast.
you sure can start using it in master, as the AI interface has not seen changes there since over half a year (not mentionable ones at least), if you are fine with the occasional bug in the engine itsself. no more changes will be added there (except fixes, and in theory, maybe one or two new callbacks).
you may join the #ai channel in the lobby (also available through IRC now), which is for AI-devs.
i am always there when i am online, and may give immediate help if i can.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: what's up

Post by AF »

hoijui wrote:well.. you had the initial idea of a C interface, that's about it.
the design has been done in a joint venture, and you did maybe 1/5th of it. the very basics (coding worth about 1 day) were done by some guy that was around for a very short time only, z.... something.
the main thing that you contributed was to use Lua info files, which is, as i explained many times already, the worst part of the whole architecture, as it is very inflexible and cumbersome in many ways.
I lay no claim to any code in the new API, and its not my fault you decided to do the horrendously longwinded method of parse lua files like strings instead of loading them using lua itself and using the lua API to save yourself the hassle in what should have taken you all of 5 minutes.
cain
AI Developer
Posts: 124
Joined: 09 Aug 2005, 10:04

Re: what's up

Post by cain »

and you did maybe 1/5th of it
well, AF was there since the early stages of the AI development and lot of what he did back in the days influenced a lot of the engine internals in terms of hooks and callbacks; I think that his influence spans on a lot more than the interface design, even if only a fifth of the actual interface is done by his specification.

that said, I don't know if I'm ready to get back into the action. I've some free time at hands but I kinda lack the focus to start a goalless project like a full fledged 'academic' AI.

I was wondering if there was some small bite to attack for a start. I've never got into scripting but I could go and see if creating a campaign is really that hard.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7049
Joined: 16 Nov 2004, 13:08

Re: what's up

Post by zwzsg »

cain wrote:I've never got into scripting but I could go and see if creating a campaign is really that hard.
  • Quantum and the ZK people made a mission editor.
  • I made my own system, which I put in KP and GRTS, (and even a BA mod) see exemple missions inside.
User avatar
Rafal99
Posts: 162
Joined: 14 Jan 2006, 04:09

Re: what's up

Post by Rafal99 »

By the way:
ZcAIn.zip
(118.9 KiB) Downloaded 19 times
I was deving my own AI 5 years ago too, although never finished or released it.
I had sources of other AIs for code examples so here is ZcAIn source which was sitting in my disk since then. :wink:
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: what's up

Post by hoijui »

ehh cool Rafal99! :D
thanks!
can you probably tell us in what state it was/is?
should it build units and attack already?
what games did you write it for?
does it have a special algorithm for problem that other AI devs might want to copy?
is it worth trying ot get it to run in current spring?
User avatar
Rafal99
Posts: 162
Joined: 14 Jan 2006, 04:09

Re: what's up

Post by Rafal99 »

Well my AI was called RafAI.
It was in playable and stable state although it was very simple in its gameplay.

Building / unit selection was quite random. With economy buildings it tried to maintain a certain metal income/energy income/buildpower/storage ratio. For metal spots detection it used Krogothe's Metal Class. It could reclaim mexes to upgrade them to mohos and I think it could do the same for geos. Other units were selected randomly weighted a little towards cheaper units. I think there were some weight modifiers for defences and antiair units too.
Attacking algorithm was almost the simplest possible. Once it had enough power in combat units it sent them all at the closest enemy, then next one etc. until it lost like 80% of the units then it turned them all back.
Every next attack the power threshhold was increased by some factor (something like 25% more) so it was sending bigger unit swarms as the game progressed.
It had a simple scouting algorithm that I put in as a placeholder. I didn't want it to use cheats so it had to find targets somewhat. It divided the map into a grid of sectors. Then when a scout was in some sector it chosed the next sector it will go to, taking the 8 neighbor sectors, then randomly selecting one, heavily weighting towards the ones not visited for the longest time.

Some interesting part of its code which I was very proud of, was a custom buildsite finding algorithm which basically replaced engine function FindClosestBuildsite while eliminating some issues. It allowed me to set different spacing for different types of buildings and respected the spacing of all of them, no matter in what order they were built. It also prevented factories from being built facing toward a hill (which was a common problem in early AIs) - it was accomplished by finding a larger buildsite than the factory really was, so there was always some free flat space in front of it. It also did some calculations on the distance of searched buildsites so it preferred buildsite next to a builder instead of a buildsite where the builder is standing (so it saved the time when the builder whould have to move from the buildsite).

Some things I was planning to add was a proper handling of groups of combat units (so they could attack different targets, split and merge etc.) and a basic tracking of units efficiency so it could learn.

It was written with *A mods in mind (tested mostly in Absolute Annihilation, I think there was no BA back then) but would probably support most mods back then since they didn't differ in features as much as now and the AI didn't use any hardcoded unitnames.

I stopped working on it mostly because of RL stuff starting getting wrong - the AI deving was too time consuming - most of that time spent testing / debugging - it is literally addicting to watch your own creation play and do stuff :wink:.
Actually I never decided to abandon that project completely and never stopped thinking about getting back to it but just didn't have that kind or motivation, or had an idea for another project etc. Also couldn't really get past the environment setup since MSVC stopped being the way to compile Spring.

Ok so thats it. I didn't expect this post to became so long but got kinda excited as I started remembering all that while writing.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: what's up

Post by AF »

Do you still have source code? I have the source of most of the AIs released but they're on another drive I cant access at the moment.

I'd be curious to see your building placement algorithm
User avatar
Petah
Posts: 426
Joined: 13 Jan 2008, 19:40

Re: what's up

Post by Petah »

I wonder if I should see if i can get BAI working on the latest Spring/BA...
User avatar
Rafal99
Posts: 162
Joined: 14 Jan 2006, 04:09

Re: what's up

Post by Rafal99 »

@AF:
Of course I have the code, even quite a lot of copies of it in different folders, which is quite a problem, because I don't remember which one is the latest...
It was never released anywhere so only I have it. I will research which copy is the latest and find out how my algorithm exactly worked and then post the source here which some description of the algorithm.
I remember the last thing I did in the AI was rewriting the attacking code but the new one was buggy and crashing and I couldn't find what exactly was wrong so it may not actually work ingame even if it gets updated to the current AI interface.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: what's up

Post by AF »

It should take little effort to support the legacy API
cain
AI Developer
Posts: 124
Joined: 09 Aug 2005, 10:04

Re: what's up

Post by cain »

Rafal99 wrote:By the way:
ZcAIn.zip
I was deving my own AI 5 years ago too, although never finished or released it.
I had sources of other AIs for code examples so here is ZcAIn source which was sitting in my disk since then. :wink:
eh :mrgreen:
good times :mrgreen:
Post Reply

Return to “AI”