Page 19 of 50

Posted: 04 Dec 2005, 23:06
by GrOuNd_ZeRo
what do you need to know? I would love a NTAI for WD :D

Posted: 05 Dec 2005, 19:11
by j5mello
do u need the build tree with explanations for everything cause thats somethin i could do. im planning on doing some modelin work maybe with Rhyoss so this is a way for me to get my hands dirty

Posted: 05 Dec 2005, 20:30
by AF
Downlaod NTAI and goto the file Agents.cpp and inside the function Factor::Update() there should be great lists of unitnames, the lists take up most fot he file.

They take the form of soemthign like this

if(unitname == name of units chekcing)
if unti hasnt already got a buildqueue
assign these..........

it might have a check to assign the variable energy either a solar generator or a wind generator.

So what you need is what your building with and what you want it to build.

e.g
commander will build this this and that, that will build those those and these, these will build etc........

Posted: 05 Dec 2005, 20:39
by j5mello
what opnes a .cpp file

Posted: 05 Dec 2005, 20:43
by FLOZi
Text editor.

Posted: 05 Dec 2005, 20:58
by AF
Build lists are defined by a number as so..

Code: Select all

// CORE
#define CCORCOM 1
#define CORCON 2
#define CORNECRO 3
#define CORACK 4
#define CORLAB 5
#define CORALAB 6
#define CORGANT 7
#define CORAP 8
#define CORVP 9
#define CORSY 10
#define CORAVP 11
#define CORASY 12
#define CORCS 13
Inside the UnitFinished function:

Code: Select all

string na = "CORCA";
		if((ud->name == na)&&(set == false)){
			uu->BList = CORCON;
			this->builders.push_back(uu);
			set = true;
			return;
		}
		na = "CORCK";
		if((ud->name == na)&&(set == false)){
			uu->BList = CORCON;
			this->builders.push_back(uu);
			set = true;
			return;
		}
		na = "CORCV";
		if((ud->name == na)&&(set == false)){
			uu->BList = CORCON;
			this->builders.push_back(uu);
			set = true;
			return;
		}
		na = "CORNECRO";
		if((ud->name == na)&&(set == false)){
			uu->BList = CORNECRO;
			this->builders.push_back(uu);
			set = true;
			return;
		}
and so on. also if it's a factory uu->repeater = true;

for the commander: in update() I'd add somethign like this

Code: Select all

na = "NATOCOM";
		if((uu->ud->name == na)&&(set == false)){
			uu->BList = CNATOCOM; // thed efined build list
			this->builders.push_back(uu);
			G->L->print("NTAI NATO");
			race = R_NATO; // a race number defined at the top
			set = true;
			return;
		}
then the big list fo unti names:

Code: Select all

/* CORE commander */if(uz->BList == CCORCOM){
				if(frame == 5){
					if(ew == true){
						energy = "CORSOLAR";
					}else{
						energy = "CORWIND";
					}
					uz->AddTask("CORAP");
					uz->AddTask("CORMAKR");
					uz->AddTask("CORMAKR");
					uz->AddTask("CORMEX");
					uz->AddTask("CORMAKR");
					uz->AddTask("CORMEX");
					uz->AddTask("CORMAKR");
					uz->AddTask("CORMEX");
					uz->AddTask(energy);
					uz->AddTask("CORMEX");
					uz->AddTask(energy);
					uz->AddTask("CORSY");
					uz->AddTask("CORALAB");
					uz->AddTask("CORMEX");
					uz->AddTask("CORMAKR");
					uz->AddTask("CORMEX");
					uz->AddTask(energy);
					uz->AddTask("CORMAKR");
					uz->AddTask(energy);
					uz->AddTask("CORMEX");
					uz->AddTask(energy);
					uz->AddTask(energy);
					uz->AddTask("CORMEX");
					uz->AddTask(energy);
					uz->AddTask("CORMEX");
					uz->AddTask("CORMEX");
					uz->AddTask("CORALAB");
					uz->AddTask("CORLLT");
					uz->AddTask("CORMAKR");
					uz->AddTask("CORMEX");
					uz->AddTask("CORMAKR");
					uz->AddTask("CORMEX");
					uz->AddTask(energy);
					uz->AddTask("CORMAKR");
					uz->AddTask(energy);
					uz->AddTask(energy);
					uz->AddTask("CORMEX");
					uz->AddTask(energy);
					uz->AddTask("CORMEX");
					uz->AddTask("CORMEX");
					uz->AddTask(energy);
					uz->AddTask("CORRAD");
					uz->AddTask("CORMEX");
					uz->AddTask("CORMEX");
					uz->AddTask("CORLAB");
					uz->AddTask("CORMEX");
					uz->AddTask(energy);
					uz->AddTask("CORMEX");
					G->basepos = G->cb->GetUnitPos(uz->uid);
					this->UnitIdle(uz->uid);
					continue;
				}
			}
In other utnis you could add if statements to change ti around a bit but they would always give the same result when used witht eh commander.

Code: Select all

* CORE con kbot/aircraft */if(uz->BList == CORCON){
				if(frame == 150){ // the unti will start building after 150 frames (30 frames per second. If this is set to the first frame ro thsi doesnt exist then the utni will start building before ti's elft the factory.)
					uz->AddTask("CORADVSOL");
					uz->AddTask("CORMEX");
					uz->AddTask("CORAVP");
					uz->AddTask("CORMEX");
					uz->AddTask("CORALAB");
					uz->AddTask("CORADVSOL"); // if this unti doesnt exist an error is logged to the logfile and the task is skipped.
					uz->AddTask("CORMEX");
					uz->AddTask("CORAP");
					uz->AddTask("CORESTOR");
					uz->AddTask("CORALAB");
					uz->AddTask("CORRAD");
					uz->AddTask("CORESTOR");
					uz->AddTask(energy);
					uz->AddTask("CORMEX");
					uz->AddTask(energy);
					uz->AddTask("CORMEX");
					uz->AddTask("CORRL");
					uz->AddTask(energy);
					if((Tframe%3)==1){ 1/3 chance of this.
						uz->AddTask("CORMAKR");
						uz->AddTask(energy);
						uz->AddTask(energy);
						if(Tframe<15000){ // build kbot lab if less than this time, toherwise build ana dv kbot lab instead.
							uz->AddTask("CORALAB");
							uz->AddTask("CORRL");
						} else {
							uz->AddTask("CORTOAST");
							uz->AddTask("CORPUN");
							uz->AddTask("CORMEX");
						}
						uz->AddTask(energy);
					}else if((Tframe%3)==2){ 1/3 chance of this
						uz->AddTask(energy);
						if(Tframe>10000){ // 10,000/30 seconds.
							uz->AddTask("CORADVSOL");
							uz->AddTask("CORADVSOL");
							uz->AddTask("CORMEX");
							uz->AddTask("CORALAB");
							uz->AddTask("CORTOAST");
							uz->AddTask("CORPUN");
						}
						if(Tframe<10000){
							uz->AddTask("CORMEX");
							uz->AddTask("CORMEX");
							uz->AddTask("CORLAB");
							uz->AddTask("CORRL");
						}
						uz->AddTask("CORRL");
						uz->AddTask(energy);
						uz->AddTask("CORMEX");
						uz->AddTask("CORADVSOL");
						uz->AddTask(energy);
						uz->AddTask("CORRL");
					}else{
						uz->AddTask("CORMEX");
						uz->AddTask(energy);
						uz->AddTask("CORMEX");
						uz->AddTask(energy);
						uz->AddTask(energy);
						uz->AddTask("CORMEX");
						uz->AddTask("CORMEX");
						uz->AddTask("CORHLT");
						uz->AddTask(energy);
						uz->AddTask("CORMEX");
						uz->AddTask("CORRL");
						if((Tframe%2)==1){ // 50% chance of the following beign built
							uz->AddTask("CORMEX");
							uz->AddTask("CORRL");
							uz->AddTask("CORMAKR");
							uz->AddTask("CORADVSOL");
							uz->AddTask("CORMEX");
							uz->AddTask("CORMEX");
							uz->AddTask(energy);
							uz->AddTask("CORMEX");
						}
					}
					uz->AddTask("CORMEX");
					uz->AddTask(energy);
					uz->AddTask("CORMEX");
					uz->AddTask(energy);
					uz->AddTask("CORMEX");
					this->UnitIdle(uz->uid);
					continue;
				}
			}
In the above the first tiem buitl would be "CORMEX" and the last buitl "CORADVSOL"

EDIT:: For mex class compatability I need to add a set of unitnames of all the emxes used, one for UW and one for land (that is if UW is used)

Posted: 05 Dec 2005, 23:50
by GrOuNd_ZeRo
I'll keep the discriptions as simple as possible, I will not add combat units though.

Commanders:
NATOCOM (NATO)
IHCCOM (Mospact) (IHC is an obsolete name for Mospact, Mospact units are either IHC or Mosp)

L0 Factory:
NATOBARR (Barracks, Builds infantry units)
IHCBARR

L0 Resources (commander and engineer)
NATOMINE (MEX, extracts more than an OTA mex but less than a Moho)
IHCMINE
NATOGASP (Gas Powerplant, produces 75 energy)
IHCGASP
NATOCONT (Ore Silo, Stores Metal)
IHCCONT
NATOBATT (Capacitator, Stores Energy)
IHCBATT

L0 Defense (commander and engineer)
NATOPB (Pillbox, armed with Heavy Machinegun, effective against infantry, light vehicles and (slow) aircraft.
IHCPB
NATOATPB (Anti-Tank pillbox, armed with Anti-Tank missiles, not effective against infantry and aircraft)
IHCATPB
GDF-005 (NATO Air Defense, kind of like a light flakker)
ZU-23 (Mospact Air Defense, lighter gun, but fires faster)
NATORAD (Radar unit)
IHCRAD

L0 Construction:
NATOENGI (Engineer, construction infantry)
IHCENGI

L1 Factories:
NATOWFL1 (Vehicle Facotory Level 1)
NATOELBA (Elite Barracks)
IHCWFL1
IHCELBA

L1 Resources
(Same as commander)

L1 Defense
(Same as Com except for some Artillery)
M198 (NATO Artillery, kinda like a Guardian, but less health)
D-20 (Mospact Artillery, is cheaper but less health)

L1 construction:
NATOENVI (engineering vehicle, builds level 2 structures)
IHCENVI
CCH-192 (NATO Construction Helicopter)
KA-152 (Mospact Construction Helicopter)

L2 Factories:
NATOAPL1 (Aircraft Plant Level 1)
IHCAPL1
NATOWFL2 (Vehicle Factory Level 2
IHCWFL2

L2 Resources (build by Engineering vehicle and helicopter)
NATOMFAC (Mining Facillity, extracts more metal, has more armor and is armed with 2 machineguns)
IHCMFAC
NATONUKP (Nuclear Powerplant, produces 900 energy)
IHCNUKP

L2 Defense
JERNAS (NATO Anti-Air Missile turret)
LY-60 (Mospact SAM)
NATOGT (Turret with Tank gun, missiles and auto-cannon)
MOSPGT
NATOGTWR (Guard Tower, large LOS and has a sniper rifle)
MOSPGTWR
NATORADT (L2 Radar Tower)
IHCRADT

Well, I hope this is enough for your AI, if you need other names let me know.

Posted: 06 Dec 2005, 17:06
by j5mello
when u have IHCBATT is the IHC mean that its for mospact

cause if it is then thats kinda confusin

Posted: 06 Dec 2005, 18:27
by FLOZi
/me fondles TACW's excessively standardised naming system :-)

/me looks at AATA's and cries. :cry:

Posted: 06 Dec 2005, 19:58
by Masse
that naming thing reminds me of this other naming problem...
--------------------------------------------------------------------------
to all mod makers
please all mod makers...
TAKE THE F*KING TA OUT OF THE NAMES OF THE MODS !!111!!

Posted: 06 Dec 2005, 20:42
by AF
Not quite.

In NTAI you need to specify what it builds yes, btu mroe importantly in what order and quantities.

But that's a start nonetheless.

Posted: 06 Dec 2005, 21:01
by GrOuNd_ZeRo
Eek, do you need discriptions as well? i.e. what they do?

Posted: 06 Dec 2005, 21:03
by AF
no, as much as a list of what to build

so e.g cormex
cormex
corsol
corrad
corlab
corsol
cormex

would be the start of the XTA core commander, just a list of what to build, each one followed by what is built immediatly after.

Posted: 07 Dec 2005, 18:24
by j5mello
ok ive been doin some WD testin i think i can make a decent build list gonna take me a bit as i have tons of hw for school

EDIT: also do u need just comm or do i enter in the con units as well?

Posted: 07 Dec 2005, 20:24
by AF
Whichever, you can just enter the commander, but if you do that then onyl the commander will build anything, all the factories it builds will just stand still and do nothing. So you need a similair entry for construction units, and for factories.

Anythign that builds needs a buildtree otherwise it'll do one of the following when it's built:

guard stuff
resurrect stuff
reclaim stuff.

Posted: 15 Dec 2005, 09:14
by submarine
i found a bug in 5.04b:

the game crashed when a a10 destroyed a soviet extractor stating that an .obj file is missing

Posted: 15 Dec 2005, 14:51
by Zenka
Masse wrote:that naming thing reminds me of this other naming problem...
--------------------------------------------------------------------------
to all mod makers
please all mod makers...
TAKE THE F*KING TA OUT OF THE NAMES OF THE MODS !!111!!
XTA-TA=X? X v0.66 SE, that doesn't sounds like anything.

But I agree, the mods arn't for TA anymore but for Spring. So they should be named to that.

Posted: 15 Dec 2005, 17:36
by Masse
well xta still is TA right ? it uses most old TA units and all :wink:

Posted: 16 Dec 2005, 00:43
by maestro
Is there any AI making tutorial ?

Posted: 16 Dec 2005, 01:01
by Dragon45