The corlab can assist??

The corlab can assist??

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

Moderators: hoijui, Moderators

Post Reply
meriton
Posts: 18
Joined: 11 Jul 2009, 14:03

The corlab can assist??

Post by meriton »

The builder manager of my fledgling AI thinks that in BA, a corlab can assist nearby construction because canAssist is true, and buildDistance is 128.

Yet I know the UI doesn't allow ordering a corlab to assist construction.

Is the corlab able to assist construction? If not, how can I reliably determine that a unit can assist construction without hardcoding mod-specific knowledge?

I am using the Java interface.

BTW, is there some documentation of what exactly the attributes in UnitDef mean? (Most of them don't have any javadoc ...)
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: The corlab can assist??

Post by knorke »

canAssist = true on the lab seems like a modmakers mistake, afaik factories can never assist, ony be assisted. (is that the reason why nano towers are units and not buildings?)
I think buildDistance has no effect on factories either.

There are many cases like that, ie a unit might have isTransport = true but ingame it will not be a useable transport unless it has some other tags such as TransportCapacity set.

http://springrts.com/wiki/Units:FBI
http://springrts.com/wiki/Lua_UnitDefs
https://github.com/spring/spring/blob/m ... nitDef.cpp
:?
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6241
Joined: 29 Apr 2005, 01:14

Re: The corlab can assist??

Post by FLOZi »

My Diagnosis?

Image

BAD BABYSITTING MODDING.
meriton
Posts: 18
Joined: 11 Jul 2009, 14:03

Re: The corlab can assist??

Post by meriton »

Thanks for the links Knorke, they already proved helpful in another matter :-)

I am not sure I understand your distinction between units and buildings though. How does the engine know whether a UnitDef represents a "building" or a "unit"?
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: The corlab can assist??

Post by knorke »

How does the engine know whether a UnitDef represents a "building" or a "unit"?
I do not know.
Some things might be:
-only buildings have yardmaps?
-some tags like canFly=true will always make it a unit?
TEDClass?
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: The corlab can assist??

Post by Forboding Angel »

tedclass is not used.

How does spring know? Easy. canMove = true/false,
slogic
AI Developer
Posts: 626
Joined: 17 Mar 2008, 19:03

Re: The corlab can assist??

Post by slogic »

Building does not have movedef (UnitDef->movedata == NULL). But for example NOTA mod has movable defences: Hatrack (armmllt). It HAS movedef but max velocity is 0.001.
slogic
AI Developer
Posts: 626
Joined: 17 Mar 2008, 19:03

Re: The corlab can assist??

Post by slogic »

Forboding Angel wrote:...canMove = true/false,
It is just for button in GUI. Do not rely on it. For exmaple it can be used to set rally point for factory.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: The corlab can assist??

Post by Forboding Angel »

Yar, I forgot about the obvious fact that a building won't have a movedef.

Does spring round maxvelocity=0, up to 0.1?Another way to do it would be to give the nanotower a massive footprint and 0 crushstrength so that it can't path anywhere.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6241
Joined: 29 Apr 2005, 01:14

Re: The corlab can assist??

Post by FLOZi »

knorke wrote:
How does the engine know whether a UnitDef represents a "building" or a "unit"?
I do not know.
Some things might be:
-only buildings have yardmaps?
-some tags like canFly=true will always make it a unit?
TEDClass?
2 out of 3 ain't half bad. :wink:
Post Reply

Return to “AI”