|
1 | | -# WorkAdventure Map Starter Kit |
| 1 | +# 🗺️ WorkAdventure Map Starter Kit |
2 | 2 |
|
3 | | - |
| 3 | +<a href="https://discord.gg/G6Xh9ZM9aR" target="blank"><img src="https://img.shields.io/discord/821338762134290432.svg?style=flat&label=Join%20Community&color=7289DA" alt="Join Community Badge"/></a> |
| 4 | +<a href="https://x.com/workadventure_" target="blank"><img src="https://img.shields.io/twitter/follow/workadventure_.svg?style=social" /></a> |
| 5 | + |
4 | 6 |
|
5 | | -This is a starter kit to help you build your own map for [WorkAdventure](https://workadventu.re). |
| 7 | + |
6 | 8 |
|
7 | | -To understand how to use this starter kit, follow the tutorial at [https://workadventu.re/map-building](https://workadventu.re/map-building). |
| 9 | +🗺️ This is a starter kit to help you build your own map for [WorkAdventure](https://workadventu.re). |
8 | 10 |
|
9 | | -## Structure |
10 | | -* *public*: Static files like PDFs or audio files |
11 | | -* *src*: Scripts files |
12 | | -* *tilesets*: All tilesets |
13 | | -* *map.tmj*: Map file |
14 | | -* *map.png*: The map thumbnail displayed on the in-game map information |
| 11 | +📚 To understand how to use this starter kit, follow [our tutorial](https://docs.workadventu.re/map-building/tiled-editor/). |
15 | 12 |
|
16 | | -If you want to use more than one map file, just add the new map file on root or in a folder. |
| 13 | +👨🏻🔧 If you have any questions, feel free to ask in the [WorkAdventure office](https://play.staging.workadventu.re/@/tcm/workadventure/wa-village). |
17 | 14 |
|
18 | | -we recommend using 500x500 images for the map thumbnails. |
| 15 | +## 🚀 Upload your map |
19 | 16 |
|
20 | | -If you are going to create custom websites to embed in the map, please reference the HTML files in the `input` option in *vite.config.js*. |
| 17 | +In the `.env` file, you can set your upload strategy to `GH_PAGES` (default) or `MAP_STORAGE`. Simply comment out the option you don't want to use. |
21 | 18 |
|
22 | | -## Requirements |
| 19 | +Uploading a map using [GitHub Pages](https://docs.github.com/pages) will host your project on GitHub servers, and it's the most straightforward way to add new maps to your world. |
23 | 20 |
|
24 | | -Node.js version >=16 |
| 21 | +Uploading a map using the [WA map storage](https://docs.workadventu.re/map-building/tiled-editor/publish/wa-hosted) will host your project on WA servers. It's a bit more difficult to set up, but it comes with great advantages, like being able to have private repositories. |
25 | 22 |
|
26 | | -## Installation |
| 23 | +## 🗂️ Structure |
27 | 24 |
|
28 | | -With npm installed (comes with [node](https://nodejs.org/en/)), run the following commands into a terminal in the root directory of this project: |
| 25 | +We recommend following this file structure: |
29 | 26 |
|
30 | | -```shell |
| 27 | +- *`public/`*: Static files like PDFs or audio files |
| 28 | +- *`src/`*: Script files or design source files |
| 29 | +- *`tilesets/`*: All PNG tilesets |
| 30 | + |
| 31 | +> [!TIP] |
| 32 | +> - If you want to use more than one map file, just add the new map file in the root folder (we recommend creating a copy of *office.tmj* and editing it to avoid any mistakes). |
| 33 | +> - We recommend using **512x512** images for the map thumbnails. |
| 34 | +> - If you are going to create custom websites to embed in the map, please reference the HTML files in the `input` option in *vite.config.js*. |
| 35 | +
|
| 36 | +## 📜 Requirements |
| 37 | + |
| 38 | +- Node.js version >= 18 |
| 39 | + |
| 40 | +## Installation and testing |
| 41 | + |
| 42 | +## 🛠️ Installation and Testing |
| 43 | + |
| 44 | +With npm installed (which comes with [Node.js](https://nodejs.org/en/)), run the following command in the root directory of the project: |
| 45 | + |
| 46 | +```bash |
31 | 47 | npm install |
| 48 | +``` |
| 49 | + |
| 50 | +Then, you can test your map by running: |
| 51 | + |
| 52 | +```bash |
32 | 53 | npm run dev |
33 | 54 | ``` |
34 | 55 |
|
35 | | -## Test production map |
| 56 | +You can also test the optimized map as it will be in production by running: |
36 | 57 |
|
37 | | -You can test the optimized map as it will be in production: |
38 | | -```sh |
| 58 | +```bash |
39 | 59 | npm run build |
40 | 60 | npm run prod |
41 | 61 | ``` |
42 | 62 |
|
43 | | -## Licenses |
| 63 | +You can manually [upload your map to the WA Map Storage]([WA Map Storage](https://github.com/workadventure/upload-maps)) by running: |
| 64 | + |
| 65 | +```bash |
| 66 | +npm run upload |
| 67 | +``` |
| 68 | + |
| 69 | +The three important variables that control the upload feature are: |
| 70 | + |
| 71 | +1. `MAP_STORAGE_URL` *(local: created in .env by the upload command / CI: to be added as a Github secret optionally)* |
| 72 | +2. `MAP_STORAGE_API_KEY` *(local: created in .env.secret by the upload command / CI: to be added as a Github secret)* |
| 73 | +3. `UPLOAD_DIRECTORY` *(local: created in .env by the upload command / CI: to be added as a Github secret optionally)* |
| 74 | + |
| 75 | +Read [the documentation](https://docs.workadventu.re/map-building/tiled-editor/publish/wa-hosted) to learn more about the upload feature. |
| 76 | + |
| 77 | +## 📜 Licenses |
44 | 78 |
|
45 | 79 | This project contains multiple licenses as follows: |
46 | 80 |
|
47 | 81 | * [Code license](./LICENSE.code) *(all files except those for other licenses)* |
48 | | -* [Map license](./LICENSE.map) *(`map.tmj` and the map visual as well)* |
49 | | -* [Assets license](./LICENSE.assets) *(the files inside the `src/assets/` folder)* |
| 82 | +* [Map license](./LICENSE.map) *(`office.tmj` and the map visual as well)* |
| 83 | +* [Assets license](./LICENSE.assets) *(the files inside the `tilesets/` folder)* |
| 84 | + |
| 85 | +> [!IMPORTANT] |
| 86 | +> If you add third party assets in your map, do not forget to: |
| 87 | +> 1. Credit the author and license of a tileset with the "tilesetCopyright" property by etiding the tileset in Tiled. |
| 88 | +> 2. Add the tileset license text in *LICENSE.assets*. |
| 89 | +> 3. Credit the author and license of a map with the "mapCopyright" property in the custom properties of the map. |
| 90 | +> 4. Add the map license text in *LICENSE.map*. |
50 | 91 |
|
51 | | -### About third party assets |
| 92 | +## ❓ Need Help |
52 | 93 |
|
53 | | -If you add third party assets in your map, do not forget to: |
54 | | -1. Credit the author and license with the "tilesetCopyright" property present in the properties of each tilesets in the `map.tmj` file |
55 | | -2. Add the license text in LICENSE.assets |
| 94 | +If you have any questions or need further assistance, don't hesitate to ask either by [email](mailto:hello@workadventu.re) or [Discord](https://discord.gg/G6Xh9ZM9aR)! |
0 commit comments