Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Freezing Game! #323

Open
noobogami opened this issue Nov 20, 2021 · 4 comments
Open

Freezing Game! #323

noobogami opened this issue Nov 20, 2021 · 4 comments

Comments

@noobogami
Copy link

noobogami commented Nov 20, 2021

in my game I have a map that handle with a system similar to tilemap that I wrote myself. some part of map are cloud that can be removed during playing and I handle them temporary with some hardcode style algorithm,
now for refactoring I changed that part to 2D tilemap extra and it worked very good but I noticed an issue; app freeze after period of time! first I thought it's a problem with a shader I used on clouds but when I disabled my shader and used "sprite default" material problem stayed.
it happens randomly and just happens when tilemap object is active (when I change a view in my game that disables tilemap object game works without problem), all unity cycles stop (every updates stop calling) but every time I touch screen logcat show this log:
2021/11/20 12:41:28.121 4815 4815 Debug ViewRootImpl@53d11aa[UnityPlayerActivity] ViewPostIme pointer 0
and "Game Analytics" cycle works and looking for new events to send every 20 or 30 seconds with this log:
2021/11/20 12:43:13.660 4815 5535 Info GameAnalytics Info/GameAnalytics: Event queue: No events to send
I use a custom ruletile for my cloud so 3 different tiles connect to eachother, here's my code:

public class MultiTextureTile : RuleTile<MultiTextureTile.Neighbor> {
    public TileBase[] tilesToConnect;

    public class Neighbor : RuleTile.TilingRule.Neighbor {    }

    public override bool RuleMatch(int neighbor, TileBase tile) {
        switch (neighbor) {
            case Neighbor.This: return tile == this || tilesToConnect.Contains(tile);
            case Neighbor.NotThis: return tile != this && !tilesToConnect.Contains(tile);;
        }
        return base.RuleMatch(neighbor, tile);
    }
}

when I tried to use profiler it didn't happened in first build but in another build it frizzed with profiler and at the time of freeze profiler graph stopped moving! there was no spike in cpu or render or memory.
I tested on two different devices a Samsung Galaxy A10 that freezes almost every time and a Xiaomi Redmi Note 8 that rarely freezes (I just saw two or three times)
freezing time is different. sometimes it wait 2 minutes, and sometimes it freeze in less than a minute.
I'm using Unity 2019.4.18

@ChuanXin-Unity
Copy link
Collaborator

Would it be possible to share what you have captured in the Profiler and provide details of the Frames where it stalls? You can also turn on "Deep Profile" to get more details of what is happening in the freezing Frame if nothing much shows there by default.

@noobogami
Copy link
Author

I tried with deep profile but it didn't freeze here's simple profile result after freezing this graph didn't update anymore
image
image
image
image

@ChuanXin-Unity
Copy link
Collaborator

Unfortunately, this does not provide any details about the freeze, which makes it difficult to figure out the issue. Perhaps you could try using the Android Profiler or try to capture the callstack when you encounter a freeze.

Would it be possible to send a bug report with your project using the Unity Bug Reporter and steps on how to reproduce this issue?

@noobogami
Copy link
Author

Unfortunately, this does not provide any details about the freeze, which makes it difficult to figure out the issue. Perhaps you could try using the Android Profiler or try to capture the callstack when you encounter a freeze.

Would it be possible to send a bug report with your project using the Unity Bug Reporter and steps on how to reproduce this issue?

yesterday I filled a bug report and after several attempts finally I could send it, until now I didn't receive any response from unity about receiving bug report (as I think it said in final message that they would send an email after delivery).
I sent my built file with bug report too.
for now I disabled tilemap and use my previous version of clouds until find a solution to this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants