I am still trying to wrap this around my head, so anyone who can correct me where I am wrong would be great. Also, I apologize for asking so many questions about this, but I haven’t found much in the Docs or online about this.
I have been making my entire scenes in my modelling program. Before I go spending a lot of time building a detailed level I want to confirm my suspicions with you guys (and possibly share some of my old Half-life world building techniques with you).
Now, lets say you are building a really long hallway of some sort-- even better; Say it is a cave, because that way you can’t just use really long boxes in the modelling program.
Side Note: I have noticed Unity does not like making box colliders for trapazoid shaped boxes. I think these mesh colliders seem the best option for levels.
Is it better to use one really long mesh to draw the cave, or is it better to divide it up into smaller subsections? (Which one would result in fewer drawcalls)
Side note: In creating the UV Map for something like a really long cave, I have noticed that the maps I have built don’t like having one texture, so my hypothesis is that it is best to divide it up into subsections to get better control of the UV Maps.
Because the cave is not simply a box, and you want your character to collide along the cave walls, I assume that using a Mesh Collider that is NOT concave is the best option.
And if I understand that Static checkbox correctly, all level geometry (which does not move) should be set to static-- this should do what I understand is Occlusion culling, which is to say if a triangle can not be seen, it isn’t drawn.
Now, further extrapolating the above statement it is best to have a cave built in such a way to build ‘rooms’ divided by hallways in the cave-- so, say you have a detailed room in this cave, possibly with stalactites and stalagmites, a beautiful water fall, etc, you might want to build the way into the room L shaped (possibly by putting cargo boxes in from on the room to block the view from when you are all the way down the hall way)… maybe an ASCII picture would help for this one:
* *
* *
* *
*Detailed Hall
* *
* ******
* * <- L shaped hall to separate
****** * detailed sections
* *
****** *
* *
* *
*Detailed*
* Room *
* *
* *
* ******
* * <- Another L shape to seperate
* * detailed sections
* ******
* Detailed Hall
**********
Now, continuing with this cave example, with these stalactites and stalagmites, I have read elsewhere that it is best to use the same material and use the Combine Children on these similar objects to reduce the draw calls.
Now on the issue with lighting, I understand it is best to ‘bake’ in lighting into the map (and i have stressed this to my superior). I use Cinema 4d, and I have read very little on this topic; I believe I have read somewhere that Unity provided a plugin to do this? And I think I also read somewhere that only recent versions of Cinema 4d where able to export models with 2 textures (one for a mesh texture, and the other for a light map). If anyone has more info on this, that would be greatly appreciated.
Continuing on my quest for game design, I also have a question about instantiating bullets.
I created a game a while back ago that maybe had 50 moving models to create the effect that you were falling down a cave (irrelevant to the above cave). iPhone did not like this one bit (and I understand why, way too many draw calls). I did this by instantiating the models, and then destroying them when they reached the top of the screen.
My question with the above example, is when I get around to making characters that shoot weapons, I am planning on having anywhere between 6 - 25 characters shooting weapons all at the same time, which instantiates bullet prefabs w/ rigidbodies. How do I go about making all of these character shoot if the iPhone does not like instantiating gameObjects (maybe in the falling game, the models were too much)?
My understanding of creating bullets is that they can not be combined because they are being instantiated dynamically.
What is more efficient? Using a trail renderer with a .2 second trail, or using an 8 polygon model for the bullet? Both use a shader with 2 passes.
I originally wanted to use a physics raycast, to make bullets shoot, but concluded that this is not possible since people want to see bullets-- which must be done with a trail renderer-- which must be done with a moving object.
Side note: For my bullets, I am using some 64x64 transparent PNGs with Self-Illumin/Tranparent/Cutout. My Unity or Unity iPhone installation I have had that shader for Self-Illumin/Transparent/Cut-Out. Someone generously provided on somewhere on these forums (P.S. Thanks to who did that, I’m using it), and I hope someone looking for a way to make bullets stumbles across this post and saves them time.
And I guess I want to ask this question while I am at it-- Given the 50 objects, which results in 50 draw calls, each with a rigid body attached, what slows down the game more-- the draw calls, or the rigid bodies?
Lastly, to all you programmers who have not yet run across EMACS-- go get it. It is the greatest programming editor of all time. Run through the tutorial (it took my 2 hours) and then after 8 hours of using it, you will really begin to appreciate its power.
I sincerely thank you all for your contributions.[/img]