godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.01k stars 21.17k forks source link

Project logs are output to the project folder instead of the specified folder (caused by WeGame client implicit Vulkan layer) #81652

Open AlexCZhou opened 1 year ago

AlexCZhou commented 1 year ago

Godot version

v4.1.1.stable.official [bd6af8e0e]

System information

Godot v4.1.1.stable - Windows 10.0.19045 - Vulkan (Mobile) - dedicated NVIDIA GeForce RTX 3070 (NVIDIA; 31.0.15.3713) - AMD Ryzen 5 5600X 6-Core Processor (12 Threads)

Issue description

This is my project folder. project folder This is my Log Path setting. Didn't change it. image

If you start Godot.exe as an administrator, no logs will be generated in the project folder (but I don’t know where they are). But I haven't started it as an administrator in the past few months and haven't seen this behavior. This is what I just discovered today.

Steps to reproduce

Create a new project and start it.

Minimal reproduction project

N/A. This problem occurs in all new projects I created, as well as old projects that have not been touched for several months.

akien-mga commented 1 year ago

Given the file names, these are actually logs for the Godot editor instance itself, and not for the game specifically. So the path configured in project.godot isn't used here, that one is for when you run the game itself (you should be able to find those logs in %APPDATA%\Godot\app_userdata\<Game Name>).

But I don't know where those editor logs come from. The naming pattern doesn't seem familiar, as Godot usually adds a suffix with ISO formatted timestamps, like this: godot2023-08-02T14.39.36.log

CC @bruvzg @KoBeWi

Charlixs commented 1 year ago

same here , suddenly appeared yesterday, i did nothing but update Windows 11

Calinou commented 1 year ago

What name does the project have? Does it contain special characters, or characters that are not allowed in Windows filenames such as :?

If you use Project > Open Project Data Folder at the top of the editor, do you end up in a folder that has a logs folder inside?

AlexCZhou commented 1 year ago

If you use Project > Open Project Data Folder at the top of the editor, do you end up in a folder that has a logs folder inside?

Yes, this is what I got. C:\Users\TypeAlpha\AppData\Roaming\Godot\app_userdata\RuntimeFeeCollector image

This is the contents of the "logs" folder. image

I have started this project in administrator mode before, but I don't remember if the modification time of this log matches the startup time.

meowlitlot commented 1 year ago

I'm having the same issue, normal project logs are generated at the specified file path, but these strange log files are also generated inside the project folder.

These log files are generated when you open a project file or debug a game. However, when you run Godot in administrator mode, these logs don't seem to be generated.

By the way, these log files do not seem to open properly, and commonly used encoding formats will show garbled characters.

Also, if you export the game in exe, these log files are also generated in the game folder when the packaged game is not running in administrator mode.

I sent the packaged game to my friend to run and everything worked fine on my friend's computer.

The problem also disappeared when Renderer switched from Forward+ to Compatibility.

Maybe this issue has already existed in v4.0.3.stable, i found this on Q&A section. {ECA53D4B-49AB-463e-AF0D-800324BCCB1F} Here's the link

AThousandShips commented 1 year ago

See also:

KoBeWi commented 1 year ago

79098 is definitely the same issue.

Both involve weird log files in project folder that contain garbage. Both are fixed by running as administrator. And another detail is that all reports come from Chinese version of Windows.

I think we had similar issue in Lumencraft; I don't remember the exact details, but it affected Chinese players and the solution was running the game in administrator mode. The logs seems to be specific to a certain language version of Windows and they don't look like coming from the engine. Not sure what we should do on our side to avoid it.

AThousandShips commented 1 year ago

It does indeed seem to not be related to Godot as such

Might be related to debugging or something with visual studio

Calinou commented 1 year ago

Out of curiosity, which Windows edition are you using? Press Windows + R and enter winver to see. (If this doesn't suffice, you'll have to navigate to the system settings to find an "About your PC" section or similar.)

Windows 10 exists in 3 standard editions, aside of Pro/Enterprise/Education:

I believe windows 10 Single Language is relatively prevalent in China, which may explain this.

meowlitlot commented 1 year ago

I'm using Windows 11 Home Chinese ( Single Language )

AlexCZhou commented 1 year ago

which Windows edition are you using?

@Calinou This is what I got. 专业版 -> Professional image

timothyqiu commented 1 year ago

I can't reproduce this and I'm using Windows 10 Home. Some users can also reproduce this on Windows 11 Pro for Workstations edition. So probably not related to Single Language.

79098 provided some of those log files, but they are actually binary files and I don't recognize the format.

AlexCZhou commented 1 year ago

8f5a2a8c7599ab3c95639f9d00fbf90c

mrbbbaixue commented 1 year ago

Seems like Godot create this file. After testing using encoding tools, the content inside seems does not match any common Chinese texts transcoding issues.

AlexCZhou commented 1 year ago

image If you try to delete the latest Log, it will prompt that GodotEngine is occupying it.

meowlitlot commented 1 year ago

I solved this problem on my computer. Here is what i do.

I find that the problem disappeared when Renderer switched from Forward+ to Compatibility. So I think there must something with vulkan.

I use Process Monitor to find what process created the log file. {D4783F69-AB94-4cc1-9CB5-3219DCD963B7} And when i find the Stack information, i find the CrossVulkanLayer do this. {CE476DF6-D3BA-4ee4-9786-1DF4A79B9A34} This layer is used by WeGame. I uninstall WeGame, and the issue fixed.

mrbbbaixue commented 1 year ago

Seems confirmed by WeGame (League of Legends client in China by Tencent). But why this file is created by Godot, does it affect the normal process of Godot?

BTW, we are currently contacting Tencent to solve this issue on their side.

AlexCZhou commented 1 year ago

It's true, and my problem disappeared after uninstalling WeGame (Goodbye League of Legends).

However, if players with WeGame installed on their computers still generate this log after my game is packaged, is there any way to avoid this problem? Almost every League of Legends player in China will install WeGame.

timothyqiu commented 1 year ago

Maybe we can try disabling that layer for the editor at least.

Creating a log file in the current working directory is a WeGame bug I believe. But we should handle this as an exception since it pollutes the edited Godot project.

Note: I still can't reproduce after installing WeGame. But @AlexCZhou can confirm that the behavior disappears after uninstalling and re-appears after reinstalling (without reinstalling any game). So probably need extra steps to reproduce. But the ierd_tgp::filesystem in the call stack is definitely WeGame (formerly known as TGP, Tencent Game Platform).

meowlitlot commented 1 year ago

It's almost certain that WeGame's vulkan implicit layer has a problem.

These strange log files are not only generated in Godot's project files, in fact, other applications that call Vulkan produce similar log files (if you installed WeGame), such as steam.

This is what my steam folder looks like now. {D8E9F999-F7E2-46cd-89C1-10C42A3F55C0}

So I recommend that people who have this problem check other folders and clean up these garbage logs.

AThousandShips commented 1 year ago

Might be something to report up-stream if it's a vulkan issue

akien-mga commented 1 year ago

Upstream here would likely be the WeGame developers, as their implicit Vulkan layer seems to be bad / unnecessarily affecting non WeGame applications.

darksylinc commented 1 year ago

First, this is a WeGame bug.

Second, that doesn't mean there's nothing we can do.

All layers (implicit and explicit) can be found via vkEnumerateInstanceLayerProperties.

We currently use that function to enable the explicit layers we want (validation).

Due to the number of complaints, in this PR https://github.com/KhronosGroup/Vulkan-Loader/pull/984 the Vulkan Loader was updated to support filtering out implicit layers via the env variable VK_LOADER_LAYERS_DISABLE.

See Layer Filtering.

We can do the same: Review all layers, find known problematic ones, and set the env variable VK_LOADER_LAYERS_DISABLE before creating the instance.

And if that doesn't work (e.g. the loader required us to have the env. variable set much earlier), we can do the following (upon detecting problematic layers):

  1. Log this situation and say that "Godot will attempt to relaunch itself with VK_LOADER_LAYERS_DISABLE=blahblah godot.exe"
  2. Check the loader version. If it's older than 1.3.234, we display a pop up to tell the user there is a problematic layer installed and that they should uninstall it. Otherwise go to step 3.
  3. Set the environment vars.
  4. Relaunch ourselves w/ "VK_LOADER_LAYERS_DISABLE=blahblah godot.exe"

The main reason for logging first is that if relaunching fails, the user experience is horrible because all they will see is that double clicking the icon does nothing (the app will launch and close itself before even a window appears).

nomadfighter commented 1 month ago

Hey guys, does this issue fixed? image image And there is no WeGame on my PC

AThousandShips commented 1 month ago

The issue is still open so it isn't fixed

If it happens to you even without WeGame that's something to investigate, but could simply be that something else uses the same layers