Page 68 of 95

Posted: 27 Jul 2007, 17:13
by DJ
the BA config runs both races...

and anyhow I'm going to build a CA config now cos the mod just looks wicked.

Posted: 29 Jul 2007, 20:33
by AF
I desperately need these bugs fixed, but right now they're unfix-able (ERROR WORKING DEBUGGER NOT FOUND).

I need a working stack trace in English that shows were the bug occurred, what file, what function even what type of exception. All I'm getting are addresses and addresses are useless, and the spring stack trace translator refuses to translate NTai code addresses.

So that means a debugger is needed, and I don't have a working debugger thats able to debug dlls.

Posted: 30 Jul 2007, 16:33
by AF
http://spring.unknown-files.net/file/33 ... berlogger/

A build of NTai with extensive logging.

Logs can be found in /AI/NTai/Logs/ if installed correctly

requires toolkit for the necessary folder structure

Needs configs for mods

1 crashbug fixed

report all crashes to the spring forums along with the AI log and infolog.txt (use a pastebin, no posting giant logs in my thread)

Posted: 01 Aug 2007, 02:23
by AF

Posted: 01 Aug 2007, 10:46
by 1v0ry_k1ng
now with less conbots reclaiming commander?

Posted: 01 Aug 2007, 13:28
by AF
I have yet to recieve any really useful information on that bug, if I ahd I'd have said so.

I need a 100% reproducible instance of ti from a config that doesnt generate masses of alternative tasks to clutter it up. aka make conbots reclaim allied units and do nothing else.

Right now that behaviour could be caused by 1 of upto 30 thousand lines of code. I'm not searching through them all untill I at least know which task is at fault.

Posted: 07 Aug 2007, 12:53
by DJ
the reclaim bug seems to be that the b_reclaim function now doesn't tell the difference between live units and dead units. remove the b_reclaim tag from task lists and you will have no commanders being reclaimed.

Posted: 07 Aug 2007, 13:22
by AF
hmm, I hadnt thought of that.

btw geothermal bug is fixed in the code, it seems I was specifying an array of x and passing x as the max param when x-1 was the correct value, so itd crash with a buffer overrun.

Posted: 07 Aug 2007, 13:34
by 1v0ry_k1ng
any chance of a non-logging stable release soon? Im making XTA SP missions and am using NTAI as the AI so cant really release a pack till its all working

Posted: 07 Aug 2007, 15:30
by DJ
OK i've been trying to figure out how the b_rule keywords work from testing configs. I've learned a bit about them but really need some help. It seems to me like the b_rule keywords act kind of like a "build if" command. The problem i'm having is I'm not sure how many times i need to put the b_rule keyword in.

lets say i have b_rule, b_mex It seems that this means buid a mex if the b_rule conditions are met, however the b_rule being present seems to sometimes cause more than one mex to be built and also seems to effect other tasks in the list. I maybe completely wrong on this but i have no documentation to go on at all. I'd be more than happy to write something up if you can explain to me what each of the keywords b_rule, b_rule_extreme and then the _no_fact versions do.

I also see that the is a b_rule_carry. Now if this means i can create a task like b_rule_carry, b_mex, b_power and it will keep building mex and power until we have enough then that is excellent but I don't know how to use it.

Posted: 07 Aug 2007, 16:14
by AF
If a keyword ahs _carry on the end it means, when I finish this task I'm going to repeat it again untill it fails.

For example b_rule_extreme_carry will keep repeating b_rule_extreme untill it skips, which is good as b_rule_extreme is intended to issue power when your power stalling, build mexes/metalmakers when metal stalling, or storage/factories when maxed out.

Look at the CEconomy in CEconomy.h/cpp. That class has no purpose outside of handling the b_rule type keywords, more specifically it checks the conditions on each aspect of the rule, aka youll see the checks that return true or false for building a mex or solar etc, its also the place were those b_rule constants in the big 2 columns are used.

EG:

Code: Select all

btype CEconomy::Get(bool extreme,bool factory){
	if(BuildMaker(extreme)==true){
		return B_METAL_MAKER;
	}
	if(BuildMex(extreme)==true){
		return B_MEX;
	}
	if(BuildPower(extreme)==true){
		return B_POWER;
	}
	if(factory){
		if(BuildFactory(extreme)==true){
			return B_FACTORY;
		}
		if (BuildEnergyStorage(extreme)==true){
			return B_ESTORE;
		}
		if(BuildMetalStorage(extreme)==true){
			return B_MSTORE;
		}
	}
	return B_NA;
}

bool CEconomy::BuildFactory(bool extreme){
	NLOG("CEconomy::BuildFactory");
	if(extreme == true){
		float a = (float)atof(G->Get_mod_tdf()->SGetValueDef("0.8","ECONOMY\\RULES\\EXTREME\\factorymetal").c_str());
		float b = (float)atof(G->Get_mod_tdf()->SGetValueDef("0.8","ECONOMY\\RULES\\EXTREME\\factoryenergy").c_str());
		if(G->cb->GetMetal() > G->cb->GetMetalStorage()*a){
			if(G->cb->GetEnergy() > G->cb->GetEnergyStorage()*b){
				return true;
			}else{
				return false;
			}
		}else{
			return false;
		}
	}else{
		float a = (float)atof(G->Get_mod_tdf()->SGetValueDef("0.8","ECONOMY\\RULES\\factorymetal").c_str());
		float b = (float)atof(G->Get_mod_tdf()->SGetValueDef("0.8","ECONOMY\\RULES\\factoryenergy").c_str());
		float c = (float)atof(G->Get_mod_tdf()->SGetValueDef("7","ECONOMY\\RULES\\factorymetalgap").c_str());
		if(G->cb->GetMetal() > G->cb->GetMetalStorage()*a){
			if(G->cb->GetEnergy() > G->cb->GetEnergyStorage()*b){
				return true;
			}else{
				return false;
			}
		}else if(G->Pl->GetMetalIncome() - G->cb->GetMetalUsage()*1.2f > c){
			return true;
		}else{
			return false;
		}
	}
	return false;
}
The factory parameter specifices wether or not it can choose a factory, as seen ehre taken from CKeywordConstructionTask.cpp:

Code: Select all

	}else if((type == B_RULE)||(type == B_RULE_EXTREME)||(type == B_RULE_EXTREME_NOFACT)||(type == B_RULE_EXTREME_CARRY)){

		type = G->Economy->Get(!(type == B_RULE),!(B_RULE_EXTREME_NOFACT == type));
		if(type == B_NA){
			valid = false;
			End();
			return false;
		}
I've compiled a new NTai with the geo and uwmex fixes, I just need to change the version numbers.

---------------------------------

As for b_reclaim, thats a problem because b_reclaim is intended for features not enemy units. Insted b_reclaim will use an area reclaim in future.

Posted: 07 Aug 2007, 16:28
by DJ
ok so if i was to make a task list that consisted of:-

b_rule,b_rule,b_rule,b_rule,b_rule,b_rule

then NTai would build mex's or power in order to satisfy the needs of the economy?

if that's true then thats wicked. Why write something that useful and not tell anyone?

Posted: 07 Aug 2007, 16:49
by AF
I did I made a huge song and dance back when I first wrote it, so much so my default config at one point was nothing but b_rule.

Then I started writting copies of b_rule with different additions for exceptions, like a weaker version for stalling, or one with no factories, or one that didnt need me to write b_rule_extreme 10000 times. I even made the interpolation thing insert one inbetween every task item.

Anyways I think XE9.79 is almost ready.

I hear IK has done some work recently. Ill do the usual dll only release and re-release maybe with one or two changes later on with the full folder structure and toolkit.

Posted: 07 Aug 2007, 16:51
by DJ
ok that's great, i think we need some documentation for all this and I think the best person to write it is probably me or IK. I'll need to run it all by you for correctness but i don't mind knocking one together.

Is it best to do it in a doc, on the wiki or here?

Posted: 07 Aug 2007, 17:00
by AF
The wikiseems most appropriate.

But make sure that the initial page for the NTai section is a menu just like the front, preferably leading into sub menu pages, organisation is essential. I wont have the usual riffraff gigantic page of text.

Or, Darkstars may be more appropriate, Im thinking it needs redoing again using a more lightweight setup.

Posted: 07 Aug 2007, 17:08
by 1v0ry_k1ng
if this coming release is functional, would it be possible to release it with an easy to use installer? say with an option for having an existing NTAI (which it replaces) or installing it unto a new machine, beign packed with all the current working configs? my core config is basicly ready so XTA will be sorted, ill start work on my own BA config afterwards because I reckon NTAI can play BA much better than XTA

Posted: 07 Aug 2007, 17:29
by AF
http://spring.unknown-files.net/file/33 ... e-release/

to late.

That release also includes a minor fix to the mexspot finder class involving possible uninitialized values.

Geo and uwmex bugs fixed.

When you release your XTA config and DJ has no problems with be releasing his BA 5.5 config Ill do an installer.

Posted: 07 Aug 2007, 19:19
by 1v0ry_k1ng
why does reclaim suddenly give a reclaim order over a vast area? my config is borked on any map with trees now :/

Posted: 07 Aug 2007, 21:38
by AF
Because b_reclaim took the nearest feature and told NTai to reclaim it, but it passed a featureID to the engine and the engine treated it as a unitID.

So instead of passing a unit/featureID it passed an area reclaim command of around 900 radius.

Posted: 07 Aug 2007, 21:43
by 1v0ry_k1ng
but that means on a map with trees any bot with a reclaim order spends the rest of the game reclaiming trees, pretty much.
wouldnt it be better to, say, have a 300 radius around the nearest feature, then it wouldnt reclaim units but wouldnt spend the whole game doin lumberjack stuff?