HandleCommand Features

HandleCommand Features

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

Moderators: hoijui, Moderators

Post Reply
User avatar
krogothe
AI Developer
Posts: 1050
Joined: 14 Nov 2005, 17:07

HandleCommand Features

Post by krogothe »

Is there a full list of the current features supported by the HandleCommand call?
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

no
Bobris
Posts: 18
Joined: 12 Feb 2006, 17:15

Post by Bobris »

Actually it is in IAICallback.h. In 0.70b2 there was nothing. And I added this:

Code: Select all

// HandleCommand structs:

const int AIHCQuerySubVersionId=0;
struct AIHCQuerySubVersion ///< result of HandleCommand is version of this sub interface
{
	AIHCQuerySubVersion(): commandId(AIHCQuerySubVersionId) {}
	int commandId; ///< equal to 0
};

// These supported in sub version 1 

const int AIHCAddMapPointId=1;
struct AIHCAddMapPoint ///< result of HandleCommand is 1 - ok supported
{
	AIHCAddMapPoint(): commandId(AIHCAddMapPointId) {}
	int commandId; ///< equal to 1
	float3 pos; ///< on this position, only x and z matter
	char *label; ///< create this text on pos in my team color
};

const int AIHCAddMapLineId=2;
struct AIHCAddMapLine ///< result of HandleCommand is 1 - ok supported
{
	AIHCAddMapLine(): commandId(AIHCAddMapLineId) {}
	int commandId; ///< equal to 2
	float3 posfrom; ///< draw line from this pos
	float3 posto; ///< to this pos, again only x and z matter
};

const int AIHCRemoveMapPointId=3;
struct AIHCRemoveMapPoint ///< result of HandleCommand is 1 - ok supported
{
	AIHCRemoveMapPoint(): commandId(AIHCRemoveMapPointId) {}
	int commandId; ///< equal to 3
	float3 pos; ///< remove map points and lines near this point (100 distance)
};
If you don't understand something, just ask ...
Firenu
Posts: 39
Joined: 29 Apr 2006, 00:49

=)

Post by Firenu »

would be great if you could supply a code example that draws lines via aicb

=)
User avatar
Rafal99
Posts: 162
Joined: 14 Jan 2006, 04:09

Post by Rafal99 »

Writing lines example:

Code: Select all

float3 pos1 = float3(0,100,0);
float3 pos2 = float3(50,100,100);
float3 pos3 = float3(100,100,0);
int groupid = cb->CreateLineFigure(pos1, pos2, 5, 0, 3000, 0);
 // creates new figure group
cb->CreateLineFigure(pos2, pos3, 5, 0, 3000, groupid);
 // width = 5 pixels, lifetime = 3000 frames
cb->SetFigureColor(groupid, 1.0, 0.0, 0.0, 1.0f); //red
This should write "V" letter on the top-left corner of the map.
Bobris
Posts: 18
Joined: 12 Feb 2006, 17:15

Post by Bobris »

Example is here:

Code: Select all

AIHCQuerySubVersion amq; 
if (mAICallback->HandleCommand(&amq)>=1) 
    { 
    // new functions are supported 
    AIHCAddMapLine aml; 
    aml.posfrom=float3(1000,0,1000); 
    aml.posto=float3(1200,0,1000); 
    mAICallback->HandleCommand(&aml); 
    }
Of course you can skip now checking of subversion if you don't support versions before 0.70b3
User avatar
Rafal99
Posts: 162
Joined: 14 Jan 2006, 04:09

Post by Rafal99 »

Oh sorry for my offtopic.

So this means that it is now possible to make labelled point via aicb, yea? :o
Good job!
Bobris
Posts: 18
Joined: 12 Feb 2006, 17:15

Post by Bobris »

Yes, like this:

Code: Select all

AIHCAddMapPoint amp;
amp.pos=float3(1000,0,1000);
amp.label="Hello World";
mAICallback->HandleCommand(&amp);
These new map painting commands are exactly same that "human" can do in normal play. So they are visible to alies and in replays.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Yay my ally cursor groupAI can be fixed now!!!
User avatar
Veylon
AI Developer
Posts: 174
Joined: 21 Sep 2005, 19:45

Post by Veylon »

Cool. Now I don't have to make the letters out of lines. Thanks a lot!
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Veylon, I've tried thata nd it doesnt work as you'd want it.

It palces a marker down, to move the marker or change its contents you need to delete it and create a new one which is problematic, because deleting it means you delete anything within 1000 pixels fo the position, and creating ti makes the minimap do aimation and sounds get played.

There's also no way of changing the colours, and it's networked so you wotn see eit unelss you're controlling the AI.

I've started suign your skywrite class, and I've added the numbers 123456789 : and adapted ti slightly to accept lowercase letters, all thats left are the rest of the alphabet (J onwards) though I took a few that looked similar such as my 5 and the S....

I also re-orientated the letters so that they face the camera straight up rather than sideways.......
User avatar
Veylon
AI Developer
Posts: 174
Joined: 21 Sep 2005, 19:45

Post by Veylon »

Well, i suppose if you kept a list of what's around, you could copy what's going to get deleted and then reinsert it...or something...

Anyway, I'll fiddle with the different ways and see what comes up.
Post Reply

Return to “AI”