Game Development Community

Level in just one .dif?

by Gustavo Boni · in Artist Corner · 05/02/2006 (4:09 pm) · 11 replies

Hi all,

Today when i was mapping the first level of my game, an a doubt poped up on my mind. My level is a small piece of city, with some streets and buildings, and one of this buildings has an interior where you can enter and kill some enemies. So, should i make the buildings and streets in differents .dif? Or should i make all in the same .dif?

Thanks in Advanced,

Gustavo Boni

#1
05/02/2006 (4:28 pm)
This really depends on the layout of your level. If it's really tight and small, with close buildings and alleyways (like a typical Rainbow Six level), and/or primarily inside, then it would totally make sense to use one DIF. On the other hand, if you have a somewhat wider more open area, multiple .DIFs might suit it better. (And with multiple DIFs, portalizing your interiors becomes very important, to minimize the rendering of non-visible portions of your interiors.)

Good luck and have fun! =)
#2
05/02/2006 (10:00 pm)
Thanks to reply Kevin =)

My level is like Freedom Fighters do you know? It's not very large, but not very small too with close buildings and small places between the buildings where you can go (sorry, i don't know the exactly eglish word for this).
So, i think i will build all the level in just one .dif =)

Regards,

Gustavo
#3
05/08/2006 (12:05 am)
If you're using Worldcraft, a lot of this is dependent on what the scale is for your game. If your character is small, then you'll be able to fit it all into one DIF file.
#4
03/07/2007 (11:57 pm)
I am floored that there are only 3 replies on this topic.

"if you have a somewhat wider more open area, multiple .DIFs might suit it better." - is the definitive word on this? WOW!

Can someone please expand upon this or point me in the right direction (reading material another post) for what is an optimal approach to using .difs in a city based game without portals? Or using .difs in general.

What I do know is that there is a brush cap of like 1024/1200 ( going with the lowest ) per .dif. This automatically makes me seperate my .difs. Should I be watching out for anything more specific?
#5
03/08/2007 (3:10 pm)
I would use single DIF's for individual houses, making sure i used a fair amount of LOD's so there isn't a huge FPS drop. For the streets, make a strait piece, and a curved piece. As long as the textures are like and are made to work together it should look pretty good. There is a lot to be said for good planing, make sure you draw up plans for any section of the city your player is going to go, I would actually draw in the different shapes of houses and such you plan to use, and count the number of textures, that way you can add the texture memory usage together, gives you a good idea of what will be required to run your game. And im not sure about what you mean by brush cap, i do recall there being a limit somewhere in there BUT i have built HUGE...I repeat HUGE buildings, all in one DIF with probably thousands of brushes(or 1 primitive shape) With LOD built into the shape, And i have run into nothing telling me i have to many of anything. The only problem i run into is with making too small a plane sometimes, the transfer to DIF from MAP sometime is going a little wonky because of this, but happens less with the new exporter. I would be happy to help you and anyone else that has trouble building anything DIF related. Please contact me at my e-mail if I don't answer a post, sometimes I miss them:)

Bobby Leighton
lmaceleighton@msn.com
#6
03/08/2007 (6:31 pm)
@Dale: No detailed explanation of DIF properties and usage was requested, so none was given. (After all, there's a shload of info here already if you just search a little.) But hey, I'll throw ya a bone... =P

If you've got long exterior view distances and/or wide open spaces, then you absolutely want to break up your level into separate DIFs for each structure so that you can take advantage of LOD. And if they are not portalized, they cannot be optimized via BSP. For a player within a large, open DIF, no optimization via LOD or BSP can be applied, so every part, whether near or far, will be rendered at full detail! Which will likely == ssllooowwww.

On the other hand, if you never intend for players to actually enter your structures ( or your structure interiors are extremely simple), you might as well use DTS shapes -- you still get LOD but also get the additional flexibility that DTS shapes provide.

Really, the only reason to use DIF structures at all is if you're constructing complex interiors. I.e. the more "outdoors" your level is, the less useful DIFs become.

But don't get me wrong -- DIFs are hugely useful! If they weren't, Garage Games probably wouldn't be going through so much effort to develop Constructor! =)
#7
03/08/2007 (6:45 pm)
It shouldn't matter if it's one dif or multiple difs as long as they are portaled correctly. Whichever is easier for you to build. Just make sure there are portals on every entrance/window.

Turn on wireframe and see if u are drawing too much.

Personally, I would build each building as it's own dif, so that I could instance multiple copies of them, and build the streets and other exterior details as DTS, just to make it easy to place them and to support LOD.

Joel
#8
03/09/2007 (12:40 am)
Thanks guys for getting back on this for me. VERY much appreciated.

@ Bobby : Wow - thanks for the offer - of help and imput. I might just take you up on that.
@ Kevin : Thanks - I was looking for a governing mentality/ethos on how to use .difs in general. You nailed this for me. Implimenting L.O.D
@ Joel : Thanks

... kewls
I will get back to this post with my results - as soon as I get some :)
#9
03/09/2007 (10:51 am)
Dynamix Interior Format
Its faster for TGE to process Dif collisions than DTS because they are convex shapes. That is all explained at TDN.
Its better to build your buildings in Pieces. Each piece has a portal. When your player is in
a diff structure, whatever is not visible will not be rendered.

Difs are necessary because of the way the Game engine works. And Yes that is why GG is making constructor.

TDN - Dif Overview.
TDN - Dif Feature Chart.
TDN - Dif Page.
Read Matts CONTRUCTOR Blogs ...all of them!

-Surge
#10
03/09/2007 (1:24 pm)
Surge, that's true but im not sure it's as simple as that. I think in general, dif collision processing is faster than dts, but under some circumstances, I doubt there'd be a noticeable difference in processing speed. difs definitely win out when it comes to full-scale environmental collision like interior walls and staircases, but for very simple objects, like say a straight sidewalk or street, I doubt you'd take much of a performance hit by using a dts if you make the collision mesh a simple convex box. for more complex collisions, dif may be a better choice.
#11
03/12/2007 (1:52 am)
@ Surge : Thanks for the links.
@ All : Thanks again for the imput.

I have already gone through all the pros and cons of .difs - on everything from
lightmapping to accurate/practical collision processing . Aint going to waste any
more pixels on this direction of discussion. .DIFs are being used - they have won.

=================================================
ATM - I have a world of about 42 city blocks. < doing a racing game >
- This is how I have broken my world up at a .dif level:

>Each block has its own specific buildings in .dif : averages out to about 25 - 35 brushes. File size Average : +/- 80 kb .dif.

>The ground I have broken up into about 700 brushes per .dif. File size Average : 190 kb

I am using the NULL material flag to circumvent non visible polygons.
Also using the Detail class to cut down on ... cutting.
Also have some decimal cleanups in place - cuts down the .dif file size.
Does the .kb size of a .dif matter?

Everything seems to be fine thus far : Average FPS : 45 - but because resources are finally coming in to roost on the project that figure is changing ( for the worse ).