Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by FHRaph · Dec 21, 2012 at 12:51 AM · physicsgraphicsngui2dtoolkit

Graphic anomalies and loss of physics with Unity 3.5.6 + NGUI + TK2D

Hi there,

So my company has been developing a product for android that in many ways mimics an iso-deco style game. It's visually 2D. Players can scroll the cam left / right, zoom in / out, buy buildings, place buildings, move buildings, upgrade buildings, interact with NPCs (tap interaction), etc... etc...

Very recently we were hit with a bug that we have not been able to resolve or even isolate to a particular area of the game. The bug is that after a non standard amount of time our game objects will appear to start z-fighting and lose box-collider response to a raycast, i.e. no physics / tap response.

We've tried camera proximity to 0, we've tried ortho with alpha test shaders, we've tried render queues, we've tried removing individual aspects of our game (npcs, buildings, UI, backgrounds, etc...) one at a time, we've tried multiple cameras with individual layers, we've tried reducing the size of our textures, we've tried forcing to a 24bit buffer, we've tried enabling / disabling static / dynamic batching, we've tried forward and deferred rendering (currently using vertex lit), etc... Always we will eventually lose input and there will be graphic anomalies / apparent z-fighting.

I've looked at our main camera's projection matric, forward, right and up vectors, positions in world and local, fov, size, etc... before and after the bug with no discernible difference.

I've run a dev build and looked at it in Eclipse with the DDMS and our memory footprint does not seem to be drastically different before or after the bug occurs.

I create a runtime boundingbox with GL.Draw to show the box collider in game and it is always where I expect it to be.

What really messes with my mind is how before the bug occurs I can cast a ray with every tap and list the objects it collides with, everything is as expected. After the bug, though everything looks to be in the same location, Buildings, npcs, etc... (minus the z-fighting) the ray cast will come back and list 0 collisions.

we are running unity 3.5.6 Pro 2/ android (but have tried with 3.5.7) the latest NGUI and the latest 2dToolkit.

Please, any advice would be very very appreciated.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by FHRaph · Dec 28, 2012 at 04:42 AM

So this turned out to be a divide by zer0 error. It seems, though we have not determined exactly where in out code base, one of our return values from a call to a static class was returning a value that was either zero or in calculable. This then caused our camera to treat our objects as though they were at nan, infinity, or -infinity on scale-z.

I wish I could be more specific about which call it was or in relation to what object, component, 3rd party software, etc... but I cannot. One of our guys took it upon himself to track down every potential divide by zer0 case and do the appropriate checks. After those checks were in, the problem was resolved.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

9 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

GetPixel() returns only one value 2 Answers

Grass is very high 1 Answer

Colliding 2 completely flat quads with physics? 5 Answers

Game build works fine in Android but is jittery in iPhone. 0 Answers

Countdown little help...! 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges