Skirmish AI: C.R.A.I.G.


Heh yeah I think you can thank Journier for that, he put 8 tank yards at end of Russia’s buildorder :stuck_out_tongue:

r1012 | journier | 2009-02-15 21:05:41 +0100 (Sun, 15 Feb 2009) | 1 line


Yeah, frontal assault is hopeless now, and you need antitank weapons fast to stay alive. But if you can flank it and get flamers/AT infantry in his base you can wreak havoc.

Yeah I really want to make some flag capping / combat management next, but I think it’s tougher then the base building and spamming I have now :slight_smile:


I watched a 4 player ffa with all 4 sides represented with bots. Russiabot and nazibot ganged up on poor little britain… :slight_smile: the russian bot does seem fucking insane tho, it had about five times the tanks everybody else did. Sadly the game got really bogged down with corpses after a while so i had to nuke them all.


The long awaited v2 is here, now with flag capping and combat management!

[size=120][b]IMPORTANT NOTES:

  • Play only on the maps mentioned in the changelog, on other maps you will barely notice any improvement!
  • There is a mod option to set the difficulty now, the default is HARD
  • There’s a desync bug in the AI right now, so don’t try to do multiplayer compstomps, and don’t expect replays of AI games to replay the original game![/b][/size]


* Added waypoint editor widget.
  - Can add new waypoints (press N).
  - Can remove waypoints (hold mouse button and press M).
  - Can move waypoints.
  - Can toggle connections between waypoints (drag).
  - Saves the profile in craig_maps/<mapname>.lua (create the 'craig_maps'
    directory if you want to try this widget and save your work.)
  - Automatically saves/loads the profile on shutdown/initialization.
* Added waypoint manager, to track flags and ownership of waypoints.
* Added pathfinder to navigate over the waypoint graph.
* Added flag capping (depends on map waypoint profile).
* Added some preliminary combat management (depends on map waypoint profile).
  - It will use multiple paths to your base.
  - It now sends units in "squads" of 24.
  - Units move at the speed of the slowest unit in the squad.
    (ie. tanks, halftracks and other vehicles stay between infantry.)
  - Units in a squad get their orders jittered around the waypoints,
    this way pinning/suppression is less effective to them and they magically
    take line formation when fighting other infantry.
* Added difficulty mod option.
  - Easy: no resource cheating.
  - Medium: cheats in 6% of what fits in storage every 128 game frames (~4 sec)
            (e.g. when it's stalling and has 1k storage, this means +14 extra)
  - Hard: infinite resources, as before.
  - Build order and unit limits can be configured per difficulty level.
* Included waypoint profiles for:
  - 1944_BocageSkirmish
  - 1944_BocageSmall
  - 1944_Caucasus_Skirmish_V4
  - 1944_Kiev_V4
  - 1944_Road_To_Rome_V3
  - 1944_Terra_Firma
  - Altair_Crossing-V1
  - Aquatic_Divide_TNM05-V2
  - Prokhorovka_1944
  - SnakeIslandV2
  - For maps not listed here, the AI falls back to v1.5 behaviour.


Hi, i can’t seem to get this to work. The lobby just crashes, and i cannot insert a bot while running it through spring.exe. Any suggestions?


Which lobby client, TASClient or SpringLobby?


And voila v3, biggest change is actually not Spring: 1944 related: C.R.A.I.G. is now also available for the Star Wars Imperial Winter Beta, for those who happen to be beta testers (it’s private).

For Spring: 1944 only players, the desync bug has been fixed by reworking entire internal architecture (AI runs in unsynced gadget code now) and various small gameplay fixes have been made.

[size=120][b]IMPORTANT NOTES:

  • Play only on the following maps, on other maps you will barely notice any improvement!
  • There is a mod option to set the difficulty now, the default is HARD.
  • The downloaded file goes into your mods folder.[/b][/size]

Supported maps:

  • 1944_BocageSkirmish
  • 1944_BocageSmall
  • 1944_Caucasus_Skirmish_V4
  • 1944_Kiev_V4
  • 1944_Road_To_Rome_V3
  • 1944_Terra_Firma
  • Altair_Crossing-V1
  • Aquatic_Divide_TNM05-V2
  • ArcticPlainsV2
  • Eye_Of_Horus
  • Prokhorovka_1944
  • SnakeIslandV2
  • TitanDuel
  • Tundra
  • Xelric_Draw_beta2


v2.0 -> v3.0
* Major technical change: the AI now runs as unsynced code.
  - CPU usage due to the AI happens only on one client, instead of all.
  - AI is actually susceptible to network lag now, unfortunately.
  - Desync bugs like the one in v2 can not exist anymore.
  - Architecture is more similar to GlobalAI. (AI DLLs)
  - There is a clear piece of framework code for building unsynced LUA AIs.
  - AI unit limits still work in synced code.
  - Properly seeded unsynced RNG, so math.random() can be used in configs.
  - Credits to lurker and BrainDamage for ideas/suggestions/testing.
* Gadget properly removes itself now if there are no AI teams.
* AI difficulty modoption uses numeric keys now, fixes it in TASClient.
* Reduced cheating at medium from 6% to 5%.
* Made bot name (as shown in the lobby) mod-agnostic, to ease maintenance.
* Doesn't try to cap allied flags anymore.
* Spring: 1944 specific changes:
  - Increased number of flag cappers from 12 to 24 for GBR, GER and US.
  - Decreased number of flag cappers from 3 to 2 for Russia.
    (because it can not properly handle the combined builders/flagcappers yet)
  - Based ModOptions.lua on the one from Operation Konstantin, instead of SVN.
* Star Wars Imperial Winter (SWIW) support, big thanks to [RoX]1v0ry_k1ng!
  - Three different buildorders for both Rebel Alliance and Imperial Remmnants.
  - Support for SWIW style flag capping (ie. flags swapped out using LUA).
  - The specific unit types used to to cap flags are now configurable.
  - Does not use NoSelect units (e.g. Royal Guards) anymore to attack.
  - Fixed Rebel Alliance commander base building bootstrap.
    (It tried to build on top of itself and then didn't move away.)
* Added waypoint profiles for:  (credits to [RoX]1v0ry_k1ng too)
  - ArcticPlainsV2.smf.lua
  - Eye_Of_Horus.smf.lua
  - TitanDuel.smf.lua
  - Tundra.smf.lua
  - Xelric_Draw_beta2.smf.lua

Download here:

EDIT: Because of popular demand, here are extremely quick instructions on how to add support for more maps:

  • Create folder craig_maps next to your maps and mods etc. folders
  • In game, enable Waypoint Editor widget (included in .sdz)
  • Use N to make new waypoint, M + hold mouse on one to delete it, drag mouse to move / toggle connection,
  • Use S to save, L to load (yes I know, conflicts with losmap on / off, so pressing it twice works best :stuck_out_tongue:)
  • On widget / spring initialization / shutdown the waypoint profile is automatically loaded / saved.
  • To make the AI use the waypoints, put the .smf.lua file that’s written in the craig_maps folder in the LuaRules/Configs/craig/maps/ folder INSIDE the .sdz archive. Only then the AI will find and use the waypoint profile.

Waypoints are used to support flag capping and to make the AI use multiple attack routes into the opponent’s base(s).
For a flag to be capped by the AI, there must be a waypoint inside it’s radius.

It would be great if you could send all profiles you finish to me so they can be bundled with next releases and used in other mods.

Source code repository is here, just in case you’re interested.


Released v3.1, pretty much the same codebase, but thanks to Lowdive and hrmph (on SWIW forum) 18 new waypoint profiles got added!

[size=120][b]IMPORTANT NOTES:

  • Play only on the following maps, on other maps you will barely notice any improvement!
  • There is a mod option to set the difficulty now, the default is HARD.
  • The downloaded file goes into your mods folder.[/b][/size]

Supported maps:

  • 1944_BocageSkirmish
  • 1944_BocageSmall
  • 1944_Caucasus_Skirmish_V4
  • 1944_Kiev_V4
  • 1944_Road_To_Rome_V3
  • 1944_Terra_Firma
  • Aberdeen3v3v3
  • AfterShock_V31
  • Altair_Crossing-V1
  • Aquatic_Divide_TNM05-V2
  • ArcticPlainsV2
  • Battle for PlanetXVII-v01
  • Comet Catcher Redux
  • Crossing_4_final
  • DeltaSiegeDry
  • Deserted_Gully-v05
  • DesertTriad
  • Eye_Of_Horus
  • FrostBiteV2
  • Geyser_Plains_TNM04-V3
  • Glass_Dreams-v01
  • GRTS_River_Valley_1.4
  • neurope_a7
  • Prokhorovka_1944
  • River Dale-v01
  • rysia
  • Sierra-v2
  • SnakeIslandV2
  • Tangerine
  • TheHunters-v3
  • TitanDuel
  • Tundra
  • Xelric_Draw_beta2


v3.0 -> v3.1
* Using exactly same code for SWIW and S44 now.
  - Squad size is now configurable.
  - Flag radius is now configurable.
  - Moved config in a directory with modShortName as name ('s44', 'swiw')
* Added waypoint profiles for:  (credits to Lowdive and hrmph!)
  - Aberdeen3v3v3
  - AfterShock_V31
  - Battle for PlanetXVII-v01
  - Comet Catcher Redux
  - Crossing_4_final
  - DeltaSiegeDry
  - DesertTriad
  - Deserted_Gully-v05
  - FrostBiteV2
  - GRTS_River_Valley_1.4
  - Geyser_Plains_TNM04-V3
  - Glass_Dreams-v01
  - River Dale-v01
  - Sierra-v2
  - Tangerine
  - TheHunters-v3
  - neurope_a7
  - rysia

C.R.A.I.G.'s Imperial Winter twin can be found here.

Download here:


This AI is now included in the game package, so no need to download it separately until I finish a new version.


I’ve tested playing against this AI, got royally beaten up 4 times before I finally figured out it’s weaknesses, exploited them shamelessly and finally won against the computer :wink:. I managed to create a “hidden exile base” quite a bit from my main HQ (the latter were destroyed by the enemy). From that exile base I flanked the enemy’s factory area, leveling it while simultaneously flanking his main force which had gathered in an enormous immobile crowd around my old HQ’s smoking ruins. Flanking were primarily done with medium howitzers using scouts for targeting information, even if I shamelessly abused attack fighters at the end of the game to speed up the assault on the enemy. Interesting to see that all my “energy” (heavy ammo) getting used up within 30-60 seconds after getting the ammo resupply, no matter how many large ammo supplies I tried to create.

Had the enemy decided to move that heap of units around the map in a systematic matter, all my factories, all my howitzers and all those millions of major supply dumps had been utterly doomed. Made the game a bit creepy… like attacking a dinosaur from a hidden location, fearing it actually would decide to come after me and just squish me in a minute or so.

Does the AI cheat? I expect not, assuming it’s hordes of vehicles and people are a result of it having a more effective economy (or rather, my slow production rate a result of my inferior understanding of how the mod’s economy system works), but there is a reference to lowering the cheating of the AI in some changelog. Also, I’m a bit puzzled by it’s spamming of units continuing in spite of me owning most of the flags (and he, apparently, very few). Anyway, C.R.A.I.G’s flooding of units (both cheaper as well as nastier ones like the feared Tiger) is a challenge, especially when trying to fight it heads on (which fails for me). I cannot wait to see this AI beast use airplanes! That must be absolutely dreadful :smiley:!

Gory details: I were US, AI were Germany, map were Levels2 (one of my favorites, just love that map!) with me at center bottom and AI at center top. Spring44 version were ‘Luettich’, Spring engine were (the latter IIRC). That map, in spite of not being listed as supported, seemed to work ok enough for C.R.A.I.G for him to at least manage to seriously level my initial HQ.

Great fun anyway!

(Realize I should take time to read the mod’s documentation…I mean… there are implied in various threads that factories can be upgraded…? Have to check that out!)


Easy - no cheats.
Medium - slight resource cheat.
Hard - massive resource cheat.


The AI plays even better on ‘supported’ maps. There it would move forces around and not only into your base. Also it will try to capture flags.
And yes, it cheats. It gets free resources on hard, less on medium and no at easy.


Thanks for the feedback. I’ll try to fix the weakness for next version :wink:

Oh and yeah tank yards can be upgraded.


erm… how do I install this in the latest ver.? :confused:


If you’re referring to the large “Supply Depots”, those don’t actually give any supply storage; they just have a huge supply radius. Unfortunately this seems to be rather non-obvious; I’ve seen many people try to build them for storage.


Hm… my max ‘energy’ increases for each of them I manage to finish, so the unit I have in mind actually do give me more shelling logistics. But still, a decent number of 10.5 cm howitzers can consume a lot of ammo in less than a minute. At the end of the day however, even if that situation is annoying for oneself, the one having real trouble with it is the enemy, as he is at the “receiving end” of all that ammo quickly being used up :wink:.

Regarding upgrading tank yards, could that (and airplanes as well, actually) be added to the documentation for Spring44? The unit guides are missing airplanes and I did not see any docs on factories, about things like which factory can be upgraded to what other kind etc. This site don’t seem to be a wiki, so I don’t know how to contribute with docs (and I don’t know if I really should, given that I don’t have much time to play the game).


Ah, it looks like we added some storage to the depots as well. However, the supply storages (as opposed to the depots) are a better deal as far as storage is concerned; they store 25% more and are much cheaper.


Ah! Thanks for the info, will make medium howitzer barrages much more… um… entertaining in the future.


It’s included in the game package. If you’re using SpringLobby (default if you used the S44 installer), just go to the singleplayer tab, select map and mod, and then use the “add bot” button to add a “C.R.A.I.G.” bot. (Selecting the mod before clicking “add bot” is the important part.)


well… ive installed luettlich so theres just an sdz, with no bot. And I use Tasclient… Is springlobby where all the players are? :smiley: :smiley:


The bot is inside sdz. It’s a lua AI, no dlls necessary.
I’m not sure TASClient supports that kind of bots however. Try Springlobby.