Assistance required: Features, tdf's...

Assistance required: Features, tdf's...

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
User avatar
mother
Posts: 379
Joined: 04 May 2005, 05:43

Assistance required: Features, tdf's...

Post by mother »

Could anyone verify for me what 'name' FeatureHandler.cpp is looking for?

(ie TreeType1, GeoVent, armfort_fort? armckfus? armckfus_dead? Armckfus_dead? ARM_FORT? etc... Depending if it cares about the filename on the .tdf, the Objectname in the tdf, or the name of the 3do specified in the .fbi... ooy)

I have a version of mapconv that appends arbitrary features after TreeType's and GeoVent are declared... same format of featurename<null>

Code: Select all

void CFeatureCreator::WriteToFile(ofstream* file, vector<string> F_map)
...
vector<string>::iterator F_map_iter;
	int ArbFeatureTypes=F_map.size();
...
for (F_map_iter=F_map.begin();F_map_iter!=F_map.end();F_map_iter++){
		string c=*F_map_iter;
		file->write(c.c_str(),(int)strlen(c.c_str())+1);
	}
Where F_map comes from:

Code: Select all

ifs.open(featureSpecFile.c_str(), ifstream::in);
		while (ifs.good()){
			char c[100]="";
		    ifs.getline(c,100);
			F_Spec.push_back(c);
			ex++;
It then places them as feature types 17, then 18, etc.

Code: Select all

if ((f) && ((256-f)<= arbFeatureTypes)) {
				map[y*xsize+x]=1;
				MapFeatureStruct ffs;
				ffs.featureType=NUM_TREE_TYPES+(int)(257-f);
				ffs.relativeSize=1;
				ffs.rotation=0;
				ffs.xpos=(float)startx+x*8+4;
				ffs.ypos=0;
				ffs.zpos=(float)starty+y*8+4;
				features.push_back(ffs);
}
Spring does NOT like this.

If you define an arbitrary feature type but don't place one, it just takes FOREVER at the 'Generating Trees' stage... If you place one too, it crashes after taking forever.

Also, assuming I can get this to work, could we possibly modify the rts/FeatureHandler to look in the maps/sd7's for the tdf's, etc?
User avatar
Dragon45
Posts: 2883
Joined: 16 Aug 2004, 04:36

Post by Dragon45 »

It sounds like you may be having a problem with a value of -1 or 0 in a FOR loop somewhere with an array reference... just a hunch though.
Post Reply

Return to “Engine”