Page 1 of 2

Terrain preventing .aas creation?

Posted: Tue Jun 12, 2007 12:49 pm
by Magnus
When trying to make a .aas for a map I am working on I keep getting the following error:

First it goes through a bunch of listed Entity 0, Brush XXXXX: duplicate plane. Although I used the brush cleanup tools and no duplicate planes were found in this map.
Then it just stops and gives me...
ERROR: MAX_MAPFILE_PLANES

I done a search on this error and found this.

"You have two choices: cut down on the number of brushes in your map, or don't add bot support. You can try putting clip brushes around heavily detailed brush work, but no guarantees that it will work."

Here is a shot of my map so far.
Image

As you can see there are not that many brushes in the map. There is a terrain portion and I figure this has something to do with the error, but the terrain brushes are listed as func_group not worldspawn as most errors like this seem to come from.

I have seen many maps that use a terrain portion and ones that use a large terrain portion and they had bot support. Look at many of the Q3:TA maps.

So what do mappers do to create their large terrain maps and still be able to avoid this error and create a .aas bot support for their maps?

Thanks

Posted: Tue Jun 12, 2007 2:48 pm
by obsidian
common error messages sticky wrote:31 Q : MAX_MAP_PLANES

A : messing about with some ASE model produced this error during BSPC (for RtCW) as a result of them being q3map_clipmodel. Removed that and manually clipping the models solved the issue. The clipped ASE models were creating an excessive number of 'planes' which broke thru the limit.
From the looks of it, even though you probably aren't using ASE models for this map, you probably still have too many planes for BSPC to handle. Botclip any areas that you don't want the bots to reach (like the edge of the maps where those steep mountains are). Simplify bot collision data by adding more large botclips around relatively flat parts of terrain or steep places. Add diagonal botclip to those stairs if necessary. Hopefully that will bring the number of planes down to something that BSPC will handle.

Just to be safe, make sure you also caulk unseen faces (particularly between terrain brushes) and also convert that terrain to detail and place some large caulk brushes underneath to seal the void.

Posted: Tue Jun 12, 2007 4:18 pm
by Magnus
Thanks obsidian

I was wondering if I could make the terrain detail, but wasn't sure since they were func_group and not worldspawn. Good to know I can.

The terrain other than the surface you can see are all made of caulk and I always draw a large caulk box around my maps and then just make them hollow to prevent leaks.

Looks like I have some major bot clipping to do :P.

Thanks for the info. :)

One more thing I would like to ask. Since I need to clip the steps and some are on an angle how do you cut brushes on an angle other than 0/360,90,180,270? Or how do you cut brushes then rotate them into place without deforming the cuts you just made?

Every time I need to cut a brush and then try to rotate it into place like on a 135 degree or whatever it deforms the cuts I made and it no longer matches the brushes around it.
I have tried arbitrary and free rotations and just setting the desired angle and tried setting the grid realy small and realy large, but it stilll comes out poorly done when you look close.

I know I should be doing searches on this instead of being an info bum, but since I am already getting some help on this map... well you know. :icon25:

Thanks again.

Posted: Tue Jun 12, 2007 5:14 pm
by Silicone_Milk
the Clipper tool works wonders for cutting the brushes at certain angles. You simply click on the tool and then slap points on the selected brush where you want the cut to be.

In GTKRadiant 1.4.0 its the button that looks like three blue balls in a kind of triangle near the camera buttons. (irrc that is)

Posted: Tue Jun 12, 2007 6:58 pm
by obsidian
Don't use arbitrary or free rotations!

Be very careful when using hollow (doesn't miter ends and can produce t-junctions).

Clipper > *

Posted: Tue Jun 12, 2007 9:56 pm
by Magnus
Silicone_Milk wrote:the Clipper tool works wonders for cutting the brushes at certain angles. You simply click on the tool and then slap points on the selected brush where you want the cut to be.

In GTKRadiant 1.4.0 its the button that looks like three blue balls in a kind of triangle near the camera buttons. (irrc that is)
Sorry I wasn't clear. I am useing the clipper tool. I make a brush place points 1,2.... from point to point where you want the cut to be. in x,y,z view.
My issue was that when I make that cut then try to rotate the brush into place the act of rotating the brush deforms the cut I just made and often the entire brush.

For example if I have a set of stairs that go up/down on a 45 degree in the z axis and I want to place a ramp of clip over the steps I can draw out a brush to fit the volume of the stairs then cut an angle to match the slope of the stairs in the x or y view, but then when I rotate the ramp into a 45 degree position in z to match the stairs it deforms the cut I made and now it no longer matches the slope or plane of the stairs.

So the #1 and #2 dots are the angle of the cut and the #3 dot is the plane it will be cut on? Cool! That could get tricky now that I think about it. Will have to play with it to get a feel for where to start and finish my cuts to get the right plane.
Geez to think I went all this time not knowing that. I feel so cheap. :dork:
obsidian wrote:Don't use arbitrary or free rotations!

Be very careful when using hollow (doesn't miter ends and can produce t-junctions).

Clipper > *
Not to worry. I always bevel my ends so they face up against each other and don't overlap after I use the make hollow ;)

Thanks for helping me with such a goon issue that I should have known long ago. XD

Posted: Wed Jun 13, 2007 12:38 am
by obsidian
Clipping Tool Tutorial... just for you.

http://www.quake3world.com/forum/viewtopic.php?t=31628

Posted: Wed Jun 13, 2007 12:54 am
by Magnus
Woot! Nice. Thanks Obsidian. :icon25:

Posted: Thu Jun 14, 2007 10:48 pm
by Magnus
Ok, here we go again. :rolleyes:

I selected all of the brushes that make up the terrain and made them detail.
I used bot clip on most of the ground and bottom of the water area as well as the bit of land sicking up out of the water and all of the hills especially the ones around the edge.
I ended up with more then 75% of my surfaces contained within large bot clip brushes. The geometry looked a lot cleaner from all the bot clip brushes when I got done actually. :icon14:

Alas it still gave me the MAX_MAPFILE_PLANES when I tried to create a .aas. :icon21:

I then created a large bot clip brush that covered from top to bottom half of the map and another that covered all but a area about 3072x1024 on the other half of the map from top to bottom.
So all that is left not covered in bot clip is a 1/12 corner of the map.

I bsp compiled it again in GTK and then tried to compile a .aas in the command prompt as usual and it gave me the MAX_MAPFILE_PLANES once again. Even with that much of the map encased in bot clip! :icon33:

Any ideas?

Posted: Fri Jun 15, 2007 1:29 pm
by Magnus
BTW. Would "bot do not enter" work as well as "bot clip" in excluding brushes and planes from being considered in the .aas creation?

Posted: Fri Jun 15, 2007 2:23 pm
by obsidian
botdonotenter is different than botclip. botdonotenter is like a very big suggestion to the bots to not enter that area but they still can get knocked into it.

Use it to cover lava pools when your bots try to do silly backflips into it and it will tell them to not jump in, though they can still get knocked in with rockets. If you put botclip over lava, they will be able to just walk over it.


Regarding your problem, I'm not sure what the exact problem is on your map. If you haven't already, try compiling with BSP -meta (plus whatever else you had) and add -forcesidesvisible to your BSPC compile. Just a guess.

Posted: Fri Jun 15, 2007 5:24 pm
by Magnus
Ok this is just getting stupid.

I even went as far as to fill the entire volume of the map from the top of the sky to 16 units below the bottom of the map ( but still withing the outer box ) with bot clip and only left a tiny corner 128x128x128. I made a room with concrete walls floor and celing in that 128x128x128 area and placed the only spawn point in that room.

I bsp compiled the map in GTK using -meta, -vis -fast, -light -fast -super 2 -filter
and bspc compiled the .aas in the command prompt using /bspc -forcesidesvisible -bsp2aas mmterractf1.bsp

So at this point as I understand it that tiny room is the only thing that the bspc .aas creation should be taking into consideration, but I am still getting a loooooong list of

Entity 0, Brush XXXXX: duplicate plane
Entity 0, Brush XXXXX: duplicate plane
Entity 0, Brush XXXXX: duplicate plane
Entity 0, Brush XXXXX: duplicate plane
Entity 0, Brush 28646: duplicate plane

and then the
ERROR: MAX_MAPFILE_PLANES
Closed log bspc.log

error. :icon33:

Maybe I am just not going to be able to provide bot support for this map. That really sucks! :tear:

It just seems that it should have created a .aas at least after I basically reduced the map to a single 128x128x128 concrete room. Wich leads me to belive that there is something wrong other than too many brushes or planes.

Posted: Sat Jun 16, 2007 12:27 am
by Shallow
Er, although people have suggested botclipping etc. I'm pretty sure MAX_MAPFILE_PLANES counts the original number of planes BSPC finds, not the result after the stuff that's inside botclip or other solid brushes gets eliminated. Unsurprisingly, you can't get around that problem by adding even more to the map, even if it is botclip as suggested.

Long shot, but did you generate the terrain in Easygen using the thin mesh option? If so, try recreating it without that option - it massively increases the number of unique planes. If you didn't use Easygen at all, ignore this :)

It's not uncommon for big terrain maps to end up missing bot support, it can be tricky to get them working. Even if you can get an AAS, you may find that running with bots makes the game keel over with memory allocation errors within a few minutes play.

Posted: Sat Jun 16, 2007 6:52 am
by dnky
I've never played about with this, but is there not a switch for bspc that allows compiling of an aas for the bsp with a different map? Fix ext, or something? If so you could remove all the geometry that could never be reached and compile the aas from that one....

Posted: Sat Jun 16, 2007 2:16 pm
by obsidian
Q3Map2 2.5.16
- New: -fixaas mode to reassociate an AAS file with a changed BSP
Yes, this allows you to create a simplified version of the map for bots. Compile BSPC for the dummy map as you normally would. Then use -fixaas to reattach the AAS file to your current BSP. This was added in an attempt to get Sock's Magician map working with bots.

Magnus' map looks relatively small and low enough in polys, so I'm surprised he ran into issues with MAX_MAPFILE_PLANES.

What happens when you take out the terrain on a duplicate copy of your map? Will bots compile then?

Another solution might be to convert the terrain to ASE and then manually clip it, or even try autoclipping the model (though this may lead to the same problem).

Posted: Sat Jun 16, 2007 6:15 pm
by Magnus
Ok first yes I did create the terrain in Easygen, but I don't think I used the thin mesh option.

I do remember several maps with large terrains that had crash issues. Even id's Q3:TA Distant Screams that would crash within a minuit or so of adding bots to the map due to the huge terrain portion of the map IIRC.

Next. Never heard of a Fix switch. Cool there is hope!

The terrain portion of the map is W6144xL6144xH1024 with various heights to the different hills as you can see.
In Easygen for this one I set the Divisions to 96x96 and Division Width to 64x64. So yes it is not really huge. I have seen quite a few large terrain maps with bot support like kineterra1 for example wich was IIRC created in Easygen as well. A great terrain map.

Now. Yes I deleted the terrain brushes and added a simple flat concrete floor and I was able to create a .aas for the map. So the problem lies somewhere with the terrain. Perhaps I have set it to too many divisions? Hopefully not I would like to keep the terrain as is.
Compile BSPC for the dummy map as you normally would. Then use -fixaas to reattach the AAS file to your current BSP. This was added in an attempt to get Sock's Magician map working with bots.
Could you point me to a tut for this or explain how to do this as I am lost having never heard of it before. :paranoid:

Thanks for all the time you guys are spending to help me finally understand a lot of this stuff. I hope it leads to me being able to create some stuff you can all really get a lot of enjoyment out of.

Re: Terrain preventing .aas creation?

Posted: Sat Jun 16, 2007 6:38 pm
by Silicone_Milk
Magnus wrote:
So what do mappers do to create their large terrain maps and still be able to avoid this error and create a .aas bot support for their maps?

Thanks
I'm surprised Kat hasn't come on this thread yet. And Dnky I'm shocked!

Magnus, visit http://www.katsbits.com to learn about creating terrain from models =)

I would suggest exporting your terrain geometry to a .ase model and loading it in to a free modeling application (katsbits application of choice is Blender http://www.blender.org) Split the mesh up and load them as individual models.

You'd also be surprised how much you can simplify the geometry in terms of tris while keeping the same shape!

The guys at katsbits are really helpful and will lead you in the right direction if you decide to take a whack at making your terrain out of models instead of brushes.

Re: Terrain preventing .aas creation?

Posted: Sat Jun 16, 2007 7:00 pm
by Kat
Silicone_Milk wrote:....I'm surprised Kat hasn't come on this thread yet. And Dnky I'm shocked!....
I have been following it but I've been trying to figure out what's going on.

@ Magnus : In that shot above what is it we're looking at? Is that basically the entire level or just the base area of something? Can you post a shot with showtris on? It's helpful to see what's going on.

Posted: Sat Jun 16, 2007 8:29 pm
by Magnus
Magnus, visit http://www.katsbits.com to learn about creating terrain from models =)

I would suggest exporting your terrain geometry to a .ase model and loading it in to a free modeling application (katsbits application of choice is Blender http://www.blender.org) Split the mesh up and load them as individual models.

You'd also be surprised how much you can simplify the geometry in terms of tris while keeping the same shape!


Nice! Looks like I have some neat new stuff to learn. Thanks man. :icon25:

I actually googled trying to figure this problem out and learn more about .ase models and got Kat's site. I never stopped to think that this was created by Kat. :dork: Great source of info Kat. :icon14: Maybe I can learn how to go back and create and animate some creature models I had in mind for my Morrowind mod.

I got Blender 2.41 and several video tuts for it as I learn best that way a long time ago when I was modding for Morrowind, but never ended up using it.
@ Magnus : In that shot above what is it we're looking at? Is that basically the entire level or just the base area of something? Can you post a shot with showtris on? It's helpful to see what's going on.
You bet buddy. :)

This shot was basically the half of the map with anything other that just terrain in it.

Image

This is the other half intended to be a copy of the blue half, but with red trim.

Image

An overhead showing the entire layout of the map so far.

Image

The first half with tris.

Image

Overhead with tris.

Image

I hope these help. Thanks again guys!

Posted: Sat Jun 16, 2007 10:14 pm
by Kat
Ah, thought so, your terrain is too dense - it's incredibly dense in fact - so that *is* what's causing the problem (I thought it might be but couldn't really get a handle on that based on the info previously posted). In effect you could probably drop the mesh back to have around 1/3rd the current count and still have a reasonably well shaped terrain; failing that try and knock back by at least 50%; I suspect it'll help the FPS as well.

This is actually where ASE models come in handy because they allow you to vary the tris density (you can do this with brush terrains but I've never tried it from a heightmap) - high where players can get, low where they can't so it might be worth looking into trying an ASE version if you still get problems.

Thanks re the web site ;)

Posted: Sat Jun 16, 2007 11:42 pm
by obsidian
Whoa! That's a lot more tris than I would have expected. I thought the first screenshot was your whole map and even that ended up being about 2-3 times what I was expecting.

Posted: Sun Jun 17, 2007 1:15 am
by Amphetamine
96x96 dividions creates 18432 triangles with 2 shader passes each and a lightmap. That is a hell of a lot. I've used that many for test maps, but not for anything that I was going to release as it's just too much. My sugestions would be:

Try it with 32 or 48 divisions (64 max as a last resort).

Forget easygen entirely and use a dotproduct2 terrain shader instead as it looks so much better and is a lot easier once you understand it.

Add phong shading to the terrain shader to make it look smoother with the lower polycount.

Hope that helps.

Posted: Sun Jun 17, 2007 2:41 am
by Magnus
Magnus wrote:Now. Yes I deleted the terrain brushes and added a simple flat concrete floor and I was able to create a .aas for the map. So the problem lies somewhere with the terrain. Perhaps I have set it to too many divisions? Hopefully not I would like to keep the terrain as is.
Oh well. I was afraid of that. I will try to learn about all the different methods and things I have heard about in this thread and see if I can add some more quality to my mapping.

Well good to finally know where the problem lies now.

Thanks again for all the help and time spent on this guys! :)

Posted: Sun Jun 17, 2007 3:04 am
by obsidian

Posted: Mon Jun 18, 2007 9:53 pm
by Magnus
Nice link Obsidian. Thanks.

Well I went back into Easygen and set the terrain to 48x48 Divisions at a 128x128 Division Width and I was well able to create a .aas for the map. It is still very beta, but so far the bots use the entire map very well. Sweet!

I did run into a sort of glitch, but I think I understand it a bit.
If I create a .aas with the switches
/bspc -bsp2aas mmterractf1.bsp
then I can go ingame and add up to 26 bots with no problems and the map still runs smooth with about 125 fps, but the bots do that thing where they spawn in the map and just sit there unless they see an enemy then once the enemy is out of sight or dead they just stop right there again.
I know when -meta is used the -forcesidesvisible switch is required to prevent this.
So I go back and create a .aas with the switches
/bspc -forcesidesvisible -bsp2aas mmterractf1.bsp
Then the bots run around like they are playing the game as intended, but the map tends to studder a lot and freeze in place for a second or two and if I add more than 6 bots I get the z_malloc crash, but the fps seem to remain a good 75 to 125.
I figure it is due to the -forcesidesvisible switch causing the engine to take way more in the map into consideration although I would have expected a real hit to fps.

Am I right? Is it due to the -forcesidesvisible switch causing the engine to take way more in the map into consideration? And is the answer to resolve this problem explained in some of the tuts and links you guys provided?

Thanks! :icon17: