Unity includes a 10,000 NPC scene

Overview

luacluster

C/C++ CI

概要

luacluster分布式游戏服务器框架。特色是实现了万人同屏,实现了无缝大地图,用户开发方式为lua的rpc调用模式,已经接入mongodb。近期计划是写技术白皮书。QQ群:927073440。

[TOC]

1. BUILDING AND INSTALLATION

CMake (Windows)

Install CMake: https://www.cmake.org

$ md build && cd build
$ cmake -G "Visual Studio 10" ..   # Or use any generator you want to use. Run cmake --help for a list
$ cmake --build . --config Release # Or "start libevent.sln" and build with menu in Visual Studio.

See Documentation/Building#Building on Windows for more information

CMake (Ubuntu)

$ cd core && mkdir build
$ cd core/build && cmake ..     # Default to ubuntu Makefiles.
$ cd core && cmake --build build

CMake (optional)

$ cmake -DLUA_USE_LUAJIT=ON #使用luajit

2. START RUNING (Windows)

服务器

启动流程:redis.bat, luacluter(_d).exe, bots.bat

在bots.bat中修改要启动的机器人数量

机器人

# --btcp的参数为连接服务器的 Ip port 总数量
$ luacluter_d.exe --bots --noudp --inside --btcp 127.0.0.1 9577 500 #服务器ip, 端口,总数量

# --btcp2的参数为连接服务器的 Ip port 数量 ip数量
$ luacluter_d.exe --bots --noudp --inside --btcp2 127.0.0.1 9577 500 #服务器ip, 端口,数量, ip的数量

两种模式的配置

服务器的默认配置文件core\res\server\config_defaults.json

压力测试模式

{
  "log_config": {
    "ruleDefault": {

    }
  },
  "base_config": {
    "inside": 1
  },
  "docke_config":{
    "dockerRandomSize":128,#随机线程的数量
    "dockerGlobeSize":8,#全局线程的数量
    "popNodeSize":200000,
    "congestion":4000000
  },
  "tcp":{
    "tcp4":[
      {
      "tcp4BindAddr":"0.0.0.0",#tcp的线程和ip端口
      "tcp4Port":9577
      }, 
      {
      "tcp4BindAddr":"0.0.0.0",
      "tcp4Port":9578
      }, 
      {
      "tcp4BindAddr":"0.0.0.0",
      "tcp4Port":9579
      }, 
      {
      "tcp4BindAddr":"0.0.0.0",
      "tcp4Port":9580
      }, 
      {
      "tcp4BindAddr":"0.0.0.0",
      "tcp4Port":9581
      }, 
      {
      "tcp4BindAddr":"0.0.0.0",
      "tcp4Port":9582
      }, 
      {
      "tcp4BindAddr":"0.0.0.0",
      "tcp4Port":9583
      }, 
      {
      "tcp4BindAddr":"0.0.0.0",
      "tcp4Port":9584
      }, 
      {
      "tcp4BindAddr":"0.0.0.0",
      "tcp4Port":9585
      }, 
      {
      "tcp4BindAddr":"0.0.0.0",
      "tcp4Port":9586
      }
    ]
  }
}

单线程调试模式

{
  "log_config": {
    "ruleDefault": {

    }
  },
  "base_config": {
    "inside": 1
  },
  "docke_config":{
    "dockerRandomSize":1,#随机线程的数量
    "dockerGlobeSize":0,#全局线程的数量
    "popNodeSize":200000,
    "congestion":4000000
  },
  "tcp":{
    "tcp4":[
      {
      "tcp4BindAddr":"0.0.0.0",#tcp的线程和ip端口
      "tcp4Port":9577
      }
    ]
  }
}

数据库存储的测试

在luacluster中使用mongodb

sc.lua全局配置中已经添加了"dbsvr"全局服务对象。

sc.cluster.serves = {"space","bigworld","dbsvr"}--集群启动时要启动的服务列表

在任意节点控制台输入命令创建一个dbentity对象

#命令new
#参数1:在什么地方创建对象
	DockerCurrent = 0, //当前线程的docker
	DockerRandom,//当前节点的随机ddocker
	NodeInside,//任意内部节点
	NodeOutside,//任意有对外部通信节点
	NodeRandom,//随机节点
	DockerGlobe//放入全局对象池
#参数2:创建对象的名字“dbentity”
#参数3:创建对象的初始化数据格式为json
>new 1 dbentity {}
>New tentity:   18302840717262782469

使用call命令调用dbentity对象的fun函数返回dbid。

>call 18302840717262782469 fun
>test entity fun
db      6253f48671099513a0f5165f

#命令call
#参数1:entityid
#参数2:entity的函数,这里为dbentity.lua中的“fun”
#剩余参数:为函数参数,类型为数字,字符串,json。例如call 18302840717262782469 fun2 111 {"a":1} aaa

3. luacluster白皮书纲要

  1. luacluster组织架构及名词定义
  2. entity对象的创建,继承,多重继承,多态,健事件。
  3. luarpc调用及封包结构。
  4. 全局对象的创建和全局对象的功能插件
  5. bigworld无缝大地图全局对象。
  6. sudoku九宫格空间全局对象。
  7. space全局对象
  8. dbsvr数据存储全局对象
  9. 命令以及参数
  10. docker的脚本api
  11. 如何使用luacluster创建一个MMO游戏
You might also like...
Unity project with an example on how to run the depthai library in Android.
Unity project with an example on how to run the depthai library in Android.

depthai-android-unity-example Unity project (built with Unity 2020.3.25f1) with an example on how to run the depthai library in Android. Important Thi

Useful cmake macros that help with: compiler/linker flags, collecting sources, PCHs, Unity builds and other stuff.
Useful cmake macros that help with: compiler/linker flags, collecting sources, PCHs, Unity builds and other stuff.

ucm - useful cmake macros ucm is a collection of cmake macros that help with: managing compiler/linker flags collecting source files with grouping in

A lightweight additive chiptune synthesizer (LV2 and Unity Plugin)

OvenMit Synthesizer kenakofer's first ever synthesizer! Coming initially out of BMusic's excellent tutoral series for lv2 synthesizers, the developer

HLSL to GLSL language translator based on ATI's HLSL2GLSL. Used in Unity.

HLSL to GLSL shader language translator ⚠️ As of mid-2016, the project is unlikely to have any significant developments. At Unity we are moving to a d

GLSL optimizer based on Mesa's GLSL compiler. Used to be used in Unity for mobile shader optimization.

GLSL optimizer ⚠️ As of mid-2016, the project is unlikely to have any significant developments. At Unity we are moving to a different shader compilati

A run-time API resolver for IL2CPP Unity.

IL2CPP Resolver A run-time API resolver for IL2CPP Unity. Quick Example #include "Main.hpp" void SomeFunction() { IL2CPP::Initialize(); // This n

AnalogWrite for ESP32 and ESP32-S2 with LEDC PWM. Includes PWM Phase Control, DAC and Smart GPIO resource management.
AnalogWrite for ESP32 and ESP32-S2 with LEDC PWM. Includes PWM Phase Control, DAC and Smart GPIO resource management.

analogWrite() ESP32 Installation Instructions This library was tested using using the ESP32 Arduino IDE Boards Manager installation method. Stable rel

Hobbyist Operating System targeting x86_64 systems. Includes userspace, Virtual File System, An InitFS (tarfs), Lua port, easy porting, a decent LibC and LibM, and a shell that supports: piping, file redirection, and more.
Hobbyist Operating System targeting x86_64 systems. Includes userspace, Virtual File System, An InitFS (tarfs), Lua port, easy porting, a decent LibC and LibM, and a shell that supports: piping, file redirection, and more.

SynnixOS Epic Hobby OS targeting x86_64 CPUs, it includes some hacked together functionality for most essential OSs although, with interactivity via Q

Working example for local_flutter_notification package in Flutter. Includes setting notification at custom time, daily, weekly.

local_notification_example Working example for local_flutter_notification package in Flutter. Includes setting notification at custom time, daily, wee

Comments
  • Bump log4j-core from 2.8 to 2.17.1 in /core/src/lib/3rd/sigar/bindings/java

    Bump log4j-core from 2.8 to 2.17.1 in /core/src/lib/3rd/sigar/bindings/java

    Bumps log4j-core from 2.8 to 2.17.1.

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 1
  • Bump log4j-api from 2.8 to 2.17.1 in /core/src/lib/3rd/sigar/bindings/java

    Bump log4j-api from 2.8 to 2.17.1 in /core/src/lib/3rd/sigar/bindings/java

    Bumps log4j-api from 2.8 to 2.17.1.

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 1
Owner
surparallel.org
Committed to automatic parallelization of software
surparallel.org
A test using a TTGO module (ESP32 + screen) which renders a 3d scene using pingo library

A simple 3D renderer tested and developed for the TTGO T-Display ESP32 board. The 3d renderer is: https://github.com/fededevi/pingo The 3D renderer is

fedevi 10 Nov 2, 2022
Super Simple Scene Renderer

SSSR Super Simple Scene Renderer Feature Rendering path Forward rendering Deferred rendering Physically based rendering GGX Image based lighting Equir

AICDG 5 Dec 9, 2021
An open collection of tools and experiments for rendering wide-gamut scene-linear data into an image for an SDR or HDR display device.

Open Display Transform An open collection of tools and experiments for rendering wide-gamut scene-linear data into an image for an SDR or HDR display

Jed Smith 127 Dec 29, 2022
Powerful automated tool for reverse engineering Unity IL2CPP binaries

Powerful automated tool for reverse engineering Unity IL2CPP binaries

Katy 2.1k Jan 7, 2023
A universal way to create a noclip mod in Unity games (Mono/IIL2CPP)

Universal-Unity-NoClip This projects aim to show how a noclip mod can be created in any unity game, regardless if its using an il2cpp or mono backend.

Jonah 25 Dec 21, 2022
Adds proper Apple Pencil support to Unity's InputSystem.

This project aims to create an Apple Pencil device for Unity's InputSystem package. The problem: Unity does not fully integrate with Apple Pencil. App

Oliver Smith 13 Dec 11, 2022
A native plugin for Unity that provides simple packet division and restoration.

uPacketDivision This is a native plug-in that divides a given data (System.IntPtr or array) into specified sizes and restores them regardless of the i

hecomi 4 Feb 20, 2022
Unity Scripting in C++

Unity Native Scripting A library to allow writing Unity scripts in native code: C, C++, assembly. Purpose This project aims to give you a viable alter

Jackson Dunstan 1.2k Dec 27, 2022
Open source simulator for autonomous vehicles built on Unreal Engine / Unity, from Microsoft AI & Research

Welcome to AirSim AirSim is a simulator for drones, cars and more, built on Unreal Engine (we now also have an experimental Unity release). It is open

Microsoft 13.8k Jan 8, 2023
Tests to check the determinism of the basic floating point arithmetic operations on different devices, using Unity and Rust.

This repo contains tests to check the determinism (consistency) of the basic floating point arithmetic operations (add, subtract, multiply, divide) on

Erik Roystan 9 Dec 20, 2022