libretro / RetroArch

Cross-platform, sophisticated frontend for the libretro API. Licensed GPLv3.
http://www.libretro.com
GNU General Public License v3.0
10.05k stars 1.81k forks source link

Optimize browsing when using Load Content / File Browser #10823

Open gmgman opened 4 years ago

gmgman commented 4 years ago

Description

Would it be possible to add a shortcut in the File Browser, that leads you to the path of the last rom you launched (as seen in my image down below)?

RA_last_used_content_path

Theoretically it should be the path in the top rom of the content_history.lpl which is used in the Histroy Tab.

Alternatively, allow the user go back to the directory they launched the last rom from, when they hit "close content", pretty much like when you exit a game from the playlist, you automatically get back to the same playlist.

I prefer the latter but wouldn't mind the shortcut either. Maybe both ideas could be implemented?

Not everyone uses playlists. I have a pretty deep file structure for sorting my roms, e.g. lets say my file structure is like this: \rom collections\everdrive\megadrive\4 Hacks\Hacks A-Z\Streets of Rage Series and I wanted to try one rom after another in that last subdirectory, I'd have to navigate through 5 or 6 folders before I reach the roms. That's pretty tiresome and no fun.

Every Emulator on Windows remembers the file path the last rom was launched from, Snes9x did this on my Win98 computer back in 1999, why can't RA remember the path?

Please make this happen devs!

How the Last Used Content Directory short cut could be implemented

In the file browser there are already 3 short cuts, (Start Directory, Downloads, Playlists), which lead to a given path that is hardcoded and stored in the retroarch.cfg.

For the Last Used Content Directory short cut RA would need a dynamic path that is overwritten each time you launch a rom. As of now, upon launching a rom, the information for the rom, including the file path is being stored in content_history.lpl. My suggestion would be, to create an extra new temporary file in the same step as the content_histroy.lpl is being updated/created. This file could be named last_content_dir.tmp, and hold the path to the last lanuched rom. The Short Cut would read from this temp file instead of reading from the retroarch.cfg file. Upon quitting or restarting RA this file should be removed. If the file does not exist, RA should go to the Start Directory path when selecting the Last Used Content Directory short cut.

Alternatively, write the last used content dir path to the retroarch.cfg file. I'm not sure if this is parctial to edit the cfg file each time you launch a rom, probably not, hence I suggest a temp file...

Passingby1 commented 4 years ago

Every Emulator on Windows remembers the file path the last rom was launched from, Snes9x did this on my Win98 computer back in 1999, why can't RA remember the path?

Please make this happen devs!

I was just thinking this very same thing earlier today. RA needs this badly and not merely for the last used rom path, it is needed for the file browser itself so it covers the other platforms (Android etc.) not just Windows.

gmgman commented 4 years ago

Every Emulator on Windows remembers the file path the last rom was launched from, Snes9x did this on my Win98 computer back in 1999, why can't RA remember the path? Please make this happen devs!

I was just thinking this very same thing earlier today. RA needs this badly and not merely for the last used rom path, it is needed for the file browser itself so it covers the other platforms (Android etc.) not just Windows.

I'm not using RA on Windows, of course I want this to be implemented generally. I was just pointing out that my emulator from 20 years ago could do this and in 2020 RA cannot, which is pretty sad.

hizzlekizzle commented 4 years ago

Remembering locations is a bad idea, IMO, unless we add some navigational breadcrumbs. That is, it's very easy to get lost if it can plunk you into some seemingly random location with no way to get your bearings.

gmgman commented 4 years ago

Remembering locations is a bad idea, IMO, unless we add some navigational breadcrumbs. That is, it's very easy to get lost if it can plunk you into some seemingly random location with no way to get your bearings.

Are you serious? Launching games from playlists takes you back to the playlist when quitting, why can't the same behaviour be implemented for the Load Content launcher? If it cannot, have a look at my image, it's just a shortcut to the last used location, you can still go down to the "Start directory" short cut, or use the file browser below to navigate from the root directory to wherever you want. How can you get lost here?

i30817 commented 4 years ago

Not much to say. It's a feature that should have been there from day one (for existing dirs anyway). Fortunately it now exists in playlists, until you move from one to the other, which resets, but it's good enough to minimize the annoyance of researching inside a huge list.

The browser is different in that it's not a flat list. And i wonder how it's implemented that this is hard, maybe the tree navigation doesn't have a attached state to save in? Regardless that it was not implemented at the same time that playlist location was done indicates that it's harder than it looks like.

As a aside there are two kinds of memoization possible; persistent and runtime. I think no one here wants to replace the startup rom dir, just make it be used the first time at each run, and then the memoized path used at runtime in subsequent browsing, if not using one of the hardcoded paths that are in that menu image the OP posted.

gmgman commented 4 years ago

Not much to say. It's a feature that should have been there from day one (for existing dirs anyway). Fortunately it now exists in playlists, until you move from one to the other, which resets, but it's good enough to minimize the annoyance of researching inside a huge list.

The browser is different in that it's not a flat list. And i wonder how it's implemented that this is hard, maybe the tree navigation doesn't have a attached state to save in? Regardless that it was not implemented at the same time that playlist location was done indicates that it's harder than it looks like.

As a aside there are two kinds of memoization possible; persistent and runtime. I think no one here wants to replace the startup rom dir, just make it be used the first time at each run, and then the memoized path used at runtime in subsequent browsing, if not using one of the hardcoded paths that are in that menu image the OP posted.

I've just edited my post and made a suggestion on how the short cut to the last used content directroy could be implement. Practically RA already "memorizes" the last used rom and its location for the history tab. It should really be one or two more lines of code to save that path in a seperate file, which then could be the source for the Last Used Content Direcorty

i30817 commented 4 years ago

There is a weirdness about this idea, retroarch gets out of the filechooser by going 'back' on the 'current start directory'. Which means that the 2nd most common usecase (after a dir with many cds), would be going up a dir and into a sibling dir, which means 'going back' would go 'down the tree' (sometimes) instead of 'up the tree'.

Not like it's impossible to happen in retroarch right now, probably not a serious issue, since RA already should use relative paths in this part of the code to support that usecase of going to the parent dir to outside of the start dir hierarchy. And people will probably not think about it and just press cancel blindly until they get out, i know i do.

I suppose this could be improved to eliminate the 'dips' that don't directly lead to the original dir when going back but that sounds complicated for a minor amount of saved user time.

gmgman commented 4 years ago

I suppose this could be improved to eliminate the 'dips' that don't directly lead to the original dir when going back but that sounds complicated for a minor amount of saved user time.

Minor amount of user time? it's not minor for me, not everyone has all their roms in one folder. sometimes one of my folders has like 20 subfolders and they have several subfolders too, and when you wanna go back to where you were last, it's seriously a pain to navigate all the way back. It pretty much makes the File Browser useless for me unless I just want to stick to one rom for the entire sitting. Think of everytime you open Excel it would force you to start from C: to point to your excel files instead of just remembering where your last opened excel file was. It's just tedious.

And what's so bad or complicated about my short cut idea, that I further explained in my OP? there are already 3 short cuts (or whatever people call them) plus RA already memorizes shit for the History Tab. Why not combine this and give us the last used path to select if wanted?

i30817 commented 4 years ago

You misunderstood. The 'minor amount for large code investment' was the optimization to the process of getting back out of the browser i mentioned which would only occur if it was implemented if people going into a dir, got out got into another dir and wanted to cancel after, not the time saved from going in the neighborhood of the current game, which is a different but related thing (because it could make that situation more common).

Also you should not take people pointing out problems personally. The issue i mentioned is a minor problem/weirdness that can be ignored, i just mentioned it because it because others might have ideas how to minimize it and i thought it neat you could shortcircuit the stored path to remove useless directory transversals which don't go to the browser start dir.

I agree with your desire, in fact I asked jdgleaver why it wasn't implemented when he did the playlists but apparently he's swamped with work right now and the code and stragegies that work for a playlist and menus don't work that well for the browser.