libTAS icon indicating copy to clipboard operation
libTAS copied to clipboard

Please make it possible for us to TAS virtual box!

Open happymimimix opened this issue 1 year ago • 12 comments

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!

happymimimix avatar Nov 08 '24 13:11 happymimimix

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).

InfoTeddy avatar Nov 08 '24 16:11 InfoTeddy

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.

happymimimix avatar Nov 09 '24 01:11 happymimimix

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.

LukeSaward avatar Nov 09 '24 02:11 LukeSaward

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.

happymimimix avatar Nov 09 '24 02:11 happymimimix

It's not that simple.

InfamousKnight avatar Nov 09 '24 04:11 InfamousKnight

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).

CasualPokePlayer avatar Nov 11 '24 19:11 CasualPokePlayer

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.

happymimimix avatar Nov 11 '24 19:11 happymimimix

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.

CasualPokePlayer avatar Nov 11 '24 20:11 CasualPokePlayer

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.

happymimimix avatar Nov 12 '24 05:11 happymimimix

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)

CasualPokePlayer avatar Nov 12 '24 06:11 CasualPokePlayer

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?

happymimimix avatar Nov 12 '24 10:11 happymimimix

If you want to tas modern windows games, you can try one core api. It's a capability layer for windows xp. Pcem can run windows xp. It's not a vm either.

I haven't saw anyone try this yet. I still need to buy a new laptop or something before I can do it myself..

InfamousKnight avatar Feb 23 '25 17:02 InfamousKnight