Ben_93 Posted October 14, 2023 Share Posted October 14, 2023 Hi all, Been playing around with a simple forest scene just using the vegetation pack assets. I'm trying to optimise for performance as I go along, however I am encountering a weird performance related issue I havent come across before. In the editor my scene is running at a stable 85fps at 1440p. However, at runtime this value massively drops to almost 50fps when I move the player, when I stop the player it goes back up to around 85fps. Does anybody know what might be the reason for this? I've attached screen recordings of whats happening, one in editor, one at runtime. I dont have enormous amount of polys or even terrain textures atm! So I am unsure what is causing this weird behaviour! Many thanks, Ben 2023-10-14 19-26-42.mkv 2023-10-14 19-27-33.mkv Link to comment
bmyagkov Posted October 16, 2023 Share Posted October 16, 2023 Hello! @Ben_93 Could you kindly provide us with microprofile dump along with your report? This will assist in pinpointing the area to investigate the cause of this behavior. The snapshot should be taken immediately after the performance drop. Thanks! Link to comment
Ben_93 Posted October 16, 2023 Author Share Posted October 16, 2023 Hi @bmyagkov, Thanks for getting back to me! Find attached the microprofile dump. Its strange, on the dump I cant see any drop in performance? (But then again, im not so clear on this stuff!) Let me know if this helps! Many thanks, Ben cbfc2669ef64cb7594a03758f0115cf5dd8030ad.html Link to comment
bmyagkov Posted October 16, 2023 Share Posted October 16, 2023 1 hour ago, Ben_93 said: Hi @bmyagkov, Thanks for getting back to me! Find attached the microprofile dump. Its strange, on the dump I cant see any drop in performance? (But then again, im not so clear on this stuff!) Let me know if this helps! Many thanks, Ben cbfc2669ef64cb7594a03758f0115cf5dd8030ad.html 55.84 MB · 0 downloads Indeed, the attached dump does not help at all because it does not even contain any hiccups that could help us understand the reason for the issue. Probably, the dump was taken too late because it only contains 200 frames by default. You can expand this value up to 500 frames by using the console command "microprofile_dump_frames." Another trick is to "bind" a hotkey for "microprofile_dump_html" command to be able to immediately take a snapshot after the performance actually drops. For example, it could be something like this: "bind F9 microprofile_dump_html Thanks! Link to comment
Ben_93 Posted October 16, 2023 Author Share Posted October 16, 2023 How is it possible to get a microprofile dump at runtime? I try to use 'microprofile_dump_html' command in the console whilst 'playing' and it says unkown command. It works in the editor, however my problem is that in editor everything is as usual, smooth - but at runtime is where the problems happen.... Many thanks, Ben Link to comment
bmyagkov Posted October 17, 2023 Share Posted October 17, 2023 Hello! 7 hours ago, Ben_93 said: How is it possible to get a microprofile dump at runtime? I try to use 'microprofile_dump_html' command in the console whilst 'playing' and it says unkown command. It works in the editor, however my problem is that in editor everything is as usual, smooth - but at runtime is where the problems happen.... Microprofile needs to be enabled first. To do that, you can customize the startup arguments for the "Run" button in the SDK Browser or set it by editing the configuration file "data\configs\default.user" in your project and adding the following line: -microprofile_enabled 1 Thanks! Link to comment
Ben_93 Posted October 17, 2023 Author Share Posted October 17, 2023 Thanks for explaining this to me, managed to get a 500 frame dump at runtime this time. Find attached, I think you can see a period of lower performance on it - can you tell me what could be the cause of this? Also, why does this happen at runtime but not in-editor? Many thanks, Ben 0a0f88912436408cf6bb4c92119322f6a1db87cb.html Link to comment
bmyagkov Posted October 17, 2023 Share Posted October 17, 2023 1 hour ago, Ben_93 said: Also, why does this happen at runtime but not in-editor? According to the microprofile dump the performance drop comes from the "game logic" which only shows up during runtime. However, when I watch the original video I can't really see any custom logic you might have used there. I also noticed the "first-person controller" component enabled in the video captured in the editor and that's what's confusing me. Have you considered experimenting with different cameras? You could place a player dummy in the scene and set it as the "main player" then deactivate all others (including "first-person controller") and initiate the runtime again to see what changes. Link to comment
Ben_93 Posted October 17, 2023 Author Share Posted October 17, 2023 I had a play around with copying the first person component to a player dummy (but couldnt get it working for me to move the dummy camera around at runtime to test) although for some reason this has broken something else and when trying to run the scene doesnt load at all when using the first person controller... haha this isnt going to plan! Attached is another video... Ben 2023-10-17 23-02-49.mkv Link to comment
bmyagkov Posted October 18, 2023 Share Posted October 18, 2023 4 hours ago, Ben_93 said: I had a play around with copying the first person component to a player dummy (but couldnt get it working for me to move the dummy camera around at runtime to test) although for some reason this has broken something else and when trying to run the scene doesnt load at all when using the first person controller... haha this isnt going to plan! Attached is another video... Please attempt to use the "Player Spectator" camera instead and setup it in the same way as demonstrated in the attached image. Make sure that the "first_player_controller" is completely turned off. Thanks! Link to comment
Ben_93 Posted October 18, 2023 Author Share Posted October 18, 2023 Okay, that works - the player spectator camera as main player runs well at runtime, no issues. However I still need to use the first_person_controller at runtime, is there a solution to get it working as usual? Or would it work adding the first_person_controller as a component of the player spectator camera? Many thanks, Ben Link to comment
bmyagkov Posted October 18, 2023 Share Posted October 18, 2023 Hello! 2 hours ago, Ben_93 said: Okay, that works - the player spectator camera as main player runs well at runtime, no issues. However I still need to use the first_person_controller at runtime, is there a solution to get it working as usual? Or would it work adding the first_person_controller as a component of the player spectator camera? Well, at least now we know the exact root cause of the issue :) Unfortunately, since the problem is directly related to the code there is no specific advice we can provide to prevent such behavior. However, upon closer examination of the project I believe there may be room for improvement within the current game logic. It would be greatly appreciated if you could share a simple sample scene or the entire project with us to be able reproduce the issue on our side. You can upload your project to our FTP server (where only our team can access it) or use any other file-hosting service and provide us with a link to the archive via private message. Our FTP server credentials: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Thanks! Link to comment
Ben_93 Posted October 18, 2023 Author Share Posted October 18, 2023 That's strange that this problem is code related as I have done nothing intentionally, its just the first_person_controller out of the box.. But yes I am happy to share my project with you, whats the easiest way to package up to send it? I appreciate your assistance with this! Many thanks, Ben Link to comment
bmyagkov Posted October 19, 2023 Share Posted October 19, 2023 Hello! 9 hours ago, Ben_93 said: That's strange that this problem is code related as I have done nothing intentionally, its just the first_person_controller out of the box.. It's understandable but the 'first_person_controller' component is also written by humans and may have some issues that are reproduced only within specific circumstances like in your case. 9 hours ago, Ben_93 said: But yes I am happy to share my project with you, whats the easiest way to package up to send it? Just zip it using any method or application you prefer. You can also split the archive into several parts for easier downloading. Thanks! 1 Link to comment
Recommended Posts