- Home /
can I use one Game as Server and Client at the same time?
hello guys,
I'm working right now on an little project for my study. This is a game where you should use your android phone/tablet as an addition to your pc.
The main game is running on a pc which is connected as Client or Server with other clients to play on network. <- this is done with Unity's network class
There should be the possibility to connect to each player an android device as extended minimap. this device is only listening to the game action, it should only display the actual positions of all objects I want to but not sending information to the pc.
Is it possible to do this with Network class again? Otherwise I will write an c# socket/tcp script for communication.
greetings Killerregenwurm
Answer by senad · Jan 22, 2013 at 08:59 AM
So if you do have a master server, this should be very easy. The androids can just connect to the server and receive all the data needed for the minimap.
However, if your architecture is peer-to-peer, it will be a little more complex, since you do not have a central game state, so the androids will have to collect the game state from all the clients.
In both cases you should be able to do it with the Unity network functionality.
Very cool idea with the minimap on mobiles btw. :) :)
Yes, it would technically be better to stream to your local android device from your game client. But if it is a small uni project, I would probably still stream from the server to the android, because it is much simpler to implement.
I do not think you can have a network view receive from one host and send to another at the same time. So you would need to work around that. And the work around depends on what kind of game you have. :)
PS: Do not open a new answer, if you want to comment on an answer. :)
Answer by Killerregenwurm · Jan 22, 2013 at 10:37 AM
there is a master server for the communication of the game clients. But the devices should connected peer-to-peer (in the local w-lan) to their game client, because they should limited for the player so you cant see enemies.
If they will be connected to the master server I had to specify which device belongs to one player and other stuff. I think that would be a lot more to do, but I will try it^^
thanks for this fast answer
Your answer
Follow this Question
Related Questions
Sending a gameobject over network with RPC? 2 Answers
Network - Client still in Network.Connections after disconnect 2 Answers
A node in a childnode? 1 Answer
Android and PHP high scores 0 Answers