Skip to content

Commit a203c27

Browse files
committed
up
1 parent 1cf0e74 commit a203c27

File tree

2 files changed

+320
-2
lines changed

2 files changed

+320
-2
lines changed

README.md

Lines changed: 160 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,160 @@
1-
# kbengine_ue4_demo
2-
kbengine_ue4_demo
1+
KBEngine_unity3d_demo
2+
=============
3+
4+
##This client-project is written for KBEngine(a MMOG engine of server)
5+
http://www.kbengine.org
6+
7+
##中文
8+
[Demo搭建文档](https://github.com/kbengine/kbengine_unity3d_demo/blob/master/README_CN.md),QQ交流群:461368412,[论坛](http://bbs.kbengine.org)
9+
10+
##Releases
11+
12+
sources : https://github.com/kbengine/kbengine_unity3d_demo/releases/latest
13+
binarys : https://sourceforge.net/projects/kbengine/files/
14+
15+
16+
##KBE-Plugins docs
17+
18+
https://github.com/kbengine/kbengine_unity3d_plugins/blob/master/README.md
19+
20+
21+
##Start:
22+
1. Download KBEngine(a MMOG engine of server):
23+
Download(KBEngine):
24+
https://github.com/kbengine/kbengine/releases/latest
25+
26+
Build(KBEngine):
27+
http://www.kbengine.org/docs/build.html
28+
29+
Installation(KBEngine):
30+
http://www.kbengine.org/docs/installation.html
31+
32+
2. Use git to get the plugin(client) and demo-assets(server):
33+
34+
In the kbengine_unity3d_demo directory:
35+
36+
* Git command: git submodule update --init --remote
37+
![submodule_update1](http://www.kbengine.org/assets/img/screenshots/gitbash_submodule.png)
38+
39+
* Or use TortoiseGit(menu): TortoiseGit -> Submodule Update:
40+
![submodule_update2](http://www.kbengine.org/assets/img/screenshots/unity3d_plugins_submodule_update.jpg)
41+
42+
* Or manually get the plugin(client) and demo-assets(server)
43+
44+
Download plugin(client):
45+
https://github.com/kbengine/kbengine_unity3d_plugins/releases/latest
46+
unzip and copy to "Assets/plugins/kbengine/kbengine_unity3d_plugins"
47+
48+
Download demo-assets(server):
49+
https://github.com/kbengine/kbengine_demos_assets/releases/latest
50+
unzip and copy to "kbengine/" (The root directory server engine, such as $KBE_ROOT)
51+
52+
3. Copy "kbengine_unity3d_demo\kbengine_demos_assets" to "kbengine\" root directory
53+
![demo_configure](http://www.kbengine.org/assets/img/screenshots/demo_copy_kbengine.jpg)
54+
55+
56+
##Configure Demo(Optional):
57+
58+
Change the login address:
59+
![demo_configure](http://www.kbengine.org/assets/img/screenshots/demo_configure.jpg)
60+
61+
kbengine_unity3d_demo\Scripts\kbe_scripts\clientapp.cs -> ip
62+
kbengine_unity3d_demo\Scripts\kbe_scripts\clientapp.cs -> port
63+
64+
65+
##Start the Servers:
66+
67+
Ensure that the "kbengine_unity3d_demo\kbengine_demos_assets" has been copied to the "kbengine\" directory
68+
Reference:Start
69+
70+
Check the startup status:
71+
If successful will find log "Components::process(): Found all the components!".
72+
Otherwise, please search the "ERROR" keyword in logs, according to the error description to try to solve.
73+
(More: http://www.kbengine.org/docs/startup_shutdown.html)
74+
75+
Start server:
76+
Windows:
77+
kbengine\kbengine_demos_assets\start_server.bat
78+
79+
Linux:
80+
kbengine\kbengine_demos_assets\start_server.sh
81+
82+
(More: http://www.kbengine.org/docs/startup_shutdown.html)
83+
84+
85+
##Start the Client:
86+
87+
Directly start(U3DEditor or Executable file).
88+
(Build Client:Unity Editor -> File -> Build Settings -> PC, MAC & Linux Standalone.)
89+
90+
91+
##Navmesh-navigation(Optional):
92+
93+
The server to use recastnavigation navigation.
94+
Recastnavigation generated navigation mesh (Navmeshs) placed on the:
95+
kbengine\kbengine_demos_assets\res\spaces\*
96+
97+
Generation Navmeshs:
98+
https://github.com/kbengine/unity3d_nav_critterai
99+
100+
101+
##Structure and interpretation:
102+
103+
The relationship between plug-ins(KBE) and U3D and servers:
104+
Plug-in and servers: Responsible for processing and server network packet. account login/logout process.
105+
By server notification logic entities are created and destroyed. Processing synchronous logical entity attribute data. etc.
106+
Plug-in and U3D: The plug-in will trigger some events to the U3D graphics layer, the graphics layer determines whether to capture some events,
107+
get data to render performance (for example: create a monster, a NPC move-speed increase, HP changes).
108+
U3D graphics layer will input the event trigger to the plug-in layer (for example: the player moved, hit the relive button UI),
109+
the plug-in logic script layer determines whether the need to transfer to the server. etc.
110+
111+
112+
Plugins\kbengine\kbengine_unity3d_plugins:
113+
Client plug-in core codes.
114+
115+
Scripts\kbe_scripts:
116+
KBE client logic scripts(in this implementation of the server side of the entity script, the entity's bag data structure, skills in client condition checks, etc.).
117+
118+
Scripts\kbe_scripts\Account.cs:
119+
Corresponds to the client side of the KBE server account entity.
120+
121+
Scripts\kbe_scripts\Avatar.cs:
122+
Corresponds to the client side of the KBE server avatar entity.
123+
124+
Scripts\kbe_scripts\Monster.cs:
125+
Corresponds to the client side of the KBE server monster entity.
126+
127+
Scripts\kbe_scripts\clientapp.cs:
128+
In the system of KBE abstraction of a client APP, which contains the KBE client plug-in initialization and destruction, etc.
129+
130+
Scripts\kbe_scripts\interfaces:
131+
Corresponding to the module defined in KBE(entity_defs\interfaces).
132+
133+
Scripts\u3d_scripts:
134+
Unity graphics layer (including scene rendering, UI, object, character model, monster model).
135+
136+
Scripts\u3d_scripts\GameEntity.cs:
137+
Monster/NPC or player script (management model and animation, etc.).
138+
139+
Scripts\u3d_scripts\World.cs:
140+
Manage a map of the game script, for example: to create a specific 3D monster into the scene.
141+
142+
Scripts\u3d_scripts\UI.cs:
143+
the game's UI processing script.
144+
145+
Scenes\start.unity:
146+
Start the scene, which starts to enter the game.
147+
148+
Scenes\_scenes\login.unity:
149+
login map.
150+
151+
Scenes\_scenes\selavatars.unity:
152+
Game character selection map.
153+
154+
Scenes\_scenes\world.unity:
155+
A map of the scene in the game.
156+
157+
##Screenshots:
158+
![screenshots1](http://www.kbengine.org/assets/img/screenshots/unity3d_demo9.jpg)
159+
![screenshots2](http://www.kbengine.org/assets/img/screenshots/unity3d_demo10.jpg)
160+
![screenshots3](http://www.kbengine.org/assets/img/screenshots/unity3d_demo11.jpg)

README_CN.md

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
KBEngine_unity3d_demo
2+
=============
3+
4+
##本项目作为KBEngine服务端引擎的客户端演示而写
5+
http://www.kbengine.org
6+
7+
##官方论坛
8+
9+
http://bbs.kbengine.org
10+
11+
12+
##QQ交流群
13+
14+
461368412
15+
16+
17+
##Releases
18+
19+
sources : https://github.com/kbengine/kbengine_unity3d_demo/releases/latest
20+
binarys : https://sourceforge.net/projects/kbengine/files/
21+
22+
23+
##KBE插件文档
24+
25+
https://github.com/kbengine/kbengine_unity3d_plugins/blob/master/README.md
26+
27+
28+
##开始:
29+
1. 确保已经下载过KBEngine服务端引擎,如果没有下载请先下载
30+
下载服务端源码(KBEngine):
31+
https://github.com/kbengine/kbengine/releases/latest
32+
33+
编译(KBEngine):
34+
http://www.kbengine.org/docs/build.html
35+
36+
安装(KBEngine):
37+
http://www.kbengine.org/docs/installation.html
38+
39+
2. 下载kbengine客户端插件与服务端Demo资产库:
40+
41+
* 使用git命令行,进入到kbengine_unity3d_demo目录执行:
42+
43+
git submodule update --init --remote
44+
![submodule_update1](http://www.kbengine.org/assets/img/screenshots/gitbash_submodule.png)
45+
46+
* 或者使用 TortoiseGit(选择菜单): TortoiseGit -> Submodule Update:
47+
![submodule_update2](http://www.kbengine.org/assets/img/screenshots/unity3d_plugins_submodule_update.jpg)
48+
49+
* 也可以手动下载kbengine客户端插件与服务端Demo资产库
50+
51+
客户端插件下载:
52+
https://github.com/kbengine/kbengine_unity3d_plugins/releases/latest
53+
下载后请将其解压缩,插件源码请放置在: Assets/plugins/kbengine/kbengine_unity3d_plugins
54+
55+
服务端资产库下载:
56+
https://github.com/kbengine/kbengine_demos_assets/releases/latest
57+
下载后请将其解压缩,并将目录文件放置于服务端引擎根目录"kbengine/"之下,如下图:
58+
59+
3. 拷贝服务端资产库"kbengine_demos_assets"到服务端引擎根目录"kbengine/"之下,如下图:
60+
![demo_configure](http://www.kbengine.org/assets/img/screenshots/demo_copy_kbengine.jpg)
61+
62+
63+
##配置Demo(可选):
64+
65+
改变登录IP地址与端口(注意:关于服务端端口部分参看http://www.kbengine.org/cn/docs/installation.html):
66+
![demo_configure](http://www.kbengine.org/assets/img/screenshots/demo_configure.jpg)
67+
68+
kbengine_unity3d_demo\Scripts\kbe_scripts\clientapp.cs -> ip
69+
kbengine_unity3d_demo\Scripts\kbe_scripts\clientapp.cs -> port
70+
71+
72+
##启动服务器:
73+
74+
确保“kbengine_unity3d_demo\kbengine_demos_assets”已经拷贝到KBEngine根目录:
75+
参考上方章节:开始
76+
77+
使用启动脚本启动服务端:
78+
Windows:
79+
kbengine\kbengine_demos_assets\start_server.bat
80+
81+
Linux:
82+
kbengine\kbengine_demos_assets\start_server.sh
83+
84+
检查启动状态:
85+
如果启动成功将会在日志中找到"Components::process(): Found all the components!"。
86+
任何其他情况请在日志中搜索"ERROR"关键字,根据错误描述尝试解决。
87+
(更多参考: http://www.kbengine.org/docs/startup_shutdown.html)
88+
89+
90+
##启动客户端:
91+
92+
直接在Unity3D编辑器启动或者编译后启动
93+
(编译客户端:Unity Editor -> File -> Build Settings -> PC, MAC & Linux Standalone.)
94+
95+
96+
##生成导航网格(可选):
97+
98+
服务端使用Recastnavigation在3D世界寻路,recastnavigation生成的导航网格(Navmeshs)放置于:
99+
kbengine\kbengine_demos_assets\res\spaces\*
100+
101+
在Unity3D中使用插件生成导航网格(Navmeshs):
102+
https://github.com/kbengine/unity3d_nav_critterai
103+
104+
105+
##结构与释义:
106+
107+
KBE插件与U3D和服务器之间的关系:
108+
插件与服务器:负责处理与服务端之间的网络消息包、账号登陆/登出流程、由服务端通知创建和销毁逻辑实体、维护同步的逻辑实体属性数据等等。
109+
插件与U3D:插件将某些事件触发给U3D图形层,图形层决定是否需要捕获某些事件获得数据进行渲染表现(例如:创建怪物、某个NPC的移动速度增加、HP变化)、
110+
U3D图形层将输入事件触发到插件层(例如:玩家移动了、点击了复活按钮UI),插件逻辑脚本层决定是否需要中转到服务器等等。
111+
112+
Plugins\kbengine\kbengine_unity3d_plugins:
113+
KBE客户端插件的核心层代码。
114+
115+
Scripts\kbe_scripts:
116+
KBE客户端的逻辑脚本(在此实现对应服务端的实体脚本、实体的背包数据结构、技能客户端判断等)。
117+
118+
Scripts\kbe_scripts\Account.cs:
119+
对应KBE服务端的账号实体的客户端部分。
120+
121+
Scripts\kbe_scripts\Avatar.cs:
122+
对应KBE服务端的账游戏中玩家实体的客户端部分。
123+
124+
Scripts\kbe_scripts\Monster.cs:
125+
对应KBE服务端的怪物实体的客户端部分。
126+
127+
Scripts\kbe_scripts\clientapp.cs:
128+
在KBE的体系中抽象出一个客户端APP,其中包含KBE客户端插件的初始化和销毁等等。
129+
130+
Scripts\kbe_scripts\interfaces:
131+
对应KBE中entity_defs\interfaces中所声明的模块。
132+
133+
Scripts\u3d_scripts:
134+
Unity3D图形层(包括场景渲染、UI、物体部件、人物模型、怪物模型、一切关于显示的东西等等)。
135+
136+
Scripts\u3d_scripts\GameEntity.cs:
137+
无论是怪物还是玩家都由此脚本负责模型动画等表现部分。
138+
139+
Scripts\u3d_scripts\World.cs:
140+
管理游戏中大地图或副本的渲染层脚本,例如:负责将具体的3D怪物创建到场景中。
141+
142+
Scripts\u3d_scripts\UI.cs:
143+
维护游戏的UI处理脚本。
144+
145+
Scenes\start.unity:
146+
起始场景,由此启动进入游戏。
147+
148+
Scenes\_scenes\login.unity:
149+
登陆场景。
150+
151+
Scenes\_scenes\selavatars.unity:
152+
角色选取场景。
153+
154+
Scenes\_scenes\world.unity:
155+
游戏中大地图/副本场景。
156+
157+
##演示截图:
158+
![screenshots1](http://www.kbengine.org/assets/img/screenshots/unity3d_demo9.jpg)
159+
![screenshots2](http://www.kbengine.org/assets/img/screenshots/unity3d_demo10.jpg)
160+
![screenshots3](http://www.kbengine.org/assets/img/screenshots/unity3d_demo11.jpg)

0 commit comments

Comments
 (0)