wraitii Posted February 8 Report Share Posted February 8 @real_tabasco_sauceCan you post the commands.txt of the 4v4 you posted on the ticket ? 1 Quote Link to comment Share on other sites More sharing options...
Atrik Posted February 8 Report Share Posted February 8 On 06/02/2025 at 7:11 PM, real_tabasco_sauce said: I recommend doing combat demo huge without the petra AI. It helps to have that variable out of the picture. Same for profiling. For having used profiler regularly for the past week, I can see absolutely 0 pattern. It can be ANY of the task that suddenly slow the game unreasonably. When it's no GC, it's state hash check, when it's not state hashcheck it's sim update, when it's not sim update, it's gui sim update. Any of them can decide to take sometimes 100+ms in a single frame. Of course it's probably linked to what's going on in game you are playing but this still hints something that isn't specific to any task in particular. Quote Link to comment Share on other sites More sharing options...
wraitii Posted February 8 Report Share Posted February 8 From what I can tell, there's a few things: Vulkan rendering makes the game have much higher FPS on average, so the simulation ticks, which happen every 200ms, are much more noticeable. This is especially true on e.g. Combat-Demo-Huge. Full state hash checks happen every 20 simulation turns (so every 4 seconds) and are quite slow. I'm not sure it's a new problem - could be exacerbated by happening every 4 seconds since this commit, but I'm pretty sure that was in A26 as well. I haven't noticed anything obvious when profiling a few things. It's possible it's also the smoother rendering making it more obvious ? Shrinking GCs happen every 500 simulation turns, so about every minute and a half. These can cause a lag spike. Pathfinder can still lead to some very slow simulation ticks on occasion. The sim itself might have some rare cases where some turns take extra-long, like when a player is defeated. The GUI is also occasionally slow, notably when selecting a lot of units. 3 Quote Link to comment Share on other sites More sharing options...
Atrik Posted February 8 Report Share Posted February 8 @wraitii Probably stupid idea/question but why isn't it possible to have a kind of proxy function in the engine to execute some of the gui functions, asynchronously while a fully asynchron gui sim is not developed? Quote Link to comment Share on other sites More sharing options...
Stan` Posted February 8 Report Share Posted February 8 2 hours ago, Atrik said: @wraitii Probably stupid idea/question but why isn't it possible to have a kind of proxy function in the engine to execute some of the gui functions, asynchronously while a fully asynchron gui sim is not developed? In our case asynchronously, would still be on the same thread. We discussed this with @phosit and @bb_ Node has the same issue. What we actually need to do is run the GUI code in another thread completely. But the main issue with selecting units is that it sends a lot of data. Like basically everything we know about these units. EDIT: See https://code.wildfiregames.com/D1618 1 Quote Link to comment Share on other sites More sharing options...
Atrik Posted February 8 Report Share Posted February 8 1 hour ago, Stan` said: But the main issue with selecting units is that it sends a lot of data. Like basically everything we know about these units. EDIT: See https://code.wildfiregames.com/D1618 I might even want to try to do it but : is it possible to make the selection more smooth with async js? Like would it even be possible to load minimal entity datas (maybe even without using getEntityState / using a alternative), THEN load entity datas next frame(s)? I can think of using mouse over event handler to load tooltip datas, but i guess the performance gain aren't worth pursuing, all the datas would be loaded on later frames? Quote Link to comment Share on other sites More sharing options...
Stan` Posted February 8 Report Share Posted February 8 4 minutes ago, Atrik said: 1 hour ago, Stan` said: I might even want to try to do it but : is it possible to make the selection more smooth with async js? Like would it even be possible to load minimal entity datas (maybe even without using getEntityState / using a alternative), THEN load entity datas next frame(s)? I can think of using mouse over event handler to load tooltip datas, but i guess the performance gain aren't worth pursuing, all the datas would be loaded on later frames? You can try js promises that were added in A27 but as I said it's the same thread so it still gonna wait after everything in the thread is done You still need to load all the datas for whatever you have selected. 1 Quote Link to comment Share on other sites More sharing options...
Atrik Posted February 8 Report Share Posted February 8 11 minutes ago, Stan` said: You can try js promises that were added in A27 but as I said it's the same thread so it still gonna wait after everything in the thread is done You still need to load all the datas for whatever you have selected. Yes I know... But that's why I was kinda asking if there is a way to make sure this will actually have a "smoothing" effect. Even if you call some async js function, will it still run it within the same frame (and therefor being totally useless)? Iirc tested it 2 days ago with a dummy 'lag' function. And calling it, was still blocking the frame until completion even if it was an async function. Quote Link to comment Share on other sites More sharing options...
Stan` Posted February 8 Report Share Posted February 8 1 hour ago, Atrik said: Yes I know... But that's why I was kinda asking if there is a way to make sure this will actually have a "smoothing" effect. Even if you call some async js function, will it still run it within the same frame (and therefor being totally useless)? Iirc tested it 2 days ago with a dummy 'lag' function. And calling it, was still blocking the frame until completion even if it was an async function. Yeah async is not a magical bullet It only works if you have threads, if you don't, might as well call it synchronously. 1 Quote Link to comment Share on other sites More sharing options...
Atrik Posted February 8 Report Share Posted February 8 Side note on performance, players who have the issue, have good results leaving/rejoining a game. So something else that seems to hints to it not being just un-optimized tasks. Quote Link to comment Share on other sites More sharing options...
Seleucids Posted February 9 Report Share Posted February 9 (edited) Here is something interesting: on extremely OP hardware, the game interface is able to run without lag. So it is not impossible to run the game smoothly, you just need to upgrade your hardware. This is the system usage during a huge fight: The frame rate was between 50fps-80fps. I am using Vulkan + GPU skinning. The operating system is Windows 11 with Atlas OS playbook. On i7-14700, 19% usage means a whole core has been consumed by 0ad. But the detailed load distribution is yet to be seen. (task manager is rubbish) The simulation still lags, but GUI level stutters didn't exist. When other players with weaker hardware are lagging, I just see the units standing stationary and repeating the same animation without the game actually progressing. Tomorrow I will try to install Linux on the same hardware and see if there is a performance difference. It is worth mentioning that in general, boosted Arch kernels allow you to achieve higher average frame rates than any Windows based OS. Edited February 9 by Seleucids Quote Link to comment Share on other sites More sharing options...
Seleucids Posted February 9 Report Share Posted February 9 Another weird discovery: The gameplay only uses 35% of my GPU but the lobby uses 90%. Quote Link to comment Share on other sites More sharing options...
wowgetoffyourcellphone Posted February 9 Report Share Posted February 9 OpenGL Vulkan Quote Link to comment Share on other sites More sharing options...
wowgetoffyourcellphone Posted February 9 Report Share Posted February 9 I lose this one, lol: I try some kind of flanking thing. Need to perfect it better. Quote Link to comment Share on other sites More sharing options...
Stan` Posted February 9 Report Share Posted February 9 @Seleucids Do you by any chance have tweaked the fps cap option ? Quote Link to comment Share on other sites More sharing options...
Seleucids Posted February 9 Report Share Posted February 9 4 hours ago, Stan` said: Do you by any chance have tweaked the fps cap option ? I increased both fps throttling to the maximum: Quote Link to comment Share on other sites More sharing options...
Stan` Posted February 9 Report Share Posted February 9 2 hours ago, Seleucids said: I increased both fps throttling to the maximum: Then it sort of makes sense. The GUI is probably completely GPU bound, which means the game has nothing to do except requesting more frames. In the game though, You're probably being CPU bound, so the game is waiting for the data to send to your GPU. Note that if you are using VSYNC it will cap the fps at your monitor's refresh rate. Quote Link to comment Share on other sites More sharing options...
real_tabasco_sauce Posted February 9 Report Share Posted February 9 commands.txt Here is the replay I used to profile the issue. 1 Quote Link to comment Share on other sites More sharing options...
real_tabasco_sauce Posted February 9 Report Share Posted February 9 On 05/02/2025 at 11:21 AM, real_tabasco_sauce said: Could we schedule a "fast PC" TG for this weekend? I expect that those with really slow computers or adversely affected setups like @Meister are slowing turns for everyone, leading to many reports from players that otherwise have good performance. However, I have never really tried to verify this is the case. If we get a 4v4 where everyone has ideally >20 fps (min) in combat demo huge (found in scenarios -> demo maps -> combat demo (huge)), we can make sure that this is really the cause. I'd like to do it on Sunday, maybe when we did the a27 RC test, 18:00 UTC. @MetaPhyZic @BreakfastBurrito_007 @Ginnungagap, and any others that have good performance in a27. Well, I suppose with the issue identified (maybe just one of the issues), we probably don't need to do this today. Its telling enough that it takes place, albeit to a lesser extent, even in the first minutes of some games when CPU load from simulation should be really low. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.