Page 1 of 1
Possible problem with UnitIdle()
Posted: 22 Feb 2007, 15:54
by submarine
At first i thought it would be a bug in my code but after a lot of tests it seems to me as if the UnitIdle(int unit) callback gets called while construction units are building something.
I noticed some strange cons. unit behaviour with earlier version as well but it had been very rare so i never really tried to find out whats wrong. latest release version however semms to be calling unitIdle all the time
maybe someone who knows the engine code better than i do can check...
Posted: 22 Feb 2007, 15:59
by AF
I've always been suspiscious of this but I've never been able to fully verify this, as everyone else assumes the interface is perfect and my AI is at fault by default.
Posted: 22 Feb 2007, 16:04
by submarine
well i dont know about the past but if there had been so many miscalls in earlier versions aai would never have worked very well
anyway, i guess other ais rely on that function as well, so we shoudl check
Posted: 22 Feb 2007, 16:19
by AF
we need a very basic experiment to test this.
I suggest we add to the empty AI to tell it to build a solar collector and log unit created, finished and idle commands to the console. That way we can say what should happen and see if it indeed happens or if unitidle is being called too many times.
Posted: 22 Feb 2007, 16:29
by submarine
its very odd but it seems to happen most of the when building factories or llts (in BA 4.7 and i dont wait until aai techs up to level 2)
Posted: 23 Feb 2007, 01:03
by trepan
UnitIdle() is thoroughly busted. The main reason for this is that "idleness" is
not being checked after a SET_WANTED_MAX_SPEED command finishes.
Easy to fix (I have it fixed in my local source).
Posted: 23 Feb 2007, 10:43
by submarine
if you have fixed the bug can you commit it?
Posted: 25 Feb 2007, 15:28
by submarine
*ping* (trying to catch trepan's attention)
Posted: 25 Feb 2007, 19:20
by AF
trepan, UnitIdle is the corner stone of every skirmish AI and groupAI in spring, its the most important callback function and unreliability in this function directly affects the AIs in so many ways. This isnt a minor bug, this is a major flaw, as this is a critical component of the AI callback interface.
Posted: 25 Feb 2007, 19:56
by trepan
I've already said that I have the fix, I just haven't committed it yet.
There are no plans for a release anytime soon (that I know of), and
the code is tied up with other changes that I've yet to complete.
When I'm done, I'll commit. Alternatively fix it yourself (I've given a
mighty big hint as to how to do it).
Posted: 25 Feb 2007, 23:15
by AF
I cant fix it, you know my computers pretty much f*cked when it comes to spring development, I cant test spring because of my drivers so I would never know if I fixed the bug or not.
Posted: 26 Feb 2007, 11:31
by submarine
ok trepan i think i got your point. however i'm not really keen on delving into the spring soruce myself, is there any timeframe for a possible fix?