Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Region flag and game ID on game selection screen #12637

Merged
merged 6 commits into from
Feb 26, 2020

Conversation

iota97
Copy link
Contributor

@iota97 iota97 commented Feb 23, 2020

Add small 22x14 flags icon (found online under creative common license) based on game region if enabled in the setting (Asia region uses China flag).

Screenshot_2020-02-23_14-10-44

Fixes #12636.

PS: Atlas file have been generated on Linux, it seem to have worked fine, but it might be better rebuild it on windows for extra safety?

@Abbanon
Copy link
Contributor

Abbanon commented Feb 23, 2020

Might I suggest adding the South Korean/KO flag as well?
They have their own specific Game ID region codes, UCKSxxxxx
kr

@NABN00B
Copy link
Contributor

NABN00B commented Feb 23, 2020

The Region of a game disc is a separate property and doesn't always correspond with the Disc_ID property.
kép

A Korean flag is indeed necessary, and I would also add something for when it couldn't be determined because the emulator seems to guess it from the third character of Disc_ID, meaning it's not gonna be accurate.

switch (regStr[2]) {

@iota97
Copy link
Contributor Author

iota97 commented Feb 23, 2020

Added korea region, both as flag and in game info.

About detection accuracy it seem from this line // region = paramSFO.GetValueInt("REGION"); // Always seems to be 32768? that it's not easy to find it and that was a workaround, not sure if there even is a better way tbh.

@Abbanon
Copy link
Contributor

Abbanon commented Feb 23, 2020

It looks like there are at least 5 region types for PSP games:

  • us US (USA)

  • eu EU (EUR)

  • jp JP (JAP)

  • kr KO (KOR)

  • cn AS (ASIA)

And each region has several different Game ID/UMD Serial codes.
For example,
US can have: ULUS, UCUS, NPUZ, NPUX, NPUF, NPUH, NPUG
EU can have: ULES, UCES, NPEZ, NPEX, NPEH, NPEG
JP can have: ULJS, ULJM, UCJS, UCJM, UCJB, NPJJ, NPJH, NPJG
KO can have: ULKS, UCKS, NPHH, NPHG
AS can have: ULAS, UCAS, NPHZ
(Not sure if that's all of them, but it's all that I'm finding.)

If a game has an un-identifiable region, why not leave it blank/without a region flag?
And do you think there would be a way to add these listed Game IDs to the detection field?

@iota97
Copy link
Contributor Author

iota97 commented Feb 23, 2020

PPSSPP detect the region (as shown on game info screen) by checking the 3rd letter of the code (notice how all the ID you listed have the same 3rd letter) as this:

U - USA
E - Europe
J - Japan
A - Asia
H - Hong kong
K - Korea (this is not detected in master, just added in this PR)

If the letter doesn't match any of those the region will be "other" and no region will be written on game info screen (and no flag will be displayed in this PR).

@NABN00B
Copy link
Contributor

NABN00B commented Feb 23, 2020

There is already a method in the code for detecting the region based on specific ID's but it's commented out in favor of the 3rd-character detection.

if (regStr == "NPEZ" || regStr == "NPEG" || regStr == "ULES" || regStr == "UCES" ||

However, I still don't believe this is going to be accurate. I see multiple region types for NPHH ID's in a database.
kép

Perhaps we should look into how UMDGen determines the region?

@Abbanon
Copy link
Contributor

Abbanon commented Feb 23, 2020

It looks like UMDGen determines based on the PARAM.SFO file contents.
Untitled

@iota97
Copy link
Contributor Author

iota97 commented Feb 23, 2020

NPHH will be detected as Hong kong, is that a possible region in UMDGen?
Also if UMDGen have is source open and available it might be possible to take a look, but even then is it worth the time?
The reason of the issues was to see the region if you have multiple version of the SAME game, accuracy is better for sure, but i got the feeling we are getting away from the issues itself.

@NABN00B
Copy link
Contributor

NABN00B commented Feb 23, 2020

If that's the reason then the base assumption was wrong to begin with: games can have multiple versions and rereleases for the same region.

Take a loot at GTA Liberty City Stories which has:

  • 3 US
  • 3 European
  • 2 German
  • 3 Japanese
  • 1 Korean
    versions and that list only includes physical releases.

A better method to tell the game version would be to use a combination of Disc_ID and Disc_Version.
An even better solution would be the calculation of the CRC-32 checksum of the game upon booting it as suggested in #12469 . This would even be able to tell if the user is loading a bad dump found from the internet, which the other methods wouldn't be able to determine.

@NABN00B
Copy link
Contributor

NABN00B commented Feb 23, 2020

We've gotten a bit off-topic here, this PR is a nice addition for the users of the emulator. However, game region alone is not reliable for telling specific game versions apart. As for how PPSSPP determines the region should be discussed in a new issue.

@Abbanon
Copy link
Contributor

Abbanon commented Feb 23, 2020

Okay, so looking more into UMDGen:
I didn't notice this before, but among the PARAM.SFO information it explicitly states the region.
NPHH shows up as N/A
Meanwhile,
ULUS shows Ntsc,
ULES shows Pal,
ULJS shows Japan, and
ULKS shows Korea
I have no idea how it determines this based on data, however.
Untitled

@iota97 iota97 changed the title Region flag on game selection screen Region flag and game ID on game selection screen Feb 23, 2020
@iota97
Copy link
Contributor Author

iota97 commented Feb 23, 2020

Added game ID and version (not sure if any game have different feature in different version in the same region tho', and that what i thought it was the main use case). Still both flag and ID are optional and disabled by default so I see no harm in having them.

@LunaMoo
Copy link
Collaborator

LunaMoo commented Feb 23, 2020

@iota97 you should probably avoid those features for Homebrew as we generate fake ID for them. Pretty much everything launched from "Game" folder might have a fake ID(althrough the detection is also checking some other things, it's overally recommended for compatibility to not place any commercial games inside that folder while always placing homebrew only there), we do assign them a "HOMEBREW" region if I recall, but there's also some still unsolved race issue where homebrew is not detected at recent screen on windows when using "" for path divider.

Edit: or actually nvm, you're applying this only for < GAMEREGION_MAX and homebrew get's higher, it still might be affected by the bug I mentioned, but it's not the scope for this pr.

@hrydgard
Copy link
Owner

I like the flag idea as long as we can get consensus on the region detection. Showing the game ID is maybe kinda odd but I guess sometimes useful.

How does this look in list view?

@iota97
Copy link
Contributor Author

iota97 commented Feb 24, 2020

Screenshot_2020-02-24-09-56-48-388_org ppsspp ppsspp

@Abbanon
Copy link
Contributor

Abbanon commented Feb 24, 2020

Considering List View has such smaller game thumbnails, what if the "game config" gear and region flags were moved to the left, between the thumbnail and the edge of the application window?
I threw this mockup together to explain what I mean:
listview-example

Edit: I would suggest removing the Game Version from the Game ID preview, and instead only display the base Game ID. Otherwise it looks like the version info clips outside of the thumbnail in List Mode, and scaling the text any smaller would probably just make it harder to read.

@iota97
Copy link
Contributor Author

iota97 commented Feb 24, 2020

Scaling the font down a bit seem fine (I had forgotten to check the list view, my bad)

0

1

@hrydgard
Copy link
Owner

I have to say that does look a little too cluttered. I'd prefer Abbanon's approach, but I'm also fine with just leaving them out in list view for now, and tweak that look later.

@iota97
Copy link
Contributor Author

iota97 commented Feb 24, 2020

Let's go for Abbanon way, game ID will be placed in bracket after the tittle in list view.

0

@NABN00B
Copy link
Contributor

NABN00B commented Feb 25, 2020

I like what you did with the icons in list view. Maybe we can display the game_id+version in smaller text size so it takes up less space. Could omit the brackets too that way.

For the grid view, would it be possible to highlight the text with a semi-transparent color for the lighter icons?

@iota97
Copy link
Contributor Author

iota97 commented Feb 25, 2020

I guess it's better to display the ID on the right as another field as this:

0

1

About highlight, the text already have a shadow so it look like this on light icon:

3

@Abbanon
Copy link
Contributor

Abbanon commented Feb 25, 2020

The only thing I could suggest further would be to shift the List View thumbnails to the right a tiny bit, so the gear and flag icons don't seem so squished into the edge. But that's just me being picky.
Otherwise I think this is perfect already!

@iota97
Copy link
Contributor Author

iota97 commented Feb 25, 2020

Added some spacing there and better aligned the ID on the grid view. Here the result:

g
l

@hrydgard
Copy link
Owner

hrydgard commented Feb 26, 2020

Now we're getting somewhere :) I like it.

By the way, I think it might be time to rewrite this stupid texture atlas system to avoid needing to generate a CPP file. I'm gonna file an issue on that.

@hrydgard hrydgard merged commit 3af63b6 into hrydgard:master Feb 26, 2020
@iota97 iota97 deleted the region branch February 26, 2020 08:42
@NABN00B
Copy link
Contributor

NABN00B commented Feb 27, 2020

Had to wait for a build until I could see for myself, but what I feared about the text color not always being readable became true. This is why I suggested a highlight color, even semi-transparent could work if it's possible to do.
kép

Loving the update otherwise and the other things you've been working on too. Keep it up!

@unknownbrackets unknownbrackets added this to the v1.10.0 milestone Mar 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] Game Region Thumbnail Icons in Recent + Games lists
6 participants