Skip to content

Commit 9d366e3

Browse files
committed
inital commit
0 parents  commit 9d366e3

30 files changed

+4032
-0
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.vscode
2+
bin/*
3+
notes.txt
4+
config.ini

LICENSE.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
The OpenFusion MIT except Marlorn License
2+
3+
Copyright 2020 Seth Stubbs
4+
5+
Excluding the individual known as "MarlornWS" and their associates, permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6+
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8+
9+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Makefile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# makefile for OpenFusion
2+
3+
OBJS = src/*.cpp # source files to compile
4+
CC = clang++ # using GNU C++ compiler
5+
WIN_CC = x86_64-w64-mingw32-g++ # using GNU C++ compiler
6+
7+
# -w suppresses all warnings (the part that's commented out helps me find memory leaks, it ruins performance though!)
8+
COMPILER_FLAGS = -std=c++17 -o3 -static #-g3 -fsanitize=address
9+
WIN_COMPILER_FLAGS = -std=c++17 -o3 -static #-g3 -fsanitize=address
10+
11+
#LINKER_FLAGS specifies the libraries we're linking against (NONE, this is a single header library.)
12+
LINKER_FLAGS = -lpthread
13+
WIN_LINKER_FLAGS = -lws2_32 -lwsock32
14+
15+
#OBJ_NAME specifies the name of our exectuable
16+
OBJ_NAME = bin/fusion # location of output for build
17+
WIN_OBJ_NAME = bin/winfusion.exe # location of output for build
18+
19+
all: $(OBJS)
20+
$(CC) $(OBJS) $(COMPILER_FLAGS) $(LINKER_FLAGS) -o $(OBJ_NAME)
21+
22+
windows: $(OBJS)
23+
$(WIN_CC) $(OBJS) $(WIN_COMPILER_FLAGS) $(WIN_LINKER_FLAGS) -o $(WIN_OBJ_NAME)

README.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# OpenFusion
2+
3+
OpenFusion is a landwalker server for FusionFall. It currently supports versions `beta-20100104` and `beta-20100728` of the original game.
4+
5+
Further documentation pending.
6+
7+
## Usage
8+
9+
tl;dr:
10+
11+
1. Download the client+server bundle from [here](...).
12+
2. Run `FreeClient/installUnity.bat` once
13+
14+
From then on, any time you want to run the "game":
15+
16+
3. Run `OpenFusion/winfusion.exe`
17+
4. Run `FreeClient/OpenFusionClient.exe`
18+
19+
You have two randomized characters available to you on the Character Selection screen, one boy, one girl.
20+
You can also make your own character and play through the tutorial. The tutorial can be skipped by pressing the ~ key.
21+
22+
For a more detailed overview of the game's architecture and how to configure it, read the following sections.
23+
24+
## Architecture
25+
26+
FusionFall consists of the following components:
27+
28+
* A web browser compatible with the old NPAPI plugin interface
29+
* A web server that acts as a gateway for launching the game
30+
* A custom version of the Unity Web Player, which gets loaded as an NPAPI plugin
31+
* A `.unity3d` bundle that contains the game code and essential resources (loading screen, etc.)
32+
* A login server that speaks the FusionFall network protocol over TCP
33+
* A shard server that does the same on another port
34+
35+
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.
36+
37+
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.
38+
39+
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`.
40+
The Web Player was previously copied there by `installUnity.bat`.
41+
42+
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.
43+
This will potentially become relevant later, as people start experimenting and mixing and matching versions.
44+
45+
The web player will execute the game code, which will request the following files from the server: `/assetInfo.php` and `/loginInfo.php`.
46+
47+
`FreeClient/resources/app/files/assetInfo.php` contains the address from which to fetch the rest of the game's assets (the "dongresources").
48+
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!
49+
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!).
50+
51+
`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.
52+
53+
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.
54+
55+
## Configuration
56+
57+
You can change the ports the FusionFall server listens on in `OpenFusion/config.ini`. Make sure the login server port is in sync with `loginInfo.php`.
58+
The shard port needs no such synchronization.
59+
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.
60+
61+
If you want to play with friends, you can change the IP in `loginInfo.php` to a login server hosted elsewhere.
62+
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).
63+
64+
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.
65+
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.
66+
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/files/index.html` to where you're hosting the `.unity3d` entrypoint.
67+
68+
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).
69+
Some modern IDEs/text editors do this automatically. If all else fails, use Notepad.
70+
71+
## Compiling
72+
73+
OpenFusion can be compiled from source using the included makefile. to compile for windows (on a *nix system) use `make windows`, otherwise to compile it for the current platform you're on just run `make`
74+
75+
## "Gameplay"
76+
77+
Notice the quotes. This is not a full-fledged game that can be played.
78+
It's what's called a landwalker; enough of the server has been implemented to allow players to run around in the game world, and not much else.
79+
80+
![](res/sane_upsell.png)
81+
82+
To make your landwalking experience more pleasant, you can make use of a few admin commands to get around easier:
83+
84+
* A `/speed` of around 2400 or 3000 is nice.
85+
* A `/jump` of about 50 will send you soaring
86+
* [This map](res/dong_number_map.png) (credit to Danny O) is useful for `/warp` coordinates.
87+
* `/goto` is useful for more precise teleportation (ie. for getting into Infected Zones, etc.).

res/dong_number_map.png

4.34 MB
Loading

res/sane_upsell.png

732 KB
Loading

0 commit comments

Comments
 (0)