codenamecpp / carnage3d

Reimplementation of Grand Theft Auto 1 [GTA1]
MIT License
480 stars 38 forks source link

Game freezes when interacting with debug window #16

Closed MiroslavR closed 5 years ago

MiroslavR commented 5 years ago

When I expand the "Ped" section in the debug window or open the console, the player character disappears and sometimes the game freezes for about 30 seconds. My whole system is barely responsive in that time.

MiroslavR commented 5 years ago

It seems that during this "freeze", the game does render and update but the frames are taking abnormally long and are seemingly very CPU intensive...

The effect is much worse when turning off VSync.

neuromancer commented 5 years ago

I had the same issue, but I didn't report it because I thought it was a some hardware-related problem (dmesg was reporting some Nvidia error commonly associated with that).

codenamecpp commented 5 years ago

Hm, very interesting. I think this somehow related to imgui rendering. First thing come in mind is to make work imgui renderer harded - I have just added one option to cfg "show_imgui_demo_window" - this will enable imgui demo window with bunch of controls, texts etc. Please test it and try to find steps which reproduces freeze.

MiroslavR commented 5 years ago

Unfortunately, after enabling the option, the game freezes on launch and doesn't unfreeze, so I can't really play with the controls. I can see the windows and they update infrequently. The metrics window reports normal average framerate.

MiroslavR commented 5 years ago

I also get Nvidia messages in dmesg, where the pid is the process ID of carnage3d:

[  568.853043] NVRM: Xid (PCI:0000:01:00): 8, pid=2662, Channel 00000018

Also Xorg seems to eat 100% CPU during the freeze. I've updated my Nvidia driver, but to no avail.

MiroslavR commented 5 years ago

I've tried compiling https://github.com/ocornut/imgui/tree/master/examples/example_glfw_opengl3. It shows the same demo window but doesn't freeze.

MiroslavR commented 5 years ago

I've done a git bisect. The first bad commit is 415b6103a9eab3164f8511b658e6b112ac6daa11 - before that there were no freezes.

codenamecpp commented 5 years ago

Thanks, MiroslavR :) Sure that will help!

codenamecpp commented 5 years ago

I made a few changes in the code, could you please test it again?

MiroslavR commented 5 years ago

That fixed it. :+1:

codenamecpp commented 5 years ago

Great! Thanks for assist.