Table of Contents
- Foreword
- Key Features
- Playable Demo
- Getting Started
- Get the project from github
- Download and Import EzyFox Server CSharp Client Unity
- Needed projects from GitHub
- Needed Unity packages from the Unity asset store
- Free-Server
- Master-Server
- Play the client
- Contributing
- Resources Section
- Credits
- Thank you
- Contact
This project utilizes free resources for both server and client technology. Without these, the project likely wouldn't have been possible, so I extend my special thanks to the team at Young Monkeys for their excellent foundational work, particularly for the EzyFox Server framework, and for sharing it with the community. Also, special thanks to all the contributors to the UMA project and their outstanding Unity Multipurpose Avatar System. For the ocean, we use the Crest Ocean System, which, in my personal opinion, is the best available ocean system for Unity. As a terrain generation tool, we use MapMagic 2 (the free version from the Asset Store). If you need more features, check out the paid version of MM2. Please check out our Resources Section to see what technologies we use and consider supporting their projects in some way, such as through donations or code contributions, to help these talented individuals continue doing what they love: writing great code and developing fantastic frameworks.
For the game client we are using Unity as game engine.
- Area of Interest System on the Unity-Server
- Capability to send spawn or despawn commands to the Unity Client player based on range
- Each entity has a NearbyPlayer list and sends position updates only to players in this list
- Entity-based System
- An entity is the base and can represent a player, effect, or building (currently, only Player is implemented)
- Each entity on the Unity Client has a NetworkTransform component to receive position updates
- If the Unity-Server sends a spawn or despawn command to the player (Client), the entity will be automatically added to or removed from the client entity list and instantiated or destroyed accordingly
- Master Server
- Extended EzyFox Server capabilities to spawn Unity-based server instances for each room
- Unified Unity-Server project for managing all room-specific game logic
- Consistent use of Unity Engine for both client and server to streamline development
- Centralized user management, database handling, and request forwarding via EzyFox Server
- Seamless communication flow between Unity-Client, Master-Server, and Unity-Servers
- Account Management
- Create a new account
- Account activation, sending activation code via email, login checks if account activated if not needed to insert the code, resend code possible.
- Login
- Forgot password function, sending new password to a given username / e-mail address
- Forgot username function, sending the username to a given e-mail address
- SSL encryption for creating accounts this is feature from the EzyFox Server framework EzyFox Server SSL
- Sending e-mails via smtp, with different authentication protocols SSL, TLS or no authentication
- Easy to create a new custom mails with our interface MailBody
- HTML based email templates, you can also use your own variables
- Character Creation
- Creating a new character
- Modifiable character model thanks to UMA, modifying the look of the character with sliders
- Colorize character, skin, hairs underwear.
- Change Hair, Beard Eyebrows, Underwear
- Save the character server/database
- Character Selection
- Character selection with all available characters
- (Todo) Delete a Character
- Character Movement
- Server Authoritative, movement (no client side prediction, server reconciliation or entity interpolation, simple send input compute position on the server send back to client)
- Simple but working animation based by the position the player getting from the server
- Scene and UI Management, from our Module-GameManager
- We use one persistent Scene all other scene will be load additive/async the last one will unloaded async.
- For each scene we can create a scene asset (ScriptableObject) that holds a List of SceneUISet also a asset (ScriptableObject)
- A SceneUISet (ScriptableObject) containing all the UIElement prefabs as a Set in an Array that we want to instantiate in the Scene. You can also add multiple sets per scene.
- All Scene UIs will automatically be instantiated for the Scene and last Scene UIs will be destroyed. A check if the next scene have the same SceneUISets, then it don't have to be destroyed or instantiated the UI`s.
- Mouse Handler, from our Module-MouseHandler
- Gives the user a visual feedback what is currently under the mouse cursor and changes the cursor look (2D UI) with Graphic Raycaster
- Enhanced IsOverUIElement - This stores when you press the left mouse button whether you was over a UI element or not and saves the state until you release the mouse button.
- CameraController, from our Module-CameraController
- The camera can orbit around the character on LMB, same on RMB but turn the target object.
- A lot of options to fine tune the camera behaviour
- Planed: Camera collision, more smoothing of the camera motions, distance and orbit
- Popup System
- Create your own popups for different use-cases
- World Scene
- Nice looking Island surrounded by an ocean
We provide a playable demo where you can play the latest release, check what Free-MMORPG can do, or test and send bug reports.
You can find it here: Get Latest. Only the latest release has a playable demo, provided as a .rar file. This client will connect to our game server.
Clone the repository:
git clone git@github.com:Assambra/Free-MMORPG.gitDownload and extract the following file: ezyfox-server-csharp-client-1.1.6-unity.zip.
Perform the following steps for both Unity projects: Free-Client and Free-Server:
- Open the project in the Unity Editor.
- Select all folders and files from the extracted folder
ezyfox-server-csharp-client-1.1.6-unity/ezyfox-server-csharp-client-1.1.6-unityand drag them into the folder/Assets/Plugins/ezyfox-server-csharp-client-1.1.6-unity/of your opened Unity project.
-
Get Crest Ocean System Download and extract the following file: crest-4.21.3.zip.
-
Install Crest Ocean System
-
Open the Unity-Client project in the Unity Editor. Unzip and select all folders and filesthe second crest folder into Unity:
crest-4.21.3/crest-4.21.3/crest/Assets/Crest/Crest. -
Select all folders and files from the extracted folder
crest-4.21.3/crest-4.21.3/crest/Assets/Crest/Crest/and drag them into the folder/Assets/Crest/of your opened Unity project.
Go to the Unity Asset Store and get the free asset: MapMagic 2.
After acquiring the asset:
- Open both projects (Free-Client and Free-Server) in the Unity Editor.
- Open the Package Manager (
Window -> Package Manager) and selectPackages: My Assets. - Download and import MapMagic 2 into both projects.
Please use our modified version of UMA: UMA 2.13 Beta 1-modified.rar.
Steps to use it:
- Download and extract the
.rarfile. - Drag the folder
UMAdirectly intoFree-Client/Assetsin the Unity Editor.
Alternatively, get the free asset from the Unity Asset Store: UMA 2.
After importing UMA 2 into the project, you must add Assembly Definition References:
Navigate toAssets/UMA/Core/UMA_Core.In the Inspector, add references forUnity.Mathematics,Unity.Burst, andUnity.Collections.
Open the Unity-Server project in Unity. Open the Build Settings: (File -> Build Settings). The master server can handle the following three types of builds:
- Windows, Mac, Linux
- Dedicated Server - Windows
- Dedicated Server - Linux
Select Windows, Mac, Linux or Dedicated Server as the Platform. Then, under Target Platform, choose your platform (Windows or Linux) and build the project.
Open the master-server project in your IDE. Edit the following file:
master-server/master-server-app-api/src/main/resources/application.properties.
Add the path to your server executables from the previous step where you saved them. For example:
D:/Game Builds/Free-Server/Free-Server.exe.
- Install MongoDB.
- Open your Mongo shell (
mongosh). - Create your database:
use free- Create a new user and password, and give it access to the created database:
db.createUser({
user: "root",
pwd: "123456",
roles: [{role: "readWrite", db: "free"}]
})- Create the following collections:
db.createCollection("account", { collation: { locale: 'en_US', strength: 2 } })db.account.createIndex({ username: 1 })db.createCollection("character", { collation: { locale: 'en_US', strength: 2 } })db.character.createIndex({ accountId: 1 })db.createCollection("character_location", { collation: { locale: 'en_US', strength: 2 } })db.character_location.createIndex({ characterId: 1 })- Add to the following configuration file:
File location: master.server/master-server-common/src/main/resources/master-server-common-config.properties
- Insert the following values into your configuration file and modify them as needed:
database.mongo.uri=mongodb://root:123456@127.0.0.1:27017/free
database.mongo.database=free
database.mongo.collection.naming.case=UNDERSCORE
database.mongo.collection.naming.ignored_suffix=Entity
Example credentials:
- User: root
- Password: 123456
- Database: free
Enable or disable server-side email sending via SMTP.
If you do not have a mail server or mail provider that supports sending emails via SMTP, or if you do not wish to send emails (e.g., for local development), locate the following file:
File location:
Free-MMORPG/master-server/master-server-common/src/main/resources/master-server-common-config.properties
Set the value to false:
server.can_send_mail=false;Important: When server.can_send_mail is set to false, only log messages are generated on the server side. This is primarily intended for local development. For production environments, email functionality should be properly configured to enable features like "Forgot Password," "Forgot Username," and "Account Activation."
Setup Mail Values
For production environments, configure email functionality in the same configuration file used for the database settings:
File location:
Free-MMORPG/master-server/master-server-common/src/main/resources/master-server-common-config.properties
Modify the following settings:
mail.host=mail.example.com
mail.port.tls=587
mail.port.ssl=465
mail.authentication=true
mail.username=account@example.com
mail.password=123456
mail.tls=true
mail.ssl=false
mail.mail.address=account@example.com
mail.mail.sender.name=YourCompany Account Management
mail.use.reply.address=false
mail.mail.reply.address=account@example.com
mail.charset=UTF-8
mail.content.type.primary=text/HTML
mail.content.type.sub=charset=UTF-8
mail.format=flowed
mail.content.transfer.encoding=8bit
Hint:
Do not set both mail.tls and mail.ssl to true simultaneously. Only one should be set to true to avoid conflicts.
Download the EzyFox Server: ezyfox-server-full-1.2.9.zip
In following examples, we use allways the location: D:\ezyfox-server.
- Extract
ezyfox-server-full-1.2.9.zipand copy the extracted files to the target location. - Open the file
D:\ezyfox-server\settings\ezy-settings.xmlin a text editor. - Add the following zones inside the
<zones>tag:
<zone>
<name>master-server</name>
<config-file>free-master-server-zone-settings.xml</config-file>
<active>true</active>
</zone>
- Open Git Bash and navigate to the folder
free-account-server-startup. - Run the following command:
mvn clean install -Denv.EZYFOX_SERVER_HOME=deploy -Pezyfox-deploy
- Run the
ExternalLibrariesExportertool located infree-account-server-startup/src/test/java/com/assambra/account/toolsin your IDE. - When prompted, enter the path:
D:/ezyfox-server.
- Open the file
Free-MMORPG/master-server/build.shin the editor - Remove the
#from the line#export EZYFOX_SERVER_HOME=: - Insert after
export EZYFOX_SERVER_HOME=, the pathD:/ezyfox-server. - Run the following command in some command client e.g. gitbash from the root of the project (./Free-MMORPG/master-server/):
bash build.sh
Hint: If you encounter an error like:
cp: cannot create regular file 'D:ezyfox-server/settings/zones/': No such file or directory
Replace backslashes (\) with forward slashes (/) in your paths, depending on your operating system.
Navigate to your server location: D:/ezyfox-server.
- Windows: Execute
console.bat. - Linux: Run:
sh ./console.sh
For Linux as a service:
- Start the service:
sh ./start-service.sh
- Stop the service:
sh ./stop-service.sh
- Restart the service:
sh ./restart-service.sh
In your Unity project (Free-Client), double-click the Persistent scene in the folder location Assets/Free-Client/Scenes/. This is the persistent scene with all Managers/Handlers. All other scenes will automatically load additively/asynchronously when needed, along with the User Interfaces for the active scene.
To learn more about the Module-GameManager, visit the Module-GameManager wiki page.
Once everything is set up, press "Play" in the Unity Editor to start the game, provided the server setup is complete (see below).
Thank you for your interest in contributing to our project! Contributions are welcome and greatly appreciated.
-
Code Contributions
- Fork the repository on GitHub.
- Create a new branch for your changes.
- Implement your changes and thoroughly test them.
- Submit a pull request to our repository.
-
Report Bugs
Use our GitHub issue tracking system to report bugs. Provide as much detail as possible to help us troubleshoot effectively. -
Feature Requests
If you have a great idea for a new feature, create an issue on GitHub and describe your idea in detail. We'll review and discuss it. -
Documentation Contributions
If you find errors or want to add to our documentation, feel free to contribute to our Wiki or submit pull requests for README updates.
- For the server/client, we use the EzyFox Server Framework from Young Monkeys. You can support their great project. For more information, visit Donate to Young Monkeys.
- For the characters, we use UMA (Unity Multipurpose Avatar System). There is currently a campaign to take UMA to a new level so that it will receive new textures and models in the future. We would be very happy if you supported this. Let’s fund some new artwork for UMA!.
- For the ocean, we use the Crest Ocean System, which, in our opinion, is the best available ocean system for Unity. You can become a sponsor for this project on GitHub Sponsors.
- For the terrain we use MapMagic 2 as a free version. If you need more features, check out the bundle version or other MM2 addons to support the developer.
- We use textures created by João Paulo, available at 3DTextures.me. He published these under the CC0 license. You can support him by buying him a Ko-fi or becoming a patron on Patreon.
- A special thanks to tvd12 for fixing various bugs and providing great help with other issues.
Join us on Discord.
