libretro / RetroArch

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

RetroArch File Structure Improvement Suggestions #14561

Open alexstreltsov opened 2 years ago

alexstreltsov commented 2 years ago

Description

I like the fact that RetroArch, despite all the nuances and complexities in game emulation, remains true to the Plug and Play principle.

It seems to me that it would be great to separate directories more strictly for files that a user, in fact, should not touch, and files that, on the contrary, a user may interact regularly. By "more strictly" I mean leave users the freedom they have now to change directories, but change some of the default directories.

I will give an example for macOS.

RetroArch uses two main directories by default: ~/Library/Application Support/RetroArch for assets, configs, cores, etc., and ~/Documents/RetroArch — for saves, states, BIOS images, etc. By default, Library folder (~/Library) is hidden for macOS users and a user's freedom of action within it is very limited, since changes to files in it can cause irreversible damage to the system. In fact, casual users do not even know that this folder exists and can be accessed.

I am confused by the following points in the current RetroArch file structure:

Also a couple of things that are not directly related to the file structure issues:

Suggested File Structure for the User File Directory

I have not used Windows for a long, long time, so I will give an example for RA macOS default directory ~/Documents/RetroArch.

Since users tend to use user-friendly file naming in Documents folder, I suggest that all directory names should be capitalized and should include spaces instead of underscores.

Suggested File Structure: ~/Documents/RetroArch/Assets/Dynamic Backgrounds

~/Documents/RetroArch/Configs — saved custom configuration files ~/Documents/RetroArch/Configs/Recording — recording configuration file/files

~/Documents/RetroArch/Logs — RetroArch general logs ~/Documents/RetroArch/Logs/Runtime Logs — runtime logs

~/Documents/RetroArch/Playlists ~/Documents/RetroArch/Playlists/Favorites ~/Documents/RetroArch/Playlists/History ~/Documents/RetroArch/Playlists/Images ~/Documents/RetroArch/Playlists/Music ~/Documents/RetroArch/Playlists/Videos

~/Documents/RetroArch/Records

~/Documents/RetroArch/ROMs

~/Documents/RetroArch/Saves

~/Documents/RetroArch/Screenshots

~/Documents/RetroArch/States

~/Documents/RetroArch/System

Version/Commit

Environment Information

hizzlekizzle commented 2 years ago

I think these are good suggestions. AFAIK, the biggest blocker on any of this stuff is just unfamiliarity with Apple development conventions. Are you able to make any of these changes? If so, we would welcome a PR :)

alexstreltsov commented 2 years ago

Are you able to make any of these changes? If so, we would welcome a PR :)

I think that I am able to make all the necessary improvements, however, I am currently working on a very time-consuming project and I am not sure when I will have the time to get everything done. At best, I will have free time only after two months.

I decided right now to pay attention to the issues with the file structure of RetroArch because this project has reached such a level of development that it has become, in fact, the only and best emulator of game systems (more precisely, an emulation frontend). In my practice, there have been many cases where seemingly minor flaws in the file structure resulted in serious problems that could not or still cannot be solved for years due to the fact that applications have acquired with a lot off new features.

In addition, modern gaming systems are striving for unification and game backward compatibility. There is no need for emulators for more modern gaming systems. In this regard, I believe that RetroArch already has all the necessary system cores and main features, like Netplay. It remains only to "do a nice haircut" and continue to support this application for all major operating systems.

I really fell in love with this project 😄

alexstreltsov commented 2 years ago

I think these are good suggestions. AFAIK, the biggest blocker on any of this stuff is just unfamiliarity with Apple development conventions.

Perhaps, however, although I have not had the opportunity to check how things are for other operating systems, separating the areas of responsibility for a user and an application is always a good thing. Therefore, I think that at least some of my suggestions are relevant for all supported operating systems. Maybe I am wrong.

In any case, as soon as I have the opportunity, I will dive deeper into this issue, if no one else has already paid attention to it.

tbone2k-git commented 2 years ago

Reading through your suggestions, I want to add: Spreading files across the operating systems user or system folders is a concept which failed for me and many others. I do not share my phone or computer with others, so I don't need configs to be placed "somehwere" outside of my application or RetroArch folder.

Moving applications from one OS installation to the next, is a nightmare if files are spread around. I also don't know anybody using an Android TV box, windows, smartphone with multiple accounts for Mum, Dad, Kids, Grandpa, it does not happen in the real world (I think o)?

So I welcome any folder structure cleanup, but please keep the "portable" people in mind, let's have an option at least to always force "portable" mode. Moving RetroArch from one Android, Windows, Linux installation to the next should be possible with a simple folder copy.

I would welcome a RetroArch user profile handling though, that would give best of both worlds (user profiles and portable), since I don't see people log out and back in of their linux session to use RA, so just switch users in RA directly if needed.

alexstreltsov commented 2 years ago

Sorry for the delay in reply, @tbone2k-git. I rammed a car with my head a few days ago 😅

I think that you misunderstood me. I wholeheartedly support portability. It would be strange if this were not so.

Spreading files across the operating systems user or system folders is a concept which failed for me and many others. I do not share my phone or computer with others, so I don't need configs to be placed "somehwere" outside of my application or RetroArch folder.

  1. Separation is not necessary so that several users of the same OS can work with RA. Separation is necessary in order to leave casual users the ability to work only with those files that are part of their area of responsibility: game ROMs, saves, states, BIOS images and boot ROMs, screenshots, recordings, playlists, saved configs (general and cores), logs, dynamic backgrounds. RA has many other resources over which users have no broad control (and should not have): UI assets, audio filters, auto-configs for input devices, video filters, shaders, cores and others. These are the resources that exist separately and are not the product of a user's activity. A user is not directly related to them. A user can only update them and, in the case of cores, download them. These are the resources that come with RA and should not be modified by a user.
    This approach is aimed precisely at portability, security and ease of understanding: users transfer between devices with different operating systems only a folder with resources that they created, modified or downloaded themselves, and which are not provided with RA. The contents of such a folder are easy to understand. Users will never lose everything they have achieved, will not lose their configs and will not disrupt the application's performance by deleting something important for its operation. All other resources are installed and updated along with RA. Does it make sense to transfer them to another device?

  2. I think that this misunderstanding arose because you mixed up /Library/Application Support and ~/Library/Application Support directories (if we are talking about macOS). I was referring to ~/Library/Application Support directory, which is contained in a user folder and is not system-wide.

I also don't know anybody using an Android TV box, windows, smartphone with multiple accounts for Mum, Dad, Kids, Grandpa, it does not happen in the real world (I think o)?

This is true! 😂 Except in some very rare cases.

So I welcome any folder structure cleanup, but please keep the "portable" people in mind, let's have an option at least to always force "portable" mode. Moving RetroArch from one Android, Windows, Linux installation to the next should be possible with a simple folder copy.

I would welcome a RetroArch user profile handling though, that would give best of both worlds (user profiles and portable), since I don't see people log out and back in of their linux session to use RA, so just switch users in RA directly if needed.

User profiles are not directly related to the file structure. It seems to me that this is a more labor-intensive feature and it can only become popular for shared devices, like Android TVs.

The only alternative to my suggestions regarding the file structure that I see is to add the ability to enable Portable Mode for the application, which would organise the file structure so that absolutely all RA files would be stored within a single directory. It may be useful for arcade halls and some advanced users. Also it is the best choice for gaming-only devices, probably (to be honest, I have not yet looked at how the RetroArch file structure for game consoles is arranged and how new game ROMs are loaded there).

However, I believe that in most cases it will be enough for an advanced user to change the directory where the cores of the game systems are stored to the RetroArch directory, which is located within the user's folder (~/Documents/RetroArch/Assets for macOS, as an example). Thus, there will be no optional files left in the RetroArch system folder.

LibretroAdmin commented 2 years ago

Nothing against your launcher but there is no purpose for it to be posted here.