Here's an AI that mostly works like the Orignal TA AI.
It Scouts, builds, attacks (thought not very well) and avoids nanostall.
Get it here: http://www.geocities.com/veylon_ii/TASpring/OTAI.zip
BTW, it does still use that dang StrDat workaround structure, so you'll have to recompile if you don't want it to do that. Instructions are in the readme file.
OTAI
Moderators: hoijui, Moderators
GEOCITIES!!! AHK AHK KILL KILL KILL!!!!!!
no really I'll have to take a look at your source and get rid of the work around.
Also this has been compiled for spring0.65b2, so it wont work with any fo th binaries me buggi or zaphod have released, and the only AI vs OTAI you cna do is with the NTAIx.dll in NTAI0.25 + goodies.
hmmm, things like this:
why so many callback->GetUnitDef(unit)->id type calls? Why not just define a const UnitDef* ud = ... type variable and use that like everybody else does.
no really I'll have to take a look at your source and get rid of the work around.
Also this has been compiled for spring0.65b2, so it wont work with any fo th binaries me buggi or zaphod have released, and the only AI vs OTAI you cna do is with the NTAIx.dll in NTAI0.25 + goodies.
hmmm, things like this:
Code: Select all
void CGlobalAI::UnitCreated(int unit)
{
#ifdef DOLOGGING
LogFile << "CGlobalAI::UnitCreated(" << unit << ")";
LogFile << ": " << callback->GetUnitDef(unit)->humanName.c_str() << endl;
#endif
myUnits.insert(unit);
UnitTypeInfo.find(callback->GetUnitDef(unit)->id)->second.Count++;
// char c[200];
// sprintf(c, "New %s Created", callback->GetUnitDef(unit)->name.c_str());
// callback->SendTextMsg(c, 0);
if(callback->GetUnitDef(unit)->extractsMetal > 0.0f)
CMex(unit, false);
_UnitInfo UI(unit, callback->GetUnitDef(unit)->id, callback->GetCurrentFrame());
UI.Damage = -1;
UI.Mission = STAT_IDLE;
UI.Target = -1;
UnitInfo.insert(map<int, _UnitInfo>::value_type(unit, UI));
}
Most of my functions that deal extensively with a unit do use a pointer to unit definition.
That one, though, that one needed one badly.
BTW, I didn't know that everyone wasn't using that latest version of TASpring. I wrote it for, and it worked with, 0.65b1.
Should I not upgrade to 0.65b2 yet, or what else can I do make it more compatable?
Getting rid of the workaround shouldn't be to hard, since I released the code with it not activated (that's why you don't see the StrDat or std::string types being used explicitly).
edit:
I'll make and put up a few screenshots and demos of the AI in action so you can actually see it doing something.
That one, though, that one needed one badly.
BTW, I didn't know that everyone wasn't using that latest version of TASpring. I wrote it for, and it worked with, 0.65b1.
Should I not upgrade to 0.65b2 yet, or what else can I do make it more compatable?
Getting rid of the workaround shouldn't be to hard, since I released the code with it not activated (that's why you don't see the StrDat or std::string types being used explicitly).
edit:
I'll make and put up a few screenshots and demos of the AI in action so you can actually see it doing something.
You might as well wait for the next release now, it's close.
Demos will probably have sync errors, at least if any game code is changed between releases.
The upcoming release has an somewhat extendable (or is it extendible?
) interface, so you won't have to release an AI with every new spring version.
Demos will probably have sync errors, at least if any game code is changed between releases.
The upcoming release has an somewhat extendable (or is it extendible?
