Game Development Community

number of leafs

by Desmond Fletcher · in Torque Game Engine · 12/08/2001 (1:30 pm) · 5 replies

What is the progamming logic behind capping the number of leaf nodes at ~32K? (see Map2dif->ExportGeometry.cc, line 182) Could this be increased to 64K?

#1
12/14/2001 (4:05 pm)
Ok, let me ask this another way. If we're capped at 32K leaf nodes in any given during a compile with map2dif, is there a max number of planes within any given mission. That is, when adding several interior instances, is there a max number of planes for the combined total difs?
#2
12/15/2001 (9:19 am)
My guess would be the run-time node indexes are 16 bit values in order to save space :) Keeping data as small as possible is alway a big issue. Increasing the size in map2dif won't do you any good.

All instances of a shape reference the same original art. Instances contain only instance related state data and scene lighting information. Multiple instances of a shape do not "combine" into some global data pool.
#3
12/15/2001 (10:43 am)
That's not exactly what I'm asking. I understand about the multiple instances of the same shapes. But let's say we have a set of unique interior instances ( a city's worth of shapes for example). Let's also say that each interior instance (one of those buildings for example) is maxed out at no more than 32K leafnodes from the map2dif. Then we add a second interior instance (another building) that is also maxed out at 32K leafnodes. What restrictions are there on the runtime side to handle these multiple instances?

I may have answered the question myself: I created a mission with two different difs that each nearly reach the compile limits of map2dif (in terms of leafnodes). The load fails at ShadowVolumeBSP's mPolyStore. So I take it the number of polys in map2dif is essentially the limit during runtime as well.
#4
12/17/2001 (6:21 pm)
The interior instances are independent of each other. You should be able to have as many as memory permits, each at it's own max. As I said earlier, they don't combine into any global data pool.

Having said that, from your previous post it looks like the mission lighting does have some problems with large number's of exterior polygons, but that's totally different than the interior code and it's limits are set elsewhere. If you have a large building with no portals set, this could be your problem.

It's also possible that the scene manager has some limits (like the number of portals or zones), but I don't know of any off hand.
#5
12/17/2001 (8:53 pm)
Ahhh, that makes sense, thx :)