Can't play Tris example for Unity3D

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

Alex_Brazil
Posts: 9
Joined: 28 Jan 2022, 19:12

Can't play Tris example for Unity3D

Postby Alex_Brazil » 04 Mar 2022, 21:41

I'm using the examples to study the implementation of a Multiplayer game, but I can't even play the example.
I've already uploaded the extension to the server and configured the Host, TCP-Port and zone (I use an overcast server).
What should I do in this game beginning to understand its usability?
Can someone help me?

Image

Image
User avatar
Bax
Site Admin
Posts: 4612
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: Can't play Tris example for Unity3D

Postby Bax » 07 Mar 2022, 14:24

The problem is the deployment of the Extension. You should deploy the Tris folder only, not the full path from the example zip file.
In other words the Extensions folder on the server side should look like this:
> /extensions
---> __lib__
---> Tris
------> TrisExtension.jar
Re-deploy the extension, restart SmartFoxServer and your clients should be able to interact and play the game.
Paolo Bax
The SmartFoxServer Team
Alex_Brazil
Posts: 9
Joined: 28 Jan 2022, 19:12

Re: Can't play Tris example for Unity3D

Postby Alex_Brazil » 09 Mar 2022, 18:37

I made the suggested change in the extension's folder structure, but I still can't play.
I could be wrong in the gameplay. What should I do to play? Click on the panels? Use the "O" or "X" keys?

https://static.wixstatic.com/media/b4280e_74f1d1443da7496382244b75acc7640e~mv2.png

Thanks
User avatar
Bax
Site Admin
Posts: 4612
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: Can't play Tris example for Unity3D

Postby Bax » 10 Mar 2022, 07:39

When two clients join the same game Room, the game starts and you can click on the panels to make the O or X appear.
Paolo Bax
The SmartFoxServer Team
Alex_Brazil
Posts: 9
Joined: 28 Jan 2022, 19:12

Re: Can't play Tris example for Unity3D

Postby Alex_Brazil » 11 Mar 2022, 14:13

That's what I tried.
I have two players in the same room, but nothing happens when I click on the panels.
I'll try to run it on the local server (localhost), for a retest.
But if you have any tips to solve the problem, I would appreciate it.
User avatar
Bax
Site Admin
Posts: 4612
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: Can't play Tris example for Unity3D

Postby Bax » 11 Mar 2022, 14:43

I'd suggest to check the server log. Look for errors or warnings which should explain what is going on.
The example works fine on our computers, so it looks like a deployment issue on your computer.
Paolo Bax
The SmartFoxServer Team
Alex_Brazil
Posts: 9
Joined: 28 Jan 2022, 19:12

Re: Can't play Tris example for Unity3D

Postby Alex_Brazil » 25 Mar 2022, 12:08

I'm not getting any logs on the server when running Tris. Do I have to enable something or change the Java extension code for this to happen?

The boot log indicates that everything started successfully.

Image
User avatar
Bax
Site Admin
Posts: 4612
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: Can't play Tris example for Unity3D

Postby Bax » 26 Mar 2022, 10:10

The AdminTool unable to display the runtime logs, the game not working as expected... definitely there's something wrong in your installation.
Instead of using the AdminTool, I'd suggest to run SmartFoxServer in a terminal and check the output directly while running the game.
As an alternative you can find the server logs in the SFS installation folder, under /logs.
Let us know if you find anything.
Paolo Bax
The SmartFoxServer Team
Alex_Brazil
Posts: 9
Joined: 28 Jan 2022, 19:12

Re: Can't play Tris example for Unity3D

Postby Alex_Brazil » 26 Mar 2022, 18:44

When you mention that we have an error in the installation, would it be in the installation of the server?
We are using the OverCast service, where we just subscribe and receive the server already mounted and initialized.

Image

I need to improve on this issue, please help me, my manager is in charge of finding a robust solution for our multiplayer applications.
If you can point me to a consultant we can hire right away, that would be great.

Something that crossed my mind now... Could it be because of the server version I'm using?
User avatar
Bax
Site Admin
Posts: 4612
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: Can't play Tris example for Unity3D

Postby Bax » 28 Mar 2022, 08:57

We tested the Tris example on your Overcast server and it looks like everything works perfectly, as expected by the way.

1) You posted two screenshots, both showing "Waiting for your opponent". I suppose on both client instances the player clicked the "Start new game" button, but this is wrong. As the label says, by doing so each client creates its own game (in other words two separate game Rooms), so both clients are waiting for more players to join. The second player is supposed to click the first player's game in the list above the button, to join the first player in the same game Room and start playing. If you try, you will find out that the game works just fine.
Sorry for not mentioning this before, but I assumed you read the example's tutorial, which describes this approach:
the UI is structured similarly to the Lobby example [...] there is now a list of games instead of a list of chat rooms that a client can join. Additionally there are two buttons, to start a match and to disconnect and return to the Login scene. The "Start new game" button requests SmartFoxServer to create a Game Room attaching the Extension to it. If either we joined an existing Room (clicking on a list item in the UI) or created a new game, the client will receive a ROOM JOIN event, etc...


2) You said "I'm not getting any logs on the server when running Tris". Did you click on the "Load" button in the AdminTool's Log Viewer module? I'm asking because I clicked it and the logs are loaded as expected. This is described in the AdminTool's documentation.

3) I've noticed the chat in the lobby doesn't work because the lobby Room couldn't be joined: the reason is that in your Zone you called the Room "The Loby" instead of "The Lobby", as the original game script requires. Maybe you changed your script too, but I wanted to mention just in case...

Alex_Brazil wrote:I need to improve on this issue, please help me, my manager is in charge of finding a robust solution for our multiplayer applications. If you can point me to a consultant we can hire right away, that would be great.

Our suggestion is to go through the SmartFoxServer documentation (at least the Overview, Getting started and Development basics), then learn from the Unity examples starting from the first one (Connector) and moving up progressively.
We don't provide a consultancy service, but you can post a message in the "Job offers" section of this forum.
Hope this helps.
Paolo Bax
The SmartFoxServer Team
Alex_Brazil
Posts: 9
Joined: 28 Jan 2022, 19:12

Re: Can't play Tris example for Unity3D

Postby Alex_Brazil » 31 Mar 2022, 14:14

Solved, sorry for the inconvenience.
It was actually a silly thing, pure lack of attention on my part.
In the LoginController.cs script there is a public and serialized field where I entered my server IP, but I don't know why Unity3D kept the localhost IP typed in the Inspector tab.

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 82 guests