shonumi / gbe-plus

DMG/GBC/GBA emulator and experimental NDS emulator.
GNU General Public License v2.0
501 stars 79 forks source link

Question about Local network ( Link cable on GB ) #86

Closed ghost closed 5 years ago

ghost commented 5 years ago

Hi Shomuni,

I have a question about the parameters of the port on the file gbe.ini.

Can I use the file "gbe.ini" for 2 instances on the same computer ? If yes, can you explain me please where i do a mistake >< ?

Sorry to bother you with that :/ . I use these parameters on "gbe.ini" for 2 instances of GBE+ on the same computer :

//Emulated serial IO device
//0 - No device, 1 - GB Link Cable, 2 - GB Printer, 3 - GB Mobile Adapter
//4 - Barcode Taisen Bardigun Scanner, 5 - Barcode Boy, 6 - Four-Player Adapter (DMG-07)
//7 - GBA Link Cable, 8 - GB Player Rumble, 9 - Soul Doll Adapter
[#sio_device:1]

//Enable netplay functionality
//1 - use netplay, 0 - no netplay
[#use_netplay:1]

//Enable "hard" syncing when using netplay
//This option forces each emulated system to syncronize every few cycles. One will pause until the other communicates it is ready
//The "hard" method should not desync and some games require it, but it can be slow
//1 - use "hard" sync, 0 - use "soft" sync
[#use_netplay_hard_sync:1]

//Netplay sync threshold
//The number of emulated system cycles GBE+ will run before waiting to sync over netplay
//This option only applies when "hard" syncing is enabled. The lower the number the more frequent the emulators sync
//Lower numbers (and slower performance) are required for some forms of netplay to avoid desyncing
//Recommended: DMG/GBC multiplayer - 32, GBC Infrared Comms - 4
[#netplay_sync_threshold:32]

//Netplay server port
//Set this to a valid number between 0 and 65535
//This is the port where other GBE+ instances will send data to, must be different from the client port
//IMPORTANT - This must match the OTHER PLAYER'S client port
[#netplay_server_port:5000]

//Netplay client port
//Set this to a valid number between 0 and 65535
//This is the port where the current GBE+ instance will receive data from others, must be different from the server port
//IMPORTANT - This must match the OTHER PLAYER'S server port
[#netplay_client_port:5001]

//Netplay client IP address
//Set this as an IPv4 address like 127.0.0.1
[#netplay_client_ip:127.0.0.1]

And on the second instance of the same computer, I get currently this message on the terminal : SIO::Error - Server could not open a connection on Port 1388

OS used : Xubuntu 18.04 - 64 bits GBE+ latest version of the github source code, compiled on the computer GBE+ SDL command line used here

Sincerely, Jackobo

shonumi commented 5 years ago

Sorry for the delay.

Anyway, I think the issue is [#netplay_server_port] and [#netplay_client_port] .ini options. You've probably got two instances of GBE+, but the value of these settings is the same in both .ini files. You should have something like this:

Instance A

[#netplay_server_port:5000]
[#netplay_client_port:5001]

Instance B

[#netplay_server_port:5001]
[#netplay_client_port:5000]

Note how the Server Port of A matches the Client Port of B and vice versa. Remember, each instance of GBE+ should be using it's own .ini file. The easiest way to do this is to make two folders like this

Folder A

- gbe_plus executable
- gbe.ini
- ROM file

Folder B

- another gbe_plus executable
- another gbe.ini
- another ROM file
ghost commented 5 years ago

Okay thanks for explanation and sorry for the delay of my answer

ghost commented 5 years ago

This is called Netplay but its really only feasible for local network and not internet play. I would call the feature Localplay then.

shonumi commented 5 years ago

It's playing over a TCP/IP network, so it's called netplay. Netplay for many handheld consoles is generally only done via local networks anyway due to the way many of them link and communicate.