1.1 Game
Client\game\Global.h
对象/变量类型 | 对象/变量名 | tDebuger* | g_pDebuger | tVariableSystem* | g_pVaribleSys | tSoundSystem* | g_pSoundSystem | tWorldSystem* | g_pWorldSystem | tEventSystem* | g_pEventSys | tTimeSystem* | g_pTimeSystem | tResourceProvider* | g_pResourceProvider | tDataBaseSystem* | g_pDataBase | tKernel | g_theKernel | HWND | g_hMainWnd | HINSTANCE | g_hInstance | const CHAR | VERSION_INFO[] | const CHAR | GAME_TITLE[] | bool | g_bDebugMode |
1.2 核心数据对象
指针 | 指针类型 | 实际类型 | 存储位置 | 备注 | s_pInputSystem | tInputSystem | CInputSystem | bin\input | 0.输入管理器 | s_pTimeSystem | tTimeSystem | tTimeSystem | bin\time | 1.计时器 | s_pNetManager | CNetManager | CNetManager | bin\netman | 2.网络管理器 | s_pSoundSystem | tSoundSystem | CSoundSystemFMod | bin\snd | 3.音效管理器 | s_pGfxSystem | tGfxSystem | CEngineInterface | bin\gfx | 4.渲染器节点 | s_pDebuger | tDebuger | tDebuger | bin\debuger | 5.调试器节点 | s_pObjectManager | tObjectSystem | CObjectManager | bin\objman | 6.物体管理器 | s_pUISystem | tUISystem | CUISystem | bin\ui_ | 7.UI 管理器 | s_pDataBaseSystem | tDataBaseSystem | CDataBaseSystem | bin\dbc | 8.数据库管理器 | s_pWorldManager | tWorldSystem | CWorldManager | bin\worldman | 9.世界管理器 | s_pVariableSystem | tVariableSystem | CVariableSystem | bin\var | 10.系统变量管理器 | s_pGameInterface | tGameInterfaceBase | CGameInterface | bin\interface | 11.接口管理器 | s_pUIDataPool | tUIDataPool | CUIDataPool | bin\datapool | 12.UI 数据池 | s_pDataPool | tDataPool | CDataPool | bin\datapool_ | 12.UI 数据池 | s_pCursorMng | tCursorSystem | CCursorMng | bin\cursor | 13.鼠标指针管理器 | s_pScriptSystem | tScriptSystem | CScriptSystem | bin\script | 14.脚本系统 | s_pEventSystem | tEventSystem | CEventSystem | bin\event | 15.事件系统 | s_pActionSystem | tActionSystem | CActionSystem | bin\action | 16.操作管理器 | s_pFakeObjSystem | tFakeObjSystem | CFakeObjSystem | bin\fake | 17.UI 模型显示管理 | s_pHelperSystem | tHelperSystem | CHelperSystem | bin\helper | 18.外接帮助系统 | s_pResourceProvider | tResourceProvider | CResourceProvider | bin\resprovider | 19.资源提供 | timerSys | tTimerSystem | CTimerManager | bin\timer | 20.定时器 | s_pTransferItemSystem | tTransferItemSystem | CTransferItemSystem | bin\transfer | 21.物品传输系统 |
取回对象
g_pScriptSys = (tScriptSystem*)g_pKernel->GetNode("bin\\script");
g_pEventSys = (tEventSystem*)g_pKernel->GetNode("bin\\event");
g_pActionSys = (tActionSystem*)g_pKernel->GetNode("bin\\action");
g_pInputSys = (tInputSystem*)g_pKernel->GetNode("bin\\input");
g_pGfxSystem = (tGfxSystem*)g_pKernel->GetNode("bin\\gfx");
g_pObjectSystem = (tObjectSystem*)g_pKernel->GetNode("bin\\objman");
g_pCursorSystem = (tCursorSystem*)g_pKernel->GetNode("bin\\cursor");
g_pDebuger = (tDebuger*)g_pKernel->GetNode("bin\\debuger");
g_pWorldSystem = ( tWorldSystem* ) g_pKernel->GetNode("bin\\worldman");
g_pTimer = (tTimeSystem*)g_pKernel->GetNode("bin\\time");
g_pFakeSystem = (tFakeObjSystem*)g_pKernel->GetNode("bin\\fake");
g_pVariableSystem = (tVariableSystem*)g_pKernel->GetNode("bin\\var");
g_pGameInterface = (tGameInterfaceBase*)g_pKernel->GetNode("bin\\interface");
g_pDataBaseSystem = (tDataBaseSystem*)g_pKernel->GetNode("bin\\dbc");
g_pSoundSystem = (tSoundSystem*)g_pKernel->GetNode("bin\\snd");
g_pTransferItemSystem = (tTransferItemSystem*)g_pKernel->GetNode("bin\\transfer");
1.3 CEngineInterface
CengineInterface 其实是上层图形适用接口层,叫 GraphicInterface 或 GfxInterface 更合适。在核心数据对象中排老四:“4.渲染器节点”。
初始化
过程名: VOID CEngineInterface::Initial(VOID* pParam)
主要工作:
1. 对各个全局对象进行赋值
2. 加载场景资源配置文件(simpleResources.cfg)
3. 加载渲染插件
RenderSystem_Direct3D9_d.dll
Plugin_ParticleFX_d.dll
Plugin_ParticleFX2_d.dll Plugin_OctreeSceneManager_d.dll
Plugin_CgProgramManager_d.dll 4. 设置 FSAA、vsync
5. 创建查询射线
6. 初始化调试面板
7. 创建摄像机
8. 创建 PostFilter
Floodlighting Bloom HeatVision Fade MotionBlur 9. 设置声音接口
10. 创建 fake obeject
11. 设置粒子 Iteration Interval 为 0.033
12. 设置光照
加载人物阴影配置
加载全局泛光配置
1.4 Client 模块表
- 序号 module Tick 描述 class
- 1 - 0 - -
- 2 - 0 - -
- 3 Database 0 数据库系统 CDataBase
- 4 Datapool 0 - -
- 5 Event Yes 游戏事件处理器 CEventSystem
- 6 fakeObject Yes 用于在 ui 上显示的物体管理器接口 CFakeObjSystem
- 7 Helper 0 程序外接帮助系统 CHelperSystem
- 8 Input Yes 输入管理器 CInputSystem
- 9 Interface 0 整个游戏的外部控制接口类 CGameInterface
- 10 Network - - -
- 11 Object Yes - -
- 12 Procedure Yes 游戏运行的流程 CGameProcedure
- 13 Script Yes 脚本系统管理器(LUA PLUS) CScriptEnvironment
- 14 Sound - - -
- 15 Variable 0 配置参数系统 CVariableSystem
- 16 World - - -
复制代码
1.6 Tick()
以下是涉及到Tick()的部分主要类:
tNode
tTimeSystem
CUICreatureBoardSystem
CUISystem
CActionSystem
CDetailAttrib_Base
CDetailAttrib_Pet
CDetailAttrib_Player
CDataPool
CUIDataPool
CEngineInterface
CEventSystem
CFakeObjSystem
CHelperSystem
CInputSystem
CInputManager
CGameInterface
CNetManager
CObjectDestoryQueue
CObjectLoadQueue
CObject_Bus
CAI_Base
CAI_MySelf
CObject_Character
CObject_PlayerPet
CObject_Phy
CObject_ProjTex_MouseTarget
CObject_ProjTex_AuraDure
CObject_ProjTex_BloodStain
CObject_Bullet
CObject_Effect
CObject_Special
CTripperObject_ItemDrop
BulletFlowSystem_Logic
CBulletEntityManager
CFakeObjSystem
CObjectManager
CGamePro_ChangeScene
CGamePro_CharCreate
CGamePro_CharSel
CGamePro_Enter
CGamePro_Login
CGamePro_Main
CGameProcedure
CScriptSystem
CSoundSystemFMod
CScene
CWorldManager
2 代码风格
局部对象 s_或 m_
全局对象 g_
|