Code Monkey home page Code Monkey logo

sphereemu's Introduction

SphereEmu

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.

Compatibility

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:

  1. Grab the latest release from https://github.com/dege-diosg/dgVoodoo2
  2. Unpack, run, add new profile for Sphere (click Add and navigate to game folder)
  3. 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
  4. In DirectX tab, select dgVoodoo Virtual 3D Accelerated Card for Videocard, 512-4096 MB for VRAM
  5. Keep everything else as is or tweak as you like
  6. Copy D3D9.dll (or all files to be safe) from MS\x86 to game folder (launcher does not care about added files)
  7. Launch the game. If everything worked correctly, cities should jump from 15 to 150+ fps
  8. If not, try different Output APIs and/or Videocards

Running the server

This is too involved as is, I will make it easier in future:

  1. Get and install prerequisities
    1. Godot v4.* with Mono included
    2. Mono runtime
    3. LiteDB (https://www.litedb.org/)
  2. 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
  3. Build and run the Godot project
  4. Launch the game, enter desired login and password. This should create a Players DB entry with your login and pwd hash
  5. 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.

File structure

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:

  1. Loading initial data and exchanging creds
  2. Logging in
  3. Getting character select screen data
  4. Choosing / creating / deleting characters
  5. Entering the game
  6. Ingame loop

Scene structure

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

sphereemu's People

Contributors

knelse avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.