Maroonroon wrote:what is better to use as bounds?
Good question, especially because bounds don't
always use triangles. In your example, it's Box bounds, but that wouldn't make any visible difference anyway. Before I go into details, remember two things:
First, computers nowadays are fast enough to compensate for lack of optimization. As long as you know about a few pitfalls about Uru, your Age will likely run fine on most computers without any optimization.
Second, physics engines are smarter than you may think. Even if you have one very bad collider in your Age, this will have zero performance issues until an avatar or kickable object comes near it.
Because of this, in your door example, you could pick any bounds type and your Age would still run fine even if you had a hundred doors in your Age. This is because the initial mesh is extremely simple, and you're never going to collide against all doors at once.
Now, back to bound types in general... (from most performant to least performant):
- Show Spoiler
- if it's more or less box-shaped, then simply use Box - it will take the smaller box that can fully encompass your whole object. How many faces the object has doesn't have any impact on physics performance. You can preview what the collision will look like by going to the Properties tab → Object → Display → Bounds. This collision type is insanely fast, because it doesn't use triangles at all (instead it relies on very simple mathematics due to the simple shape).
- if it's more or less sphere-shaped, use Sphere - it will take the smaller sphere that can fully encompass your object, and once again the actual polygon count of the original object won't affect physics performances. Also, once more, spheres don't generate any triangle for the physics engine, and rely on very simple mathematics again, so they are comparable in performances to Box.
- if it's slightly more complex than a box or sphere, use Convex Hull. While it does generate faces, those faces are much faster to use for the physics engine than Triangle Mesh. This comes with a disadvantage: your collision will not contain holes or concave features. Think of it as wrapping your object into duct tape - you can still see the original outline, but there aren't any holes visible left. This image gives a good idea of what a convex hull looks like. How many polygons your object has will affect performances, but not by much.
- if you absolutely require the collision to match your original object, then use Triangle Mesh. This generates physical triangles for each of your visible triangles. This is obviously the slowest. Is it bad ? Not really - if your mesh doesn't move and isn't a 10 centimeters teapot with thousands of vertices, then it will perform just great even though it uses triangle meshes. I made an Age a while ago that had only Triangle Mesh collisions, totaling more than a million vertices, and it still runs perfectly fine because colliders are all static and the avatar only ever collides with a few triangles at the same time.
Should Triangle Mesh performances become too bad, then you can simply split your collider mesh into multiple meshes (this usually allows you to use Convex Hull or even Box bounds instead), or replace it with a version with less polygons (the decimate modifier is very useful for this task). But don't bother with it until you notice an actual problem with your Age.
But once again, physics performance is usually not an issue, EXCEPT for one pitfall... Dynamic physics (which includes kickables and animated colliders). This is the only case where bounds type and optimization really matters, because even more recent computers will have a hard time catching up.
Dynamic boxes and spheres are perfectly fine due to them being extremely simple shapes. Dynamic convex hull is a bit more taxing, but is tolerable. Dynamic triangle mesh is a bad idea, unless your object is extremely simple.
In general, don't overthink optimization - computers nowadays have plenty of headroom, so as long as you avoid the most obvious pitfalls you'll be fine. Just focus on having fun building.
Maroonroon wrote:For animations, If I want an animation of exactly 1 second and I set the first keyframe at "0", where do I should set the second keyframe?
At "29" or "30"?
30, I think. If you were to start the animation at frame 1, you would stop it at frame 31. (Usually you won't notice the difference anyway...)