Boilerplate code to tinker with packets for Sphere (old Russian MMORPG) server emulator
Actual emulator would be a separate project once I have figured out most packets requred for it to work
Currently built with Godot 4.* Mono
, but there is an old plain-C# version in emu
subfolder.
Running Sphere on latest hardware (notably, RDNA 3 Radeon 7000 series) might turn out into a good old 15 fps in cities experience. If that happens to you, dgVoodoo2 might help:
- Grab the latest release from https://github.com/dege-diosg/dgVoodoo2
- Unpack, run, add new profile for Sphere (click Add and navigate to game folder)
- In the General tab, select Direct3D 12 (feature level 12.0) for Output API. Others didn't work for me, but your mileage may vary
- In DirectX tab, select dgVoodoo Virtual 3D Accelerated Card for Videocard, 512-4096 MB for VRAM
- Keep everything else as is or tweak as you like
- Copy D3D9.dll (or all files to be safe) from MS\x86 to game folder (launcher does not care about added files)
- Launch the game. If everything worked correctly, cities should jump from 15 to 150+ fps
- If not, try different Output APIs and/or Videocards
This is too involved as is, I will make it easier in future:
- Get and install prerequisities
- Godot v4.* with Mono included
- Mono runtime
- LiteDB (https://www.litedb.org/)
- Download and unpack game client from the Releases page
- Edit connect.cfg if you wish to use different connection settings, but default should be ok
- Build and run the Godot project
- Launch the game, enter desired login and password. This should create a
Players
DB entry with your login and pwd hash - Next time, use those credentials or create a new user if you like
Multiplayer is technically supported at this moment, but everything would act strangely.
If you want to roam around the game world instead of going to the new player dungeon, navigate to GodotServer\Client.cs
and comment StreamPeer.PutData lines in MoveToNewPlayerDungeonAsync method.
Server code resides under GodotServer
. Everything else is due for a cleanup, one day...
For the main server class, go to GodotServer\MainServer.cs
. It's responsible for managing connections and game objects and creating a new Client object per every connected player.
For the client class, go to GodotServer\Client.cs
. Right now, it's a bit of a mess, but it handles the player flow once they connect to the server:
- Loading initial data and exchanging creds
- Logging in
- Getting character select screen data
- Choosing / creating / deleting characters
- Entering the game
- Ingame loop
Supports only the new player dungeon for the moment, I'm yet to figure out the game's terrain generation.
- MainServer
- NewPlayerDungeon
- Navmesh with geometry
- Mob / loot
- Client
- NewPlayerDungeon