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

Sending event freeze game on Windows #34

Open
d954mas opened this issue Feb 13, 2021 · 24 comments
Open

Sending event freeze game on Windows #34

d954mas opened this issue Feb 13, 2021 · 24 comments

Comments

@d954mas
Copy link

d954mas commented Feb 13, 2021

Game is freeze when game analytics send event.

Info/GameAnalytics: Event queue: Sending 1 events.
Info/GameAnalytics: Event queue: 1 events sent.

On windows sending events, freeze game. Looks like it send in same thread. Can you please look on it?

https://forum.defold.com/t/strange-freeze-after-game-start-in-windows/67548/10

@subsoap
Copy link
Contributor

subsoap commented Feb 13, 2021

@the1schwartz
Copy link
Contributor

The GA SDK sends all events from a separate thread. I have tested in a Windows build and I don't get a freeze in the game.

@d954mas
Copy link
Author

d954mas commented Feb 15, 2021

Thanks. I make a example project.
And also write some videos.

At them right bottom i add dt labels.
-bottom is current
-top is max in this second.

There are 2 cases. That looks like same problem.
1)Frezze when analytics send event.
2)Frezze when game is closing.

frezze_in_game.mp4
frezze_when_close_game.mp4

@d954mas
Copy link
Author

d954mas commented Feb 15, 2021

@d954mas
Copy link
Author

d954mas commented Feb 15, 2021

If you need more info, ask. Thanks

@the1schwartz
Copy link
Contributor

Ok thanks for the videos and test project. I tried to adding the show_dt code to my test project and also an FPS counter. I see small dip when initialising the SDK but after that FPS is steady when sending events. This the project I have used to test with: https://drive.google.com/file/d/1SX7jf9pilMHq3RQo8kh4YO7og5AxCTXr/view?usp=sharing

@d954mas
Copy link
Author

d954mas commented Feb 16, 2021

Thanks. I try your project, and it also frezze.

I make small change to rect rotation. Multiple rotation by dt, to see that rect frezzed.
--gui.set_rotation(self.box1, vmath.vector3(0, 0, rot.z + 1))
--use dt to see that rect frezzed
gui.set_rotation(self.box1, vmath.vector3(0, 0, rot.z + 1 * dt*60))

Your fps counter is also reduced to 54fps

https://user-images.githubusercontent.com/2655263/108073712-6737dc80-7079-11eb-8a23-1eee58cf3dac.mp4
https://drive.google.com/file/d/1nVsEcicy937b1R56IdDvqBypQH7_J9nd/view?usp=sharing

@d954mas
Copy link
Author

d954mas commented Feb 16, 2021

Add my system info. Sorry for russian, but i think it can be understand:) Maybe it can helped
2021-02-16_17-11-16

@the1schwartz
Copy link
Contributor

Ok I will try to dig deeper to see figure out what part of the SDK causes the issue

@the1schwartz
Copy link
Contributor

I only seem to get frame rate drop on initialzing the SDK but not when sending new events after this. I have double checked that the SDK codes is run on a separate thread. I am not sure if it has anything to do libcurl or what is happening. I have tested the same c++ library in our Unreal SDK and here there is no frame rate drops.

@d954mas
Copy link
Author

d954mas commented Feb 19, 2021

Thanks.

If you share unreal project and instruction, i can check on it.

@d954mas
Copy link
Author

d954mas commented Feb 19, 2021

Maybe it it something with io?
Cleaning sended events from db, or something like that?

@the1schwartz
Copy link
Contributor

Sure here is a link to the test project I used to test: https://drive.google.com/file/d/1uhze_7K8v5GImzx1uwY4KiO9WPcS8npL/view?usp=sharing

You need Unreal Engine 4.26

I packaged the game for Windows 64-bit. When running the game press "G" to initialize the SDK and press "H" to send some more events.

@d954mas
Copy link
Author

d954mas commented Feb 22, 2021

I try Unreal Engine. There are no frezzes

@the1schwartz
Copy link
Contributor

Ok thanks for testing, so this might be engine related or what do you think?

@subsoap
Copy link
Contributor

subsoap commented Feb 22, 2021

@JCash @britzl

@d954mas
Copy link
Author

d954mas commented Feb 22, 2021

I have no ideas. Looks like something specific to engine or maybe defold openssl.

@the1schwartz
Copy link
Contributor

Defold openssl is basically just the c++ libraries for Openssl. The weird thing is the frame rate drops doesn't happen after the initialization of the SDK.

@britzl
Copy link

britzl commented Feb 22, 2021

Looks like something specific to engine or maybe defold openssl.

I just want to point out that we do not use OpenSSL in the engine itself, we use mbedTLS. But it could be something in the OpenSSL extension.

Since this happens on Windows there should be pretty good debugging tools (Visual Studio?) to try and pinpoint what happens during the freeze. I have little experience with this but I'll ask JCash for feedback.

@JCash
Copy link

JCash commented Feb 22, 2021

The weird thing is the frame rate drops doesn't happen after the initialization of the SDK.

Usually I'd expect some kind of I/O: loading a file, loading a dll etc
or generating some kind of init data tables.

I just tried the example my self and I couldn't see any hitches either.
I did have to add msg.post(".", "acquire_input_focus") since otherwise nothing would of course happen if you clicked in the window.

Apart from debugging the app in Visual Studio (make sure you bundle with "--with-symbols" so that you'll get the dmengine.pdb), I don't know how to profile that code on Win32.
I've used VTune before ( along time ago) but it apparently requires 22GB install space, which I don't have in my VM right now...

@JCash
Copy link

JCash commented Feb 22, 2021

We also have Windows Performance Toolkit which I haven't used either, and I'm not sure it's applicable here.

@JCash
Copy link

JCash commented Feb 22, 2021

I've got some good performance tool tips in this thread

@the1schwartz
Copy link
Contributor

Ok thanks I will have a look at those

@the1schwartz
Copy link
Contributor

OpenSSL doesn't seem to be the issue as the frame drop still happens if I try to use a libCurl without OpenSSL enabled and just try to use a random unsecure url to use as init url for the SDK.

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

5 participants