Skirmish AI: E323AI 3.22.4
Moderators: hoijui, Moderators
Re: Skirmish AI: E323AI v3.14.5 - High Templar
It is not afaik, see http://github.com/Error323/E323AI/blob/ ... r.cpp#L212
Re: Skirmish AI: E323AI v3.14.5 - High Templar
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
loop execution segment = 3. segment + waypoint = 4 which is out of bounds.
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++)
Re: Skirmish AI: E323AI v3.14.5 - High Templar
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 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
Afterloop execution segment = 3. segment + waypoint = 4 which is out of bounds.Code: Select all
(segment = 1; segment < path->second.size()-waypoint; segment++)
Re: Skirmish AI: E323AI v3.14.5 - High Templar
slogic wrote:After loop execution segment = 3
No. 3 + 1 = 4.Error323 wrote:This results in segment + waypoint = 2+1 = 3, which is not out of bounds.
Re: Skirmish AI: E323AI v3.14.5 - High Templar
Not according to my compiler.
- Attachments
-
- test.cpp
- (102 Bytes) Downloaded 22 times
Re: Skirmish AI: E323AI v3.14.5 - High Templar
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.
So thanks :) and sorry, you were right and I am an idiot.
Re: Skirmish AI: E323AI v3.14.5 - High Templar
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: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 just want to help to make AI more stable. Nobody likes crashes. Your AI is still the hardest for ground battles, you know.Error323 wrote:So thanks :) and sorry, you were right and I am an idiot.
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
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
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
Have Fun!
- Error
Re: Skirmish AI: E323AI v3.14.5 - High Templar
Some more memory leaks. TODO:
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.
Code: Select all
// CUnitTable.cpp
CUnitTable::~CUnitTable()
{
for(int i = 0; i < ingameUnits.size(); i++)
delete ingameUnits[i];
}
// CIntel.cpp
CIntel::~CIntel()
{
delete units;
}
Re: Skirmish AI: E323AI v3.14.5 - High Templar
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
Just sayin
- 1v0ry_k1ng
- Posts: 4656
- Joined: 10 Mar 2006, 10:24
Re: Skirmish AI: E323AI v3.14.5 - High Templar
what feature will you be working on next?
Re: Skirmish AI: E323AI v3.14.5 - High Templar
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.
Re: Skirmish AI: E323AI v3.14.5 - High Templar
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
edit: I bet this is related to slogic's post a bit further up
- Attachments
-
- Knipsel.JPG
- (40.24 KiB) Downloaded 2 times
Re: Skirmish AI: E323AI v3.14.5 - High Templar
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.
also.. please retry the same with latest version.
Re: Skirmish AI: E323AI v3.14.5 - High Templar
I mean same ally :)
[idiotic similar meanings ><]
[idiotic similar meanings ><]
Re: Skirmish AI: E323AI v3.14.5 - High Templar
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
New version, wow, great news!
Time to reinstall Spring I guess.
Just let me be done with those damned study sessions first
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
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.
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.
- 1v0ry_k1ng
- Posts: 4656
- Joined: 10 Mar 2006, 10:24
Re: Skirmish AI: E323AI v3.14.5 - High Templar
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?