Yo!
I want make an android WiFi - local multiplayer game. Something like in Minecraft PE. I dont know how start, although I know UNET. Can I use UNET for this? If not please recommend a solution and if yes can you tell me how?
Thanks for your time! ![]()
Yo!
I want make an android WiFi - local multiplayer game. Something like in Minecraft PE. I dont know how start, although I know UNET. Can I use UNET for this? If not please recommend a solution and if yes can you tell me how?
Thanks for your time! ![]()
Unity Networking (UNET) will work in the scenario you have given, as will Photon and Forge.
So if you already know UNET I guess it might be best to stick with that, as long as you bear in mind the documentation is a bit sparse currently, and there are still a few bugs, (nothing that I haven’t found a way around yet though.)
So I prepared a basic scene (networked) installed in 2 androids, connected with my WiFi (both) and hosted a LAN server. But I couldn’t connect as client from other phone.
You’ll have to post your scripts for help with what’s wrong. Also what error are you getting when you try to connect?
I’ve made a couple of applications that work multiplayer on android, both LAN and matchmaker, so I know it works.
actually theres no script yet. I am just using NetworkManager HUD component. I was searching around and found that if you want to make an android WiFi over LAN multiplayer game then the host needs to give its IP to every client… Basically there will be no internet needed offline LAN over WiFi.
I will be pleased if you can help me ![]()
First of all, do you know how to find the local IP address of a PC on your home network? And if not, which operating system(s) are you running on your PC(s)?
I know how to find IP of my PC but not my home network (haven’t tried ever). I am running on Windows 10. Basiically for the game I am making the android devices dont need to have a internet, so they are never connected to the master server. One device will switch WiFi hotspot on (this device will the host or server) so as they are not connected to master server but with that shared offline WiFi, I dont know how to tell the server android device to give its IP to every other device connected (so that they can connect). Can you help how to go about it? I am kinda loosing all hopes.
Okay, well one way or another for the time being at least, you need to get the local IP address of the device that is hosting the game on your LAN.
Here are a couple of ways to do it in Windows 10…
Now you have the IP address of the host PC. So on the client PC you just need to enter that number into the input box next to the button labelled LAN Client(C) in the NetworkManager HUD (make sure you overwrite or clear ‘localhost’ that is already in there), and click the button to join.
That’s all there is to it, if you still have problems establishing a connection you should try turning off any firewall software that is installed on the host device.
If you want to host the game on your mobile device you’ll have to Google how to find it’s IP address, but then you essentially do the same as above, but enter the mobile device IP address in the input box on the PC.
I forgot to ask. I’ll be super happy if I can do this with Photon! And also I am making it for android only. Basically I want to make a mobile version of Mafia party game. ![]()
Yes it will work just as well with Photon, however all the tutorials I can find for Photon use the Photon Cloud server to establish the connection between host and clients and would therefore require an internet connection to work, so you’ll need to read the Photon docs to find out how to do a LAN connection.
That’s not a problem, it will work fine android to android, as long as you work out how to find the IP address of the mobile device that is running as host.
I just realised, I seem to remember Photon only works using the Photon Cloud, and therefore will always require an internet connection, in which case you won’t be able to use it the way you want (i.e. with no internet connection.)
If I’m wrong, hopefully someone will be able to correct me on that.
Have you got the solution.
Having the same problem.
I want to create
a wifi networked multiplayered game. The default network manager ip address is localhost.
Even changing it to some other ip address don’t help since it reverts back to localhost again.
I followed official unity tutorial of 3D multiplayer game and made an android game out of it. In network manager i selected ip address as 192.168.15.43 instead of localhost while setting things up.
Now in one device i started the hotspot mode and made that device a host as well.
From other device which connected to hotspot network, i was unable to find any other device via Client option.
I saw first device again and realised that values has reverted back to localhost itself.
How to solve this problem?
Same here. I tried it locally on my laptop, it’s working but when I tried it on mobile (which is my target), it won’t work. I read on some posts that you need to get the ip of the host, and ways given are for pc. Hoping to look for solutions on android.
Try with ip 192.168.43.1
Here is mine. its working perfect on android.
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Networking;
public class UIManager : NetworkManager {
public Text status;
NetworkManager networkmanager;
void Awake(){
networkmanager=GetComponent<NetworkManager>();
}
public void Connect(){
networkmanager.StartClient();
status.text="ConnectBTN";
}
public override void OnStartHost(){
status.text="OnStartHost";
}
public override void OnStartServer(){
status.text="OnStartServer";
}
public override void OnClientConnect(NetworkConnection nc){
status.text="OnClientConnect "+"__"+nc.address;
}
public void Host(){
networkmanager.StartHost();
status.text="hostBTN";
}
}
The chances of their host device having that IP address are phenomenally low! You can’t just chuck random IP address in there and expect it to work.
You need to obtain the local network IP address of the device hosting the game, and also make sure that the host port isn’t blocked from incoming connections by a firewall on the device.
This link has an explanation of how to find the IP address on an Android phone. http://www.simplecodestuffs.com/how-to-find-ip-address-of-android-smartphone/
But basically it’s open Settings, tap WiFi and then tap the connected network in the list of networks, and there you’ll get an information screen which has your device’s local IP address. It’s that IP that you need to supply to clients that want to connect to your game.
Hey, I just want to know if their is a way to find available client’s ip addresses and display it on the host so I could display the clients directly without having to type the address every time they want to join.
I basically want to be able to display room created by host to a client without typing the ip. If a new client connects to a wifi the host is connected to the room should be shown automatically in the lobby.
Can this be made …are there any variables in unet which allows you to get the host ip and be able to send it to clients. Eg: if you have ever played pixel gun or modern combat 4 through lan on mobile u would understand
In a simple google serach i found a network discovery class usage with a good example, may be you like it…have a look at this
Does photon support offline multiplayer?
No, you need an internet connection.
so how to make an offline multiplayer like mini militia where one will host and others can join to play. unet says that its deprecated. so any other alternative? can u help me out?