diff --git a/src/Beginner_Tutorial/setting_up_plugin_development_environment.md b/src/Beginner_Tutorial/setting_up_plugin_development_environment.md index d83f818..b2c8c92 100644 --- a/src/Beginner_Tutorial/setting_up_plugin_development_environment.md +++ b/src/Beginner_Tutorial/setting_up_plugin_development_environment.md @@ -3,7 +3,7 @@ Plugins are typically developed in their own repositories or folders. ## Before plugin development -Before we start doing any plugin development, we need to set up the engine into your machine. Please refer to the [Development Environment](../Product_Page/dev_env.md) before we start setting up the plugin development environment. +Before we start doing any plugin development, we need to set up the engine into your machine. Please refer to the [Installation](../installation.md) as beginning installation and [Development Environment](../installation.md#most-advanced-version-development-environment-version) to set up the development environment. ## Using the template The easiest way to get started is to fork the @@ -17,25 +17,11 @@ git clone git@github.com:ChatImproVR/template.git cd template git remote remove origin ``` - -## Setting up the helper script -The helper script is intended to make it easy to run the client, server, or both from a single command. The script requires Python 3. +## Modifying the helper script +We need to update the helpder script to locate where the plugin path is located. For the next section, we will help you out how to modify the helper script based on each terminal. +> Note that all the additional change is inserting line(s) outside of the `cimvr` function call. ### On Linux/Unix/MacOS (Bash) - -If your MacOS system is using `bash` instead of `zsh`, then please follow this procedure. Otherwise, please follow the MacOS (Zsh) section. - -Assuming you have a copy of `iteration0` somewhere (in this case, `$HOME/Projects/chatimprovr`), you can put the following in your `~/.bashrc`: - -```bash -function cimvr() { - $HOME/Projects/chatimprovr/cimvr.py $@ -} -``` -This will allow you to access the script as `cimvr` anywhere. - -> *NOTE: If you do not have the .bashrc file, you need to create on in the $HOME directory.* - let's say we want to develop a plugin called `foo`, that we're developing at `$HOME/Projects/foo`. Then we could add this to our `~/.bashrc`: ```bash export CIMVR_PLUGINS="$HOME/Projects/foo" @@ -47,18 +33,6 @@ export CIMVR_PLUGINS="$HOME/Projects/foo;$HOME/Desktop/poo" ``` ### On MacOS (Zsh) - -Assuming you have a copy of `iteration0` somewhere (in this case, `$HOME/Desktop/Rust/chatimprovr`), you can put the following in your `~/.zshrc`: - -```zsh -function cimvr() { - $HOME/Desktop/Rust/chatimprovr/cimvr.py $@ -} -``` -This will allow you to access the script as `cimvr` anywhere. - -> *NOTE: If you do not have the .zshrc file, you need to create on in the $HOME directory.* - let's say we want to develop a plugin called `foo`, that we're developing at `$HOME/Desktop/Rust/foo`. Then we could add this to our `~/.bashrc` ```zsh @@ -71,20 +45,6 @@ export CIMVR_PLUGINS="$HOME/Desktop/Rust/foo;$HOME/Desktop/poo" ``` ### On Windows -Assuming you have a copy of `iteration0` somewhere (in this case, `C:\Users\dunca\Documents\iteration0`), you can put the following in your `Microsoft.PowerShell_profile.ps1`. - -```ps1 -function cimvr() { - $cimvr_path="C:\Users\dunca\Documents\iteration0" - python $cimvr_path\cimvr.py $args -} -``` -This will allow you to access the script as `cimvr` anywhere. - -> *NOTE: If you cannot find the `Microsoft.PowerShell_profile.ps1`, you can find the file by typing `$profile` in Windows PowerShell. There is a chance that `Microsoft.PowerShell_profile.ps1` might not exist yet. In that case, you need to create a new file and the directory to match that path. In the image below, the file should be located in `Documents\WindowsPowerShell` under the file name as `Microsoft.PowerShell_profile.ps1`. If running scripts is disabled on your machine, consult the common fixes section.* - -![$profile path](./images/profile_path.png) - Let's say we want to develop a plugin called `foo`, that we're developing at `C:\Users\dunca\Documents\Projects\foo`. Then we could add this to our `$profile`: ```ps1 $Env:CIMVR_PLUGINS="C:\Users\dunca\Documents\Projects\foo" @@ -94,14 +54,8 @@ If you are developing on several plugins at the same time, for example `foo` and export CIMVR_PLUGINS="C:\Users\dunca\Documents\Projects\foo;C:\Users\Mr.Kangs\Desktop\galaga" ``` - ### Using the script to launch plugins -After building both `iteration0`'s client and server as well as the example plugins, we could launch the cube example included with ChatImproVR using: -```bash -cimvr camera cube -``` - -After building our own plugin we could launch it with: +After building our own plugin and updating the helper script, we could launch it with: ```bash cimvr foo @@ -109,9 +63,9 @@ cimvr foo This will start the client and the server with our plugin as arguments. Note that this name `foo` is determined via package name, the one we set earlier. -The `CIMVR_PLUGINS` environment variable is a semicolon-seperated list of search paths. We've set it to `target/wasm32-unknown-unknown/release` under our own plugin, so that it can find `foo.wasm`. +The `CIMVR_PLUGINS` environment variable is a semicolon-seperated list of search paths. We've set it to the path of the plugin under our own plugin, so that it can find `foo.wasm`. -Note that the `example_plugins` directory will be looked for by default, so you don't need to add an environment variable for these. +> Note that the `example_plugins` directory will be looked for by default, so you don't need to add an environment variable for these. ## Tips and tricks ### Using the cargo-watch crate diff --git a/src/SUMMARY.md b/src/SUMMARY.md index f3f99cb..4acb1fe 100644 --- a/src/SUMMARY.md +++ b/src/SUMMARY.md @@ -2,8 +2,6 @@ - [Introduction](./introduction.md) - [Installation](./installation.md) -- [How do you Run](./execuation.md) -- [Development Environment](./dev_env.md) - [Core Concepts](./Core_Concepts/core_concepts.md) - [Plugins](./Core_Concepts/plugin.md) - [Webassembly](./Core_Concepts/wasm.md) diff --git a/src/dev_env.md b/src/dev_env.md deleted file mode 100644 index 5fcdafd..0000000 --- a/src/dev_env.md +++ /dev/null @@ -1,57 +0,0 @@ -# Setting up a development environment -## Preparation -### Installing Rust -Go to [Rustup](https://rustup.rs/) and follow the instructions. Alternatively, start at the [rust documentation](https://www.rust-lang.org/learn/get-started). - -### WASM target -Make sure you have the `wasm32-unknown-unknown` target installed; -```sh -rustup target add wasm32-unknown-unknown -``` - -### Dependencies on Ubuntu: -```sh -sudo apt install build-essential cmake libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libspeechd-dev libxkbcommon-dev libssl-dev -``` - -## Repository -Clone the `iteration0` repository, available [here](https://github.com/ChatImproVR/iteration0). -```sh -git clone https://github.com/ChatImproVR/iteration0.git -``` - -## Compilation -Build the client, server, and example plugins like so: -```sh -pushd server -cargo build --release -popd - -pushd client -cargo build --release -cargo build --release --features vr # (For VR/OpenXR support) -popd - -pushd example_plugins -./compile_all.sh # (Linux) -# ./compile_all.ps1 # (Windows) -popd -``` - -You can compile all of the example plugins with the `compile_all.sh` script. If you're on windows, sorry! Please open a PR. - -While most crates _are_ in a workspace, the client crate is unfortunately excluded due to an issue with the `openxr` crate. - -## Next steps -[Set up the helper script](Beginner_Tutorial/setting_up_plugin_development_environment.md#setting-up-the-helper-script) in order to easily launch the engine for local testing and development. - - -## Tips and tricks -### Sparse registries -Recently, the sparse protocol for cargo registries was stablized. This can help improve initial compile times. See [the rust blog](https://blog.rust-lang.org/2023/03/09/Rust-1.68.0.html#cargos-sparse-protocol). - -### Logging -Wasmtime/Cranelift puts a bunch of junk in the log by default. To disable this, put the following in your RC file: -```sh -export RUST_LOG="debug,cranelift=OFF,wasmtime=OFF" -``` diff --git a/src/execuation.md b/src/execution.md similarity index 100% rename from src/execuation.md rename to src/execution.md diff --git a/src/Beginner_Tutorial/images/profile_path.png b/src/images/profile_path.png similarity index 100% rename from src/Beginner_Tutorial/images/profile_path.png rename to src/images/profile_path.png diff --git a/src/installation.md b/src/installation.md index 1977640..3c490a8 100644 --- a/src/installation.md +++ b/src/installation.md @@ -14,12 +14,14 @@ We cannot provide the most accurate requirement; however, the PC must able to ru ## Softwares to Download There are four softwares to download in order to use the ChatImproVR. -1. [Rust](https://www.rust-lang.org/tools/install) -2. [CMake](https://cmake.org/download/) +1. [Rust](#rust) +2. [CMake](#cmake) 3. VR Supported Headset Software - 1. [Oculus VR](https://www.oculus.com/Setup/) - 2. [Steam VR](https://store.steampowered.com/app/250820/SteamVR/) -4. [Our Engine](https://github.com/ChatImproVR/chatimprovr) + 1. [Oculus VR](#oculus-vr) + 2. [Steam VR](#steam-vr) +4. Our Engine + 1. [Stable Version Environment](#stable-version) + 2. [Development Environment](#most-advanced-version-development-environment-version) We will guide you how to install for each software to be ready to use our engine. Before you go into the installaion, please open the links that are provided above. @@ -30,7 +32,7 @@ When you visit the page for Rust, it will greet you the screen as below. Please follow the instructions as they stated. The page might look slighlty different based on operating system. ## CMake -When you visit the page for Cmake, it will greet you the screen as below. Please download the latest version of Cmake that has the option of Windows x64 Installer: the file extension is `.msi`. +When you visit the [page for Cmake](https://cmake.org/download/), it will greet you the screen as below. Please download the latest version of Cmake that has the option of Windows x64 Installer: the file extension is `.msi`. ![Cmake Install Page](/images/cmake_install_page.png) In the image above, the version we are downloading is 3.26.4, but you can download and install a higher version if you want as well. @@ -61,7 +63,7 @@ Once the installation is complete, then you will see the following screen. ![Cmake Installer Part 6](/images/cmake_installer_part_6.png) ## Oculus VR -Once you open the page, you will be greet the follow page as below. +Once you [open the page](https://www.oculus.com/Setup/), you will be greet the follow page as below. ![Oculus Download Page](/images/oculus_download_page.png) @@ -69,12 +71,110 @@ Select the `Download Oculus Rift Software` button. By selecting the button will ## Steam VR //TODO: someone test this out/write this part. I have no idea what is a major difference when it comes to Steam VR application. +[Download Link](https://store.steampowered.com/app/250820/SteamVR/) ## Our Engine There are two methods to use our engine: the stable version and most advanced version. ### Stable Version -Use the Release Code Version +If you want to use the stable version, we recommend to download the engine from releases. You can download from [here](https://github.com/ChatImproVR/chatimprovr/releases). If you are a **Windows** user, please download the `.exe`. If you are a **Linux** or **Mac**, please download the file that is stated in the release note (The application that has no extension).From there, you can run the `cimvr_server.exe` to host your own server whereas the `cimvr_client.exe` to connect server based on the address of the server. -### Most Advanced Version -Clone the repository +### Most Advanced Version (Development Environment Version) +If you want to get the most up-to-date version that might have some bugs within the engine but has more features than the stable version and develop new plugins or engine features, then we recommend to clone our repository from [here](https://github.com/ChatImproVR/chatimprovr). There are additional steps that need to finish in order to use this version. + +#### WASM target +Make sure you have the `wasm32-unknown-unknown` target installed; +```sh +rustup target add wasm32-unknown-unknown +``` + +#### Dependencies on Ubuntu: +```sh +sudo apt install build-essential cmake libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libspeechd-dev libxkbcommon-dev libssl-dev +``` + +#### Compilation +Build the client, server, and example plugins like so: +```sh +pushd server +cargo build --release +popd + +pushd client +cargo build --release +cargo build --release --features vr # (For VR/OpenXR support) +popd + +pushd example_plugins +./compile_all.sh # (Linux) +# ./compile_all.ps1 # (Windows) +popd +``` + +You can compile all of the example plugins with the `compile_all.sh` script. +If you're on windows, you can either use `Git Bash` to run the `.sh` files or open a PR; sorry about it! + +While most crates _are_ in a workspace, the client crate is unfortunately excluded due to an issue with the `openxr` crate. + +#### Setting up the helper script +The helper script is intended to make it easy to run the client, server, or both from a single command. The script requires Python 3. + +##### On Linux/Unix/MacOS (Bash) + +If your MacOS system is using `bash` instead of `zsh`, then please follow this procedure. Otherwise, please follow the MacOS (Zsh) section. + +Assuming you have a copy of `chatimprovr` somewhere (in this case, `$HOME/Projects/chatimprovr`), you can put the following in your `~/.bashrc`: + +```bash +function cimvr() { + $HOME/Projects/chatimprovr/cimvr.py $@ +} +``` +This will allow you to access the script as `cimvr` anywhere. + +> *NOTE: If you do not have the .bashrc file, you need to create on in the $HOME directory.* + +##### On MacOS (Zsh) + +Assuming you have a copy of `chatimprovr` somewhere (in this case, `$HOME/Desktop/Rust/chatimprovr`), you can put the following in your `~/.zshrc`: + +```zsh +function cimvr() { + $HOME/Desktop/Rust/chatimprovr/cimvr.py $@ +} +``` +This will allow you to access the script as `cimvr` anywhere. + +> *NOTE: If you do not have the .zshrc file, you need to create on in the $HOME directory.* + +##### On Windows +Assuming you have a copy of `chatimprovr` somewhere (in this case, `C:\Users\dunca\Documents\chatimprovr`), you can put the following in your `Microsoft.PowerShell_profile.ps1`. + +```ps1 +function cimvr() { + $cimvr_path="C:\Users\dunca\Documents\chatimprovr" + python $cimvr_path\cimvr.py $args +} +``` +This will allow you to access the script as `cimvr` anywhere. + +> *NOTE: If you cannot find the `Microsoft.PowerShell_profile.ps1`, you can find the file by typing `$profile` in Windows PowerShell. There is a chance that `Microsoft.PowerShell_profile.ps1` might not exist yet. In that case, you need to create a new file and the directory to match that path. In the image below, the file should be located in `Documents\WindowsPowerShell` under the file name as `Microsoft.PowerShell_profile.ps1`. If running scripts is disabled on your machine, consult the common fixes section.* + +![$profile path](./images/profile_path.png) + +##### Using the script to launch the engine +After building both `chatimprovr`'s client and server as well as the example plugins, we could launch the cube example included with ChatImproVR using: +```bash +cimvr camera cube +``` +in the terminal where you installed the helper script. + +#### Additional Tips and Tricks +##### Sparse registries +Recently, the sparse protocol for cargo registries was stablized. This can help improve initial compile times. See [the rust blog](https://blog.rust-lang.org/2023/03/09/Rust-1.68.0.html#cargos-sparse-protocol). + +##### Logging +Wasmtime/Cranelift puts a bunch of junk in the log by default. To disable this, put the following in your RC file: +```sh +export RUST_LOG="debug,cranelift=OFF,wasmtime=OFF" +``` \ No newline at end of file