0
\$\begingroup\$

I am trying to make a boxing scene in my game. I decided to attempt to make the large stadium first (It's a boxing management game, so the scene can be 'pre-rendered' perhaps, the fight events (eg. Big hits, blocks, dodges) are going to be calculated based upon the boxers skill values and some luck etc.

I have this scene in Maya: enter image description here

My first idea was to 'scatter' assorted people into the crowd. But on further advice it seems this might be too resource-heavy.

I am very keen to learn such things as LOD, or effects to make it look like the crowd is full of people. Also smoke etc effect to cover empty areas (or allow for much reduced detail) would be amazing.

A little bit broad question I realise, but I'm looking for some starting points of what to learn to achieve this stuff.

Many thanks

\$\endgroup\$
8
  • \$\begingroup\$ You probably do not want to try rendering individual scattered models for an entire stadium full of people. I'd recommend revising this question to "How to render a stadium crowd" to draw answers that are lighter-weight than scattering full fledged models and game objects. Some things to consider would be imposters, as are commonly used for LOD systems, or compute shader driven mesh particles / VFX graphs, which I recall a recent Star Wars game used for background crowds and armies. \$\endgroup\$
    – DMGregory
    Commented May 14, 2021 at 13:58
  • \$\begingroup\$ Thank you I will try to think of another question and edit this \$\endgroup\$ Commented May 14, 2021 at 14:01
  • \$\begingroup\$ If you happen to have a link about 'imposters' i could give a read, that would be great. My google search 'imposters 3d LOD' brought up nothing much :| (edit: i did find this, gonna try read and understand it... users.soe.ucsc.edu/~davis/papers/yee_masters_project_paper.pdf) \$\endgroup\$ Commented May 14, 2021 at 14:15
  • \$\begingroup\$ I can't reproduce that problem. Searching "imposters lod" is giving me a full page of results talking about this exact technique. We also have past Q&A about it here. \$\endgroup\$
    – DMGregory
    Commented May 14, 2021 at 14:18
  • 1
    \$\begingroup\$ You could also use depth of field to make it less obvious that the audience isn't high-poly meshes (or meshes at all), by making the camera focus on the competitors and the ring, with the spectators out of focus. Depth of field is easy to do in Unity with URP pipeline. This would also make it easier for the player to focus on the action without getting distracted by a highly-detailed background. Be aware though that if you go this route and your background moves a lot, players may get nauseated, so you probably don't want your audience to move a lot all the time. \$\endgroup\$
    – bob
    Commented May 14, 2021 at 14:40

1 Answer 1

1
\$\begingroup\$

In answer to one of your comments:

I actually have the same question, but regarding the seats in the stadium. Would it be better to make them in maya (all of them) or is it better to import just one chair mesh to Unity and place them procedurally?

There is extra performance overhead for multiple GameObjects; for example, it's faster to render one mesh containing 100 chairs than to render a single chair mesh 100 times. You can reduce overhead by doing manual instanced rendering using Graphics.DrawMeshInstanced() but that is done with code and can be an extra headache to set up. I'd suggest grouping multiple chairs into one mesh.

However, you should not put all of the chairs in the entire arena into a single mesh, as this prevents frustum culling from working. Frustum culling refers to skipping render of objects that are not inside the camera's boundaries. If all of the chairs are in a single mesh that wraps all the way around the arena, that means that at least some of the chairs will be visible to the camera no matter what direction the camera is pointed, preventing frustum culling. I once worked on a racing game for mobile where the artist had made the barrier around the entire track as a single 200k poly mesh. This ended up causing major performance issues because the engine could never cull any part of the barrier, so we eventually had to break the barrier into segments.

I would suggest grouping chairs into sections, and making each section a single mesh. This way you have less overhead than if each chair was its own object, but frustum culling will still work for sections of chairs that are not in front of the camera.

EDIT: As DMGregory noted in a comment, in the likely event that the chairs are completely stationary, you can also use static batching to have Unity automatically combine multiple instances of a mesh into a single mesh. So for example, if you imported a mesh containing 1 chair and added 500 copies of that chair to the scene, using static batching you could let Unity combine multiple chairs into a single mesh. I do not know offhand how this would work with frustum culling.

\$\endgroup\$
2
  • \$\begingroup\$ I am also going to do as Kevin states and make 'bunches' of seats (and possibly people). But is it ok for them to be simply grouped or do they literally have to be one combined mesh? \$\endgroup\$ Commented May 14, 2021 at 22:10
  • \$\begingroup\$ Comments are not for extended discussion; this conversation has been moved to chat. \$\endgroup\$
    – DMGregory
    Commented May 14, 2021 at 22:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .