0
\$\begingroup\$

I just wanted to ask for advice those being an expert in Unity 3d and overall in game industry about how it is possible to create an open-world game by means of Unity 3D, that is, I already tried to combine several tiles of terrains, 4 to be exact, and their respective size is 500x500. However, once I started to add the fifth terrain to those terrains, Unity stopped working. Moreover, another problem that I faced was with light mapping in Unity, that is, the more terrain I add to the scene the more it is difficult to bake the light mapping. The question is if I am doing correctly by adding terrains to each other and how open-world games are actually created. Yes, I heard of chunk loading but is it possible to code it on my own without using ready plugins. Lastly, Is it possible to combine tiles of terrains just manually without using any tools like Terrain Slicing kit or Gaia please I really need your help Thank you for your attention))).

\$\endgroup\$
  • 1
    \$\begingroup\$ What do you mean with "stop working"? Ran out of memory? Ran too slow? Gave you an error message? Uninstalled itself out of spite? \$\endgroup\$ – Philipp Mar 20 '18 at 12:54
  • 1
    \$\begingroup\$ Regarding "is it possible": Definitly. Kerbal Space Program does whole planets with Unity terrains. And whatever a plugin does is also possible on your own, because plugins use the same APIs you use to develop an Unity game. \$\endgroup\$ – Philipp Mar 20 '18 at 12:56
  • \$\begingroup\$ Just gave an error and suggested to report to Unity Technologies \$\endgroup\$ – Mir Usmanov Mar 20 '18 at 13:13
  • \$\begingroup\$ To do very large terrains, you need to stream them :) There are many premade assets that can help you with it. Check out these two: assetstore.unity.com/packages/tools/utilities/… assetstore.unity.com/packages/tools/utilities/… \$\endgroup\$ – nyhjem May 1 '18 at 10:44
1
\$\begingroup\$

Unity makes these things a bit difficult. First things first, unity was mainly built on an architecture for indie and mobile games which might explain why this is difficult to accomplish. Unity is breaking out of that indie and mobile space but lacks some tech that makes things like this easy for developers.

As a professional who has used unity for almost 10 years and has somehow been always working on games that push the engine to it’s limits, I can honestly say this is more of a technical challenge than you might have signed up for.

You asked for out of the box or simple code solutions so the best I can provide for you is the built in ability for unity to load multiple levels at one time. If you imagine your world as a grid and just make several scenes that represent each square then you can just load levels (using the LoadLevelAsync function to not block the main thread) and unload levels as you move closer or farther to different squares.

Unfortunately, unity’s current component system of using Start/Awake/OnEnable in scripts causes a massive issue when loading levels. Once you tell unity to load a level it has to load everything in that scene and then all at once BAM! You have every single component in there starting up and allocating memory or spending CPU cycles, which usually results in hitching.

Also if you are wanting a breath of the wild type thing (where you can see very very far away) you will likely want to have the ability to slow down or stop update cycles on components that are very distant. Usually you want the highest poly and most CPU expensive things happening only where they matter... where they are close to or visible by the player. This is also not available by default in unity.

This is an issue I am personally setting out to solve on my own and hopefully offer up as a unity asset for others. I just thought I would share my own experiences and findings with you.

Basically level streaming is the solution here and there isn’t much out of the box that can help you get there.

\$\endgroup\$
0
\$\begingroup\$

A terrain will have a large area and large memory usage to go along with it and an open world will needs lots of these and, as you've already discovered, this is not an option.

Unless you can find a way to put in multiple, small terrains and only render those within certain areas, you're going to keep coming up against the same problem.

You should investigate voxel level design. This is what is used by titles such as Minecraft, 7 Days to Die and Space Engineers.

\$\endgroup\$
  • 2
    \$\begingroup\$ Voxels will tend to have even higher resource usage than terrains (rather than a single height/splat value per unit of area, they can contain a whole stack of values. And rather than a simple grid mesh, large voxel worlds need more complicated meshes to handle undercuts/tunnels/etc.) That's not to say they're not a good solution that works well for many games. They just don't, on their own, address the particular risks you've identified with the terrain approach. Both require chunking or LODs to be feasible over large areas. \$\endgroup\$ – DMGregory Mar 20 '18 at 12:51
  • \$\begingroup\$ Does Assasin's Creed also use voxel? \$\endgroup\$ – Mir Usmanov Mar 20 '18 at 13:14
  • \$\begingroup\$ @MirUsmanov I don't think it does. Here's an article from one of the senior level artists on AC:Origins 80.lv/articles/creating-the-world-of-assassins-creed-origins \$\endgroup\$ – Stephen Mar 20 '18 at 14:16
0
\$\begingroup\$

Method 1- Instead of terrain, use well cleverly designed 5, 10, 30, 20000 etc small meshes as terrain, and put imaginary boxes around each mesh, when mesh is out of Cam sight the just don't render them. Hence well cleverly designed meshes that just don't pop up in cam view will not get drawn. If possible learn coding functionality how not to render out of Cam view meshes.

Method 2- learn how to draw scene on the fly by creating chunks/lots of mesh quads that will be Cam view. that us the best way to produce maximum FPS scenes, as only fraction of a mesh is drawn that is only in Cam view.

Method 3- Use the most awesome method- mixing 2D + 3D within the scene, just it is done in Manga Japanese movies, ie the scene in background is 2D, and the mesh items on top of that are either 3D or 2D- as low as 7FPS.

\$\endgroup\$
  • \$\begingroup\$ Method 1 appears to describe frustum culling, something the Unity engine already does automatically. \$\endgroup\$ – DMGregory Dec 4 '18 at 5:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.