NTAI build tree info and request

NTAI build tree info and request

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

Moderators: hoijui, Moderators

Post Reply
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

NTAI build tree info and request

Post by AF »

http://www.darkstars.co.uk/NTAITrees.htm

The file's a little largish for a html file, adn it has a lot of the info needed to get untis workign with NTAI right.

In the above, ignroe the bi that says hwo it's shown in the code at the beginning as dreamweaver overwrote some bits in there. Also where ti says that a units object is usually a uu-> thing, it might be a uz-> thing too, you'll see when you've read it.

Also if an entry si still in the original code form tis cus I dotn remember what the untiname represents ro what ti does. Also the TLL and Arm build trees where originalyl Core build trees copied voer thus there are still artefacts such as TLLADVSOL or ARMTOAST entries.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

The request:

I need a lto of work done on NTAI's build tree. It onyl really gives a good battle if you're setting it up as XTA core. I need people who know more than me tog o through adn change ti for core and arm, and somebody to create an AA specific build tree. If you cant do it all in C code like I explained then at least in the plain english form I did in the above document. The above document also contains the current build trees of 0.28.10+ in plain english with an explanation.

I dont know enough about XTA and AA to devise the build trees that'd give the best results, I just balance them out so NTAI doesnt stall or gets destroyed quickly.
jellyman
Posts: 265
Joined: 13 Nov 2005, 07:36

Post by jellyman »

Possible improvements for resource development.

Define:
Resource Spend Rate = percent of metal spent on resource generating builds in last 5 minutes.
Desired Resource Rate = function of time. Could try 100% from 0 to 2 minutes, 80% from 2 to 10 minutes, 50% from 10 to 30 minutes, 25% > 30 minutes.

Then if Resource Spend Rate < Desired Resource Rate: Build Energy or metal. Else build defensive structure, or assist factory.

Also can the current metal/energy utilisation rates be measured. If metal = 130% (i.e. a bit of nano stalling due to metal shortage) and energy = 50%, then try and build metal for instance?
User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Post by jcnossen »

If you are continuing on the buildtrees, I would recommend using my config reader for it... it makes things a lot easier for people to make AI support for NTAI, instead of you having to hardcode it all into NTAI.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Well I am going to start moving voer tiem towards using tags instead of unitnames and generating the unitnames dynamically, then movign to generate those tags dynamically absed on stats.

But overrall It would be more efficient at the moment to do ti the current way since teh current way allows thgins to be finetuned somewhat, and absic if statements can fork the build tree for different circumstances such as low resources or overproduction.

edit:: I'll consider using the config reader, I'm unsure as to wether I'm ok with removing the drag and drop aspect of NTAI but I guess I sorta eliminated that when I made cains class save to a seperate folder and made the installer. it might eb a pain having the if statement thign taken away, and removing access to the ai callbak and so on for branching off and different thgins to mix up the trees so they're not rigid.
User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Post by jcnossen »

Also if you use the file reading functions in the IAICallback, then you can read it from the mod archives, so modders can put there own NTAI config in their sd7 file.
You can use this, and the CfgParser.cpp/CfgParser.h
You only need to remove/change the logPrintf and ChatMsgPrintf calls...

Code: Select all


CfgList *LoadConfigFromFS (IAICallback *cb, const char *file)
{
	CfgBuffer buf;

	buf.len = cb->GetFileSize (file);
	if (buf.len < 0) {
		ChatMsgPrintf (cb, "Failed to load \"%s\"", file);
		return 0;
	}

	buf.data = new char [buf.len];
	cb->ReadFile (file, buf.data, buf.len);

	buf.filename = file;

	CfgList *list = new CfgList;
	if (!list->Parse (buf,true))
	{
		delete list;
		delete[] buf.data;
		return 0;
	}
	delete[] buf.data;

	return list;
}

Anyway, I'd like to see some mods with an AI, and JCAI scripts are a bit too complicated so it seems (I think I made it a little too customizable so know no one knows what to put in the config ;) )
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Well I'm sticking witht he current build tree system. It's simple to add and change, as long as people ignroe the C++ code surroudnign it.

To add soemthign yuo take the unitname, add uz->AddTask(" to its left and "); to it's right, then stick it in the correct place. That's all there is to doing it. Or copy an existing units list with if statement and all and change the name at the top, then do what i said in the previous sentence.

Config files are somethign i am not fond of at all or I'd ahve written code to aprse them by now and gotten ti working.
jellyman
Posts: 265
Joined: 13 Nov 2005, 07:36

Post by jellyman »

I did some messing around in icebergs map, aa 1.3. If you can create a build tree for commander when map type = water, then I think the build tree should start something like:

Tidal x 2
Mex
Shipyard
tidal x 2
mex
tidal
mex
tidal x 2

basically the metal/energy generation is similar to if you are building solars and land mexes. However underwater mexes take a lot of energy to build, so need to start with tidal x 2 to avoid stall.

Shipyard could be something like:
construction ship
skeeter x 3
construction ship
skeeter x 2
destroyer

throw in a few subs or whatever as well but keep skeeter count high, possibly reducing or eliminating over time.

Ships are more expensive than land units, so you may want to delay the construction of the advanced ship yard, when compared to building an advanced k-bot lab.

Anyway I'm not a real expert on which units are best to build, but thought I'd see if advice on starting naval build trees would be usefull.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

extremely useful. I know next to nothing about naval tactics, all my playtests have been onland sofar.
User avatar
Triaxx2
Posts: 422
Joined: 29 Aug 2004, 22:24

Post by Triaxx2 »

Great reasoning, but the ships are more expensive, so you need to bring out the adv Shipyard faster than you would the adv bot lab. You'll need the bigger guns sooner than you would the more powerful Kbots. The reason is that while:

Pyro doesn't beat Storm automatically, but:

Cruiser beats destroyer with almost laughable ease.
Post Reply

Return to “AI”