NTai XE10.1b - Page 65

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 »

No it doesnt atm.

Right now there are enough configs built and released for 1 size fits them all style configs nevermind multiple configs for map specific gameplay. If I implemented it it would be sued for 4 or 5 maps on BA and that would be it. There'd be no mass flood fo configs and the feature would be wasted.

How do I know this? Because before the config format changed NTai supported it, and in the stretch august 2005-march2007 nobody implemented a single map specific config.
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Post by imbaczek »

well, ivory has just done it, he specifically stated it will pwn on comet.
User avatar
1v0ry_k1ng
Posts: 4656
Joined: 10 Mar 2006, 10:24

Post by 1v0ry_k1ng »

lol it still plays every other map, it just plays better on big open maps than small maps with obstables and elevation
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Post by imbaczek »

yah, but that's the whole point :> say if I made a config that played better on small hilly maps, I'd like to tell NTai to use my cfg on those and your cfg on open ones.
User avatar
DJ
Posts: 355
Joined: 17 Jan 2007, 13:26

Post by DJ »

more than that you could config AI's to play in different styles, so you could play against an aggresive or defensive ai or one that attacked with mostly aircraft.

Don't think it would be that difficult to implement but would require some work to a lobby to allow you to pick which config the instance of NTai loaded as well as NTai being changed to listen for a config modifier.

I think there are more important things to concentrate on though -Mex upgrading for one and defence placement for another.
User avatar
1v0ry_k1ng
Posts: 4656
Joined: 10 Mar 2006, 10:24

Post by 1v0ry_k1ng »

this sounds like a useful feature but id much rather see the current problems fixed;

1) epic cpu usage- needs optimisation!

2) attack behavior

3) building factories against the edge of the map so units cant get out of them
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

I'm getting conflicting reports over cpu usage. Nobody has told me any patterns or anything helpful other than

a: NTai CPU usage is low
b: NTai CPU usage is high
c: It gets laggier as the games gets longer (unavoidable, all AIs will get slower as the game goes on)

NOBODY si suggesting a replacement for defence placement. Theyre simply sayign ti needs to eb solved. If you cotninue to do this then thigns wont get any better I assure you, defence placement will be just as bad in a year as it is now ebcause nobody ahs fofered suggestions on howto improve it.

All mentions of KAI defence placement will be ignored with a vengeance. NTai has no pathfinder and I'm not spending several months implementing and learning the intracacies of pathfinding.

Attack behaviour:
Your not helping here either. What I have heard here on this isnt helpful. What suggestions youve given have all had fundamental flaws, aswell as involving a cpu cost hike, and after that they've just been regurgitated.

Let me put it plain and simple

top
1) AFLobby
2) Spring site redesign
3) Darkstars
4) Lobby bots
5) AFServer design
6) Toolkit
7) NTai
bottom

Right now your all complainign and asking for new features and I havent seen much gained from the existing feature set, which begs the question, what use is there in implementing new features?

You have the best there is at the moment make do with it untill lua rolls around. I have limited resources,a nd right nwo the same 10 sentences over and over again arent helping they're incredibly demotivating, and you all know what happens when demotivation sets it, look at KAI/JCAI/OTAI/QAI/BAI.
3) building factories against the edge of the map so units cant get out of them
Its called spacing. Raise your factory spacing values.
User avatar
1v0ry_k1ng
Posts: 4656
Joined: 10 Mar 2006, 10:24

Post by 1v0ry_k1ng »

factory spacing value is 10, so clearly that isnt the issue..

im not trying to demotive you, im pointing out problems so you know whats wrong. i dont know enough about programming to suggest solutions.

cpu usage increases the more units and cons NTAI has. once it has about 30 cons and 200-300 units the lag is quite epic. the building placelent causes lag spikes. i dont know how to solve that. i mention the cpu usage because its many many times higher than the other AIs, like 4-5 KAI with full bases causes the same lag as an NTAI. not a problem for me on 3.6 ghz, but might be for some.

no need to replace defence placement, its fine for placing light anti raider defences and theres no fun fighting an AI that porcs in hard

this AI is currently the most promising which is why its getting attention, but it wouldnt be very helpful to list the good points as you already know, im trying to help.

you should take time out to play your AI with one of the configs so you understand these issues maybe
User avatar
DJ
Posts: 355
Joined: 17 Jan 2007, 13:26

Post by DJ »

I think i've found the reason why NTai slows down towards the end of the game. It would appear to be that whatever code is called by the units that have retreated back to a base position is causing the problem. These units never move again anyway so there is definitely an issue with this.

To test this I played on the same team as NTai and when the slow down occurred I sent all the retreated units into battle and there was a noticeable improvement. AF could you do a release with the retreat behaviour just commented out so I can test?

Also as regards high CPU usage the problem seems to be that towards the end of the game you have masses of construction units all looking for build sites in a crowded area. I have a config that works really well by not allowing this to happen (send construction units off to guard factories and don't build too many) this seems to really work, hopefully if i'm right about this retreat code we should have a kick ass AI with no slow downs and all AF has to do is comment out some code, so everyone wins 8)
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Remember why the code was put there to begin with?

UnitMoveFailed causing huge cpu spikes.

Look into this further. Is this just attack units? Look at the logs to try and gauge a pattern. Is it a neverending task loop for example?

I'm at a loss why a 2 year old tried and tested system suddenly started showing these horrendous problems, yet other AIs that use very similair systems dont suffer this problem.

AAI should have this problem. AAIs system is very similair to NTais, so much so they were originally identical, I just rewrote the AAI attack routine to work in my own AI and then spent a year twiddling it and tweaking.
User avatar
DJ
Posts: 355
Joined: 17 Jan 2007, 13:26

Post by DJ »

I think its that the engine struggles with all the untis being sent back to same point, these units then just sit there, is there any trigger that you could respond to when a unit returns to full health? Could you then add that unit back into the attack groups?

What happens is the CPU usage with my test config (no rediculous levels of construction units) stays low but the latency (ping ms) goes sky high. If you could send me the code for the unitfailed stuff I'll try compare that to the other AI's and see if i can spot the problem.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

To get an event for 100% health reached I'd have to manually store and test each unit at set itnervals to see if the health has risen and if it is now 100% where it wasnt in the last check.

The unit move failed code is very very very very simple.

Code: Select all

void Unitmovefailed(int unit){
    Reatreat(unit);
}
User avatar
DJ
Posts: 355
Joined: 17 Jan 2007, 13:26

Post by DJ »

well yes that is very very simple but isn't much use if you don't include the retreat method code :?

Also I think from that that seeing as you are sending all the units to the same place, some will fail, calling the unitmovefailed code again which will again attempt to send them to the same place which is probably the loop we are looking for...
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

I dont send them all the same place.

As I said before, theres an array of base positions. It sends it to the closest position in the array iirc.

I'm on my laptop atm anyway
User avatar
DJ
Posts: 355
Joined: 17 Jan 2007, 13:26

Post by DJ »

when unitmovefailed is called does it give you the original move command? Is there any way to say that if the unit has moved to within x of command that that is good enough?
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

I'm sure you have the source code to the CActions class.

It calls Move() or MoveToStrike() I'm not sure which, and it returns a boolean. Theres no persistent memory, it calculates the necessary action, attempts to issue the order and then returns a success value. Nothing to do with commands being returned or tasks etc.
User avatar
DJ
Posts: 355
Joined: 17 Jan 2007, 13:26

Post by DJ »

if i added a add base position keyword to a task list will that be called everytime the task list gets to that point?

If so would that cause a problem?

Is there anyway to discover the contents of the base pos array?

I'm at work so i have no access to any source code.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

I suppose it would repeatedly add the position to the basepos array which might be an issue for static structures but its easily fixed by changing it from a vector to a set container.

Adding basepos to mobile units is generally not advisable.

In the mean time I've requested permission from tobi to put NTai in the svn. A full uptodate version of the source might be more useful than a slow trickle of code tags from me.
User avatar
DJ
Posts: 355
Joined: 17 Jan 2007, 13:26

Post by DJ »

i was thinking of adding it as a task to major resource structures, geo's fusions, lev2 factories. The reasoning being that the more base positions there are the less likely a unit is to be sent to the same one... How and under what circumstances are base positions added automatically?
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Whenever a factory is finished or whenever it laods a tasklist and sees a basepos tag.
Post Reply

Return to “AI”