I'm playing Diablo 3.
I wrote a script keep checking the skill cooldown status and auto cast when out of cooldown
I used Gdip_BitmapFromHWND(hwnd), Gdip_CreateBitmapFromFile(imagefile)
Gdip_ImageSearch() to accomplish this purpose.
However I found a really big side effect, the game framerate will drop from 60 to 4X and even 2X sometimes
I dont use imagesearch because a 3rd party tool used for diablo 3 is banned direct screen capture
a great performance hit when using Gdip_BitmapFromHWND(hwnd)
Re: a great performance hit when using Gdip_BitmapFromHWND(hwnd)
When on CD it will not be the castable color.
Have Fun
Re: a great performance hit when using Gdip_BitmapFromHWND(hwnd)
the performance hit is coming from gdip_bitmapfromhwnd
For my testing, even not execute the gdip_imagesearch, fps still drop
Even in pixelcolor search, it still required to get whole game screen bitmap using gdip lib
For my testing, even not execute the gdip_imagesearch, fps still drop
Even in pixelcolor search, it still required to get whole game screen bitmap using gdip lib
Re: a great performance hit when using Gdip_BitmapFromHWND(hwnd)
with using gdip_bitmapfromhwnd, i cannot capture selected area instead of a whole screen
Re: a great performance hit when using Gdip_BitmapFromHWND(hwnd)
Hint: DONT use GDIP i shown an easy solution that is beyond fast enough for D3.
GL
GL
Re: a great performance hit when using Gdip_BitmapFromHWND(hwnd)
what is GL ? pls provide more infomation
Re: a great performance hit when using Gdip_BitmapFromHWND(hwnd)
Uninstall internet "pls"
-
- Posts: 5
- Joined: 09 Mar 2019, 07:56
Re: a great performance hit when using Gdip_BitmapFromHWND(hwnd)
@Xtra for some reason I get a huge performance hit using pixelsearch/pixelgetcolor with D3. On the other hand, using Gdi+ doesn't affect the game's performance at all.
Re: a great performance hit when using Gdip_BitmapFromHWND(hwnd)
It could be with how you are using it. If you are running a loop with no sleep just about anything will cause a game to lag.ssjkakaroto wrote: ↑03 Nov 2019, 11:19@Xtra for some reason I get a huge performance hit using pixelsearch/pixelgetcolor with D3. On the other hand, using Gdi+ doesn't affect the game's performance at all.
Its been awhile but i remember no issues with using settimer running 50ms intervals (20x a second)
Without more context with how you setup your script its just a guess at best.
If you got GDI+ to work well for you why not share with the OP what you did?
-
- Posts: 5
- Joined: 09 Mar 2019, 07:56
Re: a great performance hit when using Gdip_BitmapFromHWND(hwnd)
I tried it with many sleep values, only at 1000 I could get it back to ~50 fps. I don't know why pixelsearch was so slow here.
My GDI+ script was actually suggested by OP on another forum, he just didn't update it here. With it the game runs steadily at 60 fps (vsync on).
I used an alternative Gdip_BitmapFromHWND and the result I used with Gdip_ImageSearch:
My GDI+ script was actually suggested by OP on another forum, he just didn't update it here. With it the game runs steadily at 60 fps (vsync on).
I used an alternative Gdip_BitmapFromHWND and the result I used with Gdip_ImageSearch:
Code: Select all
Gdip_BitmapFromHWNDCropped(hwnd, Screen) {
Raster := ""
Ptr := A_PtrSize ? "UPtr" : "UInt"
hhdc := GetDCEx(hwnd, 3)
S := StrSplit(Screen, "|")
_x := S[1], _y := S[2], _w := S[3], _h := S[4]
chdc := CreateCompatibleDC(), hbm := CreateDIBSection(_w, _h, chdc)
obm := SelectObject(chdc, hbm), hhdc := hhdc ? hhdc : GetDC()
BitBlt(chdc, 0, 0, _w, _h, hhdc, _x, _y, Raster)
ReleaseDC(hhdc)
pBitmap := Gdip_CreateBitmapFromHBITMAP(hbm)
SelectObject(chdc, obm), DeleteObject(hbm), DeleteDC(hhdc), DeleteDC(chdc)
return pBitmap
}
Code: Select all
bmpHaystack := Gdip_BitmapFromHWNDCropped(d3hwnd, _x "|" _y "|" _w "|" _h)
sready := Gdip_ImageSearch(bmpHaystack,vengeanceNeedle,LIST,0,0,0,0,0,0xFFFFFF,1,0)
if (sready == 1) {
Send %Key3%
}
sready := Gdip_ImageSearch(bmpHaystack,companionNeedle,LIST,0,0,0,0,0,0xFFFFFF,1,0)
if (sready == 1) {
Send %Key4%
}
Gdip_DisposeImage(bmpHaystack)
Who is online
Users browsing this forum: BernardDwess and 43 guests