TA:WD - Page 19

TA:WD

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Poll of the week: Should NATO and Mospact be devided into seperate countries?

Poll ended at 14 Jul 2006, 20:26

Yes, let's have 20.000 different races and a million units!
3
7%
Yes, but only split the up in factions like US and Canada, UK and Germany, etc.
24
56%
No! the sides need to say Binary! keep as it is.
6
14%
No, just make seperate factories for Bombers, Fighters and Helicopters.
4
9%
Yes, give the player a choice what country to play in game.
6
14%
 
Total votes: 43

User avatar
GrOuNd_ZeRo
Posts: 1370
Joined: 30 Apr 2005, 01:10

Post by GrOuNd_ZeRo »

what do you need to know? I would love a NTAI for WD :D
j5mello
Posts: 1189
Joined: 26 Aug 2005, 05:40

Post 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
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post 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........
j5mello
Posts: 1189
Joined: 26 Aug 2005, 05:40

Post by j5mello »

what opnes a .cpp file
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6241
Joined: 29 Apr 2005, 01:14

Post by FLOZi »

Text editor.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post 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)
User avatar
GrOuNd_ZeRo
Posts: 1370
Joined: 30 Apr 2005, 01:10

Post 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.
j5mello
Posts: 1189
Joined: 26 Aug 2005, 05:40

Post by j5mello »

when u have IHCBATT is the IHC mean that its for mospact

cause if it is then thats kinda confusin
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6241
Joined: 29 Apr 2005, 01:14

Post by FLOZi »

/me fondles TACW's excessively standardised naming system :-)

/me looks at AATA's and cries. :cry:
User avatar
Masse
Damned Developer
Posts: 979
Joined: 15 Sep 2004, 18:56

Post 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!!
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post 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.
User avatar
GrOuNd_ZeRo
Posts: 1370
Joined: 30 Apr 2005, 01:10

Post by GrOuNd_ZeRo »

Eek, do you need discriptions as well? i.e. what they do?
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post 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.
j5mello
Posts: 1189
Joined: 26 Aug 2005, 05:40

Post 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?
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post 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.
submarine
AI Developer
Posts: 834
Joined: 31 Jan 2005, 20:04

Post 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
User avatar
Zenka
Posts: 1235
Joined: 05 Oct 2005, 15:29

Post 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.
User avatar
Masse
Damned Developer
Posts: 979
Joined: 15 Sep 2004, 18:56

Post by Masse »

well xta still is TA right ? it uses most old TA units and all :wink:
maestro
Posts: 352
Joined: 08 Jun 2005, 11:10

Post by maestro »

Is there any AI making tutorial ?
User avatar
Dragon45
Posts: 2883
Joined: 16 Aug 2004, 04:36

Post by Dragon45 »

Post Reply

Return to “Game Development”