i know that one thing about perfomace it would be drawcalls and such but sometimes this doesn’t seem to be the main problem, most of the time i’m working with unity on a game project i seem to have lots of hicups and specially it it’s dealing with the camera rotating to fast or like in a fps looking around to fast, in my project my frames went down to 60fps .
and that’s because of the amount of enemies i have in the project and besides the fact they do animations and such.
but why most projects have the hicups? even the new project angrybots that came with unity just playing it i have hicups with it. i haven’t even touched a script.
Perhaps its your computer?
Yep, must be your end, i never have any hickups. Angrybots projects works fine.
If you’re playing in the editor, that’s to be expected.
–Eric
i don’t even get hiccups in the editor…
I don’t get hickups, but the older unity games used to due to a bit of an iffy garbage collector setup. Since then things have really smoothed out. If you’re getting that now, it means you’re allocating too much memory per frame.
Garbage collection can still cause pauses, so it’s a good idea when using a managed language (and even non-managed, although you have more control over deallocation there) to pool pretty much everything to prevent garbage collection from causing issues.
well honestly, my computer has been reformatted anyways due to other issue, so it’s a fresh installs but most of my the projects in unity still do hich ups. my system is a Quad core AMD 3.4, video card is ATI HD5800 1G, and i have 8g of ram and using windows 7.
i don’t think it could be the pc do. i heard about the whole garbage collection that we can’t use destructors in c# and such things. even if i don’t have a lot of things on my scene it still shows or plays laggy, i did a research about the whole drawcalls and i don’t get how people can make their project be around 100 drawcalls and such, for example if i do a simple scene setup with nothing yes it would depends on how many shaders and models, in one of my projects my drawcalls seems to be around 2,000 which seems imposible to lower, so how would someone go on about creating a high quality game?
even having simple things it seems like everything makes it slow down. we even cap our models to be less than 1000 polys.
2,000 drawcalls is excessive even for crysis. And it’s possible to do fine without destructors.
Some pointers about draw calls are to read the ios/android forums here. Those are stuffed with awesome tips. Also, post effect shaders may dramatically increase draw calls and the biggest offender is often lights. You need to switch to deferred rendering to put a stop to lights spamming tonnes of draw calls.
There are many other things to do like occlusion and mesh merging where possible, that will reduce them. A modern well-designed PC game can do fine with 500 draw calls, which I would consider healthy on the platform.
An i7 though, should chew through 2,000 draw calls without breaking sweat. But the garbage collector can get us all in the end. Perhaps you should profile to get to the root cause of the stutters you are having.
2000 draw calls is not unreasonable on any semi-modern PC. 500 is quite low; the terrain alone can generate that.
That’s fairly pointless; even bad Intel integrated graphics can handle more than that, never mind a half-decent discrete card.
–Eric
i am using deffered rendering and i only have one light on my scene, now one question would be do the gui increases the drawcalls? at some point it doesn’t seem to be a good thing to have around… and for example yes it think i should just maybe model a mesh as for terrain since the unity terrain seems to not to be so optimized.
even the water on unity seems to have problems, then i use the profiler it’s looking at the water that unity has, the terrain, gui and etc. it seems to be a big mess. even having more than one mesh pleying animations seems to cause a big impact too.
by the way hippocoder could you show me the links you are talking about?
let me be a bit more focused on what i’m trying to acomplish, pretty much for example me and my buddy are creating a mmorpg, and yes i know many people say that’s a big dream and so on, now away from the speaking. it’s hard thinking about the term of combining meshes since the armor pieces are different meshes.
another thing would be the amount of animations the character has and the enemies. i spent hours trying to optimize them too.
other problems would seem to have many gui screens and windows since in a genre like this most of the visual is oriented on the interface. what would you guys recomend into some of this processes when it comes to optimizing?
i can’t seem to forsee the fact of trying to get to about 500 drawcalls.
Any particular reason for using deferred rendering then? Usually you’d use it if you have lots of point lights, because otherwise it’s a performance hit.
Yes, everything you draw does.
It’s far more optimized than having a huge mesh with a billion separate objects on it. The whole point of the terrain system is to be more efficient than “normal” objects.
–Eric
I read somewhere in the Unity docs that 1200-1600(?) – I don’t recall, somewhere around there – is the sweet spot for per model minimum poly count. Below that the overhead associated with drawing the model means you aren’t conserving much with less detail.
As with everything, it really depends. On static objects, going super low poly isn’t going to help on PC much, draw calls are more important. With animated meshes, it can make a difference if you have a lot of characters on screen since every vertex has to be moved.
Poly counts really aren’t going to be your problem. The issue is draw calls with unity.
If you have 500 draw calls with your terrain, you need to look into batching and mesh merging.
As for polycounts, you can safely go up to 5K-10K depending on the type of object you are representing, and not have a problem. Of course, we’re talking PC. iOS/Mobile environments will be significantly less.
Though, I do have a bit of a different setup than most people, as I’m working on some projects using a 3D Dot Heroes style graphics engine running at the moment, so even with a simple model, I get up in the thousands of polygons quite quickly, and I’ve had to accommodate for that.
No, it’s much higher than that. It depends on the GPU of course but that kind of poly count is quite a few years out of date.
It’s not necessarily an issue. 5000 would be too many, yes. 2000 isn’t really a problem with the kind of hardware mentioned in this topic.
The terrain system already does that. It’s not something you have any real control over, although indirectly you can affect it by using a larger pixel error; that way there won’t be as many subdivisions.
–Eric
here is one of the tests i have done, about the terrain part i mentioned earlier, the terrain in unity engine had more drawcalls that bringing a 35k mesh, everything seems a bit too tricky, even how you handle the resolution in the terrain engine in unity. i even realize that trying to use the trees with the terrain engine they don’t have colliders, so if i want to be able to collide with trees i have to drag them one by one.
i can probably try a different renderer such as the foward rendering since i only have one light on the scene.
it’s like there is no ending to the optimization when it comes about creating something with a larger quality.
what about textures, is there a size i should be sticking with? icons?
That’s much much lower res than a standard terrain with the default resolution. It can work in some cases, but if you want a reasonably large area that doesn’t look like a bunch of huge triangles, you need to use some kind of terrain system.
Not quite sure what that means…if you’re having difficulty, the docs explain everything quite well in detail. It’s a straightforward heightmap system.
They do if you add colliders and use the “Create tree colliders” option.
–Eric
about checking one the block that says generate colliders and even having to make shure each tree in the import setting has a collider it doesn’t work, i still end up having to drag out a tree one by one if i want to be able to use colliders.