Skirmish AI: E323AI 3.22.4 - Page 23

Skirmish AI: E323AI 3.22.4

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

Moderators: hoijui, Moderators

User avatar
Error323
AI Developer
Posts: 237
Joined: 28 Nov 2006, 16:46

Re: Skirmish AI: E323AI v3.14.5 - High Templar

Post by Error323 »

slogic
AI Developer
Posts: 626
Joined: 17 Mar 2008, 19:03

Re: Skirmish AI: E323AI v3.14.5 - High Templar

Post by slogic »

I thought you've considered this image: http://springrts.com/phpbb/download/file.php?id=3137

Ok. I'll explain.

Let assume path->second.size() = 4.
waypoint = std::min<int>(MOVE_BUFFER, path->second.size()-segment-1) = min(1, 4 - 1 - 1) = 1
After

Code: Select all

 (segment = 1; segment < path->second.size()-waypoint; segment++)
loop execution segment = 3. segment + waypoint = 4 which is out of bounds.
User avatar
Error323
AI Developer
Posts: 237
Joined: 28 Nov 2006, 16:46

Re: Skirmish AI: E323AI v3.14.5 - High Templar

Post by Error323 »

slogic wrote:I thought you've considered this image: http://springrts.com/phpbb/download/file.php?id=3137

Ok. I'll explain.

Let assume path->second.size() = 4.
waypoint = std::min<int>(MOVE_BUFFER, path->second.size()-segment-1) = min(1, 4 - 1 - 1) = 1
After

Code: Select all

 (segment = 1; segment < path->second.size()-waypoint; segment++)
loop execution segment = 3. segment + waypoint = 4 which is out of bounds.
Well your missing the fact that path->second.size()-waypoint in ur case is not equal to 4 but to 3. This results in segment + waypoint = 2+1 = 3, which is not out of bounds.
slogic
AI Developer
Posts: 626
Joined: 17 Mar 2008, 19:03

Re: Skirmish AI: E323AI v3.14.5 - High Templar

Post by slogic »

slogic wrote:After loop execution segment = 3
Error323 wrote:This results in segment + waypoint = 2+1 = 3, which is not out of bounds.
No. 3 + 1 = 4.
User avatar
Error323
AI Developer
Posts: 237
Joined: 28 Nov 2006, 16:46

Re: Skirmish AI: E323AI v3.14.5 - High Templar

Post by Error323 »

Not according to my compiler.
Attachments
test.cpp
(102 Bytes) Downloaded 22 times
User avatar
Error323
AI Developer
Posts: 237
Joined: 28 Nov 2006, 16:46

Re: Skirmish AI: E323AI v3.14.5 - High Templar

Post by Error323 »

Ugh, beyond the loop it, of course, does become 3. However, because of the if statement at line 234 it still won't reach path->size()-1. That is, the crash you have shown in your screenshot has not occured here, ever! But i'll fix it anyhow.

So thanks :) and sorry, you were right and I am an idiot.
slogic
AI Developer
Posts: 626
Joined: 17 Mar 2008, 19:03

Re: Skirmish AI: E323AI v3.14.5 - High Templar

Post by slogic »

Error323 wrote:However, because of the if statement at line 234 it still won't reach path->size()-1. That is, the crash you have shown in your screenshot has not occured here, ever!
I don't think so. First of all, i faced it. And it is a fact. Secondly, analytically i see the closer unit to the last segment of the path the more chances "break" is never occurred. If unit somehow occurs beyond the last segment (rocket impulse?) it will never occurred.
Error323 wrote:So thanks :) and sorry, you were right and I am an idiot.
I just want to help to make AI more stable. Nobody likes crashes. Your AI is still the hardest for ground battles, you know.

By the way, do you have some mood to cache (in external file) data in CPathfinder constructor? I think it may take for one or two hours for you only. Your AI is loading too long. You can greatly speed up second etc. loadings on the same map. Cache is dependant on on mod version (actually on checksum of movetype struct but i think it is not possible to get it currently) & map checksum.
User avatar
Error323
AI Developer
Posts: 237
Joined: 28 Nov 2006, 16:46

Re: Skirmish AI: E323AI v3.14.5 - High Templar

Post by Error323 »

Yes I'll see what I can do about caching the map-graph, though it will probably take more then two hours hehe. Still it will be worth it.
User avatar
Error323
AI Developer
Posts: 237
Joined: 28 Nov 2006, 16:46

Re: Skirmish AI: E323AI v3.14.5 - High Templar

Post by Error323 »

Performed a silent update that fixes some memleaks, has a max of 6 assisting workers at a lab and updated XTA config file. Its overall performance is much better now.

Have Fun!

- Error
slogic
AI Developer
Posts: 626
Joined: 17 Mar 2008, 19:03

Re: Skirmish AI: E323AI v3.14.5 - High Templar

Post by slogic »

Some more memory leaks. TODO:

Code: Select all

// CUnitTable.cpp
CUnitTable::~CUnitTable()
{
	for(int i = 0; i < ingameUnits.size(); i++)
		delete ingameUnits[i];
}

// CIntel.cpp
CIntel::~CIntel()
{
	delete units;
}
Also you may move "units" to CE323AI class & make it public & redirect usage to this array when getting enemy/allied units. It is used also in ThreatMap class. So you'll save 32 KB of memory :) Until access to this array is in single thread it is safe.
User avatar
Error323
AI Developer
Posts: 237
Joined: 28 Nov 2006, 16:46

Re: Skirmish AI: E323AI v3.14.5 - High Templar

Post by Error323 »

Thanks Slogic. Though, as you are practically providing the fixes why not clone the project and push the fixes so i can merge them into the main git repo? I know I asked you this before, but its soo much easier really.

Just sayin :-)
User avatar
1v0ry_k1ng
Posts: 4656
Joined: 10 Mar 2006, 10:24

Re: Skirmish AI: E323AI v3.14.5 - High Templar

Post by 1v0ry_k1ng »

what feature will you be working on next?
User avatar
Error323
AI Developer
Posts: 237
Joined: 28 Nov 2006, 16:46

Re: Skirmish AI: E323AI v3.14.5 - High Templar

Post by Error323 »

Graphcaching for faster load times. The graph construction takes quite long on some computersystems.
Last edited by Error323 on 27 Jan 2010, 12:45, edited 1 time in total.
User avatar
bartvbl
Posts: 346
Joined: 21 Mar 2009, 15:55

Re: Skirmish AI: E323AI v3.14.5 - High Templar

Post by bartvbl »

v3.13.1 doesn't like to team up with RAI.. For some reason it hangs for about 5-ish seconds, and this error pops up:

edit: I bet this is related to slogic's post a bit further up
Attachments
Knipsel.JPG
(40.24 KiB) Downloaded 2 times
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Skirmish AI: E323AI v3.14.5 - High Templar

Post by hoijui »

with team-up. you mean, in the same ally-team, right? not the same team (com-sharing).

also.. please retry the same with latest version.
User avatar
bartvbl
Posts: 346
Joined: 21 Mar 2009, 15:55

Re: Skirmish AI: E323AI v3.14.5 - High Templar

Post by bartvbl »

I mean same ally :)
[idiotic similar meanings ><]
slogic
AI Developer
Posts: 626
Joined: 17 Mar 2008, 19:03

Re: Skirmish AI: E323AI v3.14.5 - High Templar

Post by slogic »

bartvbl, may be post script.txt to verify this or look into it yourself. The latest (0.59) SL goes crazy & put me in the same team (instead of ally team as requested!) with AI when using Single Player tab.
Achilla
Posts: 79
Joined: 24 Aug 2009, 15:17

Re: Skirmish AI: E323AI v3.14.5 - High Templar

Post by Achilla »

New version, wow, great news!

Time to reinstall Spring I guess.

Just let me be done with those damned study sessions first :|
User avatar
romulous
Posts: 39
Joined: 31 Jan 2010, 12:36

Re: Skirmish AI: E323AI v3.14.5 - High Templar

Post by romulous »

Just tried the latest bot (v3.14.5) with a friend in a lan game (with 2 AI's) and it crashes after about 5 minutes. The map was FolsomDamSpecial. I think this bot has potential. I like it. 8)

MOD: BA 7.04

The RAI ai plays on this map fine.
Last edited by romulous on 01 Feb 2010, 08:12, edited 1 time in total.
User avatar
1v0ry_k1ng
Posts: 4656
Joined: 10 Mar 2006, 10:24

Re: Skirmish AI: E323AI v3.14.5 - High Templar

Post by 1v0ry_k1ng »

when trying to get this to work with SWTA 1.0, even if you give each corresponding SWTA unit the same tags as the BA equivalent, it does not function properly- I cant get it to build factories not matter how I tweak configs. where/how is the AI hardcoded to TA?
Post Reply

Return to “AI”