Code Monkey home page Code Monkey logo

mmo_game_zinx's Introduction

mmo_game_zinx

基于zinx框架实现的mmo游戏

基础协议

MsgID Client Server 描述
1 - SyncPid 同步玩家本次登录的ID(用来标识玩家)
2 Talk 世界聊天
3 MovePackege 移动
200 - BroadCast 广播消息(Tp 1 世界聊天 2 坐标(出生点同步) 3 动作 4 移动之后坐标信息更新)
201 - SyncPid 广播消息 掉线/aoi消失在视野
202 - SyncPlayers 同步周围的人位置信息

网络法实现AOI算法

image-20221013150409169

场景相关数值计算

  • 场景大小: 250*250 , w(x轴宽度) = 250,l(y轴长度) = 250
  • x轴格子数量:nx = 5
  • y轴格子数量:ny = 5
  • 格子宽度: dx = w / nx = 250 / 5 = 50
  • 格子长度: dy = l / ny = 250 / 5 = 50
  • 格子的x轴坐标:idx
  • 格子的y轴坐标:idy
  • 格子编号:id = idy *nx + idx (利用格子坐标得到格子编号)
  • 格子坐标:idx = id % nx , idy = id / nx (利用格子id得到格子坐标)
  • 格子的x轴坐标: idx = id % nx (利用格子id得到x轴坐标编号)
  • 格子的y轴坐标: idy = id / nx (利用格子id得到y轴坐标编号)

mmo_game_zinx's People

Contributors

goshinoo 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.