Project

General

Profile

Actions

Emulator Issues #11876

open

[Feature Request] Load game into RAM

Added by Anuskuss over 4 years ago. Updated 4 months ago.

Status:
New
Priority:
Low
Assignee:
-
% Done:

0%

Operating system:
N/A
Issue type:
Feature request
Milestone:
Regression:
No
Relates to usability:
No
Relates to performance:
No
Easy:
No
Relates to maintainability:
No
Regression start:
Fixed in:

Description

I store my images on a NAS and I have a big stutter everytime the Final Lap sound plays in Mario Kart Wii. I'm assuming this has something to do with network latency or because my drive fell asleep but this does not happen when I place the image on my SSD.
Anyway, I have plenty of RAM and would like to load the image asynchronously into memory. PPSSPP already allows me to do that and the games start instantly (so no need to copy them to my SSD/RAM disk beforehand) and it does actually help with load times.


Related issues 2 (0 open2 closed)

Has duplicate Emulator - Emulator Issues #11957: Feature request - Copy game to RAM upon startDuplicate

Actions
Has duplicate Emulator - Emulator Issues #12216: [Feature Request] Precache entire game into RAMDuplicate

Actions
Actions #1

Updated by JosJuice over 4 years ago

  • Priority changed from Normal to Low
  • Issue type changed from Bug to Feature request
Actions #2

Updated by Helios over 4 years ago

This isn't a bad idea for the use case of NAS streaming, but it's worth noting that for Dolphin, load times won't improve. We emulate pretty accurate disc drive speeds and timings, which is relevant for a few titles.

Actions #3

Updated by Anuskuss over 4 years ago

(OT) How many titles are we speaking? I, for myself, like to keep everything as close to the original experience as possible (1xres, no speedhacks, original Wiimote) but cutting down loading times would definitely be beneficial. Can this be turned into a setting, defaulting to "as fast as possible" (PPSSPP for example offers Fast, Host and Simulate delays) and only going the accurate path via a game specific INI setting for games that really need it?

Actions #4

Updated by JosJuice over 4 years ago

Actions #5

Updated by JosJuice over 3 years ago

Actions #6

Updated by danileon95 over 3 years ago

I noticed that in the latest duplicate this feature was called "useless" by a dev, again.

This is not useless. This would prevent stutter when loading games from external hard drivers.

When loading games from my unpowered USB 3.0 4 TB hard drive, there's a lot of microstutter that is simply not there when loading the game from an internal SSD. This HDD gives pretty good speed when copying stuff from it onto the laptop (constantly at around 100 MB/s) I'm not sure what the root cause of this is: Dolphin, Windows, or whatever. The point is that copying the game to RAM would be useful to prevent these kind of issues. It would also be useful for people who load ROMs from a network drive, etc. It's not an useless feature. It's just niche.

PS: If this feature is implemented eventually (I REALLY hope it is btw), maybe it would be good for it to have a warning about how this is not recommended if you have less than X GB of RAM for GameCube games, less than Y GB of RAM for Wii games, and less than Z GB of RAM for dual layer Wii games. 8 / 16 / 32 GB maybe?

Actions #7

Updated by Anuskuss over 3 years ago

Update from me as well: Since I've opened this issue I upgraded my NAS and it turns out that my previous setup was trash and I no longer have that "Final Lap" stutter. Would still be nice to have because it would free up the connection to my server after it's done transferring (server is also used for multimedia purposes).

I've written a little script back then that would do the copying to RAM automatically but the big downside is that it's synchronous and so you'd have to wait for a couple of seconds (38s for a 4.7GB Wii ISO at 1Gbit/s) before being able to play your game. I can post it here if you want @danileon95.

Actions #8

Updated by supertrianguloid 5 months ago

Made an account just to comment on this. I think this would be a really useful option for a lot of setups, i.e. loading over a network or over an external drive. @Anuskuss, Do you still have that script? Could you post it please?

Actions #9

Updated by Anuskuss 5 months ago

For Windows I used to place imdisk.exe and dolphin-helper.bat (see below) next to Dolphin.exe and point my emu frontend to it:

@echo off
pushd "%~dp0"

REM Launch Dolphin without arguments
if "%1"=="" Dolphin & popd & exit /b

REM Load game into RAM
powershell -c "Start-Process -FilePath imdisk -ArgumentList ('-a -s ' + (([System.Math]::Ceiling(%~z1 / 65536) + 4) * 65536) + ' -m R: -p ""/fs:fat /v:RAMDISK /q /y""') -Verb RunAs -Wait -WindowStyle Hidden; (New-Object -ComObject Shell.Application).NameSpace('R:').CopyHere(""""%~1"""")"

REM Launch Dolphin
powershell -c "Start-Process -FilePath Dolphin -ArgumentList ('-b -e """"' + """"R:\%~nx1"""" + '""""') -Wait"

REM Clean up
powershell -c "Start-Process -FilePath imdisk -ArgumentList '-D -m R:' -WindowStyle Hidden"
popd

Disclaimer: You'll have to wait until the whole file gets cached before Dolphin is launched.


Nowadays I'm on Linux so I just need vmtouch:

#!/bin/bash

vmtouch -dl "$1"
dolphin-emu -be "$1"
pkill vmtouch

Disclaimer: This can lead to performance problems (i.e. your game takes longer to load) depending on how slow your NAS is.

Actions #10

Updated by supertrianguloid 4 months ago

Ah that's great! I didn't know about vmtouch, thank you! I use retroarch, so I guess now I have to figure out how to get retroarch to call dolphin like that. Thank you!

Actions

Also available in: Atom PDF