Advertisement

Two Questions - Basic Adivce And Making A "match" Manager

Started by July 23, 2016 03:58 PM
3 comments, last by Endel Dreyer 8 years, 3 months ago

Hi everyone, so I'm working on a multiplayer card game in Unity 3D. I've got networking where client can communicate with server and the other client connected to the server (I want the matches to be 1v1 so I'm only allowing 2 connections).

Question 1: Since I'm having a hard time with Unity Networking and this game style is rather simple and without too much artwork, should I just code it in Java or would that be more difficult?

Question 2: If I stick with Unity, what do you guys envision to be the best approach on managing this game. As of right now, I'm having a hard time because I'd like there to be some sort of central manager where player one tells him I want to draw a card and the manager tells him what he drew. I want to design it this way because I want to store the decks in a database.

Honestly, any advice would be helpful and welcomed.

If Unity gives you tools that save you time, then it's worth using.
If it doesn't save you time, then it's not worth using.
Writing in Java might be fine for the server side, but client-side Java is not a super experience these days. (Except for Android.)
Where do you expect players to play? On phones? In web browser? On PCs? Macs? Linux? On game consoles?
The benefit of Unity (or Unreal, or perhaps some other large engines) is that you can target all those platforms.
The draw-back is that they come with a bunch of built-in weight you may not need.

So, my recommendation, without knowing more than what you posted above, would be to build the server side of your game as a web service.
Then build the client to actually play the game in whatever way most easily targets your desired platforms.
Make the client make HTTP requests to get game information and perform game actions. You can use long-polling if you need to.
This way, the server can easily be built in some language you know, and the client can easily be targeted to the platforms you want.
enum Bool { True, False, FileNotFound };
Advertisement

My hope was to have the client run something locally that would connect to my server. The client would simply pass instructions but most things would remain server side such as what card was drawn. I also considered that instead of using a SQL database to store the decks for each player and the cards that exist in the game that maybe I can use xml. I'm going to look at how to connect unity to a java server.

Look at the WWW class and the newer UnityWebRequest for HTTP requests.
Note that lower-level sockets (non-HTTP) don't work in the WebGL builds of Unity.
enum Bool { True, False, FileNotFound };

Hey there,

I've been playing with Colyseus for a while, mostly for HTML5 prototypes and it's being a fair developer experience: https://github.com/gamestdio/colyseus

It does have a Unity3D client, which is already a bit outdate (works only with server v0.3.x, current version is v0.4.x), so I wouldn't recommend to use it on Unity games for now.

The server is written in Node.js and only accepts WebSockets connections. It has a very simple architecture and is capable to handle multiple game instances in a single server.

I'd suggest you to use just the latest version of the server and the JavaScript client.

This topic is closed to new replies.

Advertisement