NTai XE10.1b - Page 54

NTai XE10.1b

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

Moderators: hoijui, Moderators

User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

The upper case values 'could' persist after the change however they're orphan values that will never be updated. I'd say it's safe to ignore them as only the lowercase values are actually used.
User avatar
lale
Posts: 73
Joined: 29 Apr 2007, 08:36

Post by lale »

Issue 2:
I├óÔé¼Ôäóve hesitated to report this issue earlier :oops: , because it used to have minor consequence, and I believed it had something to do with my own inabilities to make a correct config file.
This error occurs in all tested maps and all mods (AA,BA,OTA,CA)

Also this ├óÔé¼┼ôerror├óÔé¼┬Ø is strangely self correcting! :!: :!:

The problem exists with all 9.7 builds, however with the NTaiCaseTest build, it becomes a showstopper! :cry: :!: :cry:
Showstopper = because it happens a lot more often, and the ├óÔé¼┼ôself correcting├óÔé¼┬Ø factor somehow occurs a lot less!
--------
Symptoms and consequence:
In the logs I see many entries with this text:
error: a problem occurred loading units unit definition corxxx
This error is reported both for factories and constructers. The consequences are different.

Let me show some examples:

Numbers in front are abstract frame/time steps, the problem is not restricted to corwin and corck, just an example
1 corck builds corwin. // everything is fine, corwin gets constructed, and starts spinning
2 corck builds cormex
3 corck tries to build corwin. -> logs: ├óÔé¼┼ôerror: a problem occurred load├óÔé¼┬ª corwin├óÔé¼┬Ø
4 corck skips building corwin, and goes to next item in queue
6-147 corck tries to build corwin with intervals according to queue, but continues to get error in log.
148 corck builds corwin // NO ERROR :!: - corwin gets constructed, and starts spinning
149-287 corck builds corwin with intervals according to queue, NO ERRORS!
288 corck tries to build corwin. -> logs: ├óÔé¼┼ôerror: a problem occurred load├óÔé¼┬ª corwin├óÔé¼┬Ø

As you can see from the example, the problem comes and goes! :shock:
Also when corck fails to build corwin due to error, ALL units (corcv etc) fails to build corwin.

For factories the problem becomes a bigger issue: :evil:
1 corck builds coralab
2 coralab tries to init, but log -> error: a problem occurred load├óÔé¼┬ª coralab
3 coralab doesn├óÔé¼Ôäót load queue, and do NOT build anything.
22 corck builds coralab
23 coralab tries to init, but log -> error: a problem occurred load├óÔé¼┬ª coralab
24 coralab doesn├óÔé¼Ôäót load queue, and do NOT build anything.
25-773 repeat above
773 ALL coralab├óÔé¼Ôäós suddenly inits correctly, loads buildqueue and ALL coralab├óÔé¼Ôäós starts building.
779-873 ALL coralabs tries to init, but log -> error: a problem occurred load├óÔé¼┬ª coralab

I have tried to do analysis of logs, to find a pattern in actions leading to the first occurrence (per game) of this error, but have failed :cry: to find any pattern.

There is a small tendency to the above error first occurrence after this is recorded in the log:
Factor::CBuild(2)unit finished does not exist?! Could it have been destroyed?
There is a small tendency to the above error first occurrence, after the first level 2 factory is completed. But sometimes the error occurs already when the commander starts building.

Most of the time however the ├óÔé¼┼ôerror: a problem occurring loading├óÔé¼┬ª├óÔé¼┬Ø happens ├óÔé¼┼ôout of the blue!├óÔé¼┬Ø :x

I wish :| I could do more to help nail this issue, but I only have my gut feeling to offer: :arrow: that this bug is loosely related to unitnames in uppercase.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Code: Select all

Factor::CBuild(2)unit finished does not exist?! Could it have been destroyed?
When NTai starts a build process it checks the builders health. If its less than 1 it quits the build process and moves to the next task in hopes that a unitdestroyed event is waiting to be processed. This check has now been removed.

Code: Select all

error: a problem occurred loading units unit definition corxxx
Are you sure you copied this correctly? I tried searching for substrings and couldnt find anywhere. So I tried similair sounding strings incase they where the culprit. There was a builder == 0 check in the tasks that could have generated those errors as there was an incorrect line above them altho that shouldnt have affected it. Itw as retrieving a untidefinition when the required value was already stored there, sort of like a=5; a=5;.

I've made that error message give more information just incase.

I also looked at exclusion zones and added checks just incase to make them lowercase though I dont think there was an issue anyway.

http://www.darkstars.co.uk/randomfiles/NTaiTest2.rar



on a side note, test test test!
http://www.darkstars.co.uk/randomfiles/MAPAI.rar
Goidse
Posts: 11
Joined: 11 May 2007, 15:02

Post by Goidse »

Well I have been trying to make a config myself. Its going pretty well but my guys won't go attack. If they see an enemy they go kill it and return to their place. Thats all they do :(.
They are selected as attackers.


How can you let you'r scout go scouting?


Mod is BA 4.7
User avatar
lale
Posts: 73
Joined: 29 Apr 2007, 08:36

Post by lale »

For a group of units to attack. u need 2 things
1) in config file, under [AI]: attackers=corxxx,armxxx; etc..
2) in config file, under [AI]: initial_threat_value=4; where 4 means build 4 units, then attack in group of 4. (use any number you like)

And finally. Using 9.7C build, NTAI should make a map mark: "attack pos". this happens after about 10 miniuts of game time (in my config).

Scouts are currently OFF, atleast thats my understanding
:?:
Goidse
Posts: 11
Joined: 11 May 2007, 15:02

Post by Goidse »

I have done those 2 settings.

In my latest tests there were attack points and if I wanted to attack in groups of 5, mostly only 1 attacked and the rest stayed put.
User avatar
lale
Posts: 73
Joined: 29 Apr 2007, 08:36

Post by lale »

AF:
This is from new build test2:
[00:18] < Frame: 543 >next task?
[00:18] < Frame: 543 >CUnitConstructionTask::Init :: CORWIN
[00:18] < Frame: 543 >CUnitConstructionTask::Init error: a problem occurred loading unit definition: unitid=4998 building=CORWIN
[00:18] < Frame: 557 >next task?

EDIT, AF the new build crashs spring!
-after a few moves / minuts.

AF: what is MAPAI.dll for?
EDIT: :o it exports map info. neat! but the export says 0 features found during export. with three tested maps....

Goidse:
hmm..
In the start, ntai often attacks a little cautious, leaving units to cover its rear.
But in my experience, it soon pick up speed, and attacks with all 5 units

What map are u using?
Last edited by lale on 11 May 2007, 18:42, edited 1 time in total.
Goidse
Posts: 11
Joined: 11 May 2007, 15:02

Post by Goidse »

SmallDevide

Can you say: const bot 1 does this, const bot 2 does this, etc. and same with factory's?
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

No, you assign a group of tasklists and it randomly picks one. Theres no ordering to which tasklist it picks at the moment.

NTai doesnt need scouts, and scouting is broken and was disabled as such.

And NTai leaves untis behidn ebcause those untis belong to the next group in line.

if your initial attack group is 5 untis and 4 units have been built and suddenly 2 units are finished then 1 will join the group and go attack and 1 will stay behind and wait for the next group to finish, which will have a size of 6 units.

Also lale, It looks like your editing the configs using a text editor but keep in mind most people edit configs using Toolkit (albeit there are a few features not integrated into toolkit such as metatags and targetting priorities).

Also keep in mind that toolkit writes out a new config it doesnt edit it, so saving in toolkit erases any unsupported tags or comments or formatting you've applied in a text editor, such as // /**/ metatags, or targetting priorities. For examples of metatags and targetting priorities look at old XTA configs from lindir and Arghs old nanoblobz config.

lale could you email me the config you were testing and details of the game you get the crash most often on? It'd help if reproducing the issue was as easy as possible. I'll try and run it through a debugger on my old computer.
Goidse
Posts: 11
Joined: 11 May 2007, 15:02

Post by Goidse »

Well the problem is that if I give 4 for the groupsnumber, only 1/5 gets away. The rest just stays there. After some time 20+ bots are standing there, doing nothing.


And if you say 4 is it 4/factory or 4 in total?
User avatar
1v0ry_k1ng
Posts: 4656
Joined: 10 Mar 2006, 10:24

Post by 1v0ry_k1ng »

NTAI does need scouts, or some mex harasser tag for raiders.
what NTAI really really needs are more customiseable attack group sizes

so you can have a first group of 2
then make the 2nd group 7
or then make it increase by 2 + 20%
User avatar
hughperkins
AI Developer
Posts: 836
Joined: 17 Oct 2006, 04:14

Post by hughperkins »

Hi AF, had a go at running NTai, but the commander just sits there not moving.

Steps taken:
- installed Spring 0.74b3

- downloaded NTai_XE9.7C.zip
- unzipped NTai_XE9.7C.zip
- copied NTai.dll into $taspring\AI\bot-libs

- downloaded NTaiToolkit0.26a.zip
- unzipped and copied contents into $taspring\ai (so the NTai directory in the zip ends up at $taspring\ai\ntai)

- ran spring with XTA 8.1 and ntai bot
- shutdown spring

- ran NTaitoolkit
- opened config $taspring\ai\ntai\XTA_BT2.tdf
- saved the config

- reran spring with XTA 8.1 and ntai bot
- nothing happened?
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

I dont remember adding a fulyl functional XTA config to the toolkit download. The onyl config that could possibly considered functional for XTA is Ivory Kings, and IK is not giving me the config for some reasond espite the tremendous probability of it never seeing the light of day that results from "wait till I'm finished syndrome".

Your gonna have to build the config yourself.

In the mean time logs wouldnt go amiss. error reports in this thread 90% of the time are utterly useless because they make no mention of logs. Its like 'I couldnt find the needle' the long needle? short? shiny? dull? in a haystack? where? etc, no context.

Goidse, it sounds like youve not assigned the attacker tag to every single attacker. If you tell it to build a peewee and you dont tell it that a peewees an attacker, itll just sit by the factory forever attacking things which come up close. Dont rely on automatic detection of attackers either, its notoriously unreliable(hence why it can be turned on and off).
User avatar
lale
Posts: 73
Joined: 29 Apr 2007, 08:36

Post by lale »

First: The crash only happens with the dll in NTaiTest2.rar. All previous versions including NTaiCaseTest.rar do not crash.

Second: As you suspect, I do not use the toolkit now, :oops: but have used it until I discovered the problem with solobuild and upper case unit names. (This bug is fixed in NTaiCaseTest). So my current config is based on lots of work in the toolkit, but the section for solobuild and maxenergy are made with a text editor.

Since I wanted to be sure, the crash wasn├óÔé¼Ôäót related to misspelling, I started a new configfile with the toolkit.

Crashreport:
NTaiTest2 crashes if a unitname (eg corwin) instead of a metatag (eg b_power) is entered in build list for a constructor. (at least for corcom)

Step to reproduce: (at least on my machine)

1) erase aa.tdf from learn and config folder
2) start spring, selecting AA v2.23 and map SmallDivide (most maps will do)
3) exit spring (now; new config file is made.)
4) start toolkit, open aa.tdf,
5) make list ├óÔé¼┼ôcom1├óÔé¼┬Ø insert 1 unit ├óÔé¼┼ôcorwin├óÔé¼┬Ø into list
6) assign list ├óÔé¼┼ôcom1├óÔé¼┬Ø to unit corcom
7) save file
8 ) start spring, set bot ntai for core, start game (same map and mod)
9) wait for game to start
10) spring crashes within the first few seconds. when corcom tries to construct corwin.

log file ends with:
[-] < FRAME: 0 >loading contents of tasklist :: com1 :: filling tasklist with #1 items
[-] < FRAME: 0 >CunitConstructionTask::CunitConstructionTask building :: CORWIN (btw upper case??)
[-] < FRAME: 0 >loaded contents of tasklist :: com1 :: loaded tasklist at 1 items
[-] < FRAME: 0 >CunitConstructionsTask::Init :: CORWIN

(no more entries ├óÔé¼ÔÇ£ spring has crashed at this point)
I do not mind sending you my old config file :?: , but as you can see from above you should easy be able to reproduce the problem without.

A few more facts:
  • Crash happens with both BA 4.7 and AA 2.23.
    Crash seams to be independent of map. (tested 5 different)
    Tried to play with previous dll from NTaiCaseTest.rar using above simple config -> no crash.
    Crash happens if unitname in list is: corwin, cortide, corsolar, corllt. But probably for all units corcom can construct
    Crash might be confined to corcom, untested at this time.
User avatar
lale
Posts: 73
Joined: 29 Apr 2007, 08:36

Post by lale »

I├óÔé¼Ôäóve done a little more testing with NTaiCaseTest.

Since I've started to rebuild using the toolkit, I was curios if "cleaning" to the config file would do anything to reduce the error:
CUnitConstructionTask::Init error: a problem occurred loading unit definition: unitid=4998 building=CORWIN
(not confined to corwin, only an example)
But so far no luck :cry:
I have, however, observed that the above error is highly depended on units under construction getting destroyed├óÔé¼┬ª
  • If a game is run, without opposition (so no destruction of ntai├óÔé¼Ôäós units), the above error will not happen.
    If NTAI is attacked early in the game, the error will happen early, and influence the whole game forward.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

So basically unitname construction si borked.

Also metatags != universal build keywords. metatags are defined by the config builder so:

say I define m_factory as corlab corvp and corsy, and give a commander a tasklist with an m_factory keyword, it will randomly pick either a corlab, corvp or corsy to build, filtering out anything that the commander cant build. This way you can define your own keywords such as artillery, raiders , flamers etc.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

User avatar
lale
Posts: 73
Joined: 29 Apr 2007, 08:36

Post by lale »

Report from NTaiCaseTest3:
Crash has been Fixed!
------
Bug inside my head has been fixed! :roll:
OK: factories do NOT shutdown due to error about loading unit (se below)
Problem was in my head and in the config file.
:shock: :oops: :( :oops: :cry: :oops: :oops:
Basically I was having problem with enemy scouts destroying units exiting factories, and came up with this ingenious solution: :roll:
>> Put ├óÔé¼┼ôb_reclaim├óÔé¼┬Ø inside build queues for factories <<
BIG MISTAKE! :shock: :shock: :shock:
Factories do NOT reclaim! (forgot that) :oops: :oops: :oops:
When a factory encounters a b_reclaim, it writes a Timeout:
ID: 90 Timeout: 2147483647 parms: 75, source of command: cmd_recl Cactions::Reclaim
After which the factory shutdowns / goes passive
Actually I think all factories should auto-reclaim per default in (or TA mods) spring , if a unit is destroyed in its creation/exit port. Especially if this is implemented:
http://spring.clan-sy.com/phpbb/viewtopic.php?t=10135

-----------------
Errors skipping of building units in list remain.
(But this is a small :!: error, as it is self correcting, only affects neat build order)

The error starts with the same unitID: eg.
First I see:
[-] < FRAME: 18031 >CKeywordConstructionTask::Init b_defense
[-] < FRAME: 18036 >next task?
[-] < FRAME: 18036 >CunitConstructionTask::Init :: CORWIN
[-] < FRAME: 18036 >CUnitConstructionTask::Init error: a problem occurred loading unit definition: unitid=4916 building=CORWIN
[-] < FRAME: 18039 >next task?
Again after several similar errors: (with different unit names, but same unitID)
[-] < FRAME: 26369 >CunitConstructionTask::Init :: CORALAB
[-] < FRAME: 26369 >CUnitConstructionTask::Init error: a problem occurred loading unit definition: unitid=4916 building=CORALAB
Now a new corck has been built and the unitID changes:
[-] < FRAME: 26513 >CunitConstructionTask::Init :: CORWIN
[-] < FRAME: 26513 >CUnitConstructionTask::Init error: a problem occurred loading unit definition: unitid=4947 building=CORWIN
- And until the error ├óÔé¼┼ôself corrects├óÔé¼┬Ø ALL constructors skips building of unit.

The metatags sounds interesting, so now I can make my own m_builder?
Are units in metatags chosen according to learn efficiency, or at random?
(I think I will wait a while before experimenting with metatags, considering the above mentioned failure with the bug in my head)
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Goidse
Posts: 11
Joined: 11 May 2007, 15:02

Post by Goidse »

If anyone needs a config for BA 4.7 -> here is one

Image


There is one bug I would like to see fixed, that is when a group goes attacking they stop if they meet an enemy on the way and then they stop moving.
Post Reply

Return to “AI”