HELP Unity 3.1 stops dynamic batching prefabs after a few saves opens of project.

I have a Unity 3.1 project with models of under 300 vtxs with a shared texture atlas material that are made into prefabs. These prefabs are manually placed in different game scenes. The scenes dynamic batch nicely when the scene is first built - I can see that from the stats view in the player. A few days go by of updating the scenes prefabs, saving the project, and then I check stats again and its not batching hardly anything! None of the static prefabs in my scene (with the shared texture atlas material) are batching. This has happened twice now. The first time I fixed it by rebuilding all the prefabs, making sure the original model file referenced the texture and Unity auto-created the shared material, then rebuilding the game levels.

Now dynamic batching isn’t happening again!

  • dynamic batching is checked in the build settings
  • GameObject scales are all still 1,1,1
  • The models didn’t change.
  • We are on OS X snow leopard
  • Models are .fbx and .3ds files.
  • As far as I can tell the objects in the scene are still connected correctly to the prefabs
  • There is still only 1 copy of the shared texture atlas material in the project, and the prefabs are using it, models are drawing textured correctly.
  • Using vertex lit shader and Beast lightmaps for everything except HUD, which is drawn with an alpha blending self lit shader.

We send the project back and forth between 2 people, zipping it up and unzipping it, so all that changes are file dates I assume (if even that). This is for an iPhone game.

HELP! We do have a deadline for Christmas…
Why does Unity quit doing dynamic batching?
How can I get batching to work again?
How can I prevent this from happening all the time?

Many thanks
Mark Johnson
markj@markj.net

Why does users keep complaining about errors without sending repro projects?
How can I make them to do this?
How can I prevent this from happening all the time?

seriously though - submit bug report WITH repro project attached and drop the number

Thankyou for responding so quickly, even though you are a bit rude. I would be happy to send my project if it means you will be able to help me. Its about 50MB. Do you really think I’m going to publish my unreleased commercial game to a forum that as far as I can tell it public. How do I send it to you in a way that is not public?

I’m a new Unity user, I expect I’m simply doing something wrong that many people have experienced. Did you read my problem description at all?

Thanks for your help.

You can submit projects to us by using the Unity Bug Reporter app… in Unity go to “Help/Report a Bug” and attach the zipped project to the bug report.

If you post the case number here Alexey will have a better chance of getting it faster than if it is processed through our QA team.

Cheers,

I just noticed exactly the same thing. Batching was working nicely until we started co-working on scenes with our graphics designer.

Now the dynamic batching is behaving totally randomly and scenes which used to render at around 20 draw calls can now take up to 70?

Did someone actually file a bug report of this already? Seems to be quite nasty bug :frowning:

br,
Sami

did you ensure your artists import the models correctly without any animation etc? cause skinned meshes won’t batch

The problem is that we haven’t changed anything on the meshes or prefabs, just bounced scenes back and forth between two computers (using SVN) and populated them with prefabs that have been working perfectly fine so far.

The behaviour is really weird - the old levels I’ve done still batch correctly, but if I add the exactly same prefabs to the newer scenes that the artist has modified the batching no longer works. And yes, I’ve triple checked that our gfx guy didn’t mess up anything in the scenes :wink:

I’ll have to investigate a bit more, but I just noticed that I’m using 3.1 f3 and our gfx guy is using 3.1 f4, this might cause some issues. I’ll try to upgrade my Unity to 3.1 f4 and re-import the scenes now…

br,
Sami

Quick update, nope, doesn’t seem to be caused by f3 / f4 version conflict, it still does the same.

br,
Sami

sounds very fishy and disturbing whats going on there, that it works on old but not on new etc …

Very fishy indeed. I’ve been trying to do a reliable, reproduceable test case but it seems to be damn hard :frowning:

Anyway, so far it looks like the prefabs really are somehow broken (very hard to say what happens because I do not know how the prefabs work internally in the engine). Like I said, this batching issue started after we started modifying the scenes on another computer. During the import the library was re-built from the .meta files on the other computer, so my gut feeling is that this could be an issue in the library generation from .meta files.

Another thing that speaks for this is that for example the prefab’s previews do not show up at all on our gfx designer’s computer (they show the default box instead of the actual prefab’s picture). Another thing worth noting is that during the import Unity re-generated the meta files for all audio files and two materials on the second computer. Everything else went smoothly.

I think I’ll file a bug on this one, and commit our project in it’s current state.

br,
Sami