hrydgard / ppsspp

A PSP emulator for Android, Windows, Mac and Linux, written in C++. Want to contribute? Join us on Discord at https://discord.gg/5NJB6dD or just send pull requests / issues. For discussion use the forums at forums.ppsspp.org.
https://www.ppsspp.org
Other
11.01k stars 2.15k forks source link

Ad-hoc games that use Quazal Net-Z middleware won't work #14555

Open ghost opened 3 years ago

ghost commented 3 years ago

What happens?

The game freezes (or won't show any ohsted games) when you got into the ad-hoc menu while trying to join a game.

What should happen?

Game should work as intended.

What are you using?

What hardware / device and operating system?

Windows 10.

What graphics card (GPU) or mobile phone model?

Radeon 530 Intel 8550U CPU

What PPSSPP version (standalone/official), and did it work before?

It never did as far as I know.

Which game or games?

ULUS10235 ULES00670 ULJM05465

Checklist

ghost commented 3 years ago

Further notes: The game uses middleware by Quazal (dunno if the only that does on adhoc). The game might use both infrastructure and adhoc in its code but its not an "infrastucture lan" game in the same vein as other games like Twisted Metal and Untold Legends. On PSP when you host a game the game wont connect to any access point like the previously mentioned games. Possibly the infra part is only used when joining a game instead. Later I also talked to @Zero1UP on discord and he seems to confirm that (that its not an "infra lan" game in the traditional sense).

anr2me commented 3 years ago

Interesting to know that it doesn't try to connect to a hotspot, so i guess it's possible to use infrastructure protocol (TCP/UDP) on Adhoc too, since this game is using UDP instead of PDP (adhoc protocol) for communication.

This game also try to initialize both Apctl (usually used to connect to a hotspot) and Adhocctl (usually used for grouping), not sure if this is really allowed or can successfully be done on a real PSP tho (will need to be tested later)

ghost commented 3 years ago

It's possibly because the game uses middleware that was made by Quazal (their middleware is not understood yet even on other consoles that use it).

The game does work over xlink kai though and I might make some packet captures about it later.

anr2me commented 3 years ago

Actually, these kinda packet captures aren't really useful other than for a record, because we can't tell which packets came from which syscall or library :D reading a bunch of packets (especially encrypted one) will only cause a headache without knowing what each packets related to.

While HTTP packet captures like this can still be usefull, at lease we can separate which packets related to which HTTP request https://www.psx-place.com/threads/psx-capture-project-ps2-ps5.25067/

ghost commented 3 years ago

Interesting to know that it doesn't try to connect to a hotspot, so i guess it's possible to use infrastructure protocol (TCP/UDP) on Adhoc too, since this game is using UDP instead of PDP (adhoc protocol) for communication.

You said it uses UDP and it does seem to have non encrypted data in it so I thought it could be useful. Because the infrastructure packet dumps seem more useful and show more detail etc. Maybe if someone deciphers them they show the issue or something. Also I only posted the joining side so you kinda know.

ghost commented 3 years ago

Actually, these kinda packet captures aren't really useful other than for a record, because we can't tell which packets came from which syscall or library :D reading a bunch of packets (especially encrypted one) will only cause a headache without knowing what each packets related to.

While HTTP packet captures like this can still be usefull, at lease we can separate which packets related to which HTTP request https://www.psx-place.com/threads/psx-capture-project-ps2-ps5.25067/

These memory dumps captures from a PSP seem more useful. They also confirm that the game uses Quazal Net-Z middleware for ad-hoc. You could use a hex editor to see all this stuff. Driver 76 Quazal Net-Z memory dumps.zip

This is the only PSP title that uses Net-Z btw at least on ad-hoc (other PSP multi-platform games didn't use it for some reason or used it on infra only) https://www.mobygames.com/game-group/middleware-net-z

Also the game doesn't use UDP it uses a custom UDP protocol called PRUDP. 3DS also uses PRUDP (and some other Quazal stuff) for local wireless communication in some games maybe looking at CItra code could be useful for once lol.

There is also some more info about it here: https://github.com/zeroKilo/GROBackendWV/wiki/List-of-games-using-Quazal

ghost commented 3 years ago

Well there is a 2nd game that uses Quazal Net-Z on Ad-hoc which is called: Onore no Shinzuru Michi o Yuke So I guess it's time to rename this issue. That game might use a later version of Net-Z cause it got out on 2009. Memory dump of that game on PSP: Onore no Shinzuru Michi o Yuke Quzal Net-Z.zip

anr2me commented 3 years ago

Well there is a 2nd game that uses Quazal Net-Z on Ad-hoc which is called: Onore no Shinzuru Michi o Yuke So I guess it's time to rename this issue. That game might use a later version of Net-Z cause it got out on 2009. Memory dump of that game on PSP: Onore no Shinzuru Michi o Yuke Quzal Net-Z.zip

What is the game title id?

ghost commented 3 years ago

Well there is a 2nd game that uses Quazal Net-Z on Ad-hoc which is called: Onore no Shinzuru Michi o Yuke So I guess it's time to rename this issue. That game might use a later version of Net-Z cause it got out on 2009. Memory dump of that game on PSP: Onore no Shinzuru Michi o Yuke Quzal Net-Z.zip

What is the game title id?

ULJM05465 i got version 1.01. Rocky Balboa also seems to use the middleware.

anr2me commented 3 years ago

Could you guide me how which menu i should choose to host/join multiplayer?

Update1: When i choose the 4th menu, the game seems to be using GameSharing image Which is different with Driver 76

Update2: When i choose the 3rd menu, it tried to use both Adhoc and Inet, which is similar to Driver 76 i guess image But i can see both side were able to send and receive without issue.

How does it supposed to look when you host/join? i can't even figured out how to host a room because there is only 1 button LOL image

Update3: based on this log, it seems the game is trying to poll multiple sockets, while the current sceNetInetPoll doesn't support more than 1 socket as i remembered (because it use windows's socket id/fd directly instead of using PSP-compatible socket id/fd which is capped at 255), so that might be the issue. image

ghost commented 3 years ago

Actually when a PSP hosts using the Pro Online plugin then PPSSPP could connect I found out lol. To host you need to press the button and then click yes in japanese. But yeah the game progress furthers if someone hosts on a PSP for some reason... And then you can get into the lobby and even start the game. And when the game starts it will disconnect after the loading screen for some reason (it will disconnect on xlink too) Maybe it should work when JPCSP hosts too who knows. I wonder if any other middlware or 3rd party libraries used ad-hoc the same but I guess not...