r/howdidtheycodeit • • Jun 18 '22
Question How did they make such gigantic maps in War Thunder or BFV?
I am making a WWII FPS that has planes, tanks and infantry on Unity
All vehicles have real life speed values, making the making of a map for all of those vehicles super hard to make
Basically, how do they make such maps in War Thunder that just sprawls as far as the eye can see but still achieve 60 or more FPS??
I tried making such a map with Unity’s terrain but the performances are horrendous
34
Upvotes
14
u/nmkd Jun 18 '22
LOD (level of detail) systems, simple as that.
Decrease detail for objects far away, or hide them completely.
Textures are also streamed based on distance - You can't load the entire map at once into RAM, so only the visible parts are loaded. The closer you get to an object, to higher the loaded texture resolution.
Ever seen the initial version of PUBG on Xbox One? That's how things look when your asset streaming is too slow (because of unoptimized code and/or weak hardware).
4
u/DecentCoder134 Jun 18 '22
On first guess they're probably doing some sort of terrain streaming or distance based level of detail scaling.
Essentially, they have a giant detailed map consisting of different sections. When you're close to a section of the map it's rendered at full scale so that things you immediately see are in high quality. Then the sections that are farther away are loaded at a lower and lower quality so that you still see the general terrain features, but not all of the precision.
I think Sebastian Lauge has a tutorial series on procedural terrain generation that covers this in one of his later episodes - it might be worth a look to get you on the right track.
3
u/BoogalooBoi1776_2 Jun 18 '22
I'm gonna go out on a limb and assume that large maps are broken up into chunks (kinda like Minecraft), and each chunk has variations for different LoD levels. That way you can also cull chunks that are outside the player's field of view.
As far as I'm aware Unity's terrain feature gives one big solid model, so you can't cull parts of it or change the lod of farther but visible parts, but I bet there's plugins out there that can slice it into chunks.
2
u/the_Demongod Jun 18 '22
Engines like Unity are general-purpose engines that are designed to meet most common needs. That means mostly high-detail, small-scale games. While Unity probably provides you a fair number of tools to manage larger scenes, You'll notice that games that are designed for huge scales are all running on custom engines since it affords the creators a lot more control over this exact thing.
30
u/Neoptolemus85 Jun 18 '22
I can't comment on Unity or those games in particular, but there are two techniques which are usually used to handle large landscapes and keep performance smooth: