Possible problem with UnitIdle()

Possible problem with UnitIdle()

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

Moderators: hoijui, Moderators

Post Reply
submarine
AI Developer
Posts: 834
Joined: 31 Jan 2005, 20:04

Possible problem with UnitIdle()

Post 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...
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post 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.
submarine
AI Developer
Posts: 834
Joined: 31 Jan 2005, 20:04

Post 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
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post 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.
submarine
AI Developer
Posts: 834
Joined: 31 Jan 2005, 20:04

Post 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)
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Post 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).
submarine
AI Developer
Posts: 834
Joined: 31 Jan 2005, 20:04

Post by submarine »

if you have fixed the bug can you commit it?
submarine
AI Developer
Posts: 834
Joined: 31 Jan 2005, 20:04

Post by submarine »

*ping* (trying to catch trepan's attention)
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post 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.
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Post 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).
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post 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.
submarine
AI Developer
Posts: 834
Joined: 31 Jan 2005, 20:04

Post 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?
Post Reply

Return to “AI”