- Home /
What is the best approach to building a non terrain FPS level?
Hi all, I've written a draft concept of a first person game mostly set in an office building and I want to do a basic mock up of an office floor. What would the best approach be? I presume I would model desks,props etc and import those as prefabs.Would I use the mesh collider? But my main query is with the level environment itself. Should I model each room separately? Or would I be best sticking with a modular approach? IE model some basic wall sections etc and plug together in unity? How would I handle stairs and the floor above?
Thanks for any feedback :D
Answer by HappyMoo · Jan 02, 2014 at 03:27 PM
You can model however it makes most sense to your game. If you stay modular, creating new levels will be easier. Mesh colliders probably won't make a lot of sense, as you don't need to bumb into every little detail of a desk. If you can't duck below it, a BoxCollider will be enough. If you can duck below it, multiple BoxColliders are still a more performant option than a MeshCollider.
Stairs: You can place one BoxColliders for every step or create a lowpoly version of the stairs for using it in a MeshCollider.
The floor abive makes no differene... if it has a Collider, you can walk on it.
Also make sure your FirstPersonController has the right step height configured, so it can actually climb the stairs.
Thanks for the reply.Ah ok so the modelling approach is up to me then? There isn't an optimal approach? But to use box colliders where possible? So say you are building a multistory level, is there a way of turning off the visibility of the different floors? Also does unity handle what is and isnt rendered? As in if you walk to a higher floor and the below floor isnt visible do you need to turn off renderer compenents etc of the lower floor?
There is no optimal approach because it depends on your Game. Do you want to use your 3D program as a level Editor or Unity? Depends on how often you plan to do new levels.
I would probably prefer the modular approach, but if there is some special room with special properties, this special room could be modeled completely ins$$anonymous$$d of built from wall segments etc.
Regarding the $$anonymous$$ultifloor visibility: Unity by default does frustum culling(not rendering stuff outside cam view frustum), only renders frontfacing faces(back culling) and does a depth test with the z-buffer, but occlusion culling - that is not rendering what is behind something else and not visible - is a pro feature: http://docs.unity3d.com/Documentation/$$anonymous$$anual/OcclusionCulling.html Also interesting depending on your level sizes could be dynamic level of detail - that is replacing far away meshes with simpler versions. This is of course again a pro feature :) http://docs.unity3d.com/Documentation/$$anonymous$$anual/LevelOfDetail.html
Now... you can invest in a third party solution like this: https://www.assetstore.unity3d.com/#/content/6391
... or roll your own - especially if your maps are not that huge ... then you can do manual occlusion culling:
Like if you enter the 2. floor (Triggers), you can deactivate the lower floor (gameObject.SetActive(false)), and activate it again when you walk down the stairs etc...
excellent that makes sense thanks! So that should be fairly simple then if I wind up having multilevel ..umm levels :D
Answer by Michaelarby · Jan 02, 2014 at 03:50 PM
not that I'm particularly experienced- but I could see both approaches working out. Modular units are easier to duplicate and therefore make bigger levels, but do tend to look repeated (the 3d castlevania games on ps2 are a perfect example of how terrible modular levels can look).
Heres a few thoughts anyway:
-Custom made levels- which you would create entirely in a 3d program like Max, will look more unique, but require a lot more texturing and stuff, and potenitally a lot more time.
-Each method will have their own planning challenges- for example you might think modular is faster, but they require a lot of foresight, or you might end up with doors that dont align, or other wee niggly thinks that you didn't think of at first.
-Of course you could always do a mixture of both- have a unique corridor, with one or two types of rooms that repeat and come off it, or a unique shaped room with modular elements in it- like repeating rows of pillars etc.
-In modular systems, its down to the props you put in the room to really differentiate them- absolutely save these as separate prefabs and just drop them in in unity.
With modular units I always tend to make them square or rectangular so they fit together better, but then like I say they can look very boring. custom designs can have split level floors, arched or curved walls, angled walls and ceilings, custom windows- large small, circular, etc.
-Personal preference would be to model fancy stairs (such as spirals or free floating)separately- same as modelling a desk or furniture, then drop it into unity. Just be sure to keep the dimensions in mind when designing the floors around them. Added benefit here is that you can reuse the model in other levels or even other projects. Same goes for all the other props you make!
Alternatively- if its just a set of steps leading up a narrow corridor, or attached to a wall them it might be better to model the room and stairs as one.
Hope any of that is of benefit to you lol
Michael
Cheers yeah its does help. Ties in with the other answer as well.Well im not too worried about repetition in the game, its going to play on that hopefully..