Skip to content

devforgood/GameServerFramework

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

230 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Game Server Framework

A game server framework built with open-source technologies to accelerate game server development. Supports MMORPG, MORPG, PVP, Action, and other genres. Primary languages: C# and C++.

🌍 Language Selection

πŸ—οΈ Project Structure

πŸ“ Server Projects

  • Battle/ - Battle Server (In-game character movement and skill synchronization)
  • Lobby/ - Lobby Server (User authentication, matching, etc.)
  • Login/ - Login Server
  • Chat/ - Chat Server
  • Cache/ - Cache Server
  • IAP/ - In-App Purchase Server
  • GmTool/ - GM Tools

πŸ“ Core Libraries

πŸ“ Data & Tools

πŸ“ Client

  • Client/ - Unity Client (includes pathfinding test tools)

πŸ“ External Libraries

πŸš€ Quick Start

Requirements

# Install dependencies via vcpkg
./vcpkg install behaviortree-cpp
./vcpkg install protobuf:x64-windows

Key Dependencies

πŸ›οΈ Server Architecture

Server Architecture

Server Composition

  1. Lobby Server - User authentication, matching, and all features except in-game
  2. Battle Server - In-game character movement and skill synchronization
  3. AI Server - AI state management, pathfinding

In-Game Synchronization

  1. Character Movement Sync - Client key input β†’ Server simulation β†’ Client correction
  2. State Synchronization - Periodic sync of only changed objects (replication)
  3. Skill Synchronization - Skill information sync via RPC calls

Protocols

  • gRPC - Stateless protocol suitable for mobile environments
  • RUDP - Secures latency without unnecessary TCP processing

πŸ“Š Sequence Diagrams

Login Sequence

Login Sequence

Game Result Sequence

Game Result Sequence

Matching Sequence

Match Sequence

Matching v2 Sequence

Match v2 Sequence

πŸ› οΈ Development Tools

Unity Client Tools

  • Sample Terrain Generator - Terrain generation for pathfinding tests
  • Advanced Terrain Generator - Advanced terrain generation (various test scenarios)
  • Pathfinding Test Manager - Pathfinding agent management

Data Pipeline

  • JSON β†’ Protobuf Conversion - Fast loading and automatic code generation
  • Factory Pattern Auto-Generation - ID-based object creation code automation
  • Reusable Property Structure - Component-based design

πŸ“ˆ Performance Optimization

GridManager

  • SIMD Vectorization - Simultaneous calculation of 8 distances using AVX2 instructions
  • Trigonometric Look-up Tables - Fast angle calculation using pre-computed values
  • Adaptive Grid Structure - Automatic Vector/HashMap selection based on data density

Processing Performance

  • 10,000 entities: AoE queries < 1ms
  • 100,000 entities: Line of sight range search < 5ms
  • SIMD optimization: 3-8x performance improvement over conventional methods

🀝 Contributing

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“„ License

This project is distributed under the MIT License. See the LICENSE file for details.

πŸ“ž Contact

Project Link: https://github.com/yourusername/GameServerFramework

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published