AI version info itnerface
Moderators: hoijui, Moderators
AI version info itnerface
Looking at the interface between the dll and the engine ther eseems onyl one flow of information, being dll gives a globalAI instance and an itnerface version, engien responds with interface calls.
I propose we add 3 new functions, a
const char* GetAIVersion()
const char* GetDescription()
int GetVersion()
So that other programs could get more information about an AI and display it. The returned strings would be html formatted too.
I'll have this in NTAI 0.29 among other things, are there any suggestions on variations or alternatives?
I propose we add 3 new functions, a
const char* GetAIVersion()
const char* GetDescription()
int GetVersion()
So that other programs could get more information about an AI and display it. The returned strings would be html formatted too.
I'll have this in NTAI 0.29 among other things, are there any suggestions on variations or alternatives?
a bit offtopic ther.
AI not beign able to cheat without the user typing .cheats is because of a check done by the engine. If this was undone then any AI dll could cheat at will but that would mean I could write a GroupAI that gave me the location of every enemy unit without typing .cheat and without the enemy knowing till I've already seen ti all. It could give me extra untis without them knowing too, and increase my resources, and I wouldnt have to do anythign to hack the engine either.
To spectate the AI's I just start a FFA then type '.cheat', and '.spectate'
AI not beign able to cheat without the user typing .cheats is because of a check done by the engine. If this was undone then any AI dll could cheat at will but that would mean I could write a GroupAI that gave me the location of every enemy unit without typing .cheat and without the enemy knowing till I've already seen ti all. It could give me extra untis without them knowing too, and increase my resources, and I wouldnt have to do anythign to hack the engine either.
To spectate the AI's I just start a FFA then type '.cheat', and '.spectate'
I know about the .cheat and .spectate and .give 100 CORKROG (or something like that).
The cheating in the groupAI can be fixed by doing what we are all asking for, a checkbox system with allowed AIs, so that a DLL must be enabled first by all players. Its possible to do it without opening the game to exploitage, and it would help a great deal in testing not needing to type cheats every single time
The cheating in the groupAI can be fixed by doing what we are all asking for, a checkbox system with allowed AIs, so that a DLL must be enabled first by all players. Its possible to do it without opening the game to exploitage, and it would help a great deal in testing not needing to type cheats every single time

Group AI callback, no cheat interface:
Global AI callback, a cheat interface:
Code: Select all
class IGroupAICallback
{
public:
virtual IAICallback *GetAICallback ()=0;
virtual void UpdateIcons()=0; virtual const Command* GetOrderPreview()=0; virtual bool IsSelected()=0;
virtual int GetUnitLastUserOrder(int unitid)=0;
};
Global AI callback, a cheat interface:
Code: Select all
class IGlobalAICallback
{
public:
virtual IAICheats* GetCheatInterface()=0;
virtual IAICallback* GetAICallback()=0;
};
Look at Logger::GameTime() in NTAI. It returns a string in the format [00:00] showing minutes and seconds. If it goes into hours it reformats as [00:00:00].
A second in game time is 30 frames unless you increase the gamespeed. You can check the gametime manually by comparing with the system clock, to see howto do that look at NTAI's log class again. Otherwise assume the game runs at 30 fps or 60 fps. NTAI's logging times seem synced fairly well anyways with the clock in the corner showing gametime.
Also it relies on the interface to count not some abstract coutnign of update() calls so it doesnt keep coutning while the game's paused.
A second in game time is 30 frames unless you increase the gamespeed. You can check the gametime manually by comparing with the system clock, to see howto do that look at NTAI's log class again. Otherwise assume the game runs at 30 fps or 60 fps. NTAI's logging times seem synced fairly well anyways with the clock in the corner showing gametime.
Also it relies on the interface to count not some abstract coutnign of update() calls so it doesnt keep coutning while the game's paused.
It does, it takes the game frame from the engien that applies the sae set fo rules to ti that the engine uses to display the clock in the corner, then does some formatting to it.
edit::
edit::
Code: Select all
string Log::GameTime(){
char min[2];
char sec[2];
char hour[2];
int Time = G->cb->GetCurrentFrame();
Time = Time/30;
int Seconds = Time%60;
int Minutes = (Time/60)%60;
int hours = 0;
if(Time>3600) hours = (Time-(Time%3600))/3600;
if(Seconds+Minutes+hours == 0){
return "[00:00]";
}
sprintf(hour,"%i",hours);
sprintf(min,"%i",Minutes);
sprintf(sec,"%i",Seconds);
string stime="[";
if(hours>0){
if(hours<10) stime += "0";
stime += hour;
stime += ":";
}
if(Minutes<10){
stime += "0";
}
stime += min;
stime += ":";
if(Seconds <10){
stime += "0";
}
stime += sec;
stime += "]";
return stime;
}
Code: Select all
DLL_EXPORT void WINAPI GetInfo(char* name)
{
strcpy(name,"NTAI V0.29.05, a skirmish AI coded by Alantai");
}
DLL_EXPORT float WINAPI GetVersion()
{
return 0.2905f;
}