NOE AI - development, ideas, manual

NOE AI - development, ideas, manual

Moderators: smartie, Thor, PepeAmpere, Moderators, Content Developer

User avatar
PepeAmpere
Posts: 589
Joined: 03 Jun 2010, 01:28

NOE AI - development, ideas, manual

Post by PepeAmpere »

Here it is, after 80 days of hard work im glad i can introduce the NOE AI 8).

N.O.E. - AI

= ingame lua AI for standard skirmish game primary for NOTA
= set of tools that is used for SP/COOP campaing and missions

current version: beta (donwload nota 1.79a (revision 20x))
current status: AI can kill noobs and honestly face other players :).
last revision changed NOE: check on project site
used in missions: TTD, xants-pd
the greatest enemies: NOTA module for SHARD AI, PepeAmpere

WIKI and MANUAL

http://code.google.com/p/nota/wiki/NOE_introduction

[+] FEATURES

- independent agent system, commanding struncture (group, supergroup, brain)
- modules - formations, groups, spirit programs can be easily redefined
- more then 10 formations
- speedable
- inteligent building system (buildmapping)
- strategic mapping
- graphic debug mode

[-] KNOWN ISSUES, NOT FINISHED FEATURES

!! AI is not fair, knows everything
! no difference between EASY, MEDIUM, HARD yet
! up to 16x16 map, max 3 AIs in 3 different is possible to have on map (with all speedups ON), bigger amount of AIs lag... 28x28 map can run with 2 AIs
! no advanced tactics for all attack groups (advanced things not implemented), they are able only gather and attack in one choosen formation, only main Thud/Hammer battlegroup is able to do some advanced things
! no use of tech2 now
! not possible play on map, that have not classic metal spots
! no big difference in tactics of ARM and CORE (expect snipers, morties, levelers) and some group counts
! only two clone brains Thor (CORE), Cake (ARM), very few special features implemented yet, no special tactics yet, Morphdog planed too
! not metalmaker controler now
! buildSpots are choosen quite clever, but no spacing around geo spots and factories (mexes spots ok)
! NOE AI is not able to start in the middle of the sea, needs some dry land around
! not using users def files for creating own AIs setup
! not using, not finished Spectator learing widget
! taking of AI stuff not possible

TECHNICAL INFO

this moved on own N.O.E. wiki, placed on project site

NOE GAME OPTIONS

- mapping coef - (0.5 -4, def 1.0) - current simple speeding of AI mapping, 0.5 is for 1v1 game on small map (AI thinks faster), bigger maps needs bigger value.
- splited mapping - TRUE/FALSE (def: TRUE) - if TRUE, every AI team gets own frames for counting strategic mapping, good for many AI teams on medium and big maps (or then LAG)
- frames for agent - (4-60, def: 10) - how many frames are needed for making decisions, 4 is ok almost in every situtation, with 10 or more no problems

NOE AI DEBUG MODE

- you can use some shortcuts to see some graphic representation of AI mapping tables. Some of them are not used, some of them tell you nothing, if you dont know it, but safeIndex table and build spots tables are quite easy to understand... :-)

ALT + D - showing holdPower table
ALT + E - showing holdZero table
ALT + F - showing present table
ALT + R - showing safeIndex table
ALT+ Q - showing best 2-10 safe positions on the map (OFF now)
ALT + H - showing tile height map
ALT + M - showing metal spots map
ALT + A - showing build spots map


Image

Image

NOE FORMATIONS

Tactical groups are able to use formations. Such things are defined in file noe_formations.lua, some of them automaticly generated and rotated (if its rotable formation).

Current defined formations are (bold most used):

- hexagon
- box
- arrow
- swarm
- standardLine
- standardLine2nd (for Pepes thuds/hammers line zigzagin' ;) )
- smallLine
- doubleColumn
- seaUnit (not used)
- artyLine
- wedge

Image

.... more info i add later

MODIFIING AI - mission way (not finished description)

What is needed to set up correctly for new mission (draft)

Here are some conditions, that need to observed for clean work of your mission. Most of them you dont brake by mistake, but if broken, usally the bug is here:
  • have missions folder in game folder
  • in that folder missions have folder with mission that i will call <mission_name>
  • names of AI from missions/<mission_name>/settings.lua, missionInfo.AInames table need to be the same names that are in:
    ..- missions/<mission_name>/AIdef/side.lua newSideSettings table (on first level)
    ..- gamefile - LuaRules/config/noe/noe_side.lua sideSettings table (on first level)
  • names of battlegroups listed in missions/<mission_name>/AIdef/side.lua table (on second level, these simple strings) have to be the same names you can find in:
    ..- missions/<mission_name>/AIdef/groups.lua newGroupDef table (name)
    ..- gamefile - LuaRules/config/noe/noe_groups.lua groupDef table (name)
  • groups defined in missions/<mission_name>/AIdef/groups.lua have to had the names of spirits listed in:
    ..- missions/<mission_name>/AIdef/spirits.lua newSpiritDef table
    ..- gamefile - LuaRules/config/noe/noe_spirits.lua spiritDef table
    and these spirits (if users custom) need to have defined one formation in:
    ..- missions/<mission_name>/AIdef/formations.lua newFormationBySpirit table
    ..- gamefile - LuaRules/config/noe/noe_formations.lua formationBySpirit table
  • plans used in spirits have to had the same names used in
    ..- missions/<mission_name>/AIdef/spirits.lua newPlan table
    ..- gamefile - LuaRules/config/noe/noe_spirits.lua plan table
  • use <mission_name> when launching a game in modoption "mission"
User avatar
Thor
NOTA Developer
Posts: 291
Joined: 05 Mar 2006, 10:26

Re: NOE AI - development, ideas, manual

Post by Thor »

I was impressed the first time it sent a thud battleline at me. Keep up the good work!
BaNa
Posts: 1562
Joined: 09 Sep 2007, 21:05

Re: NOE AI - development, ideas, manual

Post by BaNa »

I played a game to check it out, seemed nice (im not used to nota)

started spamming this error after a while and it had a lot of stumpies idling front of labs for all ais

Code: Select all

[f=0034910] Error: LuaRules::RunCallIn: error = 2, GameFrame, [string "LuaRules/Configs/noe/noe_spirits.lua"]:359: Invalid unitID given to GiveOrderToUnit()
stack traceback:
	[C]: in function 'spGiveOrderToUnit'
	[string "LuaRules/Configs/noe/noe_spirits.lua"]:359: in function '?'
	[string "LuaRules/Configs/noe/noe_spirits.lua"]:584: in function '?'
	[string "LuaRules/Gadgets/unit_noe.lua"]:1392: in function 'RunPlans'
	[string "LuaRules/Gadgets/unit_noe.lua"]:1524: in function 'GameFrame'
	[string "LuaRules/gadgets.lua"]:931: in function <[string "LuaRules/gadgets.lua"]:929>
	(tail call): ?
got this too after a while, im guessing from all the stumpies: in a bunch

Code: Select all

[f=0100761] No space on the ground, says group: , 100
[f=0100761] No space on the ground, says group: , 100
[f=0100761] No space on the ground, says group: , 100
[f=0100761] No space on the ground, says group: , 100
I had globallos on and speed was at 3 btw
User avatar
PepeAmpere
Posts: 589
Joined: 03 Jun 2010, 01:28

Re: NOE AI - development, ideas, manual

Post by PepeAmpere »

Thor: thank you, yes, formations should be thing that makes this AI unique a bit and enhances the feeling you are playing against dangerous enemy ;)

BaNA: yes, that alpha version had some quite really annoying bugs, one of them was ordering some dead units in special tactical groups. I think this problem is solved now, you can create own test file from last development version on project site and play. Just now, when i replay to you, current revision of nota has no. 36 and that alpha version had no. 31. Revisions 33 and 34 repaired a lot of mistakes and added a lot of new stuff and in current version there are new defence groups, enhanced behavior of territory capture and all units are used for warfare now, so no idle stumpies :).
User avatar
PepeAmpere
Posts: 589
Joined: 03 Jun 2010, 01:28

Re: NOE AI - development, ideas, manual

Post by PepeAmpere »

new release - nota1.68c (revision 41)
enjoy :mrgreen:
User avatar
PepeAmpere
Posts: 589
Joined: 03 Jun 2010, 01:28

Re: NOE AI - development, ideas, manual

Post by PepeAmpere »

new release, nota 1.68d (revision 43)

- AI knows ground tech2
- AI knows storages, llts and plasma batteries
- AI knows some late game special attack
- some speedups are default ON, some calculated automaticly
- many new battlegroups
User avatar
Pendrokar
Posts: 658
Joined: 30 May 2007, 10:45

Re: NOE AI - development, ideas, manual

Post by Pendrokar »

You got me interested.

Pros:
  • Formations
  • Uses a variety of units in battlegroups including radars and jammers
  • Could quickly rebuild after having base decimated
  • [edit] retreats with battlegroups
Cons:
  • Lacks scouting(oh it knows everything? Does it have a threat map then?) and raiding attempts
  • A bit slow expansion
  • Considers long range artillery as an attack that requires units sent to defend
  • Not enough mobile AA or even doesn't care if the enemy has air or aircraft construction capabilities.
  • Main attack force ignores greater threat that is incoming on home base, although it might not have enough time to get there, but I doubt it calculated that. :P
  • On red triangle map, gets units stuck on shores when there are no enemy units on other islands.
Suggestions:
  • Add automatic factory facing to the center of map relative to starting position.
Well done PepeAmpere, with a few of these AIs it can be really chalenging(probably).
Attachments
20120630_215923_EE-RiverGlade-v02_88.sdf
Demo
(1.29 MiB) Downloaded 76 times
User avatar
PepeAmpere
Posts: 589
Joined: 03 Jun 2010, 01:28

Re: NOE AI - development, ideas, manual

Post by PepeAmpere »

Thy for reaction and reflexion. Here are some short answers for cons.
Pendrokar wrote:
  • Lacks scouting(oh it knows everything? Does it have a threat map then?) and raiding attempts
Yes, the second debug image (in first post) is one visualization from few threat maps that NOE keeps (in that example more green means more safe place).
Pendrokar wrote:
  • A bit slow expansion
Agreed, the expansion algorithm is more clever that the one in alpha version, but it is still very simple (i have not started work on the good one, yet). Now its only bucket sorted list of mexes (by distance from tower) which const. units groups tries to capture, no clever spread to the most close mex, yet.
Pendrokar wrote:
  • Considers long range artillery as an attack that requires units sent to defend
I dont get this point :) Artillery is usually defended by main battlegroup fighting nearby, only few times happen they face enemy alone (special cases, for example: attacking the hills, heavy loses of main battlegroup in short interval,...)
Pendrokar wrote:
  • Not enough mobile AA or even doesn't care if the enemy has air or aircraft construction capabilities.
Yes, only AA groups defined are support bot groups for main battlegroup (crashers/jethros), no vehicle AA, no tech2 AA, no fighters defined yet. Theres a problem cause these units have only special use and it needs a bit more clever buildmanagement then ground fight units. There was not time to do that, becouse the basic ground opponent for newbies was the first main task of this project.
Pendrokar wrote:
  • Main attack force ignores greater threat that is incoming on home base, although it might not have enough time to get there, but I doubt it calculated that. :P
There are few defending groups, more for ARM, that have only peewee/ak members, not looking for targets, only patroling now. No defence management implemented yet, all my efforts were pushed to show attack in alpha version.
Pendrokar wrote:
  • On red triangle map, gets units stuck on shores when there are no enemy units on other islands.
Red triangle is broken for NOTA all the time, its not matter of AI. Theres some problem with height callculation, so ships shoot to low for example.
Pendrokar wrote: Suggestions:
  • Add automatic factory facing to the center of map relative to starting position.
Such widgets for AI can be created, but they are only kind of cosmetic changes. For near future theres planned defining most of the late techs, making first brains and preparing some clever usage of the hills.
Pendrokar wrote: Well done PepeAmpere, with a few of these AIs it can be really chalenging(probably).
Current version suprises me that it doesnt use any clever mechanism (if i dont mean tech. part of mapping) and it works quite good on not much hilly or water maps. I was happy that 1.68b version was able to kill E323 AI in 1v1 fight (it was looking bad at start - E323 expand great, but big NOE groups were the winning factor) and the system i use is easy to be upgraded (you can check how the formations or groups are defined, adding new ones is as easy as a pie).

Adding own players/users group will be possible in the end of the summer, you will be able to define own AI groups (with user defined formations, spirits, stats,... or using my difinition and with changed only few numbers in group definiton).

If i will find the time for spectator learning widget, spectator will be able to learn AI which buildspots are clever choosen and such data will be used in next matches.
Conte_Vincero
Posts: 11
Joined: 04 May 2012, 16:05

Re: NOE AI - development, ideas, manual

Post by Conte_Vincero »

WONDERFUL!, an AI that actually does human like mass attacks! One question, does it make up it's armies based on what you have, or does it just choose it's favourite units?
User avatar
PepeAmpere
Posts: 589
Joined: 03 Jun 2010, 01:28

Re: NOE AI - development, ideas, manual

Post by PepeAmpere »

Conte_Vincero wrote:WONDERFUL!, an AI that actually does human like mass attacks! One question, does it make up it's armies based on what you have, or does it just choose it's favourite units?
If it does such impression, thats good :-). It has prepared some buildlists (that are randomly choosen, yet) and there are so many sleeping battlegroups waiting for units now, that no unit stay idle when finished (i hope).
BaNa
Posts: 1562
Joined: 09 Sep 2007, 21:05

Re: NOE AI - development, ideas, manual

Post by BaNa »

I played with it again, quite nice, a lot of improvement. i was very impressed with performance, I played a 16 way ffa with the ais and it could run at 3* speed. I am not well versed in nota but i would def recommend a bit more t2 eco spamming and mex expanding for ai, i got my eco up much faster.
User avatar
PepeAmpere
Posts: 589
Joined: 03 Jun 2010, 01:28

Re: NOE AI - development, ideas, manual

Post by PepeAmpere »

BaNa wrote:I played with it again, quite nice, a lot of improvement. i was very impressed with performance, I played a 16 way ffa with the ais and it could run at 3* speed. I am not well versed in nota but i would def recommend a bit more t2 eco spamming and mex expanding for ai, i got my eco up much faster.
SPEED - yes, it behaves good, and if slow, you can change the AI speed options before game to get better result

TECH2 spamming - tech2 is never core of army in NOTA, tech1 are still main fighters in most of the games. Thats first reason, and second: it needs more attention (=much more clever AI), becouse it costs a lot and loosing tech2 means bad things for the player/AI. Tech2 was implemented week ago, so AI is not clever enough to push more resources into tech2.

EXPANDING - yes, the expanding part is still very simple and slower than other AIs do.
Conte_Vincero
Posts: 11
Joined: 04 May 2012, 16:05

Re: NOE AI - development, ideas, manual

Post by Conte_Vincero »

Done some more games, and a few questions,
1. Does the AI use defensive buildings. I didn't see any which I find odd, as there was only mobile AA used
2. Does the AI use ships? again none seen, and the absence of defensive turrets allowed me to easily bombard their base
User avatar
PepeAmpere
Posts: 589
Joined: 03 Jun 2010, 01:28

Re: NOE AI - development, ideas, manual

Post by PepeAmpere »

Conte_Vincero wrote:Done some more games, and a few questions,
1. Does the AI use defensive buildings. I didn't see any which I find odd, as there was only mobile AA used
2. Does the AI use ships? again none seen, and the absence of defensive turrets allowed me to easily bombard their base
1) AI use few def buildings, but only in late game, if has a lot of metal. Its not odd, mobile units are more cost/battle_output effective

2) AI is not using ships now, not implemented yet. No defence turret helps you against navy, only your own navy can kill it 8).
User avatar
PepeAmpere
Posts: 589
Joined: 03 Jun 2010, 01:28

Re: NOE AI - development, ideas, manual

Post by PepeAmpere »

new release, nota 1.68e (revision 45)

- AI knows air and def tech2 expansions, build airfighters, wings, napalms and nukes
- main battlegroup uses using more AA and advanced AA
- main tank attack brigade is using the same "keep formation" procedures as other groups now => tanks attacking in (own) formations, too
- many new battlegroups
- more airpads when AI goes air
- air using target attacking again
- AI knows mohobuilder and upgrades mines
Conte_Vincero
Posts: 11
Joined: 04 May 2012, 16:05

Re: NOE AI - development, ideas, manual

Post by Conte_Vincero »

VERY NICE, the battle groups of Raptor IV's really caught me by surprise, One small problem, my ally won the game by building nukes, but the two enemies had completely failed to build missile defence (or nukes themselves) this could be due to the fact that the two enemies were exhausting all their resources on a titanic struggle against my defences, whereas the ally was just sitting back quietly doing their own thing. Also there was an absence of heavy mobile artillery which was the only thing that would have allowed them to crack my massive plasma batteries.
BaNa
Posts: 1562
Joined: 09 Sep 2007, 21:05

Re: NOE AI - development, ideas, manual

Post by BaNa »

I played some more games with it and it was very nice, i couldn't take 3 hard ais against me but could beat 2 of them. Played a few hueg 3v3v3v3v3vme ffas and one of them became very strong, sadly that was mainly reflected in the fact that his hammer group streched the map, not in any t2-t3 stuff.
User avatar
PepeAmpere
Posts: 589
Joined: 03 Jun 2010, 01:28

Re: NOE AI - development, ideas, manual

Post by PepeAmpere »

Conte_Vincero wrote: (...) but the two enemies had completely failed to build missile defence (or nukes themselves) this could be due to the fact that the two enemies were exhausting all their resources on a titanic struggle against my defences, whereas the ally was just sitting back quietly doing their own thing. Also there was an absence of heavy mobile artillery which was the only thing that would have allowed them to crack my massive plasma batteries.
1) AI doesnt know antinuke, yet, it knows only nukes now :)

2) Sometimes it happends, that some AI player doesnt build tech2 arty, but its really unussual
BaNa wrote:I played some more games with it and it was very nice, i couldn't take 3 hard ais against me but could beat 2 of them. Played a few hueg 3v3v3v3v3vme ffas and one of them became very strong, sadly that was mainly reflected in the fact that his hammer group streched the map, not in any t2-t3 stuff.
Theres no brain yet, so parts of army are partly random and partly hardcoded. With brains (next task of my developement) AI will choose its developement in reaction on game situation - so for example more teching or airspam against turtle-like playing players.
User avatar
PepeAmpere
Posts: 589
Joined: 03 Jun 2010, 01:28

Re: NOE AI - development, ideas, manual

Post by PepeAmpere »

some marks about news in 1.69
  • killed bug with skipping some tech2 building becouse hardcoded energy limits
  • main battlegroup secondary line now keep near primary line (no such crazy positions as before, far from fights)
some issues still not fixed
  • sleeping AI when not enough mexes at start around the base
  • new bug: sometimes energy stall when big metal income for AI in late game
User avatar
yuritch
Spring 1944 Developer
Posts: 1018
Joined: 11 Oct 2005, 07:18

Re: NOE AI - development, ideas, manual

Post by yuritch »

I've seen one of AI's moho engineers reclaiming a mex while some other con unit (maybe the base) was repairing it. Effectively those 2 units got infinitely stuck and were using metal without doing anything useful.

Probably the mex was nearly completed when moho engineer decided to upgrade it, but I'm not 100% sure how exactly that happened (and have no replay).
Post Reply

Return to “NOTA”