![]() ![]() Run_afap makes the game think it runs with the specified FPS i. if the factor is 0.5 the game runs at half the speed. Set_speed adjusts the perceived time by the given factor. The time perceived by the game can be adjusted with the methods t_speed(double factor) and n_afap(double fps). Then the back buffer is copied into a shared memory space in order to be returned by GameInterface.step. The this releases the lock until wglSwapBuffers is called again. If one wants to advance the game for one step and retrieve the next frame GameInterface.step can be called from python. The wglSwapBuffers hook first locks the games execution. ![]() The function wglSwapBuffers is called every time the game finishes rendering a frame in order to swap the back and front buffer. This DLL hooks into the OpenGL function wglSwapBuffers as well as the system calls timeGetTime, GetTickCount, GetTickCount64, and RtlQueryPerformanceCounter. To do so, the library injects a DLL into the game's process. Secondly, it intercepts the system calls used to get the system time such that the game can be run at a desired speed. This library serves two functions:įirstly, it efficiently retrieves the frames and sends them to the python process. In order to efficiently train the agent, a C++ library was written.
0 Comments
Leave a Reply. |