Foliage, Sectors, Portals and Framerate Improvement....

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
Hebes24
Sith Master
Sith Master
Posts: 2594
Joined: Sat Jun 03, 2006 5:15 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: In An Epic Space Battle!
Contact:

Foliage, Sectors, Portals and Framerate Improvement....

Post by Hebes24 »

I have a Few question about the foliage editing mode in ZE.

1.) What is it?

2.) How does it work?

3.) Can you place trees with it? I'm doing a big Yavin map and I need ALOT of trees. Basically, the whole thing is a forest with a few clearings and a road.
Last edited by Hebes24 on Mon Oct 02, 2006 1:36 pm, edited 1 time in total.
Big_rich

RE: Foliage....

Post by Big_rich »

1) Foliage are the little shrubs, grass, bushes you find in maps.
2) You "paint" it in ZE, then use a .prp file in your world1 folder to define the "foliage".EX of prp file:

Code: Select all

	{
		File("end_prop_fern5.msh", 80);
		Frequency(50);
		Scale(1);
		Stiffness(0.0);
		CollisionSound("foliage_collision");
	 	ColorVariation(0.2);
		AIVisibilityFactor(0.7,1.0);
	}
	Mesh()
	{
		File("end_prop_fern5.msh", 150);
		Frequency(70);
		Scale(1);
		Stiffness(0.0);
		CollisionSound("foliage_collision");
	 	ColorVariation(0.2);
		AIVisibilityFactor(0.7,1.0);
	}
	Mesh()
	{
		GrassPatch("end_prop_grass.odf", 40);
		File("editor_grasspatch.msh", 80);
		Frequency(50);
		Scale(1);
		Stiffness(0.0);
	        CollisionSound("foliage_collision");
	        ColorVariation(0.2);
		AIVisibilityFactor(0.40,0.9);
	}
}

Layer(1)
{
	SpreadFactor(0.4);
 	Mesh()
	{
		File("end_prop_fern5.msh", 30);
		Frequency(20);
		Scale(1);
		Stiffness(0.0);
		CollisionSound("foliage_collision");
	        ColorVariation(0.2);
		AIVisibilityFactor(0.7,1.0);
	}

 	Mesh()
	{
		File("end_prop_treeclump_1.msh", 50);
		Frequency(50);
		Scale(1);
		Stiffness(0.0);
		CollisionSound("foliage_collision");
	        ColorVariation(0.2);
		AIVisibilityFactor(0.35,0.6);
	}
}

Layer(2)
{
	SpreadFactor(0.4);

 	Mesh()
	{
		File("end_prop_foliage5.msh", 100);
		Frequency(50);
		Scale(1);
		Stiffness(0.0);
		CollisionSound("foliage_collision");
	        ColorVariation(0.1);
		FadeDist(10.0);
		AIVisibilityFactor(0.2,0.4);
	}
 	Mesh()
	{
		File("end_prop_foliage6.msh", 100);
		Frequency(50);
		Scale(1);
		Stiffness(0.5);
		CollisionSound("foliage_collision");
	        ColorVariation(0.1);
		FadeDist(10.0);
		AIVisibilityFactor(0.1,0.2);
	}
 	Mesh()
	{
		File("end_prop_foliage7.msh", 140);
		Frequency(50);
		Scale(1);
		Stiffness(0.5);
		CollisionSound("foliage_collision");
	        ColorVariation(0.1);
		FadeDist(10.0);
		AIVisibilityFactor(0.1,0.2);
	}
}

TreeLine()
{
	Path("jungle1")
	{
		Distance(28);
		BorderOdf("end_prop_treebill.odf");
	}
}
3) Yes you can use it to place trees.Look in the above .prp file taken from endor, experment with it for placing those trees.

The layers noted in the above code define which "brush" or layer you are using in ZE. 1, 2, 3, 4.
Hebes24
Sith Master
Sith Master
Posts: 2594
Joined: Sat Jun 03, 2006 5:15 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: In An Epic Space Battle!
Contact:

RE: Foliage....

Post by Hebes24 »

Thanks Big_Rich! Though, where do you put the mshs, and odfs? in data_***\worlds\***\msh(or odf)?
Last edited by Hebes24 on Sun Oct 01, 2006 6:36 pm, edited 1 time in total.
User avatar
EraOfDesann
Jedi Admin
Jedi Admin
Posts: 2170
Joined: Mon May 30, 2005 5:22 pm
Location: North Texas
Contact:

Post by EraOfDesann »

You put the odf's and msh's in their corresponding folders of your world. So yeah, data_ABC/worlds/ABC/(msh or odf).
Hebes24
Sith Master
Sith Master
Posts: 2594
Joined: Sat Jun 03, 2006 5:15 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: In An Epic Space Battle!
Contact:

Post by Hebes24 »

Thanks! I have foliage now!! Now I just have to get some tree mshs in that prp file....
Hebes24
Sith Master
Sith Master
Posts: 2594
Joined: Sat Jun 03, 2006 5:15 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: In An Epic Space Battle!
Contact:

Post by Hebes24 »

New Question about foliage:

How do you make foliage have collision Geometry? I have it working with trees now, but you can go right through them! (LOL!)

Sorry about the double post.
Penguin
Jedi Admin
Jedi Admin
Posts: 2541
Joined: Sun Mar 05, 2006 12:00 am
Location: Australia

Post by Penguin »

place them in ZE manually
Big_rich

Post by Big_rich »

Yep as penguin says anything located in the prp section is gonna have no collision. Cause it is usually used for grasses, brushes and such. I really don't know of any msh option to force collision.
Hebes24
Sith Master
Sith Master
Posts: 2594
Joined: Sat Jun 03, 2006 5:15 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: In An Epic Space Battle!
Contact:

Post by Hebes24 »

Aw man! That means I'll have about 6.022*10^23 trees that I'll have to place manually! My mouse finger hurts just thinking about it! Oh well....

Alright I put in a bunch of trees (filled about 1/3 of the map the way I want it) but now, whe I look at the forest, my Framerate is at 0.82!! (holy [diet dr. pepper]!) is there any way to have a forest and be able to actually look at it?
Penguin
Jedi Admin
Jedi Admin
Posts: 2541
Joined: Sun Mar 05, 2006 12:00 am
Location: Australia

Post by Penguin »

go back to having foliage with no collison, it runs slow in ZE becouse everythign shirez, not low rez and it doesnt render the collison, ingame it will run slower becouse it has hirez and lowrez calculating and collison and manging all the normal map stuff ((units, animation, etc))

but with foliage it doesn't do the colision and lowrez stuff, etc etc etc. lol
Rekubot
Jedi
Jedi
Posts: 1080
Joined: Wed Apr 05, 2006 12:34 pm
Projects :: No Mod project currently.
Games I'm Playing :: Shadow Complex
xbox live or psn: Rekubot
Location: UK

Post by Rekubot »

It's just because of all the animated leaves. Your best bet is to take 'em all off with the ODF file, LoL. Otherwise, you've gotta live with the lag.
-(DW)-Big_Rich

Post by -(DW)-Big_Rich »

Or maybe try using sectors, and adjust your farsceen/nearsceen range. You can do it, it's just gonna take allot of messing around with differant numbers to try to get a mix of distant fog and visual appeal. This is how felucia's level designers does it. I would suggest checking out feluica's sky file and maybe check it's sectors and portals. Maybe it can give you some hints on how to create the visual effect your looking for.
Hebes24
Sith Master
Sith Master
Posts: 2594
Joined: Sat Jun 03, 2006 5:15 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: In An Epic Space Battle!
Contact:

Post by Hebes24 »

I don't know how to use sectors and portals, and I only have a vague idea about what they are. I frankly Hate the amount of fog Felucia and I still get lag there, so I don't like the fog Idea. I also think that nearscene and farscene ranges should not be played with, because I have som tall hills whare you can see the whole map, and I need certain objects to be visible from those heights (greattemples), so if I play with that, it won't look good.
Rekubot wrote: Otherwise, you've gotta live with the lag.
Do you know how bad 0.82 FPS is? Your unit moves like, every 3 seconds. But it's only if you look at the forest.


This is what my map looks like now:

Image

Basically, the real trees are where you should be on the map (on the paths to the CPs, etc), then it goes to the foliage trees where you technically shouldn't be, then at the edges it fades to no trees. this is better, but the framerate is still about 2-5 FPS when looking at a large section of trees. (ugh!)

Would sectors/portals improve the framerate? How do I set them up in ZE?
xwingguy

Post by xwingguy »

sectors and portals....READ THE BF2 PORTALSYSTEM DOC! Also look at the shipped maps, especially tantiveIV

Also visit this post to make the portals & sectors work:
http://www.gametoast.com/index.php?name ... 717#103717

btw sectors & portals may not work for folage but hey, felucia used em
Hebes24
Sith Master
Sith Master
Posts: 2594
Joined: Sat Jun 03, 2006 5:15 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: In An Epic Space Battle!
Contact:

Post by Hebes24 »

WOW!! How did I not see that doc! Man! *smacks himself*
t551
General
General
Posts: 791
Joined: Sat Jul 16, 2005 3:23 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Post by t551 »

Also, did you really place 1 mol of trees in your map? At 5 tons a tree, that gives a molar mass of... I've taken too much chemistry.
Big_rich

Post by Big_rich »

psych0fred wrote: Setting up collision and odfs/mshs helps (most people think if it works it works). Make sure your objects are small and have collision set up (vs having the engine use the visible geometry for collision). The larger the object the more time it takes to check a unit or vehicle's collision against it.
You have an example of this? I'm not to clear on what you mean.
Hebes24
Sith Master
Sith Master
Posts: 2594
Joined: Sat Jun 03, 2006 5:15 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: In An Epic Space Battle!
Contact:

Post by Hebes24 »

Yeah, I don't know what you mean either.

I've decided to scratch my forest idea, and only put trees in some places where it's really neccissary. And, since it's called "Yavin IV: Foothills" I could say that the whole map is very high altitude and close to the treeline, so there isn't that many trees anyway. :P
Post Reply