Page 23 of 38
Re: Skirmish AI: E323AI v3.14.5 - High Templar
Posted: 23 Jan 2010, 22:28
by Error323
Re: Skirmish AI: E323AI v3.14.5 - High Templar
Posted: 23 Jan 2010, 23:07
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.
Re: Skirmish AI: E323AI v3.14.5 - High Templar
Posted: 23 Jan 2010, 23:19
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.
Re: Skirmish AI: E323AI v3.14.5 - High Templar
Posted: 23 Jan 2010, 23:27
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.
Re: Skirmish AI: E323AI v3.14.5 - High Templar
Posted: 23 Jan 2010, 23:30
by Error323
Not according to my compiler.
Re: Skirmish AI: E323AI v3.14.5 - High Templar
Posted: 24 Jan 2010, 00:13
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.
Re: Skirmish AI: E323AI v3.14.5 - High Templar
Posted: 24 Jan 2010, 12:15
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.
Re: Skirmish AI: E323AI v3.14.5 - High Templar
Posted: 24 Jan 2010, 12:45
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.
Re: Skirmish AI: E323AI v3.14.5 - High Templar
Posted: 25 Jan 2010, 00:46
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
Re: Skirmish AI: E323AI v3.14.5 - High Templar
Posted: 26 Jan 2010, 18:47
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.
Re: Skirmish AI: E323AI v3.14.5 - High Templar
Posted: 26 Jan 2010, 19:35
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

Re: Skirmish AI: E323AI v3.14.5 - High Templar
Posted: 27 Jan 2010, 07:36
by 1v0ry_k1ng
what feature will you be working on next?
Re: Skirmish AI: E323AI v3.14.5 - High Templar
Posted: 27 Jan 2010, 12:03
by Error323
Graphcaching for faster load times. The graph construction takes quite long on some computersystems.
Re: Skirmish AI: E323AI v3.14.5 - High Templar
Posted: 27 Jan 2010, 12:31
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
Re: Skirmish AI: E323AI v3.14.5 - High Templar
Posted: 27 Jan 2010, 12:38
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.
Re: Skirmish AI: E323AI v3.14.5 - High Templar
Posted: 27 Jan 2010, 17:49
by bartvbl
I mean same ally :)
[idiotic similar meanings ><]
Re: Skirmish AI: E323AI v3.14.5 - High Templar
Posted: 27 Jan 2010, 18:26
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.
Re: Skirmish AI: E323AI v3.14.5 - High Templar
Posted: 28 Jan 2010, 12:25
by Achilla
New version, wow, great news!
Time to reinstall Spring I guess.
Just let me be done with those damned study sessions first

Re: Skirmish AI: E323AI v3.14.5 - High Templar
Posted: 31 Jan 2010, 12:46
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.
MOD: BA 7.04
The RAI ai plays on this map fine.
Re: Skirmish AI: E323AI v3.14.5 - High Templar
Posted: 31 Jan 2010, 14:23
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?