User Tools

Site Tools


development:player:web

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
development:player:web [2016/06/14 20:27] – update domain name fdelapenadevelopment:player:web [2020/09/14 12:30] – The games must be in the subdirectory. There is no absolute path. ghabry
Line 5: Line 5:
 If you want to test it you can play with a [[https://easyrpg.org/play/|Demo of our TestGame]]. Try also a working game: [[https://easyrpg.org/play/?game=ib|Ib]] If you want to test it you can play with a [[https://easyrpg.org/play/|Demo of our TestGame]]. Try also a working game: [[https://easyrpg.org/play/?game=ib|Ib]]
  
-===== How does it work =====+===== How it works =====
  
 Web request are asynchronous. This means that all assets like pictures and music must be fetched asynchronously. When the Player wants to display a new graphic it will appear on the desktop versions (Windows, Linux, Android, ...) immediately but on the web it will be invisible while the file is downloaded. Once the downloaded finishes it is replaced with the real image. Web request are asynchronous. This means that all assets like pictures and music must be fetched asynchronously. When the Player wants to display a new graphic it will appear on the desktop versions (Windows, Linux, Android, ...) immediately but on the web it will be invisible while the file is downloaded. Once the downloaded finishes it is replaced with the real image.
Line 13: Line 13:
 ===== Hosting your own games ===== ===== Hosting your own games =====
  
-Hosting your own games is quite simple. Just follow these three steps.+Hosting your own games is quite simple. Just follow these steps.
  
 ==== Deploying the Player on your server ==== ==== Deploying the Player on your server ====
Line 22: Line 22:
  
   * index.html   * index.html
-  * index.html.mem+  * index.wasm
   * index.js   * index.js
   * games/   * games/
Line 28: Line 28:
 Note: if you want to try it locally you need a HTTP server, using ''file:'' protocol locally will not work, install Apache httpd server (or any other) on localhost instead. Note: if you want to try it locally you need a HTTP server, using ''file:'' protocol locally will not work, install Apache httpd server (or any other) on localhost instead.
  
-==== Preprocessing steps for games ==== 
  
-EasyRPG Player supports WAV files for music and sounds, but Ogg Vorbis is lot smaller and worth for the web. Do the same following process for both ''Music'' and ''Sound'' folders and remove unneeded WAV files after the conversion.+==== Deploying game on your server ====
  
-=== Ogg Vorbis conversion === +Because RPG Maker games refer to files without extension and querying the server for every supported extension would be slow, you need to run a small tool to generate a file called ''index.json'' (containing an game file list index with extensionsfor every game before uploadingThe tool is called ''gencache''.
- +
-== GNU/Linux command line option == +
- +
-  * Install ''vorbis-tools'' and encode all WAV to Ogg Vorbis. +
- +
-  oggenc -q0 *.wav +
- +
-Beware of existing MS ADPCM WAV files, they are not supported by oggenc. If you get conversion errors, use ''ffmpeg -i adpcmfile.wav -o pcmfile.wav'' and rename it. +
- +
-== Windows drag and drop tools option == +
- +
-  * First, download [[http://www.rarewares.org/ogg-oggdropxpd.php|oggdropXPd]] (aoTuV version is preferred). +
- +
-  * Then open the oggdropXPd app (it is a square window), select all WAV files from the folder, then drag and drop them over the square oggdropXPd windowThey will be converted to Ogg Vorbis. If you want to make smaller Ogg Vorbis files, do secondary mouse button click over the square window to select options and adjust the compression quality option to 0 (~64 kbps) -1 (~48 kbps) or -2 (~32 kbps). +
- +
-==== Deploying a game on your server ====+
  
-Because RPG Maker games refer to files without extension and querying the server for every supported extension would be slow, you need to run a small tool to generate a file called 'index.json' (containing an game file list index with extensions) for every game before uploading. The tool is a php script called "indexgen".+You can get the tool here:
  
-If you use Windows you can get the tool in .exe format here: {{:development:player:indexgen.zip|}} +  * {{https://ci.easyrpg.org/job/tools-win32/lastSuccessfulBuild/artifact/bin/gencache.exe|gencache for Windows}} 
-Unpack ''indexgen.zip'' contents (indexgen.exe and php5.dll) in a game working folder (the folder containing RPG_RT.files) to generate the ''index.json''Move ''indexgen.exe'' and ''php5.dll'' to working folders for each game you want to upload and run ''indexgen.exe'' again to generate the ''index.json'' for them. Once finished you can remove (don't upload them, they are unneeded and useless in the server) the ''indexgen.exe'' and ''php5.dll'' from any game folder.+  {{https://ci.easyrpg.org/job/tools-linux/lastSuccessfulBuild/artifact/gencache.tar.gz|gencache for Linux}}
  
-If you use other operating system, install php-cli and run [[https://github.com/EasyRPG/Player/blob/master/resources/emscripten/indexgen.php|this script]] with ''php path/to/file/indexgen.php'' from the game working folder (the folder containing RPG_RT.* files)for each game you want to upload.+Place the gencache executable in a game working folder (the folder containing RPG_RT.* files) to generate the ''index.json''. Move the ''gencache'' executable to working folders for each game you want to upload and run ''gencache'' again to generate the ''index.json'' for them. Once finished you can remove (don't upload it, it's not needed) the ''gencache'' from any game folder.
  
 Your games are expected in subdirectories of the ''games'' directory. The default game executed is the one in ''games/default''. You can create further games by just by putting them in subdirectories of the ''games'' directory. Your games are expected in subdirectories of the ''games'' directory. The default game executed is the one in ''games/default''. You can create further games by just by putting them in subdirectories of the ''games'' directory.
  
 Now open the ''index.html'' file and your default game should start. To play a different game pass ''?game=folder_name'' to your index file. Now open the ''index.html'' file and your default game should start. To play a different game pass ''?game=folder_name'' to your index file.
development/player/web.txt · Last modified: 2021/11/11 09:38 by ghabry

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki