-
Notifications
You must be signed in to change notification settings - Fork 8
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
A.I.M.: Artificial Intelligence Machines - world map is heavy on performance #76
Comments
Not sure the immediate cause of this issue as the framerate drops even when CopyRects is disabled. It is probably due to the many queue syncs caused by calling LockRect a whole bunch. Not sure if this can easily be fixed without refactoring d3d9 a bunch. |
@Kritzmensch can you confirm that the issue doesn't occur if the game is run on Windows with Microsoft D3D8? Or is it just apitrace where it's fast? |
It does occur, but it's not nearly as taxing as with anything else, including D8VK, that I've tested so far. Although the drop isn't visible (at least on 1080p and lower) without uncapping and monitoring FPS, the overhead is still rather high on pure Windows, too (~45 frames on my setup; though perhaps that's the way the game works and it's the best result that can be hoped in the end). AIM.v1.06.Windows.AMD.d3d8.mp4 |
@Kritzmensch Can you please retest with latest main? There have been some changes done to buffer allocation which might have fixed these performance issues. |
Just built the latest commit, the game slows down to a crawl on the map screen. Intel Core i5-7400, Intel HD Graphics 630, Mesa 23.0.2. The game is patched to version 1.04 + 1.06 No-CD. Menus in general significantly tank performance, and the game seems to constantly hitch when you're on the move, even in the areas that you've been before. It's... not exactly a technological masterpiece. (Although the map didn't tank performance that hard, even on a much weaker Windows configuration.) |
@GranMinigun Thank you for retesting.
Does setting |
Doesn't seem to, no. |
@WinterSnowfall Unfortunately I have to confirm @GranMinigun's earlier findings. There's no FPS increase. |
No worries and thanks again for retesting. We'll keep this on the burner then and hopefully sort it at a later date. |
I'm not familiar with either D3D or Vulkan, but some observations, just in case: The number of queue syncs always stays at zero, but the numbers of queue submissions, barriers, and CS chunks considerably increase in menus, and jump drastically at the map screen, skyrocketing frametimes up to 300+ ms on my machine. The game also performs a lot of render passes (around 150, double that on map), but with a relatively digestible number of draw calls (usually less than 1200, much less in menus). Numbers fluctuate a bit. D8VK built from commit 4a7c627.
|
Not related to this specific issue but I've noticed a significant drop in average FPS over last few months with D8VK when compared to d3d8to9+DXVK combination. There are many areas in the first game where FPS will always drastically drop for me, all seemingly where there is a lot of foliage around (and particle effects in case of Clan Wars). One of the worst locations is a southern shore of the lake near raw materials base in Tundra Sector. Start from somewhere in the middle of the northern part of the lake and start moving southwards without deviating from the course (coords: x13670 y8100, marked with the red circle on map). You should experience a steady decline in frame rate while approaching. @GranMinigun can you check if same happens on you setup too? Observations I've made:
|
My iGPU suffers greatly from alpha-blending overdraw in general, and it's not unique to this game or DXVK. There's a field of dry grass west of Climate Activator in the Hills Sector, which seems to hit even harder. In other news, the map screen doesn't tank performance into single digits on my setup any more (still slows down). |
Did you try to compare D8VK against d3d8to9+DXVK, was there any noticeable perf. diff. on your setup as well? If I remember correctly the gap used to be much narrower at the start of the year in my case.
I guess that might explain why particles also decrease FPS so drastically.
I removed foliage models from all terrain materials and it indeed is the cause for the abysmal frame rate. Game runs unbelievably smoothly without them.
Funnily enough, for me it's the other way around. It's not single-digit of course, but the frame rate has degraded by some 50 frames in map view (from around 100 FPS, or a bit less, at 1080p seen in the video above). |
d3d8to9 with the current DXVK release crashes on first attempt to render water, then doesn't draw it at all in subsequent launches. But yes, I too observe that performance difference, although much less extreme likely due to weaker hardware.
Reverse the game, rewrite the renderer. I don't think the developers would mind that. ;) Or, as an option, see if there's a way to replace alpha blending with masked alpha. |
Thank you for testing!
Honestly, no kidding, that is something I might just look into at some point in the future, even if it takes 10 or more years to get on par with the original binaries (considering how long, or fast, it approx. took to RE original binaries of RenderWare engine, 3D GTAs and Morrowind and then rewrite them as librw and re3, and OpenMW). The interest is certainly there.
Spline, the lead dev, does indeed seem chill on that regard. He's even given some small hints/clarifications about the code and inner workings of the engine. The current IP owners, however, would probably have something to say about that unless the clean way is used. But that's a topic for another time to avoid going too off-topic of the opened issue.
Possibly. I know M2 has [non-specular] uses for masks in some places, maybe M1 as well with correct configuration. There's also the way of disabling transparency selectively for commonly occurring spammy textures, including particle effects, entirely in the game's database. It would, of course, have a downside of looking ugly but it would still be a viable way to have higher FPS with foliage for those who're seeking it. |
It's most likely not. If I had to guess it might be the game is one of the few impacted by our D3DPOOL_MANAGED workaround. At some point I think we'll devise a better system to handle games that read from WRITE_ONLY buffers, but for now it's the best compromise we could come up with and unfortunately other games (which ironically behave properly) are expected to take a hit on performance. Try running it with |
Getting better performance with that setting. If the game misbehaves, would it crash or just show graphical artefacts? Not seeing anything weird in a brief flythrough.
I thought Dust, one of the original devs, bought out the rights from 1C? But sure, if you don't want to derail the ticket even further. |
The game won't misbehave with this setting, because we're doing what it asks of us in the first place (with it set to false). The underlying problem is that apparently a lot of d3d8 games read back from DEFAULT resources on the CPU, which tanks performance severely when it happens - these situations are what we're currently mitigating with MANAGED buffer placement. But having an extra local copy around can cause performance regressions with other well behaved games, which seems to be the case here as well. Since the number of games that have been observed to be negatively affected keeps growing, I'll raise an issue to track this problem and hopefully come up with a better solution once d8vk is merged upstream. Feel free to use the above config option for now. |
You're right. Frame rate is of course sometimes higher, sometimes lower, between different sessions making it more difficult to compare the two but it seems to be on par with D8VK+d3d8to9 when this setting is disabled.
Since you're using
I don't remember the whole story behind it, I'll have to recheck, but I remember he got the right/license to use A.I.M./Механоиды name again and [some?] assets. I doubt he actually owns them again. The original trilogy (A.I.M., A.I.M. 2: Clan Wars and A.I.M.: Racing) are, however, still property of 1C.
Scratch the last part. Frame rate doesn't drop half of the times when a lot of spammy particles are spawned at once. And when it does drop it doesn't seem to be affected by whether I'm using d3d8to9+DXVK or |
Apart from what Alpyne mentioned at the start (the game abusing LockRect), it could be spamming a lot of ProcessVertices calls at times, which is also known to pose a performance problem with d8vk/dxvk. Unfortunately, there's no way to address that at the moment and as luck would have it older games are more likely to exhibit this behavior, since on hardware at the time it wasn't all that expensive (and done on the CPU). |
@GranMinigun I see the person who opened this issue is gone, but can you perhaps retest this on dxvk 2.4 and let us know if it's still a problem? If so, please also try setting |
Same hardware as before, Linux 6.nice.8, Mesa 24.1.3, freshly built DXVK 2.4. The map screen used to plummet framerate into a single digit a long time ago, but at some point that improved - 20~30 FPS, not sure whether that's DXVK or Mesa improvements, or something else.
DXVK HUD suggests that queue and CS syncs take a lot of time, and this is the only place where I see these values being non-zero, if that helps. |
Setting |
Frame rate drops significantly when viewing world map.
For comparison, both WineD3D and d3d8to9 + DXVK have similar results. FPS drops also on MS Windows with D8VK in combination with AMD proprietary drivers. However, on Windows without D8VK there's virtually no FPS loss at all.
d3d8-map-fps2.mp4
Software information
A.I.M.: Artificial Intelligence Machines, versions 1.00 to 1.06
System information
Apitrace file(s)
Log files
The text was updated successfully, but these errors were encountered: