Open source server for the FusionFall client
Go to file
2020-12-24 05:22:46 +01:00
res added radio's logo, started NPCManager 2020-08-19 17:21:35 -05:00
sql Remove excessive indentation in tables.sql 2020-12-24 05:19:04 +01:00
src Fix other group members not respawning properly in Lairs 2020-12-24 05:22:46 +01:00
tdata@385b298533 Update tdata ref 2020-12-23 13:48:19 -05:00
.editorconfig Add .editorconfig to enforce 4 space indent 2020-08-28 15:34:49 -05:00
.gitattributes Add .gitattributes file, exclude src/contrib from linguist (#73) 2020-09-08 19:55:59 -04:00
.gitignore Finalize ALL the statements 2020-12-18 00:17:35 +01:00
.gitmodules switched to dumped XDT & moved to a submodule 2020-09-09 12:06:22 -05:00
.vimrc Reword some comments and correct paths in the Readme. 2020-08-28 22:18:28 +02:00
appveyor.yml Add the Academy build to the Appveyor script 2020-12-23 13:50:12 -05:00
CMakeLists.txt Remove vendored libsqlite from the repository 2020-12-14 03:44:58 +01:00
config.ini Add academy.json loading to TableData 2020-12-23 13:50:12 -05:00
CONTRIBUTING.md Wrote a CONTRIBUTING.md. 2020-08-31 03:47:56 +02:00
LICENSE.md Use regular old MIT license 2020-08-20 16:17:53 -04:00
Makefile Add RacingManager 2020-12-21 16:18:08 -05:00
README.md Update README.md 2020-12-23 18:31:48 -05:00
suppr.txt Tweak mob roaming logic and a few other values 2020-12-17 02:35:55 +01:00
version.h.in Print server version when starting up. 2020-09-16 20:12:56 +02:00

AppVeyor Discord

OpenFusion is a reverse-engineered server for FusionFall. It currently primarily targets version beta-20100104 and has some support for version beta-20100728 and beta-20111013 of the original game.

Further documentation pending.

Usage

tl;dr:

  1. Download the client+server bundle from here.
  2. Extract it to a folder of your choice.
  3. Run OpenFusionClient.exe

To host your own server:

  1. Grab OpenFusionServer-1.3-original.zip or OpenFusionServer-1.3-academy.zip from here.
  2. Extract it to a folder of your choice.
  3. Add a new server to the client: the default port is 23000, so the full IP with default settings would be 127.0.0.1:23000.

If you want, compiled binaries (artifacts) for each new commit can be found on AppVeyor.

For a more detailed overview of the game's architecture and how to configure it, read the following sections.

Architecture

FusionFall consists of the following components:

  • A web browser compatible with the old NPAPI plugin interface
  • A web server that acts as a gateway for launching the game
  • A custom version of the Unity Web Player, which gets loaded as an NPAPI plugin
  • A .unity3d bundle that contains the game code and essential resources (loading screen, etc.)
  • A login server that speaks the FusionFall network protocol over TCP
  • A shard server that does the same on another port

The original game made use of the player's actual web browser to launch the game, but since then the NPAPI plugin interface the game relied on has been deprecated and is no longer available in most modern browsers. Both Retro and OpenFusion get around this issue by distributing an older version of Electron, a software package that is essentially a specialized web browser.

The browser/Electron client opens a web page with an <embed> tag of MIME type application/vnd.unity, where the src param is the address of the game's .unity3d entrypoint.

This triggers the browser to load an NPAPI plugin that handles this MIME type, the Unity Web Player, which the browser looks for in C:\Users\USERNAME\AppData\LocalLow\Unity\WebPlayer. The Web Player was previously copied there by installUnity.bat.

Note that the version of the web player distributed with OpenFusion expects a standard UnityWeb magic number for all assets, instead of Retro's modified streamed magic number. This will potentially become relevant later, as people start experimenting and mixing and matching versions.

The web player will execute the game code, which will request the following files from the server: /assetInfo.php and /loginInfo.php.

FreeClient/resources/app/files/assetInfo.php contains the address from which to fetch the rest of the game's assets (the "dongresources"). Normally those would be hosted on the same web server as the gateway, but the OpenFusion distribution (in it's default configuration) doesn't use a web server at all! It loads the web pages locally using the file:// schema, and fetches the game's assets from Turner's CDN (which is still hosting them to this day!).

FreeClient/resources/app/files/loginInfo.php contains the IP:port pair of the FusionFall login server, which the client will connect to. This login server drives the client while it's in the Character Selection menu, as well as Character Creation and the Tutorial.

When the player clicks "ENTER THE GAME" (or completes the tutorial), the login server sends it the address of the shard server, which the client will then connect to and remain connected to during gameplay.

Configuration

You can change the ports the FusionFall server listens on in Server/config.ini. Make sure the login server port is in sync with loginInfo.php. The shard port needs no such synchronization. You can also configure the distance at which you'll be able to see other players, though by default it's already as high as you'll want it.

If you want to play with friends, you can change the IP in loginInfo.php to a login server hosted elsewhere. This just works if you're all under the same LAN, but if you want to play over the internet you'll need to open a port, use a service like Hamachi or nGrok, or host the server on a VPS (just like any other gameserver).

If you're in a region in which Turner's CDN doesn't still have the game's assets cached, you won't be able to play the game in its default configuration. You'll need to obtain the necessary assets elsewhere and set up your own local web server to host them, because unlike web browsers, the game itself cannot interpret the file:// schema, and will thus need the assets hosted on an actual HTTP server. Don't forget to point assetInfo.php to where you're hosting the assets and change the src param of both the <embed> tag and the <object> tag in FreeClient/resources/app/files/index.html to where you're hosting the .unity3d entrypoint.

If you change loginInfo.php or assetInfo.php, make sure not to put any newline characters (or any other whitespace) at the end of the file(s). Some modern IDEs/text editors do this automatically. If all else fails, use Notepad.

Compiling

OpenFusion has one external dependency: SQLite. You can install it on Windows using vcpkg, and on Unix/Linux using your distribution's package manager. For a more indepth guide on how to set up vcpkg, check this wiki page.

You have two choices for compiling OpenFusion: the included Makefile and the included CMakeLists file.

Makefile

A detailed compilation guide is available for Windows users in the wiki using MinGW-w64 and MSYS2. Otherwise, to compile it for the current platform you're on, just run make with the correct build tools installed (currently make and clang).

CMake

A detailed guide is available in the wiki for people using regular old CMake or the version of CMake that comes with Visual Studio. tl;dr: cmake -B build

Contributing

If you'd like to contribute to this project, please read CONTRIBUTING.md.

Gameplay

The goal of the project is to faithfully recreate the game as it was at the time of the targeted build. The server is not yet complete, however, and some functionality is still missing.

Because the server is still in development, ordinary players are allowed access to a few admin commands:

Movement commands

  • A /speed of around 2400 or 3000 is nice.
  • A /jump of about 50 will send you soaring
  • This map (credit to Danny O) is useful for /warp coordinates.
  • /goto is useful for more precise teleportation (ie. for getting into Infected Zones, etc.).

Item commands

  • /itemN [type] [itemId] [amount] (Refer to the item list)

Nano commands

  • /nano [id] (1-36)
  • /nano_equip [id] (1-36) [slot] (0-2)
  • /nano_unequip [slot] (0-2)
  • /nano_active [slot] (0-2)

Accounts

A basic account system has been added, when logging in if the username doesn't exist in the database, a new account with the provided password will be made and you'll be automatically logged in. Otherwise a login attempt will be made. A username must be between 4 and 32 characters, and a password must be between 8 and 32 characters otherwise the account will be rejected.