NTai XE10.1b - Page 62

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 »

Then I'll remove the mex safety fallbacks. This does mean that conbots will walk through enemy bases to reach mexes at the back of them.

In the mean time I'm rather confused, people keep mentioning tasklists failing to load but I havent a clue what you mean is this the mex bug? huh? =s... Make very very very clear what a bug is. If you dont then bug A + Bug B == AF sees an imaginary single Bug C that doesnt exist and gets confused. You want me to see A, or B, not the imaginary combo Bug C.

Imagine all your posts mixed up and garbled up randomly.

Toolkit bugs go in the toolkit thread. NTai bugs go in the NTai thread.

The value 3k has nothing at all todo with mexes, I only mentioned it as the default range used to search for geothermal spots. I remember one mex system where if a mex was flagged as bad, any mex spots that were further away and within 20 degree arc distance of a bad spot were skipped. There are other mechanisms but I dont remember them. This is old code, probably nearing a year old.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

I've looked through and found more of the mechanisms

If a mex spot has an enemy within 900 pixels of it that has a weapon it will be skipped. So NTai will build a mex nearby an enemy solar if theres not an llt or attack unit nearby.

There also appeared to be a part where it listed 'infestations' of enemies and wouldnt go near infested regions. Part of the problem may be that the infested regions are never uninfested. But I've commented out a lot of those anyway.

In XE9.72 the code that controlled putting together unit groups had false not true on FindTarget function parameter, which meant it wasnt going to make the threshold higher. There were 2 copies of this code. I fixed UnitMoveFailed but not in UnitIdle, and in the last build in XE9.72B, I cleaned that up so UnitMoveFailed called UnitIdle() and forgot I had to change the parameter.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

User avatar
1v0ry_k1ng
Posts: 4656
Joined: 10 Mar 2006, 10:24

Post by 1v0ry_k1ng »

AF wrote:If a mex spot has an enemy within 900 pixels of it that has a weapon it will be skipped
maybe reduce that to like 500?
User avatar
1v0ry_k1ng
Posts: 4656
Joined: 10 Mar 2006, 10:24

Post by 1v0ry_k1ng »

AH YEARH!
attack groups are working like gramps down the mines,
my config has become a man.
i realise this may be hard but would it be possible to allow a numerical increase AND a percentage one? so I could have +4, minus 20% so attack groups start small, grow, then level out at around 20/ wave

ill get crackin on the core config
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

A percentage increase has been added to toolkit and the checkbox removed.

A max attack group size has been added, and a dont build mexes fi an enemy weapons in this radius has been added, so you can switch it to 500.

The changes to NTai havent been made yet so I wont release this just yet.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

XE9.73

see above for chaneglog
User avatar
1v0ry_k1ng
Posts: 4656
Joined: 10 Mar 2006, 10:24

Post by 1v0ry_k1ng »

the mex placement in the version that just got the attack groups working was perfect, what setting was that on?
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Its the same as normal but with all the safety mechanisms removed except that weapons one.
User avatar
1v0ry_k1ng
Posts: 4656
Joined: 10 Mar 2006, 10:24

Post by 1v0ry_k1ng »

ok NTAI plays much better now, and as a result the old flaws are getting more obvious

1) repaired units not being sent back into attack (any unit sent to a basepos)

2) units often get a move order back to the nearest basepoint in the middle of an attack, and when on the threat marker, when given attack orders, if they attempt to move away from the marker they get an instant move order back, meaning at the end of the game, forces can never move to attack the last mex's

3) threat system isnt refreshing; units hang around a threat point where there is no longer any enemy units, for ever

4) NTAIs strong beleif that it should attack the strongest enemy position in a single file line means that despite outnumbering the enemy 5:1 it usually gets a total drubbing. equally frustrating is NTAI sending all its units at the enemy commander in single file line, where they get m,ass dgunned. this isnt a problem with anything but NTAI deciding what should be attacked.

I realise your not working on this anymore, but if you ever do i have an idea for you;

the threat matrix by default has value of 0 everywhere
units with weapons give a positive value to the matrix, which is where attacks are launched.
if units without weapons are given negative values, then you could set NTAI to attack the lowest threat value in an area, resulting in it avoiding anywhere with an enemy garrison or defences, and heading for where there is the most ungaurded economy/factories, which would cause it to behave more like KAI did (avoiding your forces and sneaking round the backy). by giving fixed defences high values, you could make NTAI avoid entering areas in range of defences, which would make it seem more intelligent. just ideas, ill send you a config for test sometime tmoz

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

Post by AF »

That would work the same way as it does now only you then have mroe problems

Threat matrix searches would be 100x slower to process
Ever increasing values when attempting to depreciate the matrix turns into appreciation, causing runaway values and then overflows into the negative.
User avatar
1v0ry_k1ng
Posts: 4656
Joined: 10 Mar 2006, 10:24

Post by 1v0ry_k1ng »

i dont understand how the threat values change or decrease. how i imagined it would be is that the threat matrix is regulary recalculated from fresh, ie, every 10 seconds it calculates the area of biggest threat dependant on what units are in that position. you make it sound far more confusing than that though, so what is the process?
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Imagine a tabletop with a grid on it thats the same dimensions as the map.

Every 2 seconds, you look at all the units on the map and their efficiency. So say there's an AK at 2,5 and it has 5 efficiency, go add 5 blocks to the stack of blocks at 2,5 on the table, repeat for every other unit.

Every 3 seconds reduce the height of each stack by multiplying its size by 0.9 or 0.99 etc.

To find an attack position return the co-ords of the highest stack.

As units are built they make stacks get higher. If a untis destroyed the stack gets smaller and smaller because there arent any more blocks being added.

Its the trick of fiddling the two values.

Regenerating the threat matrix every time you do the cycle could increase cpu usage a lot. It also takes a huge array of tricks and shunts them intot he garbage can, such as assigning a large threat to initial startpositions to encourage early attacks. Or letting threat build up to present a more effective cumulative view of the threats distribution, and provide greater contrast.
User avatar
1v0ry_k1ng
Posts: 4656
Joined: 10 Mar 2006, 10:24

Post by 1v0ry_k1ng »

ok, my idea was more along the line of no tricks or shunts;

every 3 seconds the blocks are placed, positive blocks for units with weapons, negative blocks for mex, economy, factory.

its refreshed 3 seconds later

the AI picks the area with the highest negative value (highest proportion of negative to positive) and attack there.

anyway, since i dont know how it works i cant really comment, just suggesting that the AI needs to choose its attack pos in a way that dosnt make it hit the strongest place on the line
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

by highest proportion fo negative to positive your going to have to expand into somethign a little more logically rigid.

Your idea also has a major flaw. A base with as many atatckers as resources could balance out into a 0, cancelling eachother out.

Also, it would have disastrous consequences if a race had weapons on the vast majority of units. For example, in EE betas, the alien race has units building units, the commander builds an assult form which then builds other assault forms and the assault form of the next tech tier. These need blowing up.

Also what if theres a huge army just about to attack your base? Should you go attack the mexes on the other side of the map or the untis about to obliterate your base? Should you attack a vulcan built next to your base about to fire or fusion farm a screen away?

The immediate answer is to make resource generating units extremely threatening.

The point of an AI si not to destroy the player but to put up a fight. In the ideal game situation the AI is slightly worse than the player so the player has to put up a good fight but they will win if they keep at itjj. Keep that in mind.
User avatar
1v0ry_k1ng
Posts: 4656
Joined: 10 Mar 2006, 10:24

Post by 1v0ry_k1ng »

i think i know what is wrong w/ ntai.
try removing the intial threat boost on starting position, and any weird things like that you put in. i reckon they are why the AI never mops up.

also, if you made it attack the lowest threat area, it would just pick the area with the least guns.

and considering that everything has a diffrent efficency, often with decimal places, there is no chance in hell of the whole map or actually any of the map being threat 0.

the point of an AI is to be a challenging alternate to a human opponent, ideally playing just as well as a human player with as little cheating as possible
User avatar
lale
Posts: 73
Joined: 29 Apr 2007, 08:36

Post by lale »

I├óÔé¼Ôäóm going to troll you a little IK ;-)
If you were a player against NTAI, and you realized that the game you currently are playing is going to be lost to NTAI. Would you feel that your ├óÔé¼┼ôentertainment├óÔé¼┬Ø time is well spent seeing NTAI take that last mex from you, or would you rather start a new game?
In that perspective I think AF├óÔé¼Ôäós priority on his resources is reasonable.

BUT. If you play a game: Player vs RAI vs NTAI. Then expecting NTAI to clean RAI is reasonable, then again this isn├óÔé¼Ôäót where the n00b player would be most disappointed with the AI.

However, letting NTAI attack resources, is reasonable.

There is two way├óÔé¼Ôäós to deal with this:
  • 1) Maintain NTAI current threat matrix. And add another matrix where ├óÔé¼┼ôrich├óÔé¼┬Ø (resources etc.) enemy targets are kept. This will let unit handling in NTAI weight each rich target vs. the threat.
    2) Quick hack. Use IK├óÔé¼Ôäós scheme with a modification:

Code: Select all

If (new threat) then
     if area < 0 then area=threat 
                 else area=+threat
if (new ├óÔé¼┼ôrich target├óÔé¼┬Ø)
     if area <=0 then area=+├óÔé¼┬Ørich target├óÔé¼┬Ø  
                 else area=area (ie no change)
Solution 2 makes it possible to attack unprotected targets, by attacking largest value of |area| (numerical)
Solution 1 is a completely new and possible expensive, feature to NTAI.


Ohh and AF that fix you did with:
AF wrote: There also appeared to be a part where it listed 'infestations' of enemies and wouldnt go near infested regions. Part of the problem may be that the infested regions are never uninfested. But I've commented out a lot of those anyway.
REALLY solved the problem with mex rebuilding.
User avatar
1v0ry_k1ng
Posts: 4656
Joined: 10 Mar 2006, 10:24

Post by 1v0ry_k1ng »

lale wrote:I├óÔé¼Ôäóm going to troll you a little IK ;-)
If you were a player against NTAI, and you realized that the game you currently are playing is going to be lost to NTAI. Would you feel that your ├óÔé¼┼ôentertainment├óÔé¼┬Ø time is well spent seeing NTAI take that last mex from you, or would you rather start a new game?
your a player against NTAI and you can beat it every time playing one handed while reading a magazine, because when you make a few hlts NTAI will attack them in single file and ignore your base. Would you feel that your ├óÔé¼┼ôentertainment├óÔé¼┬Ø time is well spent seeing as you could go out to a party and make out with a pretty girl and come home the next morning with an epic hangover to find your still winning?

ok thats a bit exxagerated, but justifiying an AI being stupid by "players like to win" is dumb :P
However, letting NTAI attack resources, is reasonable.
attacking resources and attacking the most heavily defended HLT line is the diffrence between a clever AI and a no AI :P
There is two way├óÔé¼Ôäós to deal with this:
  • 1) Maintain NTAI current threat matrix. And add another matrix where ├óÔé¼┼ôrich├óÔé¼┬Ø (resources etc.) enemy targets are kept. This will let unit handling in NTAI weight each rich target vs. the threat.
    2) Quick hack. Use IK├óÔé¼Ôäós scheme with a modification:

Code: Select all

If (new threat) then
     if area < 0 then area=threat 
                 else area=+threat
if (new ├óÔé¼┼ôrich target├óÔé¼┬Ø)
     if area <=0 then area=+├óÔé¼┬Ørich target├óÔé¼┬Ø  
                 else area=area (ie no change)
Solution 2 makes it possible to attack unprotected targets, by attacking largest value of |area| (numerical)
Solution 1 is a completely new and possible expensive, feature to NTAI.
solution 1 would probably maek moar lag

and agreed, mex building is 10000000000000000000000000000 times better, although it does send cons to enemy mexs, where they sit in puzzlement. maybe make it detect any any units in the radius, not just units with guns? or make it reclaim an enemy mex it finds in place already?
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

units attack in single file not ebcause NTai says so but because thats how springs pathfinder works. Youd get the same results if you did it yourself.

142.75299142942378410289762067474

After 5 minutes with a depreciation of 0.99 epr second, thats what a 3k threat matrix blimp will be. 142 is a terribly small value in most mods. values less than 10 arent stored.

In the mean time I'll try and decrease matrix resolution and attempt to weigh in attack group efficiency, by calculating the efficiency of the attack group and atatcking the largest value sector that has a threat smaller than attack groups efficiency*constant.

That will take time tho. My room ocerheats badly atm and I have an aflobby and an afserver to build and a website to build.
User avatar
DJ
Posts: 355
Joined: 17 Jan 2007, 13:26

Post by DJ »

This AI is really performing well now! Got it consistently beating 2 RAI's allied against it.

I'm not sure I understand entirely how the threat matrix works but my understanding is that attack points are set dependant on the efficiency of the enemy units in a square. There's been alot of discussioin about whether this is correct or not. Regardless of that I would say that that solution is incomplete as the threat matrix takes no account of the proximity of the enemy to NTai's units. It might be better to have a multiplier to the threat level that was dependant on the proximity to and the efficiency of NTai's units. If I've not explained that very well what i mean is this -if the enemy has two krogoths in the top left but has 5 level 1 rocket tanks near my commander I want to attack the rocket tanks not the krogoths. -I don't know how difficult this would be to implement but i'm not sure it would be that hard...

Another point entirely, don't know if its useful to anyone but if you give a b_retreat order to a construction vehicle (in BA) then tell it to build a nano tower it will build the nano tower within range of the factory. If you give nano towers a task list with only gaurd nearest factory in and hold position orders NTai then has nano turrets guarding factories which works really really well! 8)
Post Reply

Return to “AI”