Open piggeywig2000 opened 6 years ago
Ya, it's normal for there to be lag. But there are a few things you can do to increase the speed. The first thing to do is turn off the sound. Then you can also disable any unnecessary text printing to the console. I think I left some code in there that prints out unknown objects, and whenever it tries to print things every frame it causes serious lag. The last thing I always did was turn off the video output so the screen was just black and let the script run.
You can also search on the emulators website (tasvideos.org) for more information on how to increase the frame rate, and I am sure there are other things you can do. But this emulator is pretty much going to have lag problems. Don't forget that these games all run on one thread, so you are always going to be limited to how fast one thread on your computer can run.
If you are really ambitious you can check out the emulator called mupen64plus. It runs on linux and it has a command line option (--nospeedlimit) that basically limits the frame rate to the clock speed of your computers CPU (with video, but without sound). When I tested this it was lightning fast. So fast that it could complete a whole race in about 13 seconds. The problem with this emulator is that there is no API for scripting in place. So there is no way to read game data and send controller input into the game like you can with the BizHawk emulator, which has a really nice API. It looks like one person at one point had made a patch to allow for it, but it was a long time ago and there was no support for it. So if this is something you want to do then you will have to pretty much engineer it yourself, and it would probably be a good idea to work with the developers so they could help you figure it out. I am pretty sure they are still actively working on it so it wouldn't hurt to send them a message. But if you can get over this hurdle then you can write scripts in Python or even C++, or whatever language you want, to play games and it would be incredibly fast.
Anyway, hope this helps.
Is it normal for scripts like these to generate lots of lag? My game runs at roughly 15fps while it's running. Is it just me, or is this kind of thing normal and nothing can be done?