Coder Social home page Coder Social logo

unitylockstepdemo's Introduction

UnityLockStepDemo

基于Unity做的帧同步Demo
底层使用了我的Unity框架SupperSocket
ECS架构
该框架还在开发中

构建目标:

  1.前后端能统一语言的框架,以至于在前端写好的游戏逻辑,拿到后端就可以直接使用。
  2.在框架层面解决同步问题,在此之上写游戏逻辑的时候不需要再考虑游戏同步的问题。

架构思路见我的博客

客户端目录

  Script/SyncFrameWork 存放前端同步框架
  Script/SyncClientLogic 存放游戏表现层逻辑
  Script/SyncGameLogic 存放游戏数据层逻辑,这里的代码要与服务器一致

服务器目录

  SyncGameLogic 存放游戏数据层逻辑
  ServiceFrameWork目录下是C#服务器框架
  LockStepFrameWork目录下是帧同步框架
  Data是配置表目录
  Network是网络协议目录
  Generate是自动生成的代码目录

客户端工具

  见前端框架

服务器工具

  Tool_GenerateAnalysisCode 生成协议解析代码
  Tool_ClearAnalysisCode 清除协议解析代码
  Tool_CSharp2Protocol 把c#类生成对应协议
  Tool_Protocol2Csharp 把协议生成对应的C#类
  Tool_GenerateDataClass 把数据表转换成对应的c#类,用法与前端相同

服务器可配置项(在项目的App.config中配置)

  IsDebug => Debug开关

  DataBaseURL = 数据库地址
  DataBaseUser = 数据库用户名
  DataBasePassword = 数据库密码
  DataBaseName = 数据库名

  RoomPeopleNum = 房间的人数
  UpdateInterval = 帧更新间隔(毫秒)

unitylockstepdemo's People

Contributors

gaokaihaha avatar

Watchers

 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.