clementgallet / libTAS

GNU/Linux software to (hopefully) give TAS tools to games
GNU General Public License v3.0
499 stars 57 forks source link

Please make it possible for us to TAS virtual box! #625

Open happymimimix opened 3 weeks ago

happymimimix commented 3 weeks ago

I wonder if TASing virtual box or vmware workstation would be possible in libTAS someday? If that could be done, we can then TAS ANY game on ANY operating system!

InfoTeddy commented 3 weeks ago

libTAS already supports PCem using a deterministic fork of the emulator. The main problem with VirtualBox, VMware, etc. is ensuring it runs deterministically.

If that could be done, we can then TAS ANY game on ANY operating system!

There would still be many games that either wouldn't work in a virtual machine or actively fights against being virtualized (e.g. Valorant).

happymimimix commented 3 weeks ago

libTAS already supports PCem using a deterministic fork of the emulator. The main problem with VirtualBox, VMware, etc. is ensuring it runs deterministically.

If that could be done, we can then TAS ANY game on ANY operating system!

There would still be many games that either wouldn't work in a virtual machine or actively fights against being virtualized (e.g. Valorant).

I don't think PCem can emulate Windows 10 and PCem is extremely hell slow when itself is running in a virtualized environment. (aka nesting virtual machines) If I use virtual box, the performance of the first layer of virtual machine would be almost the same as bare metal, and the second layer, although a lot slower, would still run at an acceptable speed. There's not much I can do if we run Windows in PCem in Linux Mint in Vmware Workstation in Windows. But if I use virtual box, I can install Windows 10 or even Windows 11, and OMG I can still play minecraft at about 30 FPS in Windows 10 in Linux Mint in Windows 10! Can PCem do that? I don't even think PCem can run Windows at an acceptable speed even when running on bare metal.

For games that refuses to run in a virtualized environment, it would fail already when I run it in Linux in Vmware Workstation in Windows. So I don't really care about that.

LukeSaward1 commented 3 weeks ago

Yeah good luck with actually getting that to work. The TAS would most likely desync before you even boot into windows (and there would be no way TASVideos or any other medium for that matter would accept a virtual machine and translation layer sandwich. At least with pcem it's deterministic—with anything else, you've got no chance.

happymimimix commented 3 weeks ago

Yeah good luck with actually getting that to work. The TAS would most likely desync before you even boot into windows (and there would be no way TASVideos or any other medium for that matter would accept a virtual machine and translation layer sandwich. At least with pcem it's deterministic—with anything else, you've got no chance.

Virtual box is open sourced, so how about making a virtual box TAS mod? Make the CPU fixed to a very specific clock speed so there will be no desyncs when system boots. The frame rate of the monitor will always follow the clock speed of the CPU. Then we can TAS games in virtual box.

InfamousKnight commented 3 weeks ago

It's not that simple.

CasualPokePlayer commented 2 weeks ago

VirtualBox makes a VM. This fundementally is incompatible with how libTAS works. "Ensuring it runs deterministically" is not really the issue per se, it's just you cannot hook a VM here like you can with an application (if you could hook anything, it's just the VirtualBox GUI maybe, not the VM itself). There's no magic settings you can do to fix this, the only way to do this is to not be a VM (e.g. an emulator like PCem, which does not operate under the same manner, and of course it's limited to emulating early computers for obvious reasons, or just having the game be a native Linux game, heck even Wine would have a remotely better chance than a VM).

happymimimix commented 2 weeks ago

VirtualBox makes a VM. This fundementally is incompatible with how libTAS works. "Ensuring it runs deterministically" is not really the issue per se, it's just you cannot hook a VM here like you can with an application (if you could hook anything, it's just the VirtualBox GUI maybe, not the VM itself). There's no magic settings you can do to fix this, the only way to do this is to not be a VM (e.g. an emulator like PCem, which does not operate under the same manner, and of course it's limited to emulating early computers for obvious reasons, or just having the game be a native Linux game, heck even Wine would have a remotely better chance than a VM).

What do you think of my idea of modding virtual box? @CasualPokePlayer

Yeah good luck with actually getting that to work. The TAS would most likely desync before you even boot into windows (and there would be no way TASVideos or any other medium for that matter would accept a virtual machine and translation layer sandwich. At least with pcem it's deterministic—with anything else, you've got no chance.

Virtual box is open sourced, so how about making a virtual box TAS mod? Make the CPU fixed to a very specific clock speed so there will be no desyncs when system boots. The frame rate of the monitor will always follow the clock speed of the CPU. Then we can TAS games in virtual box.

CasualPokePlayer commented 2 weeks ago

It doesn't work fundementally again, regardless of it's being libTAS or a VirtualBox mod. There is no magic way to TAS a VM no matter what you do, due to how it fundementally works.

If you want to use a VM to TAS games, you're free to use any Linux VM (like WSL2) to use libTAS against native Linux games.

happymimimix commented 2 weeks ago

It doesn't work fundementally again, regardless of it's being libTAS or a VirtualBox mod. There is no magic way to TAS a VM no matter what you do, due to how it fundementally works.

If you want to use a VM to TAS games, you're free to use any Linux VM (like WSL2) to use libTAS against native Linux games.

But I want to TAS windows games. Is it possible to make a libTAS that runs natively on windows? Wine sucks, barely any game runs well on it. Especially some of the new games that needs DirectX 12. I also tried hourglass, but it only works with extremely ancient games that used directx 9.0 or below. If the game used a later version of directX, or Open GL, or GDI Plus, it will simply just crash!

Even if I have the source code of a windows game, it would still be extremely difficult to port it to Linux. Especially if it used directX and GDI.

I don't even think a direct equivalence to GDI even exists on Linux.

CasualPokePlayer commented 2 weeks ago

Is it possible to make a libTAS that runs natively on windows?

That is what Hourglass is. You can blame Windows for why it is as bad as it is and why it is abandoned.

But I want to TAS windows games.

If the game is Unity or GameMaker game, there is a chance you could self port it. Otherwise, there generally is just nothing you can actually do here (unless you're willing to go through extremely difficult technical routes yourself, like game specific tooling)

happymimimix commented 2 weeks ago

Is it possible to make a libTAS that runs natively on windows?

That is what Hourglass is. You can blame Windows for why it is as bad as it is and why it is abandoned.

But I want to TAS windows games.

If the game is Unity or GameMaker game, there is a chance you could self port it. Otherwise, there generally is just nothing you can actually do here (unless you're willing to go through extremely difficult technical routes yourself, like game specific tooling)

Is that possible for Game Maker 8.1?