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.32k stars 2.18k forks source link

Error Multiplayer Phantasy portable 2 y Phantasy portable 2 Infinite #14720

Open CristobalManga opened 3 years ago

CristobalManga commented 3 years ago

Game or games this happens in

ULES-01419 Phantasy portable 2 y Phantasy portable 2 Infinite

What area of the game / PPSSPP

I am using the latest builds, The problem is the following, I was going to play phantasy star portable 2 infinite from android in multiplayer mode via local and via VPN or Socom.cc

But when I hit multiplayer, the game doesn't connect to the room to play, and after a few minutes the game says there is no network connection, when in fact there is.

image

I thought it was my router, but all other multiplayer games work perfectly. So I tried the phantasy portable 2, and it got the same error.

I also have to say that on PC this game works perfectly with the emulator, everything happens on android.

And another thing, is that the first error I had with the game, is that it told me that the port was busy, and I must change it, so I changed it to 1100, it worked, but the error that I mentioned at the beginning appears, the game does not starts after connecting to the room.

Also in the phantasy star portable 2 online discord community, they say that android users have flaws with this game specifically on android.

What should happen

Well, start the multiplayer

Logs

No response

Platform

Android

Mobile phone model or graphics card

Pixel 2

PPSSPP version affected

v1.11.3-1112-g5de47c6cf

Last working version

v1.11.3-1112-g5de47c6cf

Graphics backend (3D API)

Vulkan

Checklist

anr2me commented 3 years ago

You change the port offset to 1100 but does the other players also use 1100? Also try using port offset 10000, also make sure all players use the same port offset, i often get issue on android with port offset 5k but 10k seems to be okay

CristobalManga commented 3 years ago

Cambia la compensación del puerto a 1100, pero ¿los otros jugadores también usan 1100? También intente usar la compensación de puerto 10000, también asegúrese de que todos los jugadores usen la misma compensación de puerto, a menudo tengo problemas en Android con la compensación de puerto 5k pero 10k parece estar bien

If I have already tried several ports and if they work, but after that comes the error that I mentioned in the beginning, the game does not enter the room. I do not know if it is a port error, but on PC that does not happen.

The other players use port 1100 and it works perfectly. But many use PC

CristobalManga commented 3 years ago

I have also noticed that when connecting in the first phase, there is actually no connection, since when I send a message from the PPSSPP chat, the other person does not receive it. I mean, it seems that the game has not made any connection, neither locally, nor vpn, or Socom.cc

ghost commented 3 years ago

@CristobalManga just ot what vpn are you using to play multiplayer on ppsspp?

CristobalManga commented 3 years ago

@CristobalManga ¿Qué vpn estás usando para jugar multijugador en ppsspp?

Zero tier VPN.

ghost commented 3 years ago

Could be the incorrect port issue because its more prevalent on Android. But if it happened with a VPN its strange... Or its that buffer size issue that also affected radmin vpn.

anr2me commented 3 years ago

I have also noticed that when connecting in the first phase, there is actually no connection, since when I send a message from the PPSSPP chat, the other person does not receive it. I mean, it seems that the game has not made any connection, neither locally, nor vpn, or Socom.cc

The chat feature is not part of Adhoc, it's AdhocServer feature and all chat messages are going through AdhocServer, so if you have issue with chat that mean you (or your friend) also have issue with AdhocServer, and without communication to AdhocServer working properly.. Adhoc games won't work properly either.

CristobalManga commented 3 years ago

También he notado que al conectarme en la primera fase, en realidad no hay conexión, ya que cuando envío un mensaje desde el chat PPSSPP, la otra persona no lo recibe. Quiero decir, parece que el juego no ha hecho ninguna conexión, ni localmente, ni vpn, ni Socom.cc

La función de chat no es parte de Adhoc, es la función de AdhocServer y todos los mensajes de chat pasan a través de AdhocServer, por lo que si tiene problemas con el chat, eso significa que usted (o su amigo) también tiene problemas con AdhocServer y sin que la comunicación con AdhocServer funcione correctamente. Los juegos Adhoc tampoco funcionarán correctamente.

It only happens with this game, all other games work well for me in multiplayer. I do not know if it is a port problem, but everything indicated that it has to do with the multiplayer connection.

CristobalManga commented 3 years ago

También he notado que al conectarme en la primera fase, en realidad no hay conexión, ya que cuando envío un mensaje desde el chat PPSSPP, la otra persona no lo recibe. Quiero decir, parece que el juego no ha hecho ninguna conexión, ni localmente, ni vpn, ni Socom.cc

La función de chat no es parte de Adhoc, es la función de AdhocServer y todos los mensajes de chat pasan a través de AdhocServer, por lo que si tiene problemas con el chat, eso significa que usted (o su amigo) también tiene problemas con AdhocServer y sin que la comunicación con AdhocServer funcione correctamente. Los juegos Adhoc tampoco funcionarán correctamente.

Log in to the router to see if something went wrong. And I found this, I do not know what it is because I do not know anything about networks.

But on PC where the game does work, this appears:

image

The difference is that 1 UDP becomes 1501. While in android where you cannot use ports 1 or 2, it starts from 10001 UDP to 10001.

I don't know if this is the error.

image

as we can see the digits are repeated in android.

PPSSPP:NPJH... | 13539 | TCP | 13539 | PPSSPP:NPJH... | 14509 | TCP | 14509 | PPSSPP:NPJH... | 13500 | TCP | 13500 | PPSSPP:NPJH... | 14501 | TCP | 14501

while on PC they are different

PPSSPP:NPJH... | 13009 | TCP | 14509 | PPSSPP:NPJH... | 12000 | TCP | 13500 | PPSSPP:NPJH... | 13001 | TCP | 14501 | PPSSPP:NPJH... | 1 | UDP | 1501

They are tests locally, on VPN or public server, it has the same error

anr2me commented 3 years ago

The difference is that 1 UDP becomes 1501.

This is probably because you Enable "UPnP Use Original Port" setting, it will make PSP or other PSP emulators that doesn't have Port Offset/shifting feature over the internet to see PPSSPP as PSP-compatible. Other players using PPSSPP need to enable this settings too if you're using it.

If all players only using PPSSPP you should Disable it (which is the default), to make sure old version of PPSSPP can play with you too (ie. old version that doesn't have this "UPnP Use Original Port" setting yet)

PS: "UPnP Use Original Port" only affects multiplayer over public IP because it only different on the external port, it doesn't have any effects on LAN or VPN multiplayer because they don't use UPnP.

ghost commented 3 years ago

Contacted the guy and tried to play with him using socom.cc. It's true its an Android only issue. If an Android player hosts the game the infinite loop issue gonna appear until an error (that also impacts blazblue and kingdom hearts too sometimes btw). If a PC user hosts (me) the game gonna proceed past the loop and into gameplay. we played using socom.cc and UPNP enabled to port 5000 without UPNP use original port enabled. This does not seem to be an incorrect port issue though as I didn't see it on my screen. It could be also his internet connection tho.

CristobalManga commented 3 years ago

The difference is that 1 UDP becomes 1501.

This is probably because you Enable "UPnP Use Original Port" setting, it will make PSP or other PSP emulators that doesn't have Port Offset/shifting feature over the internet to see PPSSPP as PSP-compatible. Other players using PPSSPP need to enable this settings too if you're using it.

If all players only using PPSSPP you should Disable it (which is the default), to make sure old version of PPSSPP can play with you too (ie. old version that doesn't have this "UPnP Use Original Port" setting yet)

PS: "UPnP Use Original Port" only affects multiplayer over public IP because it only different on the external port, it doesn't have any effects on LAN or VPN multiplayer because they don't use UPnP.

Yes, we tested the game with partner MojoJojoDojo. Interestingly, it only seems to work online, with socom.cc.

Locally I get the same error. Regardless of whether the host is someone from PC.

anr2me commented 3 years ago

Contacted the guy and tried to play with him using socom.cc. It's true its an Android only issue. If an Android player hosts the game the infinite loop issue gonna appear until an error (that also impacts blazblue and kingdom hearts too sometimes btw). If a PC user hosts (me) the game gonna proceed past the loop and into gameplay. we played using socom.cc and UPNP enabled to port 5000 without UPNP use original port enabled. This does not seem to be an incorrect port issue though as I didn't see it on my screen. It could be also his internet connection tho.

Is this issue similar to the old issue on KHBBS where it stuck when the mission started? As i remembered that issue were related to AdhocMatching, due to some AdhocMatching events (which came from network packets) didn't get processed or missing, and with the way how the pro-online AdhocMatching worked (that use PDP/UDP which is prone to lost packet, and worsen by faked ACK) i guess it could still happened sometimes.

But this issue shouldn't happened much on LAN tho, while his issue occurred on LAN too, which is rather strange.. usually just a mistake on the settings or blocked port (if he was using firewall or internet security on PC)

ghost commented 3 years ago

Man this faking ACK seems to cause a lot of issues. I thought its the buffer size thing that was related to the loop issue thought but you say its fake ACK as well. https://github.com/hrydgard/ppsspp/issues/13648#issuecomment-725440037 Also dunno if he knows how to setup a LAN game properly its a bit more non trivial then playing online ironically.

CristobalManga commented 3 years ago

Contacté al chico e intenté jugar con él usando socom.cc. Es cierto que es un problema exclusivo de Android. Si un jugador de Android aloja el juego, el problema del bucle infinito aparece hasta que se produce un error (que a veces también afecta a blazblue y kingdom hearts). Si un usuario de PC aloja (yo), el juego pasará del bucle y entrará en juego. jugamos usando socom.cc y UPNP habilitado para el puerto 5000 sin UPNP usamos el puerto original habilitado. Sin embargo, esto no parece ser un problema de puerto incorrecto, ya que no lo vi en mi pantalla. Aunque también podría ser su conexión a Internet.

¿Es este problema similar al problema anterior en KHBBS donde se atascó cuando comenzó la misión? Como recordé, ese problema estaba relacionado con AdhocMatching, debido a que algunos eventos AdhocMatching (que provenían de paquetes de red) no se procesaron o faltaron, y con la forma en que funcionaba AdhocMatching pro-online (que usa PDP / UDP que es propenso a paquete perdido, y empeorado por ACK falso) supongo que todavía podría suceder a veces.

Pero este problema no debería ocurrir mucho en LAN aunque, mientras que su problema también ocurrió en LAN, lo cual es bastante extraño ... generalmente solo un error en la configuración o puerto bloqueado (si estaba usando firewall o seguridad de Internet en la PC )

It could be my router, I'll try to borrow one. But it is certainly a game that has problems with multiplayer.

Thanks to all for the help. I don't know how your head doesn't hurt looking at so many codes and numbers. imao.

CristobalManga commented 3 years ago

I already tried it with another router, and android can be connected to the room. But it cannot be the host. That would be the only flaw.

Lemoncak3 commented 2 years ago

Are you playing the english patched one? I have problem when using adhoc tho, we can see each other and when start it just stuck in there not getting into game. I just tried the japan one and same problem occured. Is this only happen in android since me and my friend only play using android Screenshot_20211124-155526

zoy-0 commented 2 years ago

So? Anyone can help us in this matter? hahahaha

adenovan commented 2 years ago

@ANR2ME probably need to investigate more on tcp sockets compability between unix and windows , winsocket never has problem hosting the room when android almost fails everytime hosting the room even with port offset.

That is the last info i get when still actively play this game with some member online through vpn.

anr2me commented 2 years ago

Yes, there are some inconsistencies issue found recently between windows and non-windows, mostly related to different behavior of the error code (ie. ECONNREFUSED) and some posix functions (ie. connect, select, getpeername).

There is one major issue related to socket's FIONREAD on Linux i haven't fixed yet, and based on what i found on stackoverflow, linux's kernel can sometime took the data to kernel's internal buffer thus no longer returning the correct "number of available byte to received" (ie. smaller than it should), while some games relies on this number of bytes before receiving data and end up only receiving partial of it and the rest of the data will piled up resulting to delayed effects on Hokuto no Ken. In order to fix this i'll need to managed the socket buffer my self and get the correct number of bytes by receiving it until it gets an error (ie. moving the data to the socket's internal buffer on PPSSPP) instead of relying on FIONREAD, will need to create socket class first to do this (so i can also use the class to implement built-in tunneling/vpn/xlink support too)