Advertisement

Open World games in Unity game engine?

Started by March 21, 2015 09:31 AM
9 comments, last by Gian-Reto 9 years, 9 months ago

Hey Guys, after a long time i'm asking a question a question here. Now what my question is that is it possible to create open world games within Unity game engine? i mean it will lag a lot with a lot of Drawcalls and tris. My PC specs are intel core i3 , CPU @ 2.40GHz and 2gb ram also a 1gb video card. Also approximately how many vertices can unity handle before it lags on my computer? .

Thanks!

I personally don't see any difference between open or closed environment, nor have i heard much on this, unless there is specific code involved. (like prioritising those inside the "box", though if you put everything in one, it's not really any different then. So what's the difference between using an image background instead of a skybox? Is it still not open world?) Actual problems would occur with ai elements and particles, probably.

If anything you can edit the camera's display distance in Unity, if it helps. Although i'm guessing, that is not preferred by most developers, probably.

- I just realised you could be talking about open world elements of a game, but those can be managed to the necessary amounts, we both probably know that open world games have existed long before your computer was produced.

You also want some professional opinion on that. heheh-

Advertisement

You don't need to have amazing rig to create an open world game, but do expect some lag if you over-crowd certain areas. I'm currently making Open-world as well and I noticed that the biggest drop in framerate comes from massive cities, overload of FX (basically anything above 20 at screen causes FPS drop and my comp is a little better than yours), and if a certain area is running a buttload of scripts. If you can limit yourself in those areas, you should be fine (unless, of course, you use 4x textures and high-poly models, then good luck good sir :D)

Draw distance is the key to keeping lag to a minumum .

Try adding an option in your game were the player can select how far out they can see, and from that number only render the objects in that area.

I cannot remember the books I've read any more than the meals I have eaten; even so, they have made me.

~ Ralph Waldo Emerson

It really depends on what you are putting in your world. This goes for any type of game, whether it be open or closed. If you have lots of stuff, expect lag. I've made some basic world explorers (which are, in theory, open world) but they have no lag.

No one expects the Spanish Inquisition!

is it possible to create open world games within Unity game engine?

Yes. Many games have done this.

i mean it will lag a lot with a lot of Drawcalls and tris. ... Also approximately how many vertices can unity handle before it lags on my computer?

That is a difficult question to answer, and it depends on the game, how the game is written, and what you choose to draw.

Unity's terrain engine is pretty good about CLOD (Continuous Level of Detail) changes. As your camera moves around the world distant terrain is replaced with simpler models, and nearby terrain uses more complex models. Distant trees and grass gets swapped out first from being modeled objects into becoming billboards, or basically a picture of a generic tree.

Many games with open worlds will precompute the view of distant hills, then use those in the skybox instead of using actual terrain. It can swap the skyboxes out when your camera travels far enough around the world.

Both viewport culling (not drawing stuff that is off the screen) and occlusion culling (not drawing items that are visually blocked by other objects) can help with drawing large worlds. Unity can do both, but it needs a little bit of setup to get best results.

You asked about the number of draw calls and number of triangles. Not all draw calls and triangles are created equally. Rendering an object that has no shaders is going to be very different from rendering something with a large number of compute-heavy shaders attached. There are soft limits that depend on many factors, but they should seem sane if you think about them.

For example, if you are flying low over a forest from a bird's eye view, it is unrealistic to expect to draw 750,000 individual trees spreading out before you while maintaining a high framerate. But with billboarding and prerendered proxies for distant zones, you could draw several thousand nearby trees with the built-in terrain engine plus ten or twenty distant proxies or a distant tree-filled skybox.

Advertisement


we both probably know that open world games have existed long before your computer was produced.

Yup. Here's an open world game. Bet it wouldn't "lag" if implemented in Unity.

Ultima_V_-_Warriors_of_Destiny.png

With Unity 5, you can load/unload levels in the background additive. This means you can load parts of a large open world at any time, and unload those parts too. Which means you can break up and store your open world as a levels which get loaded in the background async with no loading screen or lag.

In this way you can load only the cubes the player is in, and the cubes around him, and unload the ones that are not. That said you must also decide some feature for handling view distance beyond the loaded sections of your world, like fog or perhaps having some LOD.

If this post or signature was helpful and/or constructive please give rep.

// C++ Video tutorials

http://www.youtube.com/watch?v=Wo60USYV9Ik

// Easy to learn 2D Game Library c++

SFML2.2 Download http://www.sfml-dev.org/download.php

SFML2.2 Tutorials http://www.sfml-dev.org/tutorials/2.2/

// Excellent 2d physics library Box2D

http://box2d.org/about/

// SFML 2 book

http://www.amazon.com/gp/product/1849696845/ref=as_li_ss_tl?ie=UTF8&camp=1789&creative=390957&creativeASIN=1849696845&linkCode=as2&tag=gamer2creator-20

Yes and sort of No. I am currently working with a team right now to build an open world game.

The definition of such? Streaming levels so there are no zonings, except for buildings naturally.

As others mentioned, there is an additive method to loading scenes and tile them in Unity 5... but Unity's design makes it ridiculously difficult to work with.

The first step is, you need to be aware that you have to program the Open World aspect yourself. This can be pretty easy depending on your level of experience with general game engine programming. Other wise, there are no tutorials available for it, because the code it's self is more than just "simple".

The second step is to design a method in which these tiles are stored. Usually you will index them like sectors of a map using X and Y coordinate system. Not the position ordinates, but the sort that you would see on graph paper.

The MAJOR problem which makes this so difficult in Unity is that by design, you can only have one scene open at a time normally in the editor. You can build a work around for this, but it's stupidly difficult and time inefficient.

A possible solution is to make one really big scene file. But that's impossible due to, once again, Unity's resource management being as sterling as ever. The level file is ridiculously heavy, and grows as more and more data is shoved into it. It does not stream, which means everything is loaded at once.

If you aren't that skilled of a programmer, do yourself a favor and stick to Zoning, Zelda Style. It's much simpler and you will get more work done.

The added benefit is that you can create more intricate level designs with the terrain.

Yes and sort of No. I am currently working with a team right now to build an open world game.

The definition of such? Streaming levels so there are no zonings, except for buildings naturally.

As others mentioned, there is an additive method to loading scenes and tile them in Unity 5... but Unity's design makes it ridiculously difficult to work with.

The first step is, you need to be aware that you have to program the Open World aspect yourself. This can be pretty easy depending on your level of experience with general game engine programming. Other wise, there are no tutorials available for it, because the code it's self is more than just "simple".

The second step is to design a method in which these tiles are stored. Usually you will index them like sectors of a map using X and Y coordinate system. Not the position ordinates, but the sort that you would see on graph paper.

The MAJOR problem which makes this so difficult in Unity is that by design, you can only have one scene open at a time normally in the editor. You can build a work around for this, but it's stupidly difficult and time inefficient.

A possible solution is to make one really big scene file. But that's impossible due to, once again, Unity's resource management being as sterling as ever. The level file is ridiculously heavy, and grows as more and more data is shoved into it. It does not stream, which means everything is loaded at once.

If you aren't that skilled of a programmer, do yourself a favor and stick to Zoning, Zelda Style. It's much simpler and you will get more work done.

The added benefit is that you can create more intricate level designs with the terrain.

This is pretty accurate regarding the current state of Unity 5 and the available APIs.

However, it is worth noting that per http://blogs.unity3d.com/2014/08/04/multi-scene-editing/, a SceneManager and native multi-scene editing are both on the way. The video attached to the blog post shows some of this in action.

This topic is closed to new replies.

Advertisement