Drops now land on the ground as gadgets and are picked up with F instead of appearing in the bag out of nowhere. Chests, ore, crystals and plants all spawn and can be interacted with. Monsters load by scene group rather than by a radius around each one, so a camp shows up as a camp and nothing pops into existence mid fight. The group anchors come out of the scene Lua, which also killed four invented tuning constants. The gateway was creating a whole new session for every handshake datagram, and the client retransmits those until it gets an answer. That is where the piles of duplicated monsters and the chests coming back from the dead were coming from. Also: monster level scales to the party now, path queries return an actual two point path instead of an empty one, NpcTalk closes properly, and the ability and combat invocations are no longer echoed back to the client that sent them. |
||
|---|---|---|
| Yuanshen.Common | ||
| Yuanshen.Gameserver | ||
| Yuanshen.Kcp | ||
| Yuanshen.Proto | ||
| Yuanshen.SDK | ||
| .gitignore | ||
| LICENSE | ||
| message-names-0.9.txt | ||
| README.md | ||
| THIRD-PARTY-NOTICES.md | ||
| Yuanshen.sln | ||
yuanshen
A private server for Genshin Impact 0.9.10 (CBT3), written from scratch in C#.
I started this to figure out how the client actually talks to its server, and it grew from "can I get past the login screen" into something you can walk around in. You can log in, run around Mondstadt, kill hilichurls, buy things and pull on a banner. Plenty is still missing.
What's in here
Yuanshen.Gameserveris the KCP server. Packet dispatch, scenes, combat, gacha, shop, GM commands.Yuanshen.SDKis a small HTTP server on 8899 for the login flow, plus a wish history page.Yuanshen.Protoholds the generated protobuf types and the CmdType table.Yuanshen.Commonhas excel loading and the shared console stuff.Yuanshen.Kcpis a vendored copy of KcpSharp. See THIRD-PARTY-NOTICES.md.
Getting it running
.NET 10 and a PostgreSQL somewhere. Both servers read their connection string from
appsettings.json and default to postgres/postgres on localhost. That is a local dev default,
not a leaked password, but change it if your setup is different.
dotnet build Yuanshen.sln
Start the SDK first, then the gameserver, then a patched client. The gameserver console takes
GM commands directly, /help lists them.
About the game data
Everything under Yuanshen.Gameserver/assets came out of the client rather than being typed
by hand. The excel tables live in a packed bin container that turns out to be a single byte
XOR, with the key derived from the version string, and the monster spawn points come out of
the compiled Lua scene scripts.
One thing you'll notice: items show up as ids and weapon types instead of names. The client only ships text map hashes, and there is no text map in the build, so there is nothing to resolve names against yet.
State of things
Working: login, world streaming, movement, monsters and combat, gacha with pity and the 50/50, shop, wish history.
Not done: quests, dungeons, co-op, chests and world drops.
This is a reverse engineering project for learning. It is not affiliated with miHoYo and it is not trying to be a playable replacement for the real game.