add more docs

main
Anton Franzluebbers 2023-08-26 00:58:26 -04:00
parent 16f21bb01d
commit fc3c866f1a
12 changed files with 193 additions and 29 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

View File

@ -0,0 +1,25 @@
# VelNetUnity
### NetworkManager
Deals with instantiating NetworkPlayers, and dealing with join, left, new master client events. Also manages the list of NetworkObjects. It maintains a list of prefabs that can be instantiated, as well as the prefab to use for players.
### NetworkPlayer
One of these will be instantiated for each player that joins the "room". Most application communication happens by calling methods on this object. Voice comms are also handled within this object. Only one NetworkPlayer "isLocal". The others are remote. The local network player is the one that can modify it's "owned" network objects. It also has a special networkobject representing itself (setup within the prefab, not part of the networkmanager list). This is where most of the user behavior is going to go (e.g. an avatar).
### NetworkObject
Something that can be owned by a network player, who is responsible for updating it. Only the owner network player can/should modify a network object, whether locally or in response to a received message from the local version. NetworkObjects are delineated by an session-unique id, which consists of the creator's userid + "-" + an increasing number designated by the creator. Only local NetworkPlayers should send instantiate message, which contain this id. This class should be extended to sync and send messages. Scenes are basically built from NetworkObjects. Scene's can also start with network objects. Those are known by all, and start with "-1-increasing". That should happen the same on all clients, and is done locally at the start of the networkmanager. An example of a NetworkObject is SyncTransform, which is a simple one that keeps an object's position and orientation synchronized.
### Ownership
Ownership of objects changes regularly. Any local networkplayer can send a message to take ownership of a networkid. That client immediately assumes ownership. The message is sent to the network, and will be ordered with any other ownership messages. So, if two clients try to get ownership at the same time, both will assume ownership, but one will happen after the other. This means that the one who was first will quickly lose ownership.
### Joining
An interesting problem is what to do when new clients join. This is partially left up to the developer. Any objects that are instantiated (or scene objects that are deleted) will be automatically handled.
### Message Groups
Clients can manage network traffic using messaging groups. This is especially useful for audio, where you can maintain a list of people close enough to you to hear audio

View File

@ -0,0 +1 @@
# Quick Start

View File

@ -0,0 +1,11 @@
# Samples
This page has a brief explanation of each of the samples included in VelNetUnity. To install a sample, go to the Package Manager, and use the Import buttons in the Samples tab on the VelNet package (`Window->Package Manager->VelNet->Samples`).
## Basic Example
## Full Example
## VEL Voice Example
## Dissonance Example

View File

@ -0,0 +1 @@
# VEL Voice

View File

@ -1,19 +1,57 @@
# VelNet # VelNet
An easy-to-use networking library for Unity. VelNet is architected similar to Photon PUN, with a single server that acts as a relay for information sent by all clients. VelNet is an easy-to-use networking library for Unity. VelNet is architected similar to [Photon PUN](https://doc.photonengine.com/pun/current/getting-started/pun-intro), with a single server that acts as a relay for information sent by all clients.
VelNet consists of two main parts: VelNet consists of two main parts, [VelNet Server](/server) and [VelNetUnity](/client).
### [VelNet Server]()
<!-- ### [VelNet Server](/server)
[GitHub Link :simple-github:](https://github.com/velaboratory/VelNetServerRust)
### VelNet Unity ### VelNet Unity
## Installing [GitHub Link :simple-github:](https://github.com/velaboratory/VelNetUnity) -->
1. Set up the [server](/server_setup), or use the default server at `velnet-example.ugavel.com` ## Installation
2. Install the UPM package in Unity
- Option 1: 1. Set up the [server](/server), or use the default server at `velnet-example.ugavel.com`
- Add the VEL package registry:
- Install the UPM package in Unity:
=== "**Option 1:** Add the VEL package registry"
![Scoped registry example](/assets/screenshots/scoped_registry.png){ align=right }
Using the scoped registry allows you to easily install a specific version of the package by using the Version History tab.
- In Unity, go to `Edit->Project Settings...->Package Manager`
- Under "Scoped Registries" click the + icon
- Add the following details, then click Apply
- Name: `VEL`
- URL: `https://npm.ugavel.com`
- Scope(s): `edu.uga.engr.vel`
- Install the package:
- In the package manager, select `My Registries` from the dropdown
- Install the `VelNet` package.
=== "**Option 2:** Add the package by git url"
1. Open the Package Manager in Unity with `Window->Package Manager`
- Add the local package:
- `+`->`Add package from git URL...`
- Select the path to `https://github.com/velaboratory/VelNetUnity#upm`
To update the package, click the `Update` button in the Package Manager, or delete the `packages-lock.json` file.
=== "**Option 3:** Add the package locally"
1. Clone the repository on your computer:
`git clone git@github.com:velaboratory/VelNetUnity.git`
- Open the Package Manager in Unity with `Window->Package Manager`
- Add the local package:
- `+`->`Add package from disk...`
- Select the path to `VelNetUnity/TestVelGameServer/Packages/VelNetUnity/package.json`
To update the package, use `git pull` in the VelNetUnity folder.
Then check out the [samples](client/samples), or follow the [quick start](/client/quick-start).

View File

@ -0,0 +1,17 @@
# VelNet Server
[GitHub Link :simple-github:](https://github.com/velaboratory/VelNetServerRust){ .md-button }
The VelNet server acts as a relay between users of your application. It is not aware of the details of your application, and a single server can be used to serve many different applications.
To get started, either use the demo server at `velnet-demo.ugavel.com`, or [host it yourself](self-host.md)
This basic, single-file relay server is designed to be used for network games, and is similar to Photon Realtime in design. It is written in Rust, with a single-threaded, non-blocking design and does not rely on any network frameworks (pure TCP/UDP). A Unity/C# client implementation can be found in our [VelNetUnity](https://github.com/velaboratory/VelNetUnity) repository.
Like Photon, there is no built-in persistence of rooms or data. Rooms are created when the first client joins and destroyed when the last client leaves.
The only game logic implemented by the server is that of a "master client", which is an easier way to negotiate a leader in a room that can perform room level operations.
The "group" functionality is used to specify specific clients to communicate with. Note, these client ids can bridge across rooms.
The server supports both TCP and UDP transports.

View File

@ -0,0 +1,53 @@
# Self-hosting the Server
VelNet's server can be self-hosted with modest resources. The limiting factor will almost always be network bandwidth.
=== "Option 1: Pull from Docker Hub"
Make sure you have [Docker](https://www.docker.com/) installed, then pull the Docker image using:
```sh
docker run -p 5000:5000 -p 5000:5000/udp velaboratory/velnet
```
or
```sh
docker run -p 5050:5000 -p 5050:5000/udp --name velnet velaboratory/velnet
```
to run on a different port and change the name of the container.
=== "Option 2: Use docker-compose"
1. Clone the repo
- `git clone https://github.com/velaboratory/VelNetServerRust.git`
- Make sure you have [Docker](https://www.docker.com/) and [docker-compose](https://docs.docker.com/compose/) installed.
- The docker compose file runs both the control panel and the server.
- To start:
```sh
docker compose up -d
```
- To stop:
```sh
docker compose stop
```
This builds the images from the local data in the folder, and doesn't pull anything from Docker Hub.
=== "Option 3: Run Rust natively"
1. Clone the repo
- `git clone https://github.com/velaboratory/VelNetServerRust.git`
- Edit `config.json` to an open port on your firewall
- Modify the `user` field in `control-panel/config.json` to be your username.
- Install rust through using [rustup](https://rustup.rs/)
- Install: `sudo ./install.sh`
- Run server: `sudo systemctl start velnet`
- Run control panel: `sudo systemctl start velnet-control-panel`
- Install tuptime: `cargo install tuptime`
- Install onefetch: `cargo install onefetch`

View File

@ -1,33 +1,50 @@
site_name: VelNet Docs site_name: VelNet Docs
site_url: https://docs.velnet.ugavel.com
repo_url: https://github.com/velaboratory/VelNetUnity
repo_name: velaboratory/VelNetUnity
edit_uri: edit/main/Documentation
theme: theme:
name: material name: material
features:
- content.action.edit
- navigation.instant
# - navigation.sections
- navigation.expand
- navigation.path
- navigation.indexes
- toc.follow
- toc.integrate
palette: palette:
scheme: slate scheme: slate
primary: custom primary: custom
accent: red accent: red
# background: custom # background: custom
font: font: false
# text: Oswald # text: Oswald
# text: Merriweather # text: Merriweather
text: Merriweather Sans # text: Merriweather Sans
logo: assets/logo.png logo: assets/logo.png
favicon: assets/logo.png
plugins:
- search:
# - social:
# cards_layout_options:
# font_family: Oswald
- git-revision-date-localized:
enable_creation_date: true
markdown_extensions:
- attr_list
- md_in_html
- pymdownx.emoji:
emoji_index: !!python/name:materialx.emoji.twemoji
emoji_generator: !!python/name:materialx.emoji.to_svg
- pymdownx.superfences
- pymdownx.tabbed:
alternate_style: true
extra_css: extra_css:
- stylesheets/extra.css - stylesheets/extra.css
# theme:
# name: material
# palette:
# # Palette toggle for dark mode
# - scheme: custom
# media: "(prefers-color-scheme: dark)"
# # primary: custom
# toggle:
# icon: material/weather-sunny
# name: Switch to light mode
# # Palette toggle for light mode
# - scheme: default
# media: "(prefers-color-scheme: light)"
# toggle:
# icon: material/weather-night
# name: Switch to dark mode

View File

@ -1 +1,2 @@
mkdocs-material mkdocs-material
mkdocs-git-revision-date-localized-plugin