07-19-2010, 04:39 AM
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
07-19-2010, 08:16 AM
hmhmhm...now I got up Snowpeak, and when I came out on top, out of the cave, my FPS went down to 23. Strangely, after the battle with the shadow suckers there, my FPS went to 30 again...I think the sky also clears up after the fight and the wind soothes down...
Having EFB scale at auto-fractional.
Just wanna point out that it's not exclusively Hyrule Field.
Having EFB scale at auto-fractional.
Just wanna point out that it's not exclusively Hyrule Field.
07-19-2010, 08:53 AM
I discovered something else, the Hyrule Field speedup hack does not work in single core mode. That means only those using dual core mode will see a speedup, the hack does not work at all in single core mode.
Perhaps this information will be of some use to the developers in some way. By the way, when will there be another patch, hopefully to add the option to the other plugins?
Perhaps this information will be of some use to the developers in some way. By the way, when will there be another patch, hopefully to add the option to the other plugins?
07-20-2010, 12:49 PM
Sorry I've been MIA, I got way sidetracked when digging into the dolphin code, and then had to deal with some school work...
It seems like some people have gotten back into discussing the cause of the slowdown, so i guess i'll give my 2 cents... I think it has something to do with how we handle textures. Basically, the game starts each in-game frame by going through the tedious process of drawing the minimap from scratch, which involves alot of vertices. Then it performs an EFB copy to Texture, meaning that this map is now stored somewhere in memory. Since the mini map is now available in memory, it makes no sense that the game redraws it again each frame. I believe that the game attempts to raise some sort of flag (To be used like a boolean variable) after drawing the minimap, but dolphin somehow misses or doesn't recognize it (The flag would also have to be lowered whenever the player moved to a different area, because a new map would need to be drawn). Since this flag never gets raised, the game believes it needs to redraw the map again and again, instead of accessing it from memory. The reason this would slow down hyrule field more than other areas is because of the great detail involved in drawing the giant hyrule field minimap (The fact that my hack works should support this statement).
If the failed "flag" was identified and fixed, then there would be a much greater increase in speed, that might even translate to other games...
Now I'm going to make it clear that my "missed flag" conjecture is merely speculation: I've noticed some odd behavior by the game (unnecessary map redrawing) and have proposed a possible explanation behind it. That said, i currently suspect that the BP Registers involved in Texture invalidation (Which dolphin ignores) may have something to do with the issue. I also think that the code implementing EFB Copy may be involved in some way...
Anyways, as far as the patch goes, I got way sidetracked and started looking for some way to identify the map texture directly as it is copied from the DVD, but i have failed so far, and i don't even know if it would increase speed at all. I'm going to go ahead and just brush that work aside and go back to writing the OpenGL and DX11 patches so that the patch can be committed. BTW, I was hoping to submit this patch for commit myself, does anyone know how i go about doing that (this is my first open source work).
It seems like some people have gotten back into discussing the cause of the slowdown, so i guess i'll give my 2 cents... I think it has something to do with how we handle textures. Basically, the game starts each in-game frame by going through the tedious process of drawing the minimap from scratch, which involves alot of vertices. Then it performs an EFB copy to Texture, meaning that this map is now stored somewhere in memory. Since the mini map is now available in memory, it makes no sense that the game redraws it again each frame. I believe that the game attempts to raise some sort of flag (To be used like a boolean variable) after drawing the minimap, but dolphin somehow misses or doesn't recognize it (The flag would also have to be lowered whenever the player moved to a different area, because a new map would need to be drawn). Since this flag never gets raised, the game believes it needs to redraw the map again and again, instead of accessing it from memory. The reason this would slow down hyrule field more than other areas is because of the great detail involved in drawing the giant hyrule field minimap (The fact that my hack works should support this statement).
If the failed "flag" was identified and fixed, then there would be a much greater increase in speed, that might even translate to other games...
Now I'm going to make it clear that my "missed flag" conjecture is merely speculation: I've noticed some odd behavior by the game (unnecessary map redrawing) and have proposed a possible explanation behind it. That said, i currently suspect that the BP Registers involved in Texture invalidation (Which dolphin ignores) may have something to do with the issue. I also think that the code implementing EFB Copy may be involved in some way...
Anyways, as far as the patch goes, I got way sidetracked and started looking for some way to identify the map texture directly as it is copied from the DVD, but i have failed so far, and i don't even know if it would increase speed at all. I'm going to go ahead and just brush that work aside and go back to writing the OpenGL and DX11 patches so that the patch can be committed. BTW, I was hoping to submit this patch for commit myself, does anyone know how i go about doing that (this is my first open source work).
07-20-2010, 12:57 PM
But what about earlier in the game? Hyrule Field SouthWest in ZTP (GC) runs full speed until Hyrule Field North is visited, after that anything Hyrule Field runs slow and gets progressively slower throughout the game.
Also, would changing the BPWrites from 150 to another value speed anything up? Even with the patch, the FPS fluctuates between 22 - 25 FPS, so it's not full speed yet. Is there also any idea why some users aren't experiencing any slowdowns at all in Hyrule Field other than the theory Kiesel-Stein mentioned?
There's also slowdowns in other games, but the ZTP Speed Hack doesn't affect slowdowns in other games, so there's room for optimizations elsewhere as well.
Also, would changing the BPWrites from 150 to another value speed anything up? Even with the patch, the FPS fluctuates between 22 - 25 FPS, so it's not full speed yet. Is there also any idea why some users aren't experiencing any slowdowns at all in Hyrule Field other than the theory Kiesel-Stein mentioned?
There's also slowdowns in other games, but the ZTP Speed Hack doesn't affect slowdowns in other games, so there's room for optimizations elsewhere as well.
07-20-2010, 01:32 PM
Xtreme, Is it possible to see if the entire minimap is drawn before the slowdown occurs? I'd imagine that before you step foot in the other provinces the sections of hyrule field in those provinces are not drawn. I do know that while anywhere in hyrule field later in the game the minimap is made up of sections from Eldin, Lanaryu, and faron provinces. If the whole minimap is drawn before a slowdown occurs, then that digs a major hole in my understanding of this problem...
As for the 150 value, changing that will only affect how the texture is found, not how the hack behaves after it is found (The texture is only found once during program execution). So changing it will not affect the speed of the game. The only reason for changing that value would be if the hack is not working at all at some point, because the texture is not being found. Monotone reported earlier that this was occuring for him at some point in the game, which means that it may be necessary to change this to a lower value (I might try around 100).
EDIT: I finished the Patch! OpenGL and DX11 now are working (At least according to my preliminary testing
) They got a Mondo boost on my system, to the point where they were running only a few FPS slower than DX9! I changed two other things too:
1) I changed the value discussed above from 150 to 100. This allowed the texture to be found while in the gerudo desert, which i don't think was possible before. Its possible that this may cause problems.
2)I changed the "ZTP texture found at address <memory location>" notification from INFO_LOG to WARN_LOG, so that it can now be seen without using the debugger (Go to view->Log window and make sure the verbosity is set to Warning). This is so the address is easier to see while testing. This value should Always be the same (At least it is for me, mine is 1124ee60, yours is probably something different), and if for some reason you get different values when loading from different areas, it means the value changed above should be returned to 150 (I have no idea what the hack will do if it identifies the wrong texture...).
Anywho, the patch has been attached and was made against r5925. I think its just about ready for a commit!
As for the 150 value, changing that will only affect how the texture is found, not how the hack behaves after it is found (The texture is only found once during program execution). So changing it will not affect the speed of the game. The only reason for changing that value would be if the hack is not working at all at some point, because the texture is not being found. Monotone reported earlier that this was occuring for him at some point in the game, which means that it may be necessary to change this to a lower value (I might try around 100).
EDIT: I finished the Patch! OpenGL and DX11 now are working (At least according to my preliminary testing
) They got a Mondo boost on my system, to the point where they were running only a few FPS slower than DX9! I changed two other things too:1) I changed the value discussed above from 150 to 100. This allowed the texture to be found while in the gerudo desert, which i don't think was possible before. Its possible that this may cause problems.
2)I changed the "ZTP texture found at address <memory location>" notification from INFO_LOG to WARN_LOG, so that it can now be seen without using the debugger (Go to view->Log window and make sure the verbosity is set to Warning). This is so the address is easier to see while testing. This value should Always be the same (At least it is for me, mine is 1124ee60, yours is probably something different), and if for some reason you get different values when loading from different areas, it means the value changed above should be returned to 150 (I have no idea what the hack will do if it identifies the wrong texture...).
Anywho, the patch has been attached and was made against r5925. I think its just about ready for a commit!
07-20-2010, 05:13 PM
you sure you mean the "minimap"? O_o I guess you mean the Hyrule Field with its textures and all, right? The minimap (in my understanding of the word) is only that thing on the left which only works right with EFB to RAM.
07-20-2010, 06:09 PM
I'm actually talking about the minimap, the one that is in grayscale when using EFB Copy to Texture! Basically the first thing done each frame is that a very small gray circle (16pixels X 16 pixels) is drawn over and over again (by setting it as the active texture and flushing loads and loads of vertices) in order to shape the current minimap (actually, this only shapes the background of the map). Once this is complete, the EFB is copied to some location in memory and cleared. Then the rest of the frame begins drawing, and at some point later, the map is drawn back to the frame as a texture in its proper place. Right after this things like the location indicator, etc. are drawn to the map.
My point is that while in Hyrule field, this map is being drawn exactly the same way at the beginning of each frame, and being stored in the exact same memory location, which doesnt seem like normal behavior to me (I assume the map is being drawn the same way, I have no idea how to check the individual vertex values). I know that this map drawing process takes a significant amount of time because my hack works, and it only acts by disabling some of the flushes that occur during this map drawing period.
I'm assuming that this process is close to as expensive on the actual Wii, which leads me to believe that the Zelda programmers wrote it expecting it to only occur in the first frame in a new area. So I believe that for some reason the test that the game performs in order to check whether or not the map needs to be redrawn again is not working with dolphin for whatever reason.
My point is that while in Hyrule field, this map is being drawn exactly the same way at the beginning of each frame, and being stored in the exact same memory location, which doesnt seem like normal behavior to me (I assume the map is being drawn the same way, I have no idea how to check the individual vertex values). I know that this map drawing process takes a significant amount of time because my hack works, and it only acts by disabling some of the flushes that occur during this map drawing period.
I'm assuming that this process is close to as expensive on the actual Wii, which leads me to believe that the Zelda programmers wrote it expecting it to only occur in the first frame in a new area. So I believe that for some reason the test that the game performs in order to check whether or not the map needs to be redrawn again is not working with dolphin for whatever reason.
07-20-2010, 06:54 PM
oh? maybe I understood it wrong all the time but until now it sounded to me like everyone was rather talking about the field itself with all its textures and geometry and not about the minimap. Would there be a way to let Dolphin kinda "skip" drawing the minimao altogether? Firstly that would proof if the minimap is the problem and secondly, I could well live without the minimap if I had full speed ^^
07-20-2010, 07:09 PM
Yea, i was a little confused about that too when first started getting involved with this problem... I think Keissel was refering to the minimap now that i have done my own research on the issue. I just confirmed via another method that in fact all the speed gained from my hack is definitely from changing how the vertices are flushed while drawing the minimap.
Yes i believe ("Believe", definitely not "know") that there is a way to signal the game to stop drawing the map each frame, i just dont know how
Finding the answer will involve figuring out how the Zelda programmers are checking whether or not drawing the minimap is necassary (again, assuming that this check is even happening).
Yes i believe ("Believe", definitely not "know") that there is a way to signal the game to stop drawing the map each frame, i just dont know how
Finding the answer will involve figuring out how the Zelda programmers are checking whether or not drawing the minimap is necassary (again, assuming that this check is even happening).