Features defined by files

Features defined by files

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
Dragon45
Posts: 2883
Joined: 16 Aug 2004, 04:36

Features defined by files

Post by Dragon45 »

So i've been poking around the code for the first time and I was thinking it might be possible (of course it is possible, i mean for someone with my skill level of coding, which isnt much) to get MapConv to start placing different and other sorts of features other than the currently defined 16 trees and 1 type of grass, and making it defined by an external file isntead of hard coded like it currently is in featurecreator.cpp.

Featurecreator.h looks like it can work with any kind of feature, so i would already have something to work with.

At the very least, it might be made so that it has the potential accept input for different types of features, and someone else write a seperate GUI to actually let the mapmaker place said features ( Buggi! ).

Just wondering if anyone else is working on this at the moment, and if i should try and pursue this in terms of engine limitations.
User avatar
Buggi
Posts: 875
Joined: 29 Apr 2005, 07:46

Post by Buggi »

As you know I did the new map converter and can place features with any feature id.

Here is all that is stored in the map file:

Code: Select all

public struct FeatureFileStruct
{
	public int featureType;
	public float xpos;
	public float ypos;
	public float zpos;
	public float rotation;
	public float relativeSize;
}
That's it. featureType is set from 1 to 16 for trees, 0 for grass, and 17 for geovents. Yep, geovents are features.

-Buggi
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

I was thinking that a script could be written internally that took arbitrary arguements for which units to load rather than specific function calls to specific units, giving something like features in OTA. I hadnt thought out though so maybe if someone could think it through?
User avatar
Ace07
Posts: 348
Joined: 21 Apr 2005, 20:46

Post by Ace07 »

Yes, scripting is good, but its hard to impliment once everything is written. If you start out with the objective of producing fully scriptable code, then you will most certainly get that. I doubt thats how this project started out though. :?
Sean Mirrsen
Posts: 578
Joined: 19 Aug 2004, 17:38

Post by Sean Mirrsen »

Maybe instead the main executable could be modified to read a special txt file on map load, placing units (and also, features, since DTs are placed as units, but are features in essense), belonging to a neutral team (team -1?). That way, we get less trouble when moving or adding features to a map (no need to recompile it), and quite a load of flexibility for placing features - as well as neutral units, WC3-style.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Didnt I do a big post on there being a GAIA player? at least then I could create a tree AI that would spawn new trees and branches, fullfilling aGorms original dream and shutting up the alantai tree people once and for all. Or maybe I could just program a highly flexibl bird subroutine... wings flap... tweeeet... flap
SJ
Posts: 618
Joined: 13 Aug 2004, 17:13

Post by SJ »

CVS version allows maps to point to wreck feature files to include in the map.
User avatar
Buggi
Posts: 875
Joined: 29 Apr 2005, 07:46

Post by Buggi »

I noticed, can you PM me an example so I can integrate it into my Map Conversion Util in time for the next release?

-Buggi
User avatar
aGorm
Posts: 2928
Joined: 12 Jan 2005, 10:25

Post by aGorm »

Now thats cool. I take it we can pack our own .ufo in with the map with custom wreks, and point to them, letting us have any feature we like??
If so this would rock in large amounts...

aGorm
SJ
Posts: 618
Joined: 13 Aug 2004, 17:13

Post by SJ »

There is no example to be had I havent tested the code :) But it should just be to add a definition in the map file like the current tree and grass ones but named after a wreck file.
Post Reply

Return to “Engine”