• Dear Cerberus X User!

    As we prepare to transition the forum ownership from Mike to Phil (TripleHead GmbH), we need your explicit consent to transfer your user data in accordance with our amended Terms and Rules in order to be compliant with data protection laws.

    Important: If you accept the amended Terms and Rules, you agree to the transfer of your user data to the future forum owner!

    Please read the new Terms and Rules below, check the box to agree, and click "Accept" to continue enjoying your Cerberus X Forum experience. The deadline for consent is April 5, 2024.

    Do not accept the amended Terms and Rules if you do not wish your personal data to be transferred to the future forum owner!

    Accepting ensures:

    - Continued access to your account with a short break for the actual transfer.

    - Retention of your data under the same terms.

    Without consent:

    - You don't have further access to your forum user account.

    - Your account and personal data will be deleted after April 5, 2024.

    - Public posts remain, but usernames indicating real identity will be anonymized. If you disagree with a fictitious name you have the option to contact us so we can find a name that is acceptable to you.

    We hope to keep you in our community and see you on the forum soon!

    All the best

    Your Cerberus X Team

games in real time

bosh77

Member
Joined
Oct 26, 2019
Messages
44
Hi, how can I create an online multiplayer game, where apps can communicate with each other in real time? Is there any example or module with which you can do this?
 
Last edited:
I don't think there's a specific module, but here's a limited example: https://www.cerberus-x.com/communit...ime-co-for-a-turn-based-multiplayer-game.639/

Cerberus X can use websockets, which is a good way to go, not sure if it uses WebRTC.
https://webrtc.org/getting-started/overview

You can do just fine with websockets game, but the difficult part is deciding on a server to maintain game sessions and state. If someone drops off for 3 seconds, how is the game handled? Using a self-hosted (or on AWS, Vultr) server is one way:
https://github.com/colyseus/colyseus

I think there are hosting game servers out there, Google Cloud seems to have one: https://cloud.google.com/game-servers
It would be possible to forego a server, but the two (or more) machines would have to know each other's IP addresses.
 
Hello, I'm trying to work with sockets but I don't understand how to make communicate my Android device with the computer (forgive my ignorance).
If imposed an IP address different from Localhost, I get the Bind Failed error.
How do I use the IP address of the devices that I want to make communicate with each other?
 
I am trying with the example echoserver_tcp.cxs.
When imposed "localhost" as a address it works, but when I use the ip address of the machine it gives me error.

Code:
Class TcpEchoServer Implements IOnAcceptComplete

    Method New(port:Int)
        _socket=New Socket( "server" )
        If Not _socket.Bind(hostx, port) Error "Bind failed"
        _socket.AcceptAsync( Self )
    End
    
    ....

If I impose "hostx" with an IP address I get Bind Failed error, so I can't try on a LAN.

Also I don't have very clear ideas on the functioning of sockets:cry:. My goal is to be able to exchange data between devices to manage a multiplayer game.
 
If both devices share the same lan, it should work. Do they?
Yes if I use local IP address I can connect my Windows app with my Android device.
But I can't make them communicate via remote IP address
 
So you have a Server running somewhere that shares the messages between connected devices? So for maybe asking stupid questions. It’s not my field of expertise.
 
Yes, Windows and Android devices are connected to the home router

The problem is to connect them via remote IP

I am not an expert either

Maybe it is not possible to do as I think

the Bind method of the Socket class does not allow you to connect to a remote IP
 
Last edited:
Your router uses just "one" external IP #. If you assign this IP # to all devices, it won't work. You need to use the IPs your router gives your devices, something like '192.168.1.100' - open a command prompt and type "ipconfig /all" to see that on Windows.
 
Back
Top Bottom