Unity Console Server - unity3d

I have to make the online game as my project at the university.
The game must have
The server and the client of any turn-based game. Implementing the basic principles and rules of the game.
The server keeps a list of connected clients, runs the game, deals
processing and transfer of information. The application server with text-based interface
user concurrent operation. Client GUI
I would like to use Unity3D engine, but do not know if this is feasible.
How to make a console server for unity?

Feasible? yes
Easy, well, it depends of your aproach, but it is completly possible, there exist some people than do it with Node.js
But, if your thing is turn based, then maybie you can do an invention with a webserver (like uniserver for example, or Xamp, or some other Apache / mysql implementation) and, inside unity, use the WWWForm class.
https://docs.unity3d.com/ScriptReference/WWWForm.html
Is a little cheaty, but it's maybie the easiest way for testing purposes (in no way you must use it for production of a serious game if you have any decent, fast (for production) and secure aproach to the subject, which this is not.
Cheers

Related

What is the cons of using unity built in network manager?

Why do Unity game developers implement server by themselves instead of using unity built-in NetworkManager?
It seems like multi online games can easily be developed by using NetworkManager,
but why do developers implement server by themselves using node.js, ... etc??
Its my understanding that it is not possible for two separate unity projects to talk to each other using the Unity HLAPI (High Level API, which is what NetworkManager is utilizing).
That means that you would have to have all the server code, and all the client code, in the same project.
This doesnt have to be a problem really, but for larger scale projects, separating the server from client can be easier to work with, and you dont push out all the server code to the clients to possibly reverse engineer.
Lets say you have a round-based, non-realtime game like scrabble, in this case it would make sense to use node or any http protocol, where you have a centralized server with a database for persisting game states.
But i honestly have no clue why anyone would prefer pure sockets when you have the Unity TLAPI (Transport Layer API)
https://docs.unity3d.com/Manual/UNetUsingTransport.html
I hope this was somewhat helpful and not just a rant.

Photon Unity Networking or Bolt or ...?

I am not able to decide whether to use PUN or Bolt in my Unity based multiplayer game. The game must have LAN and over the internet playing options.
According to documentation on photon website, PUN is meant for multiplayer games over the internet. Master Server is hosted either in the photon cloud or dedicated servers running Photon Server.
Bolt, on the other hand, is meant for LAN games. One of the clients becomes the server.
My game needs both, LAN and Internet. Should I use both the SDKs? Can't there be common code for both options?
EDIT:
UNET is now depricated!
You can also go with the new network from Unity (UNet) It has both lan and Internet (if you portforward, but I think that there should be an option for that non the less. Quote me on this).
You however can take a look in the UNet manual to see if you like it.:
https://docs.unity3d.com/Manual/UNet.html
I am currently working on a 3v1 game with this. And it takes some time to understand, but you don't have to worry about payments or other things.
(I don't have 50 reputation so I can only give an answer)
Photon Support replied,
1] Should I use both the SDKs?
Combining PUN + Bolt does not make sense. Bolt works fine for LAN and online gameplay. Bolt is not based on UNET, it is written from the ground up. Photon Cloud and Dedicated servers can be used with Bolt as well. https://doc.photonengine.com/en-us/bolt/current/advanced-tutorials/headless-server
2] Should i write separate code for online and LAN feature?
No, this is not necessary - you "just" need to deal with the higher latency in online gameplay.
I would recomment you Photon. It's pretty easy to use and it's really cheap. Photon server are way MUCH cheaper than the UNET servers.
Both UNET and Photon have a great documentation, lots of tutorials and a big community, so you should't have a problem with that if you pick one or another :)
Bolt work with "internet" game as well if you prefer to differentiate games by internet and LAN.
However choose which one is highly depend on your game itself.
If the game required central secure server to handle logic process, you should go with Photon or similar approach.
If the game is p2p, fast faced and doesn't care much (not meaning doesn't care at all) to secure (avoid cheating, speed, wall hack for example) then you should go with Bolt.
Photon made a comparison here:
https://doc.photonengine.com/en-us/pun/current/reference/pun-vs-bolt
The major difference to me is the Host Migration, Bolt and UNet are not support Host Migration yet (UNet support LAN but not Internet)...
If your game is really fast pace (~30s per game) and don't care about Host Migration (Master client disconnected), then PUN or own dedicated server (which I wouldn't consider) are the only choices.
I have heard that if you want to do something well done do it yourself. This does not mean that PUN or Bolt or UNet do not work, on the contrary they serve perfectly for the scenarios that were created, but for your particular scenario they may not fit well. If you want LAN, Internet, Central Server or a client as a server, in addition to algorithms that avoid latency, such as interpolation and prediction you must do it from scratch, creating your own framework, for this use the Unity Networking API.

Developing a VoIP/Chat Server-Client platform, where to start

I am interested in developing a Client and a Server for VoIP and IM communication like mumble/teamspeak/skype/raidcall etc.
I would like to stay away from hardcore stuff, while my main goals regarding the client are:
Basic VoIP and Chat functionality
Custom emoticons in chat
A completely flat designed UI
Project lasts one month
So is this in your opinion a realistic and doable concept? If so which language do you think that would fit my above goals the most? And can you also point me to a certain direction? (Like should I use xmpp, should I find a completed Server and develop only the client etc).
I can code in C, C++ and Java at a university level.
Thanks in advance.
Maybe you should have a look at: www.freeradionetwork.eu
It's a prehistoric, but nevertheless interesting project. They published their protocol in hope for someone to write an API.
Do you want to stream through your server, or make it P2P?

Advices on server implementation for server/client structure iOS App development?

There are must be a lot of apps that are designed to communicate with server. My question is only about App installed on iOS device + Server side service interaction. Web app is not what I am talking about, and there should be no webpage involved in this discussion at all. Typical examples are Apps like Instagram and Twitter, in which most of the information exchanged between the App and the server is just data like String, Image and Integers(wrapped in JSON or XML), no webpage presentation needed.
My question will be: if you are an independent app developer, and you are designing such an app from scratch without any existing website API, database structure or application(so you are not limited by any existing API or database structure or application protocol), What will be the most efficient approach?
What the sever side need to do are:
receive data send by the App;
process the data with designed logic;
interact with database(like MySQL);
do necessary data mining and analysis---this could be a constantly running service or one time task requested by the App client;
send the data back to the App upon request or spontaneously;
exchange or broadcast the data between/among different App clients (i.e.: group chatroom and peer to peer message);
As far I as know there are 3 obvious options to implement the server side:
PHP
Python
Ruby on Rails
(please feel free to add more options)
My questions are:
which one is the most appropriate choice to implement the server side?
If the App is focusing intensively on natural human language/text searching, analyzing and data mining, which one is the best choice? I heard Python is doing pretty good in this area.
Any advice on the database choices? I am using MySQL for now, and I found it's quite powerful for my purposes, I heard Twitter is switching to Cassandra. Will that be too difficult to start with?
For the server end, if you need to build a Server management interface, for you as an admin to manage and monitor the community, membership, data and such, is there any existing solution, or framework or tool for that? what will be the most efficient approach?
If a new programmer has no experience in non of them, which one you suggest he/she to start with?
Is there any good reference material or sample code on the server side in such context we can learn from?
I know there are a lot of very experienced experts on these areas on Stackoverflow, but I saw more newbies who just entered the iOS developing area without much knowledge in server/database programming experience. And I hope this thread can help these who are thinking to design an App with server/client structure but have no idea where to start with.
ps: I will keep updating this question thread and adding my findings on this topic, to help all other users at stackoverflow. :-) Please try to make your answer informative, easy to understand, and constructive. I guess most of readers for this thread will be new members of this great community.
Are you sure you want to spend time & money to develop your own Server & develop your own API?
There are lots of mBaaS (mobile Backend as a Service) providers today such QuickBlox, Parse,StackMob, which are ready to use and they have great Custom Objects API and some of predefined modules. They have great free plans with big quota. Some of them such QuickBlox has Enterprise plan - so you can buy license and they server team update server for you purpose.
So, i recommend not develop your server and think about mBaaS market.
Just about your issue - I can recommend look at QuickBlox Custom Objects code sample and also Custom Objects API. Custom Objects module provides flexibility to define any data structure(schema) you need. Schema is defined in Administration Panel. The schema is called Class and contains field names and their type. I think it's what you need.
which one is the most appropriate choice to implement the server
side?
Well that depends on what you know, there is reason to choice one of the other
If the App is focusing intensively on natural human language/text
searching, analyzing and data mining, which one is the best choice? I
heard Python is doing pretty good in this area.
This would reflect on your first question, you pick the language on you needs. Thus if python makes it easier then pick that one.
Any advice on the database choices? I am using MySQL for now, and I
found it's quite powerful for my purposes, I heard Twitter is
switching to Cassandra. Will that be too difficult to start with?
Again not one that is easy to answer, since it all has to do with requirements. But any SQL server will do. Cassandra is meant for "scalability and high availability without compromising performance" accourding to there website. Do you think you webservice will get many request then it might be a choice to consider.
For the server end, if you need to build a Server management
interface, for you as an admin to manage and monitor the community,
membership, data and such, is there any existing solution, or
framework or tool for that? what will be the most efficient approach?
This again is only going to be answered when you pick the a SQL server and server language.
If a new programmer has no experience in non of them, which one you
suggest he/she to start with?
Start with something simpler, you are really going out on a limb here.
Is there any good reference material or sample code on the server
side in such context we can learn from?
Propably there is some, but you should really start small and work from there.
Twitter started out as a Rub on Rails app and is working on scalability and availability which ruby is not really good ar (that is my person opinion). or Look at facebook they have written a php to c compiler to make php run faster.
The only thing I can say to start code, when you app does take off then tackle the some of the performance issues.
And since you state that you are new to programming do not bite of more then you can chew.
This is a huge question and I don't think there is a best answer. It most depends on what you care about, such as how quickly the development process, how easily the implementation, etc.
And which one is popular, which one is cool, I don't think it make really sense.
In my personal opinion, I'm good at ASP.NET and I can get Windows server easily, so I'll start with an ASP.NET service to provides data.
And, to be continued.

Socket vs HTTP based communication for a mobile client/server application

I've recently decided to take on a pretty big software engineering project that will involve developing a client-server based application. My plan is to develop as many clients as possible: including native iPhone, Android and Blackberry Apps as well as a web-based app.
For my server I'm planning on using a VPS (possibly from slicehost.com) running a flavor of Linux with a MySQL database. My first question is what should be my strategy for clients to interface with the server. My ideas are:
HTTP-POST or GET based communication with a PHP script.
This is something I'm very familiar with - passing information to a PHP script from a form, working with it and returning output. I'm assuming I'd want to return output to clients as some sort of XML or JSON based string. I'm also assuming I'd want to create a well defined API for clients that want to interface with my server.
Socket based communication with either a PHP script, Java program, or C++ program
This I'm less familiar with. I've worked with basic tutorials on creating a script or simple application that creates a socket, listens for a connection and returns data. I'm assuming there is far less communication data-overhead with this method than an HTTP based method. My dream is for there to be A LOT of concurrent clients in use, all working with the server/database. I'm not sure if a simple HTTP/PHP script based communication design can scale effectively to meet the needs of many clients. Also, I may eventually want the capability of a Server-Push to clients triggered by various server events. I'm also unsure of what programming language is best suited for this. If efficiency is a big concern I'd imagine a PHP script might not be efficient enough?
Is there a commonly accepted way of doing this? For me this is an attempt to bridge a gap between some of my current skills. I have a lot of experience with PHP and interfacing with a MySQl database to serve dynamic web pages. I also have a lot of experience developing native iPhone applications (however none that have had any significant server-based communication). Also I've worked with Java/C++, and I've developed applications in both languages that have interfaced with MySQL.
I don't anticipate my clients sending/receiving a tremendous amount of data to/from a server. Something on par with a set of strings per a given client-side event.
Another question: Using a VPS - good idea? I obviously don't want to pay for a full-dedicated server (slicehost offers a VPS starting at ~ $20/month), and I'm assuming a VPS will be capable of meeting the requirements of a few initial clients. As more and more users begin to interface with my server, I'm assuming it will be possible to migrate to larger and larger 'slices' and possibly eventually moving to a full-dedicated server if necessary.
Thanks for the advice! :)
I'd say go with the simplicity of HTTP, at least until your needs outgrow its capabilities. (The more stateful your application needs to be, the less HTTP fits).
For low cost and scalability, you probably can't go wrong with a cloud like Rackspace's or Amazon's. But I'm just getting started with those, my servers have been VPSs from tektonic until now.