saishy / tinybirdnet-unity Goto Github PK
View Code? Open in Web Editor NEW[DISCONTINUED] A high level API for making networked games in Unity, utilizes https://github.com/RevenantX/LiteNetLib
License: MIT License
[DISCONTINUED] A high level API for making networked games in Unity, utilizes https://github.com/RevenantX/LiteNetLib
License: MIT License
Machine A: Windows 7 x64 Japanese on an Atom CPU
Machine B: Windows 10 x64 English on a Ryzen 3 CPU
Problem:
Machine A runs the Example Project included with TinyBirdNet as host mode. Machine B connects to Machine A and everything is synchronized correctly, etc. However, when the host instance of the example project on Machine A is quit, Machine B remains "connected" and does not get kicked back to the main menu. This leaves Machine B in a limbo state.
Severity:
Low if it's just the example project at fault. High if the actual library (TinyBirdNet) is at fault.
Expected behaviour:
If Machine A goes down and it was the host, then Machine B should be taken back to the main menu.
I guess the fix would be very trivial and I could probably fix it in a few lines of code. It just needs to load the main menu scene if the disconnection event is fired.
This is a two-part issue ticket. Let's start with the puzzler:
In my test scene, I have 2 prefabs that are called "Floor" and "Game". "Game" contains management scripts that the controller I'm porting to TinyBirdNet. Each gameobject has an attached TinyNetIdentity and the Asset GUID is correctly set (as part of the prefab saving process). For example, here's what the "Game" gameobject has attached:
And I have them in the scene, enabled as usual:
However, upon connecting to the server, they get disabled and never get re-enabled (as in, they get grayed out in the inspector). I don't know what's going on, but I have a Network Manager gameobject that contains a very barebones script as follows:
using UnityEngine;
using TinyBirdNet;
public class ExperimentalTinyBirdNetManager : TinyNetGameManager
{
string hostAddress = "127.0.0.1";
int hostPort = 31337;
// Use this for initialization
private void Start()
{
print("ExperimentalTinyBirdNetManager started up");
instance.SetPort(hostPort);
instance.StartServer();
instance.StartClient();
instance.ClientConnectTo(hostAddress, hostPort);
}
public override void ClientConnectTo(string hostAddress, int hostPort)
{
base.ClientConnectTo(hostAddress, hostPort);
}
public void OnClientReady()
{
print("OnClientReady fired!!");
}
}
Part 2 of the issue ticket:
What would be the TinyBirdNet Equivalent of this UNET code?
public override void OnServerAddPlayer(NetworkConnection conn)
{
var spawnPosition = Vector3.right * conn.connectionId;
var player = GameObject.Instantiate(playerPrefab, spawnPosition, Quaternion.identity) as GameObject;
NetworkServer.AddPlayerForConnection(conn, player);
}
As you can probably tell, this code is called if you issue a server-side AddPlayer command on the Server side. It would spawn a player object and assign the connection as the owner of that GameObject. I see you either haven't implemented such functions or I'm looking in the wrong place. I cannot use TinyNetPlayerController as the kit I'm using would break and it already uses a lot of RPCs and whatnot for server <-> client communication.
If it's unimplemented then I am going to have to stop porting the kit my project uses to TinyBirdNet because this is a show-stopper.
Hi there,
Just wondering if the current version of TinyBirdNet-Unity is stable or if it's got any bugs/gotchas that need to be addressed? I also wanted to know if the project is still alive and kicking, because I really do like the idea of a UNET-like HLAPI that will plug directly into LiteNetLib rather than going through and having to manually write adapters, wrappers and all that painful things. However, the last commit date was a little concerning, so I thought I'd open a issue ticket and ask.
Cheers!
I am very grateful to you for your help.😭
Because I am not familiar with the Internet, I would like to ask you what you think about server switching?
Server switching means
when a server disconnects, it allows a client player to become a server.
Hey there,
I have been researching lots of different networking solutions, trying to determine what I would like to use for my small online rpg and came across yours. I noticed network activity is tied to frames, is this not a bad idea instead of having network possibly run on its own thread or something like that?
Also, is it possible to have the server listen on multiple ports and then handle messages differently based on which incoming port is used? I wanted servers to interconnect on one port but then clients connect on another port and their messages of course would end up being handled appropriately. I was able to get this working for the most part using standard LiteNetLib by just making a second netmanager, but when I tried using this, I keep getting null reference errors in TinyNetScene.InternalUpdate().
Thanks!
First let me say awesome work.
I wanted to introduce myself. Hey im Mike. :)
The goals of my project are to create a networking library more similar to Amazons GridMate. I may also help contributing to LiteNetLib for some of the features that people have been requesting that I would also love to see.
If your down we should chat some time about the current implementations of networking that Unity and third parties have to offer, and what we see as limitations, and how we can improve networking in the unity community.
Take care and awesome work. My email is listed on my profile.
I want to know if there is such a value in NetManager that controls the connection time. /(ㄒoㄒ)/~~
Apparently the SyncVar implementation that TinyBirdNet features does not support hooks. As the kit I'm trying to migrate to TinyBirdNet uses some of these hooks, I'm going to have to implement workarounds.
Is there any reason why hooks are not implemented or are they currently on the to-do list?
Why can I only use 32 TinyNetSyncVar?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.